dsp-semactic 0.7.5 → 0.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +36 -36
- package/dist/index.es.js +7887 -7837
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ro=require("vue-i18n"),ss={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},rs=["value"],is=["placeholder","value","disabled"],cs=["placeholder","value"],us=["placeholder","value"],ds=["aria-selected","onClick"],ms={class:"dss-datepicker__list-item-label"},ps={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"},vs={key:1,class:"dss-datepicker__double-wrap"},hs={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},gs=["disabled","onClick"],ys={class:"dss-datepicker__double-calendars"},ks={class:"dss-datepicker__double-calendar"},Cs={class:"dss-datepicker__calendar-header"},bs=["aria-label"],xs={class:"dss-datepicker__month-year-row"},ws=["aria-label"],Es={class:"dss-datepicker__weekdays"},Ss={class:"dss-datepicker__grid"},Vs=["disabled","onClick","onMouseenter"],Ns={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Bs={class:"dss-datepicker__double-calendar"},Ms={class:"dss-datepicker__calendar-header"},_s=["aria-label"],$s={class:"dss-datepicker__month-year-row"},Ls=["aria-label"],As={class:"dss-datepicker__weekdays"},Ts={class:"dss-datepicker__grid"},Ds=["disabled","onClick","onMouseenter"],Hs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Rs={class:"dss-datepicker__calendar-header"},Fs=["aria-label"],Is={class:"dss-datepicker__month-year-row"},zs=["aria-label"],Ps={class:"dss-datepicker__weekdays"},Os={class:"dss-datepicker__grid"},Ws=["disabled","onClick","onMouseenter"],qs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Zs={class:"dss-datepicker__calendar-header"},Us={class:"dss-datepicker__month-year-row"},Xs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ys={class:"dss-datepicker__months-grid"},js=["onClick"],Ks={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Gs={class:"dss-datepicker__month-year"},Qs={class:"dss-datepicker__years-grid"},Js=["data-year","onClick"],Na=27,zn=8,pa={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:E=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(E)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,{t:ce,locale:O}=ro.useI18n(),L=e.ref(!1),fe=e.ref("days"),rt=new Date,ee=e.computed(()=>$.minDate instanceof Date?$.minDate:rt),v=e.ref(ee.value.getMonth()),be=e.ref(ee.value.getFullYear()),ke=e.ref(ee.value.getMonth()),J=e.ref(ee.value.getFullYear()),Y=e.ref(ee.value.getMonth()),me=e.ref(ee.value.getFullYear()),F=e.ref("start"),ue=e.ref(null),$e=e.ref(null);function tt(){const T=ee.value,z=T.getMonth(),_=T.getFullYear(),le=z===11?0:z+1,Te=z===11?_+1:_;return{left:{month:z,year:_},right:{month:le,year:Te}}}const mt=e.ref(null),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(null),je=e.ref(null),re=e.ref(null),Qe=new Date().getFullYear(),Ce=e.computed(()=>["single","singleFromAvailable"].includes($.mode)),Je=e.computed(()=>["range","rangeFromAvailable"].includes($.mode)),ut=e.computed(()=>$.mode==="listFromAvailable"),ht=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes($.mode))return null;const T=$.modelValue;return T instanceof Date?T:null}),dt=e.computed(()=>{if(!Je.value)return{start:null,end:null};const T=$.modelValue;return!T||typeof T!="object"?{start:null,end:null}:{start:T.start instanceof Date?T.start:null,end:T.end instanceof Date?T.end:null}});function Wt(T){if(!T||!(T instanceof Date))return"";const z=T.getDate(),_=T.getMonth()+1,le=T.getFullYear(),Te=pt=>String(pt).padStart(2,"0");return`${Te(z)}/${Te(_)}/${le}`}const qt=e.computed(()=>Wt(ht.value)),Ct=e.computed(()=>{const{start:T,end:z}=dt.value;if(!T&&!z)return"";const _=!z||T&&T<=z?T:z,le=!T||z&&z>=T?z:T;return jt(_,le)?Wt(_):`${Wt(_)} - ${Wt(le)}`}),wt=e.computed(()=>{if($.mode!=="readonly")return"—";const T=$.modelValue;if(T instanceof Date)return Wt(T)||"—";if(T&&typeof T=="object"&&("start"in T||"end"in T)){const z=T.start instanceof Date?T.start:null,_=T.end instanceof Date?T.end:null;if(!z&&!_)return"—";const le=!_||z&&z<=_?z:_,Te=!z||_&&_>=z?_:z;return jt(le,Te)?Wt(le):`${Wt(le)} - ${Wt(Te)}`}return"—"});e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const Yt=e.computed(()=>$e.value==="left"?ke.value:$e.value==="right"?Y.value:v.value),it=e.computed(()=>$e.value==="left"?J.value:$e.value==="right"?me.value:be.value),Kt=e.computed(()=>{const T=new Date(be.value,v.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),yt=e.computed(()=>{const T=new Date(it.value,Yt.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),el=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(z,_)=>T.format(new Date(2024,_,1)))}),X=e.computed(()=>{const z=($e.value?it.value:be.value)-Math.floor(Na/2);return Array.from({length:Na},(_,le)=>z+le)}),ge=e.computed(()=>{const T=X.value;return T.length?`${T[0]} – ${T[T.length-1]}`:""});function W(T){return T===7?0:T}function G(T){try{const z=new Intl.Locale(T);if(z.weekInfo?.firstDay!=null)return W(z.weekInfo.firstDay)}catch{}return 1}function Ne(T){const z=new Date(2024,0,1),_=(z.getDay()-T+7)%7,le=new Date(z);return le.setDate(z.getDate()-_),le}const Pe=e.computed(()=>G(O.value)),Xe=e.computed(()=>{const T=new Intl.DateTimeFormat(O.value,{weekday:"short"}),z=Ne(Pe.value),_=[];for(let le=0;le<7;le++){const Te=new Date(z);Te.setDate(z.getDate()+le),_.push(T.format(Te).slice(0,2))}return _});function Et(T,z,_){const le=new Date(T,z,1),Te=new Date(T,z+1,0),pt=(le.getDay()-_+7)%7,ct=Te.getDate(),lt=[];for(let st=0;st<pt;st++)lt.push(null);for(let st=1;st<=ct;st++)lt.push(new Date(T,z,st));return lt}const Ge=e.computed(()=>Et(be.value,v.value,Pe.value)),Zt=e.computed(()=>Et(J.value,ke.value,Pe.value)),Ue=e.computed(()=>Et(me.value,Y.value,Pe.value));e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)}),e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(T)});const We=e.computed(()=>{const T=new Date(J.value,ke.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Dt=e.computed(()=>{const T=new Date(me.value,Y.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(T)}),Lt=e.computed(()=>$.availableDates&&$.availableDates.length>0),ne=e.computed(()=>Lt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),j=e.ref({top:0,left:0}),K=e.ref("left");let de=null;function xe(){L.value&&e.nextTick(()=>{L.value&&(de!==null&&window.cancelAnimationFrame(de),de=window.requestAnimationFrame(()=>{de=null,Ke()}))})}function Ke(){if(!Ve.value||!L.value)return;const T=Ve.value.getBoundingClientRect(),z=window.innerWidth||document.documentElement.clientWidth,_=window.innerHeight||document.documentElement.clientHeight;let le=T.left,Te=T.bottom+4;const pt=Le.value;if(pt){const ct=pt.offsetWidth,lt=pt.offsetHeight;K.value==="right"||le+ct>z-zn?(K.value="right",le=T.right-ct):K.value="left";const il=Math.max(zn,z-ct-zn);if(le=Math.min(Math.max(le,zn),il),Te+lt>_-zn){const kl=T.top-4-lt;kl>=zn?Te=kl:Te=Math.max(zn,_-lt-zn)}}j.value={top:Te,left:le}}const Ht=e.computed(()=>!Ve.value||!L.value?{}:{position:"fixed",left:`${j.value.left}px`,top:`${j.value.top}px`,zIndex:1002});function jt(T,z){return!T||!z?!1:T.getFullYear()===z.getFullYear()&&T.getMonth()===z.getMonth()&&T.getDate()===z.getDate()}function et(T){return new Date(T.getFullYear(),T.getMonth(),T.getDate()).getTime()}function vl(T){return!$.availableDates||!$.availableDates.length?!0:$.availableDates.some(z=>z instanceof Date&&jt(z,T))}function M(T){const z=et(T);return!($.minDate instanceof Date&&z<et($.minDate)||$.maxDate instanceof Date&&z>et($.maxDate))}function x(T){const z=new Date(T);return new Date(z.getFullYear(),z.getMonth(),z.getDate())}function A(T){return T.filter(z=>M(z))}function ae(T,z){if(!(T instanceof Date)||!(z instanceof Date))return null;let _=et(T),le=et(z);if(_>le&&([_,le]=[le,_]),$.minDate instanceof Date){const Te=et($.minDate);_=Math.max(_,Te),le=Math.max(le,Te)}if($.maxDate instanceof Date){const Te=et($.maxDate);_=Math.min(_,Te),le=Math.min(le,Te)}return _>le?null:{start:x(_),end:x(le)}}function oe(T){return!$.exceptDates||!$.exceptDates.length?!1:$.exceptDates.some(z=>z instanceof Date&&jt(z,T))}function Fe(T){return oe(T)?!1:["singleFromAvailable","rangeFromAvailable"].includes($.mode)?vl(T):M(T)}function bt(T){const z=ht.value,_=dt.value,le=et(T),Te=Je.value&&_.start&&_.end&&le>et(_.start)&&le<et(_.end),pt=Je.value&&_.start&&jt(T,_.start),ct=Je.value&&_.end&&jt(T,_.end),lt=pt&&ct,st=Ce.value&&z&&jt(T,z)||pt||ct;let il=!1;if(Je.value&&_.start&&!_.end&&ue.value){const kl=et(_.start),Gt=et(ue.value),wl=Math.min(kl,Gt),Rt=Math.max(kl,Gt);il=le>wl&&le<Rt}return{"dss-datepicker__day--selected":st&&!lt,"dss-datepicker__day--range-start":pt&&!lt,"dss-datepicker__day--range-end":ct&&!lt,"dss-datepicker__day--range-single":lt,"dss-datepicker__day--in-range":Te&&!pt&&!ct,"dss-datepicker__day--in-range-preview":il&&!pt&&!ct&&!Te,"dss-datepicker__day--disabled":!Fe(T)}}function ot(T){if(!Je.value)return;const z=dt.value;if(!z.start||z.end){ue.value=null;return}if(!Fe(T)){ue.value=null;return}ue.value=new Date(T.getFullYear(),T.getMonth(),T.getDate())}function Ie(){ue.value=null}function xt(){if(!$.doubleCalendar||!Je.value)return;const T=dt.value,{start:z,end:_}=T;if(z&&_){const pt=z<=_?z:_,ct=z<=_?_:z,lt=pt.getMonth(),st=pt.getFullYear(),il=ct.getMonth(),kl=ct.getFullYear();if(lt!==il||st!==kl){const Gt=ke.value===lt&&J.value===st,wl=Y.value===il&&me.value===kl;if(Gt&&wl)return;ke.value=lt,J.value=st,Y.value=il,me.value=kl}else{const Gt=lt===0?11:lt-1,wl=lt===0?st-1:st;ke.value===Gt&&J.value===wl&&Y.value===lt&&me.value===st||(ke.value=lt,J.value=st,lt===11?(Y.value=0,me.value=st+1):(Y.value=lt+1,me.value=st))}return}const le=z||_;if(le){const pt=le.getMonth(),ct=le.getFullYear(),lt=ke.value===pt&&J.value===ct,st=Y.value===pt&&me.value===ct;if(lt||st)return;ke.value=pt,J.value=ct,pt===11?(Y.value=0,me.value=ct+1):(Y.value=pt+1,me.value=ct);return}const Te=tt();ke.value=Te.left.month,J.value=Te.left.year,Y.value=Te.right.month,me.value=Te.right.year}const Mt=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),St=e.computed(()=>{if(!ut.value)return[];const T=($.availableDates||[]).filter(_=>_ instanceof Date&&!Number.isNaN(_.getTime())).filter(_=>!oe(_)&&M(_)).map(_=>new Date(_.getFullYear(),_.getMonth(),_.getDate()));T.sort((_,le)=>le.getTime()-_.getTime());const z=ht.value;return T.map(_=>({date:_,ts:_.getTime(),label:Mt.value.format(_),selected:!!(z&&jt(_,z))}))});function At(){if(L.value){yl();return}Ve.value=qe.value?.closest(".dss-datepicker__input-wrap"),K.value="left",L.value=!0,xe(),e.nextTick(()=>{re.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function It(T){if(!(T instanceof Date))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());V("update:modelValue",z),yl()}function Nt(T="start"){if($.mode==="readonly")return;F.value=T;const z=ht.value,_=dt.value;if(Ce.value&&z)v.value=z.getMonth(),be.value=z.getFullYear();else if(Je.value)if($.doubleCalendar)xt();else{const le=T==="start"&&_.start?_.start:_.end||_.start;le&&(v.value=le.getMonth(),be.value=le.getFullYear())}Ve.value=Ce.value?mt.value?.closest(".dss-datepicker__input-wrap"):U.value,fe.value="days",$e.value=null,K.value="left",L.value=!0,xe()}function yl(){fe.value="days",$e.value=null,ue.value=null,L.value=!1}function nn(T,z){$e.value=T,fe.value=z}function Vl(){fe.value="days",$e.value=null}function Nl(T){const z=new Date,_=z.getFullYear(),le=z.getMonth(),Te=z.getDate();let pt,ct;if(Lt.value){const lt=A([...$.availableDates].filter(st=>st instanceof Date).map(st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()))).sort((st,il)=>st.getTime()-il.getTime());if(lt.length===0)return null;if(T==="all")pt=lt[0],ct=lt[lt.length-1];else{const st=parseInt(T.replace("last",""),10);if(st<2||st>5)return null;const il=lt.slice(-st);if(il.length===0)return null;pt=il[0],ct=il[il.length-1]}}else{const lt=new Date(_,le,Te);switch(T){case"today":pt=lt,ct=lt;break;case"lastWeek":pt=new Date(_,le,Te-6),ct=lt;break;case"last15Days":pt=new Date(_,le,Te-14),ct=lt;break;case"last30Days":pt=new Date(_,le,Te-29),ct=lt;break;case"thisMonth":pt=new Date(_,le,1),ct=lt;break;case"last3Months":pt=new Date(_,le-3,1),ct=new Date(_,le,0);break;case"last6Months":pt=new Date(_,le-6,1),ct=new Date(_,le,0);break;case"last12Months":pt=new Date(_,le-12,1),ct=new Date(_,le,0);break;case"lastYear":pt=new Date(_-1,0,1),ct=new Date(_-1,11,31);break;default:return null}}return{start:pt,end:ct}}function tl(T){const z=Nl(T);return z?ae(z.start,z.end):null}function jl(T){return tl(T)!==null}function on(T){const z=tl(T);z&&(V("update:modelValue",z),xt())}function xl(T){$e.value==="left"?ke.value=T:$e.value==="right"?Y.value=T:v.value=T,Vl()}function Fl(T){$e.value==="left"?J.value=T:$e.value==="right"?me.value=T:be.value=T,Vl()}function dn(){v.value===0?(v.value=11,be.value--):v.value--}function Hl(){v.value===11?(v.value=0,be.value++):v.value++}function Pn(){ke.value===0?(ke.value=11,J.value--):ke.value--}function mn(){ke.value===11?(ke.value=0,J.value++):ke.value++}function pn(){Y.value===0?(Y.value=11,me.value--):Y.value--}function wn(){Y.value===11?(Y.value=0,me.value++):Y.value++}function ql(T){if(!Fe(T))return;const z=new Date(T.getFullYear(),T.getMonth(),T.getDate());if(Ce.value){V("update:modelValue",z),yl();return}const _=dt.value;if(!_.start&&!_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(_.start&&_.end){V("update:modelValue",{start:z,end:null}),F.value="end";return}if(F.value==="start"){let le=z,Te=_.end;le&&Te&&le>Te&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="end"}else{let le=_.start,Te=z;le&&Te&&Te<le&&([le,Te]=[Te,le]),V("update:modelValue",{start:le||Te,end:Te||le}),F.value="start"}}e.watch(dt,()=>{$.doubleCalendar&&Je.value&&L.value&&xt()},{deep:!0});let rl=null,Il=null,Kl=null;function sn(){rl&&(document.removeEventListener("keydown",rl),rl=null),Il&&(window.removeEventListener("resize",Il),Il=null),Kl&&(window.removeEventListener("scroll",Kl,!0),Kl=null)}return e.watch(fe,T=>{T==="years"&&e.nextTick(()=>{je.value?.querySelector(`[data-year="${it.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[L.value,fe.value,v.value,be.value,ke.value,J.value,Y.value,me.value,$e.value,$.doubleCalendar,$.quickSelect],()=>{xe()}),e.watch(L,T=>{sn(),T&&(rl=z=>{z.key==="Escape"&&(fe.value==="years"||fe.value==="months"?Vl():yl())},Il=()=>{Ke()},Kl=()=>{Ke()},document.addEventListener("keydown",rl),window.addEventListener("resize",Il),window.addEventListener("scroll",Kl,!0))}),e.onBeforeUnmount(()=>{de!==null&&(window.cancelAnimationFrame(de),de=null),sn()}),(T,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":E.mode==="readonly"}])},[E.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ss,[z[10]||(z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,rs)])):Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:z[0]||(z[0]=_=>Nt("start"))},[z[11]||(z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:mt,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectDate"),value:qt.value,readonly:"",disabled:E.mode==="readonly"},null,8,is)])):ut.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":L.value}]),onClick:At},[z[13]||(z[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:qe,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectFromList"),value:qt.value,readonly:""},null,8,cs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":L.value}]),"aria-hidden":"true"},[...z[12]||(z[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):Je.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:U,onClick:z[1]||(z[1]=_=>Nt("start"))},[z[14]||(z[14]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:ze,type:"text",class:"dss-datepicker__input",placeholder:$.placeholder||e.unref(ce)("datepicker.selectRange"),value:Ct.value,readonly:""},null,8,us)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(yl,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Le,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":E.doubleCalendar&&Je.value&&fe.value==="days","dss-datepicker__dropdown--quick-select":E.doubleCalendar&&Je.value&&fe.value==="days"&&E.quickSelect,"dss-datepicker__dropdown--list":ut.value}]),onClick:z[9]||(z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ht.value)},[ut.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[St.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:re},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,_=>(e.openBlock(),e.createElementBlock("li",{key:_.ts,role:"option","aria-selected":_.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":_.selected}]),onClick:le=>It(_.date)},[e.createElementVNode("span",ms,e.toDisplayString(_.label),1),_.selected?(e.openBlock(),e.createElementBlock("svg",ps,[...z[15]||(z[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,ds))),128))],512)):(e.openBlock(),e.createElementBlock("div",fs,e.toDisplayString(e.unref(ce)("datepicker.noAvailableDates")),1))],64)):fe.value==="days"&&E.doubleCalendar&&Je.value?(e.openBlock(),e.createElementBlock("div",vs,[E.quickSelect?(e.openBlock(),e.createElementBlock("nav",hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!jl(_.id),onClick:le=>on(_.id)},e.toDisplayString(e.unref(ce)(_.labelKey)),9,gs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ys,[e.createElementVNode("div",ks,[e.createElementVNode("div",Cs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Pn}," ‹ ",8,bs),e.createElementVNode("div",xs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[2]||(z[2]=_=>nn("left","months"))},e.toDisplayString(We.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[3]||(z[3]=_=>nn("left","years"))},e.toDisplayString(J.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:mn}," › ",8,ws)]),e.createElementVNode("div",Es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ss,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Vs)):(e.openBlock(),e.createElementBlock("span",Ns))],64))),128))])]),e.createElementVNode("div",Bs,[e.createElementVNode("div",Ms,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:pn}," ‹ ",8,_s),e.createElementVNode("div",$s,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[4]||(z[4]=_=>nn("right","months"))},e.toDisplayString(Dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[5]||(z[5]=_=>nn("right","years"))},e.toDisplayString(me.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:wn}," › ",8,Ls)]),e.createElementVNode("div",As,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ds)):(e.openBlock(),e.createElementBlock("span",Hs))],64))),128))])])])])):fe.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Rs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,Fs),e.createElementVNode("div",Is,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[6]||(z[6]=_=>fe.value="months")},e.toDisplayString(Kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[7]||(z[7]=_=>fe.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Hl}," › ",8,zs)]),e.createElementVNode("div",Ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,_=>(e.openBlock(),e.createElementBlock("span",{key:_,class:"dss-datepicker__weekday"},e.toDisplayString(_),1))),128))]),e.createElementVNode("div",Os,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(_,le)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:le},[_?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",bt(_)]),disabled:!Fe(_),onClick:Te=>ql(_),onMouseenter:Te=>ot(_),onMouseleave:Ie},e.toDisplayString(_.getDate()),43,Ws)):(e.openBlock(),e.createElementBlock("span",qs))],64))),128))])],64)):fe.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Zs,[e.createElementVNode("div",Us,[e.createElementVNode("span",Xs,e.toDisplayString(yt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:z[8]||(z[8]=_=>fe.value="years")},e.toDisplayString(it.value),1)])]),e.createElementVNode("div",Ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(_,le)=>(e.openBlock(),e.createElementBlock("button",{key:le,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":le===Yt.value}]),onClick:Te=>xl(le)},e.toDisplayString(_),11,js))),128))])],64)):fe.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",Ks,[e.createElementVNode("span",Gs,e.toDisplayString(ge.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:je},[e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,_=>(e.openBlock(),e.createElementBlock("button",{key:_,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":_===it.value,"dss-datepicker__year-cell--current":_===e.unref(Qe)}]),"data-year":_,onClick:le=>Fl(_)},e.toDisplayString(_),11,Js))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},er=["data-chart-type"],tr={class:"dss-chart-header-titles"},lr={key:0,class:"dss-chart-title"},nr={key:1,class:"dss-chart-subtitle"},or=["onClick","onMouseenter"],ar={class:"dss-legend-text"},sr=["onClick","onMouseenter"],rr={class:"dss-legend-text"},ir=["title"],cr=["src"],ur={class:"dss-chart-area-wrapper"},dr={key:0,class:"dss-chart-z-axis-label"},mr=["width","height","data-smooth","data-animated"],pr=["id"],fr=["y","width","height"],vr=["id"],hr=["d"],gr=["id"],yr=["d"],kr={key:0},Cr=["clip-path"],br=["x1","x2","y1","y2"],xr=["clip-path"],wr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Er=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Sr={class:"dss-axes"},Vr=["x1","x2","y1","y2"],Nr=["x1","x2","y1","y2"],Br=["x1","x2","y1","y2"],Mr={class:"dss-axis-labels"},_r=["x","y"],$r=["x","y"],Lr=["x","y"],Ar=["x","y"],Tr=["y","transform"],Dr=["x","y","transform"],Hr={key:2,class:"dss-flag-markers"},Rr=["clip-path"],Fr=["x1","x2","y1","y2","onMouseover"],Ir=["x1","x2","y1","y2","onMouseover"],zr=["x1","x2","y1","y2","onMouseover"],Pr=["cx","cy","onMouseover"],Or=["cx","cy","fill","onMouseover"],Wr=["x","y"],qr=["clip-path"],Zr={key:0},Ur=["d","onMouseover"],Xr=["x","y","width","height","fill","onMouseover"],Yr={class:"dss-line-chart"},jr=["d","stroke","stroke-width","stroke-dasharray"],Kr=["d","stroke","stroke-width","opacity"],Gr=["cx","cy","r","fill","onMouseover"],Qr={key:1},Jr=["d","stroke","stroke-width","stroke-dasharray"],ei=["d","stroke","stroke-width","stroke-dasharray"],ti=["d","stroke","stroke-width","opacity"],li=["cx","cy","r","fill","onMouseover"],ni={key:2},oi=["id"],ai=["x","y","width","height"],si=["d","fill","fill-opacity","mask"],ri=["d","stroke","stroke-width"],ii={key:3,class:"dss-stepbar-chart"},ci=["x","y","width","height","rx","ry","fill","onMouseover"],ui=["transform"],di=["r","fill","stroke","stroke-width"],mi=["font-size","fill"],pi=["d","fill","onMouseover"],fi=["x","y","width","height","onMouseover"],vi=["clip-path"],hi=["x1","x2","y1","y2","stroke"],gi=["cx","cy","r","fill"],yi={key:1,class:"dss-bubble-chart"},ki={key:0,class:"dss-bubble-group"},Ci=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],bi=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],xi=["transform"],wi=["cx","cy","r"],Ei=["data-chart-type","clip-path"],Si=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Vi={key:1,class:"dss-radial-segment-data-labels"},Ni=["x","y"],Bi=["x","y","font-size","fill"],Mi=["x1","y1","x2","y2","stroke"],_i=["x1","y1","x2","y2","stroke"],$i=["x","y","text-anchor","font-size"],Li=["transform"],Ai={key:0,class:"dss-spider-grid"},Ti=["cx","cy","r"],Di={class:"dss-spider-grid-labels"},Hi=["x","y"],Ri=["x","y"],Fi=["x1","x2","y1","y2"],Ii={class:"dss-spider-labels"},zi=["x","y","text-anchor","dominant-baseline"],Pi=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],Oi=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Wi={class:"dss-chart-logos"},qi=["cx","cy","r","fill"],Zi=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Ui=["onClick","onMouseenter"],Xi=["src"],Yi={class:"dss-marker-tooltip-category"},ji={key:0,class:"dss-marker-tooltip-description"},Ki={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Gi={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Qi={class:"dss-tooltip-series-name"},Ji={class:"dss-tooltip-series-value"},ec={key:1,class:"dss-tooltip-section"},tc={key:0,class:"dss-tooltip-title"},lc={class:"dss-bubble-tooltip-data"},nc={key:2,class:"dss-tooltip-section"},oc={class:"dss-tooltip-title"},ac={class:"dss-tooltip-value"},sc={key:0,class:"dss-tooltip-section"},rc={class:"dss-tooltip-section-title"},ic={class:"dss-tooltip-group-header"},cc={class:"dss-tooltip-item-content"},uc={class:"dss-tooltip-item-text"},dc={key:1,class:"dss-tooltip-section"},mc={class:"dss-tooltip-section-title"},pc={class:"dss-tooltip-item-content"},fc={class:"dss-tooltip-item-title"},vc={key:0,class:"dss-tooltip-item-description"},hc={class:"dss-tooltip-section"},gc={class:"dss-tooltip-title"},yc={key:0,class:"dss-bubble-tooltip-data"},kc={class:"dss-tooltip-series-name"},Cc={class:"dss-tooltip-series-value"},bc={key:0,class:"dss-tooltip-section"},xc={class:"dss-tooltip-section-title"},wc={class:"dss-tooltip-group-header"},Ec={class:"dss-tooltip-item-content"},Sc={class:"dss-tooltip-item-text"},Vc={key:1,class:"dss-tooltip-section"},Nc={class:"dss-tooltip-section-title"},Bc={class:"dss-tooltip-item-content"},Mc={class:"dss-tooltip-item-title"},_c={key:0,class:"dss-tooltip-item-description"},$c=["onClick","onMouseenter"],Lc={class:"dss-legend-text"},Ac={key:1,class:"dss-context-menu-separator"},Tc={key:0,class:"dss-context-menu-separator"},Dc={key:0,class:"dss-context-menu-separator"},Hc=["onClick"],Rc=["innerHTML"],Fc={key:0,class:"dss-context-menu-icon"},Ic={class:"dss-marker-modal-header"},zc={class:"dss-marker-modal-body"},Pc={class:"dss-form-group"},Oc={class:"dss-form-group"},Wc={for:"dss-marker-description"},qc={key:0,class:"dss-form-text-display"},Zc=["placeholder"],Uc={class:"dss-marker-modal-footer"},Xc={class:"modal-footer-left"},Yc={class:"dss-modal-footer-right"},jc=["disabled"],Kc={name:"DSSChart"},Gc=Object.assign(Kc,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=te,O=e.ref(null),L=e.ref(null),fe=e.ref(null),rt=e.ref(0),ee=e.ref(0);let v=null,be=null;const ke=20,J=e.computed(()=>{if(ee.value,rt.value,!O.value||!L.value)return 0;try{const t=O.value.getBoundingClientRect();return L.value.getBoundingClientRect().top-t.top}catch{return 0}}),Y=e.computed(()=>`chart-clip-${F.chartId}`),me=e.computed(()=>`url(#${Y.value})`),F=E,ue={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},stepbar:{totalValue:100,segmentOrder:"input",showRemainder:!0,remainderLabel:"Remaining",remainderColor:"#E5E7EB",barWidth:42,minBarWidth:12,maxBarWidth:58,barRadius:6,axisBars:{show:!0,showVertical:!1,color:"#d6d6d6",opacity:.75,width:1,dashArray:"3,4"},maxSegment:{marker:{enabled:!1,icon:"",radius:8,backgroundColor:null,borderColor:"#fafafa",borderWidth:2,color:"#fafafa",fontSize:10}}},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5,comparison:{fillOpacity:0,strokeDasharray:"6,4",usePrimaryColor:!0,bubbleSize:0}},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function $e(t,o){const l=Object.assign({},t);return mt(t)&&mt(o)&&Object.keys(o).forEach(r=>{mt(o[r])?r in t?l[r]=$e(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const tt=()=>{let t=20,o=0,l=0;if(ut.value&&(t+=30),ht.value&&(t+=25),W.value&&F.series.length>0){const r=F.series.filter((m,f)=>!zt.value.has(f)).length;if(G.value==="top"||G.value==="bottom"){if(Ne.value==="horizontal"){const f=Math.floor(Ve.value/100);o=Math.ceil(r/f)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const U=e.computed(()=>$e(ue,F.options)),ze=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.width==="auto"}),qe=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.height==="auto"}),Ve=e.computed(()=>{const t=U.value;return ze.value?rt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Le=e.ref(ke),je=e.computed(()=>{if(qe.value){const t=je.value;return t??Math.max(0,(ee.value||400)-Le.value*5)}}),re=e.computed(()=>{const t=U.value;if(Ce.value==="mini-radial")return Ve.value;if(qe.value){const o=je.value;return o??Math.max(0,(ee.value||400)-Le.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Qe=e.computed(()=>{if(qe.value&&Ce.value==="semi-radial"&&je.value!=null)return Le.value+re.value+"px";if(qe.value)return"100%";if(al.value)return Le.value+re.value+"px";if(W.value&&G.value==="bottom"){const t=tt();return re.value+(t.legendHeight||35)+"px"}return re.value+(W.value?20:0)+"px"}),Ce=e.computed(()=>{const t=U.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Je=e.computed(()=>{const t=F.series.map(o=>o.type||Ce.value);return new Set(t).size>1}),ut=e.computed(()=>{const t=U.value;return t&&t.title&&t.title.text?t.title.text:""}),ht=e.computed(()=>{const t=U.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),dt=e.computed(()=>{const t=U.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),Wt=e.computed(()=>{const t=U.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),qt=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Ct=e.computed(()=>{const t=U.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),wt=e.computed(()=>{const t=Ct.value;return t&&t.title&&t.title.text?t.title.text:""}),Yt=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.min;return typeof o=="number"||o===Be?o:Be}),it=e.computed(()=>{const t=U.value;if(!t||!t.yAxis)return Be;const o=t.yAxis.max;return typeof o=="number"||o===Be?o:Be}),Kt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.min;return typeof o=="number"||o===Be?o:Be}),yt=e.computed(()=>{const t=Ct.value;if(!t)return Be;const o=t.max;return typeof o=="number"||o===Be?o:Be}),el=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),X=e.computed(()=>{const t=U.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ge=e.computed(()=>{const t=U.value;return t&&t.grid&&t.grid.show!==!1}),W=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.show!==!1}),G=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ne=e.computed(()=>{const t=U.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Pe=e.computed(()=>{const t=U.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Xe=e.computed(()=>{const t=U.value;if(!t||!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Et=e.computed(()=>{const t=U.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ge=e.computed(()=>{const t=U.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Zt=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ue=e.computed(()=>{const t=U.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),We=e.computed(()=>{const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Dt=e.computed(()=>{if(!al.value)return 0;const t=U.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Lt=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}=He.value;return t===0}),j=(t,o)=>ne.value&&o===0?5:o,K=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},de=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),xe=e.computed(()=>{const t=U.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Ke=e.computed(()=>{const t=U.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ht=e.computed(()=>{const t=U.value;return xe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),jt=e.computed(()=>{const t=U.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),et=e.computed(()=>U.value?.stepbar||{}),vl=e.computed(()=>{const t=et.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),M=e.computed(()=>{const t=Number(et.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),x=e.computed(()=>et.value?.showRemainder!==!1),A=e.computed(()=>et.value?.remainderLabel||"Remaining"),ae=e.computed(()=>et.value?.remainderColor||"#E5E7EB"),oe=e.computed(()=>{const t=Number(et.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),Fe=e.computed(()=>{const t=Number(et.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),bt=e.computed(()=>{const t=Number(et.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58}),ot=e.computed(()=>{const t=Number(et.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6}),Ie=e.computed(()=>et.value?.axisBars||{}),xt=e.computed(()=>Ie.value?.show!==!1),Mt=e.computed(()=>Ie.value?.showVertical===!0),St=e.computed(()=>Ie.value?.color||"#d6d6d6"),At=e.computed(()=>{const t=Number(Ie.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),It=e.computed(()=>{const t=Number(Ie.value?.width);return Number.isFinite(t)&&t>0?t:1}),Nt=e.computed(()=>Ie.value?.dashArray||"3,4"),yl=e.computed(()=>et.value?.maxSegment?.marker||{}),nn=e.computed(()=>yl.value?.enabled===!0),Vl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.enabled!==!1}),Nl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),tl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),jl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),on=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),xl=e.computed(()=>{const t=U.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Fl=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.onDataChange!==!1}),dn=e.computed(()=>{const t=U.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Hl=e.computed(()=>{const t=U.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Pn=e.computed(()=>U.value?.spider?.gridSteps||5),mn=e.computed(()=>{const t=[],o=Pn.value;for(let l=1;l<=o;l++)t.push(gt.value/o*l);return t}),pn=t=>{const o=wn.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=mn.value[t];return Math.round(l/gt.value*100)+"%"},wn=e.computed(()=>U.value?.spider?.gridLabels||null),ql=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),rl=e.computed(()=>{const t=U.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Il=e.computed(()=>{const t=U.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Kl=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ll.value}),sn=e.computed(()=>{const t=U.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),T=e.computed(()=>{const t=U.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),z=e.computed(()=>{const o=U.value?.valueFormat?.extension;return typeof o=="string"?o:""}),_=t=>{const o=z.value;if(t==null)return"";const l=String(t);return o?l+o:l},le=e.computed(()=>!ie.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=vt(t.categoryIndex),l=J.value+R.value.bottom-T.value/2;return{...t,x:o,y:l}}return t}));function Te(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[f,C,b]=t.split("-"),P=Number(b?.length===2?`20${b}`:b);l=new Date(P,Number(C)-1,Number(f))}else return 0;let r=0,m=1/0;return o.forEach((f,C)=>{const[b,P,B]=f.split("-"),H=Number(B?.length===2?`20${B}`:B),S=new Date(H,Number(P)-1,Number(b)),q=Math.abs(S-l);q<m&&(m=q,r=C)}),r}const pt=e.computed(()=>{const t=F.markers.map(l=>{const r=Te(l.marker_date,F.categories),m=vt(r),f=J.value+R.value.bottom-T.value/2;return{...l,x:m,y:f,categoryIndex:r,source:"props"}}),o=Tt.value.map(l=>{if(l.categoryIndex!==void 0&&(ol.value||ul.value)){const r=vt(l.categoryIndex),m=J.value+R.value.bottom-T.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),ct=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.enabled===!0}),lt=e.computed(()=>{const t=U.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),st=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),il=e.computed(()=>{const t=U.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),kl=e.computed(()=>{const t={left:R.value.left,top:R.value.top,width:R.value.width,height:R.value.height};let o,l;const r=String(st.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),Gt=e.computed(()=>{const{width:t,height:o}=kl.value,l=il.value;let r,m;const f=R.value.left,C=R.value.right,b=R.value.top,P=R.value.bottom,B=R.value.width,H=R.value.height;switch(l){case"center":r=f+(B-t)/2,m=b+(H-o)/2;break;case"top-left":r=f+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=f+15,m=P-o-5;break;case"bottom-right":default:r=C-t-15,m=P-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),wl=t=>!F.flags||!F.flags.length?[]:F.flags.filter(o=>o.categoryIndex===t),Rt=t=>{const o=wl(t),l=Xo(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),f=[];return r.length>0&&f.push({type:$("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&f.push({type:$("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:f,markers:l.map(C=>({title:C.title,description:C.description,type:$("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Ll=e.computed(()=>{const t=F.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),so=require("vue-i18n"),gs={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ys=["value"],ks=["placeholder","value","disabled"],Cs=["placeholder","value"],bs=["placeholder","value"],ws=["aria-selected","onClick"],xs={class:"dss-datepicker__list-item-label"},Es={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"},Ss={key:1,class:"dss-datepicker__list-empty"},Vs={key:1,class:"dss-datepicker__double-wrap"},Ns={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},Bs=["disabled","onClick"],Ms={class:"dss-datepicker__double-calendars"},_s={class:"dss-datepicker__double-calendar"},$s={class:"dss-datepicker__calendar-header"},Ls=["aria-label"],Ts={class:"dss-datepicker__month-year-row"},As=["aria-label"],Ds={class:"dss-datepicker__weekdays"},Hs={class:"dss-datepicker__grid"},Rs=["disabled","onClick","onMouseenter"],Fs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Is={class:"dss-datepicker__double-calendar"},zs={class:"dss-datepicker__calendar-header"},Ps=["aria-label"],Os={class:"dss-datepicker__month-year-row"},Ws=["aria-label"],qs={class:"dss-datepicker__weekdays"},Zs={class:"dss-datepicker__grid"},Us=["disabled","onClick","onMouseenter"],Xs={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ys={class:"dss-datepicker__calendar-header"},js=["aria-label"],Ks={class:"dss-datepicker__month-year-row"},Gs=["aria-label"],Qs={class:"dss-datepicker__weekdays"},Js={class:"dss-datepicker__grid"},er=["disabled","onClick","onMouseenter"],tr={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},lr={class:"dss-datepicker__calendar-header"},nr={class:"dss-datepicker__month-year-row"},or={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},ar={class:"dss-datepicker__months-grid"},sr=["onClick"],rr={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ir={class:"dss-datepicker__month-year"},cr={class:"dss-datepicker__years-grid"},ur=["data-year","onClick"],$a=27,On=8,pa={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:S=>["single","range","singleFromAvailable","rangeFromAvailable","listFromAvailable","readonly"].includes(S)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(S,{emit:ee}){const L=S,N=ee,{t:ue,locale:O}=so.useI18n(),H=e.ref(!1),me=e.ref("days"),ot=new Date,ne=e.computed(()=>L.minDate instanceof Date?L.minDate:ot),f=e.ref(ne.value.getMonth()),be=e.ref(ne.value.getFullYear()),he=e.ref(ne.value.getMonth()),oe=e.ref(ne.value.getFullYear()),j=e.ref(ne.value.getMonth()),fe=e.ref(ne.value.getFullYear()),_e=e.ref("start"),V=e.ref(null),$e=e.ref(null);function lt(){const R=ne.value,W=R.getMonth(),D=R.getFullYear(),se=W===11?0:W+1,De=W===11?D+1:D;return{left:{month:W,year:D},right:{month:se,year:De}}}const rt=e.ref(null),Qe=e.ref(null),Z=e.ref(null),qe=e.ref(null),ze=e.ref(null),ye=e.ref(null),Ue=e.ref(null),ke=e.ref(null),Te=new Date().getFullYear(),at=e.computed(()=>["single","singleFromAvailable"].includes(L.mode)),ge=e.computed(()=>["range","rangeFromAvailable"].includes(L.mode)),Ft=e.computed(()=>L.mode==="listFromAvailable"),dt=e.computed(()=>{if(!["single","singleFromAvailable","listFromAvailable"].includes(L.mode))return null;const R=L.modelValue;return R instanceof Date?R:null}),Ye=e.computed(()=>{if(!ge.value)return{start:null,end:null};const R=L.modelValue;return!R||typeof R!="object"?{start:null,end:null}:{start:R.start instanceof Date?R.start:null,end:R.end instanceof Date?R.end:null}});function Pt(R){if(!R||!(R instanceof Date))return"";const W=R.getDate(),D=R.getMonth()+1,se=R.getFullYear(),De=mt=>String(mt).padStart(2,"0");return`${De(W)}/${De(D)}/${se}`}const It=e.computed(()=>Pt(dt.value)),bt=e.computed(()=>{const{start:R,end:W}=Ye.value;if(!R&&!W)return"";const D=!W||R&&R<=W?R:W,se=!R||W&&W>=R?W:R;return Ot(D,se)?Pt(D):`${Pt(D)} - ${Pt(se)}`}),ft=e.computed(()=>{if(L.mode!=="readonly")return"—";const R=L.modelValue;if(R instanceof Date)return Pt(R)||"—";if(R&&typeof R=="object"&&("start"in R||"end"in R)){const W=R.start instanceof Date?R.start:null,D=R.end instanceof Date?R.end:null;if(!W&&!D)return"—";const se=!D||W&&W<=D?W:D,De=!W||D&&D>=W?D:W;return Ot(se,De)?Pt(se):`${Pt(se)} - ${Pt(De)}`}return"—"});e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)});const Yt=e.computed(()=>$e.value==="left"?he.value:$e.value==="right"?j.value:f.value),it=e.computed(()=>$e.value==="left"?oe.value:$e.value==="right"?fe.value:be.value),At=e.computed(()=>{const R=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),ht=e.computed(()=>{const R=new Date(it.value,Yt.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),il=e.computed(()=>{const R=new Intl.DateTimeFormat(O.value,{month:"short"});return Array.from({length:12},(W,D)=>R.format(new Date(2024,D,1)))}),St=e.computed(()=>{const W=($e.value?it.value:be.value)-Math.floor($a/2);return Array.from({length:$a},(D,se)=>W+se)}),Dt=e.computed(()=>{const R=St.value;return R.length?`${R[0]} – ${R[R.length-1]}`:""});function pe(R){return R===7?0:R}function A(R){try{const W=new Intl.Locale(R);if(W.weekInfo?.firstDay!=null)return pe(W.weekInfo.firstDay)}catch{}return 1}function X(R){const W=new Date(2024,0,1),D=(W.getDay()-R+7)%7,se=new Date(W);return se.setDate(W.getDate()-D),se}const ae=e.computed(()=>A(O.value)),Ce=e.computed(()=>{const R=new Intl.DateTimeFormat(O.value,{weekday:"short"}),W=X(ae.value),D=[];for(let se=0;se<7;se++){const De=new Date(W);De.setDate(W.getDate()+se),D.push(R.format(De).slice(0,2))}return D});function je(R,W,D){const se=new Date(R,W,1),De=new Date(R,W+1,0),mt=(se.getDay()-D+7)%7,ut=De.getDate(),Ze=[];for(let Je=0;Je<mt;Je++)Ze.push(null);for(let Je=1;Je<=ut;Je++)Ze.push(new Date(R,W,Je));return Ze}const Ge=e.computed(()=>je(be.value,f.value,ae.value)),Vt=e.computed(()=>je(oe.value,he.value,ae.value)),Pe=e.computed(()=>je(fe.value,j.value,ae.value));e.computed(()=>{const R=new Date(oe.value,he.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)}),e.computed(()=>{const R=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(O.value,{month:"long",year:"numeric"}).format(R)});const Ke=e.computed(()=>{const R=new Date(oe.value,he.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),nt=e.computed(()=>{const R=new Date(fe.value,j.value,1);return new Intl.DateTimeFormat(O.value,{month:"long"}).format(R)}),qt=e.computed(()=>L.availableDates&&L.availableDates.length>0),te=e.computed(()=>qt.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),K=e.ref({top:0,left:0}),Q=e.ref("left");let ce=null;function Ve(){H.value&&e.nextTick(()=>{H.value&&(ce!==null&&window.cancelAnimationFrame(ce),ce=window.requestAnimationFrame(()=>{ce=null,We()}))})}function We(){if(!ze.value||!H.value)return;const R=ze.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,D=window.innerHeight||document.documentElement.clientHeight;let se=R.left,De=R.bottom+4;const mt=ye.value;if(mt){const ut=mt.offsetWidth,Ze=mt.offsetHeight;Q.value==="right"||se+ut>W-On?(Q.value="right",se=R.right-ut):Q.value="left";const dl=Math.max(On,W-ut-On);if(se=Math.min(Math.max(se,On),dl),De+Ze>D-On){const ml=R.top-4-Ze;ml>=On?De=ml:De=Math.max(On,D-Ze-On)}}K.value={top:De,left:se}}const Nt=e.computed(()=>!ze.value||!H.value?{}:{position:"fixed",left:`${K.value.left}px`,top:`${K.value.top}px`,zIndex:1002});function Ot(R,W){return!R||!W?!1:R.getFullYear()===W.getFullYear()&&R.getMonth()===W.getMonth()&&R.getDate()===W.getDate()}function pt(R){return new Date(R.getFullYear(),R.getMonth(),R.getDate()).getTime()}function wt(R){return!L.availableDates||!L.availableDates.length?!0:L.availableDates.some(W=>W instanceof Date&&Ot(W,R))}function B(R){const W=pt(R);return!(L.minDate instanceof Date&&W<pt(L.minDate)||L.maxDate instanceof Date&&W>pt(L.maxDate))}function w(R){const W=new Date(R);return new Date(W.getFullYear(),W.getMonth(),W.getDate())}function T(R){return R.filter(W=>B(W))}function ie(R,W){if(!(R instanceof Date)||!(W instanceof Date))return null;let D=pt(R),se=pt(W);if(D>se&&([D,se]=[se,D]),L.minDate instanceof Date){const De=pt(L.minDate);D=Math.max(D,De),se=Math.max(se,De)}if(L.maxDate instanceof Date){const De=pt(L.maxDate);D=Math.min(D,De),se=Math.min(se,De)}return D>se?null:{start:w(D),end:w(se)}}function re(R){return!L.exceptDates||!L.exceptDates.length?!1:L.exceptDates.some(W=>W instanceof Date&&Ot(W,R))}function He(R){return re(R)?!1:["singleFromAvailable","rangeFromAvailable"].includes(L.mode)?wt(R):B(R)}function gt(R){const W=dt.value,D=Ye.value,se=pt(R),De=ge.value&&D.start&&D.end&&se>pt(D.start)&&se<pt(D.end),mt=ge.value&&D.start&&Ot(R,D.start),ut=ge.value&&D.end&&Ot(R,D.end),Ze=mt&&ut,Je=at.value&&W&&Ot(R,W)||mt||ut;let dl=!1;if(ge.value&&D.start&&!D.end&&V.value){const ml=pt(D.start),Tt=pt(V.value),ll=Math.min(ml,Tt),Bt=Math.max(ml,Tt);dl=se>ll&&se<Bt}return{"dss-datepicker__day--selected":Je&&!Ze,"dss-datepicker__day--range-start":mt&&!Ze,"dss-datepicker__day--range-end":ut&&!Ze,"dss-datepicker__day--range-single":Ze,"dss-datepicker__day--in-range":De&&!mt&&!ut,"dss-datepicker__day--in-range-preview":dl&&!mt&&!ut&&!De,"dss-datepicker__day--disabled":!He(R)}}function et(R){if(!ge.value)return;const W=Ye.value;if(!W.start||W.end){V.value=null;return}if(!He(R)){V.value=null;return}V.value=new Date(R.getFullYear(),R.getMonth(),R.getDate())}function Ae(){V.value=null}function yt(){if(!L.doubleCalendar||!ge.value)return;const R=Ye.value,{start:W,end:D}=R;if(W&&D){const mt=W<=D?W:D,ut=W<=D?D:W,Ze=mt.getMonth(),Je=mt.getFullYear(),dl=ut.getMonth(),ml=ut.getFullYear();if(Ze!==dl||Je!==ml){const Tt=he.value===Ze&&oe.value===Je,ll=j.value===dl&&fe.value===ml;if(Tt&&ll)return;he.value=Ze,oe.value=Je,j.value=dl,fe.value=ml}else{const Tt=Ze===0?11:Ze-1,ll=Ze===0?Je-1:Je;he.value===Tt&&oe.value===ll&&j.value===Ze&&fe.value===Je||(he.value=Ze,oe.value=Je,Ze===11?(j.value=0,fe.value=Je+1):(j.value=Ze+1,fe.value=Je))}return}const se=W||D;if(se){const mt=se.getMonth(),ut=se.getFullYear(),Ze=he.value===mt&&oe.value===ut,Je=j.value===mt&&fe.value===ut;if(Ze||Je)return;he.value=mt,oe.value=ut,mt===11?(j.value=0,fe.value=ut+1):(j.value=mt+1,fe.value=ut);return}const De=lt();he.value=De.left.month,oe.value=De.left.year,j.value=De.right.month,fe.value=De.right.year}const Et=e.computed(()=>new Intl.DateTimeFormat(O.value,{day:"2-digit",month:"long",year:"numeric"})),xt=e.computed(()=>{if(!Ft.value)return[];const R=(L.availableDates||[]).filter(D=>D instanceof Date&&!Number.isNaN(D.getTime())).filter(D=>!re(D)&&B(D)).map(D=>new Date(D.getFullYear(),D.getMonth(),D.getDate()));R.sort((D,se)=>se.getTime()-D.getTime());const W=dt.value;return R.map(D=>({date:D,ts:D.getTime(),label:Et.value.format(D),selected:!!(W&&Ot(D,W))}))});function $t(){if(H.value){Gt();return}ze.value=qe.value?.closest(".dss-datepicker__input-wrap"),Q.value="left",H.value=!0,Ve(),e.nextTick(()=>{ke.value?.querySelector(".dss-datepicker__list-item--selected")?.scrollIntoView({block:"nearest",behavior:"auto"})})}function Ht(R){if(!(R instanceof Date))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());N("update:modelValue",W),Gt()}function kt(R="start"){if(L.mode==="readonly")return;_e.value=R;const W=dt.value,D=Ye.value;if(at.value&&W)f.value=W.getMonth(),be.value=W.getFullYear();else if(ge.value)if(L.doubleCalendar)yt();else{const se=R==="start"&&D.start?D.start:D.end||D.start;se&&(f.value=se.getMonth(),be.value=se.getFullYear())}ze.value=at.value?rt.value?.closest(".dss-datepicker__input-wrap"):Qe.value,me.value="days",$e.value=null,Q.value="left",H.value=!0,Ve()}function Gt(){me.value="days",$e.value=null,V.value=null,H.value=!1}function Ll(R,W){$e.value=R,me.value=W}function hl(){me.value="days",$e.value=null}function Nl(R){const W=new Date,D=W.getFullYear(),se=W.getMonth(),De=W.getDate();let mt,ut;if(qt.value){const Ze=T([...L.availableDates].filter(Je=>Je instanceof Date).map(Je=>new Date(Je.getFullYear(),Je.getMonth(),Je.getDate()))).sort((Je,dl)=>Je.getTime()-dl.getTime());if(Ze.length===0)return null;if(R==="all")mt=Ze[0],ut=Ze[Ze.length-1];else{const Je=parseInt(R.replace("last",""),10);if(Je<2||Je>5)return null;const dl=Ze.slice(-Je);if(dl.length===0)return null;mt=dl[0],ut=dl[dl.length-1]}}else{const Ze=new Date(D,se,De);switch(R){case"today":mt=Ze,ut=Ze;break;case"lastWeek":mt=new Date(D,se,De-6),ut=Ze;break;case"last15Days":mt=new Date(D,se,De-14),ut=Ze;break;case"last30Days":mt=new Date(D,se,De-29),ut=Ze;break;case"thisMonth":mt=new Date(D,se,1),ut=Ze;break;case"last3Months":mt=new Date(D,se-3,1),ut=new Date(D,se,0);break;case"last6Months":mt=new Date(D,se-6,1),ut=new Date(D,se,0);break;case"last12Months":mt=new Date(D,se-12,1),ut=new Date(D,se,0);break;case"lastYear":mt=new Date(D-1,0,1),ut=new Date(D-1,11,31);break;default:return null}}return{start:mt,end:ut}}function cl(R){const W=Nl(R);return W?ie(W.start,W.end):null}function nn(R){return cl(R)!==null}function un(R){const W=cl(R);W&&(N("update:modelValue",W),yt())}function Ul(R){$e.value==="left"?he.value=R:$e.value==="right"?j.value=R:f.value=R,hl()}function Tl(R){$e.value==="left"?oe.value=R:$e.value==="right"?fe.value=R:be.value=R,hl()}function dn(){f.value===0?(f.value=11,be.value--):f.value--}function Al(){f.value===11?(f.value=0,be.value++):f.value++}function Wn(){he.value===0?(he.value=11,oe.value--):he.value--}function Ln(){he.value===11?(he.value=0,oe.value++):he.value++}function El(){j.value===0?(j.value=11,fe.value--):j.value--}function on(){j.value===11?(j.value=0,fe.value++):j.value++}function Dl(R){if(!He(R))return;const W=new Date(R.getFullYear(),R.getMonth(),R.getDate());if(at.value){N("update:modelValue",W),Gt();return}const D=Ye.value;if(!D.start&&!D.end){N("update:modelValue",{start:W,end:null}),_e.value="end";return}if(D.start&&D.end){N("update:modelValue",{start:W,end:null}),_e.value="end";return}if(_e.value==="start"){let se=W,De=D.end;se&&De&&se>De&&([se,De]=[De,se]),N("update:modelValue",{start:se||De,end:De||se}),_e.value="end"}else{let se=D.start,De=W;se&&De&&De<se&&([se,De]=[De,se]),N("update:modelValue",{start:se||De,end:De||se}),_e.value="start"}}e.watch(Ye,()=>{L.doubleCalendar&&ge.value&&H.value&&yt()},{deep:!0});let Ol=null,Hl=null,ul=null;function Tn(){Ol&&(document.removeEventListener("keydown",Ol),Ol=null),Hl&&(window.removeEventListener("resize",Hl),Hl=null),ul&&(window.removeEventListener("scroll",ul,!0),ul=null)}return e.watch(me,R=>{R==="years"&&e.nextTick(()=>{Ue.value?.querySelector(`[data-year="${it.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(()=>[H.value,me.value,f.value,be.value,he.value,oe.value,j.value,fe.value,$e.value,L.doubleCalendar,L.quickSelect],()=>{Ve()}),e.watch(H,R=>{Tn(),R&&(Ol=W=>{W.key==="Escape"&&(me.value==="years"||me.value==="months"?hl():Gt())},Hl=()=>{We()},ul=()=>{We()},document.addEventListener("keydown",Ol),window.addEventListener("resize",Hl),window.addEventListener("scroll",ul,!0))}),e.onBeforeUnmount(()=>{ce!==null&&(window.cancelAnimationFrame(ce),ce=null),Tn()}),(R,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":S.mode==="readonly"}])},[S.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",gs,[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:ft.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ys)])):at.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=D=>kt("start"))},[W[11]||(W[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:rt,type:"text",class:"dss-datepicker__input",placeholder:L.placeholder||e.unref(ue)("datepicker.selectDate"),value:It.value,readonly:"",disabled:S.mode==="readonly"},null,8,ks)])):Ft.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-datepicker__input-wrap dss-datepicker__input-wrap--list",{"dss-datepicker__input-wrap--open":H.value}]),onClick:$t},[W[13]||(W[13]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputListRef",ref:qe,type:"text",class:"dss-datepicker__input",placeholder:L.placeholder||e.unref(ue)("datepicker.selectFromList"),value:It.value,readonly:""},null,8,Cs),e.createElementVNode("span",{class:e.normalizeClass(["dss-datepicker__chevron",{"dss-datepicker__chevron--open":H.value}]),"aria-hidden":"true"},[...W[12]||(W[12]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"})],-1)])],2)],2)):ge.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Qe,onClick:W[1]||(W[1]=D=>kt("start"))},[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:"inputRangeRef",ref:Z,type:"text",class:"dss-datepicker__input",placeholder:L.placeholder||e.unref(ue)("datepicker.selectRange"),value:bt.value,readonly:""},null,8,bs)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Gt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ye,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":S.doubleCalendar&&ge.value&&me.value==="days","dss-datepicker__dropdown--quick-select":S.doubleCalendar&&ge.value&&me.value==="days"&&S.quickSelect,"dss-datepicker__dropdown--list":Ft.value}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Nt.value)},[Ft.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[xt.value.length?(e.openBlock(),e.createElementBlock("ul",{key:0,class:"dss-datepicker__list",role:"listbox",ref_key:"listRef",ref:ke},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,D=>(e.openBlock(),e.createElementBlock("li",{key:D.ts,role:"option","aria-selected":D.selected,class:e.normalizeClass(["dss-datepicker__list-item",{"dss-datepicker__list-item--selected":D.selected}]),onClick:se=>Ht(D.date)},[e.createElementVNode("span",xs,e.toDisplayString(D.label),1),D.selected?(e.openBlock(),e.createElementBlock("svg",Es,[...W[15]||(W[15]=[e.createElementVNode("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"},null,-1)])])):e.createCommentVNode("",!0)],10,ws))),128))],512)):(e.openBlock(),e.createElementBlock("div",Ss,e.toDisplayString(e.unref(ue)("datepicker.noAvailableDates")),1))],64)):me.value==="days"&&S.doubleCalendar&&ge.value?(e.openBlock(),e.createElementBlock("div",Vs,[S.quickSelect?(e.openBlock(),e.createElementBlock("nav",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D.id,type:"button",class:"dss-datepicker__quick-select-btn",disabled:!nn(D.id),onClick:se=>un(D.id)},e.toDisplayString(e.unref(ue)(D.labelKey)),9,Bs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ms,[e.createElementVNode("div",_s,[e.createElementVNode("div",$s,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:Wn}," ‹ ",8,Ls),e.createElementVNode("div",Ts,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=D=>Ll("left","months"))},e.toDisplayString(Ke.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=D=>Ll("left","years"))},e.toDisplayString(oe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Ln}," › ",8,As)]),e.createElementVNode("div",Ds,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vt.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,Rs)):(e.openBlock(),e.createElementBlock("span",Fs))],64))),128))])]),e.createElementVNode("div",Is,[e.createElementVNode("div",zs,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:El}," ‹ ",8,Ps),e.createElementVNode("div",Os,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=D=>Ll("right","months"))},e.toDisplayString(nt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=D=>Ll("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:on}," › ",8,Ws)]),e.createElementVNode("div",qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,Us)):(e.openBlock(),e.createElementBlock("span",Xs))],64))),128))])])])])):me.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Ys,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.prevMonth"),onClick:dn}," ‹ ",8,js),e.createElementVNode("div",Ks,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=D=>me.value="months")},e.toDisplayString(At.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=D=>me.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ue)("datepicker.nextMonth"),onClick:Al}," › ",8,Gs)]),e.createElementVNode("div",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,D=>(e.openBlock(),e.createElementBlock("span",{key:D,class:"dss-datepicker__weekday"},e.toDisplayString(D),1))),128))]),e.createElementVNode("div",Js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ge.value,(D,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[D?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",gt(D)]),disabled:!He(D),onClick:De=>Dl(D),onMouseenter:De=>et(D),onMouseleave:Ae},e.toDisplayString(D.getDate()),43,er)):(e.openBlock(),e.createElementBlock("span",tr))],64))),128))])],64)):me.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",lr,[e.createElementVNode("div",nr,[e.createElementVNode("span",or,e.toDisplayString(ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=D=>me.value="years")},e.toDisplayString(it.value),1)])]),e.createElementVNode("div",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(il.value,(D,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===Yt.value}]),onClick:De=>Ul(se)},e.toDisplayString(D),11,sr))),128))])],64)):me.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:4},[e.createElementVNode("div",rr,[e.createElementVNode("span",ir,e.toDisplayString(Dt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ue},[e.createElementVNode("div",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,D=>(e.openBlock(),e.createElementBlock("button",{key:D,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":D===it.value,"dss-datepicker__year-cell--current":D===e.unref(Te)}]),"data-year":D,onClick:se=>Tl(D)},e.toDisplayString(D),11,ur))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},dr={class:"dss-step-bar__layout"},mr={class:"dss-step-bar__header"},pr={class:"dss-step-bar__label"},vr={key:0,class:"dss-step-bar__counter"},fr={class:"dss-step-bar__track-wrapper"},hr=["aria-valuemax","aria-valuenow","aria-label"],gr=["onMouseenter"],Ta={__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:S=>["input","desc","asc"].includes(S)},orientation:{type:String,default:"horizontal",validator:S=>["horizontal","vertical"].includes(S)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:S=>["up","down","left","right"].includes(S)},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(S){const ee=S,L={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"}}},N=A=>A&&typeof A=="object"&&!Array.isArray(A),ue=(A,X)=>{const ae=Object.assign({},A);return!N(A)||!N(X)||Object.keys(X).forEach(Ce=>{if(N(X[Ce])){Ce in A?ae[Ce]=ue(A[Ce],X[Ce]):Object.assign(ae,{[Ce]:X[Ce]});return}Object.assign(ae,{[Ce]:X[Ce]})}),ae},O=e.computed(()=>ue(L,ee.options)),H=e.computed(()=>Math.max(1,Number(ee.steps)||1)),me=e.computed(()=>Math.min(H.value,Math.max(0,Number(ee.currentStep)||0))),ot=e.computed(()=>Array.isArray(ee.segments)&&ee.segments.length>0),ne=e.computed(()=>{if(!ot.value)return[];const A=ee.segments.map((X,ae)=>{const Ce=Number(X?.value);return{label:X?.label||`Step ${ae+1}`,value:Number.isFinite(Ce)&&Ce>0?Ce:0,color:X?.color||ee.activeColor,marker:X?.marker}});return ee.segmentOrder==="desc"?[...A].sort((X,ae)=>ae.value-X.value):ee.segmentOrder==="asc"?[...A].sort((X,ae)=>X.value-ae.value):A}),f=e.computed(()=>ot.value?ne.value.reduce((A,X)=>A+X.value,0):me.value),be=e.computed(()=>ot.value?Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0?Number(ee.totalValue):Math.max(1,f.value):H.value),he=e.computed(()=>ot.value&&Number.isFinite(Number(ee.totalValue))&&Number(ee.totalValue)>0),oe=e.computed(()=>he.value?Math.max(0,Number(ee.totalValue)-f.value):0),j=e.computed(()=>typeof ee.remainderLabel=="string"&&ee.remainderLabel.trim().length>0),fe=e.computed(()=>oe.value>0),_e=e.computed(()=>ne.value.reduce((A,X)=>Math.max(A,Number(X.value)||0),0)),V=e.computed(()=>ne.value.filter(A=>A.value>0).map(A=>`${A.label}: ${bt(A.value)}`).join(" | ")),$e=e.computed(()=>ot.value?he.value?ne.value.filter(A=>A.value>0):ne.value:[]),lt=e.computed(()=>{if(!ee.counterAsPercentage)return`${f.value} / ${be.value}`;const A=Number(be.value);if(!Number.isFinite(A)||A<=0)return"0%";const X=Math.round(Number(f.value)/A*100);return`${Math.min(Math.max(X,0),100)}%`}),rt=e.computed(()=>f.value),Qe=e.computed(()=>be.value),Z=e.reactive({visible:!1,x:0,y:0,content:""}),qe=e.computed(()=>ee.orientation==="vertical"),ze=e.computed(()=>{const A=ee.barHeight;return A==null||A===""?"200px":typeof A=="number"?`${A}px`:String(A)}),ye=e.computed(()=>{const A=ee.sideLabelMaxWidth;if(!(A==null||A===""))return typeof A=="number"?`${A}px`:String(A)}),Ue=e.computed(()=>{const A=ee.sideLabelWrapWidth;return A==null||A===""?"18ch":typeof A=="number"?`${A}ch`:String(A)}),ke=e.computed(()=>({left:`${Z.x}px`,top:`${Z.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Te=A=>qe.value?{flex:`${A} 0 0`,minHeight:A>0?"6px":"0",minWidth:"0"}:{flex:`${A} 0 0`,minWidth:A>0?"6px":"0"},at=A=>{const X=A?.parentElement;if(!X)return{x:0,y:0};const ae=X.getBoundingClientRect();return{x:ae.left+ae.width/2,y:ae.top}},ge=A=>{const X=A.getBoundingClientRect();return{x:X.left+X.width/2,y:X.top}},Ft=A=>{if(he.value){const Ce=Math.max(0,Number(A.value)||0);return{...Te(Ce),backgroundColor:A.color}}const X=f.value,ae=A.value>0?A.value:X>0?1e-4:1;return{...Te(ae),backgroundColor:A.color}},dt=A=>Number(A?.value||0)>0&&Number(A?.value||0)===_e.value,Ye=A=>{const X=N(A?.marker)?A.marker:{},ae=A?.marker===!0||X.enabled===!0,Ce=dt(A)&&O.value.maxSegment?.marker?.enabled===!0;if(!(ae||Ce))return{enabled:!1};const Ge=X.backgroundColor??(Ce?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),Vt=X.borderColor??(Ce?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Pe=X.color??(Ce?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),Ke=X.width??(Ce?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),nt=X.height??(Ce?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Ge,borderColor:Vt,color:Pe,width:Ke,height:nt,icon:X.icon??null,...X}},Pt=A=>{const X=Ye(A);return{backgroundColor:X.backgroundColor??void 0,borderColor:X.borderColor??void 0,color:X.color??void 0}},It=A=>{const X=Ye(A);return{width:X.width??void 0,height:X.height??void 0}},bt=A=>`${A}${ee.valueLabel}`,ft=e.computed(()=>({...Te(oe.value),backgroundColor:ee.inactiveColor})),Yt=(A,X)=>{ee.disableTooltips||ht(A,X)},it=A=>{ee.disableTooltips||il(A)},At=()=>{ee.disableTooltips||St()},ht=(A,X)=>{if(!A||!X?.currentTarget)return;const ae=X.currentTarget;if(ee.remainderTooltipSummary){const je=at(ae);Z.x=je.x,Z.y=je.y,Z.content=V.value,Z.visible=!!Z.content;return}const Ce=ge(ae);Z.x=Ce.x,Z.y=Ce.y,Z.content=`${A.label}: ${bt(A.value)}`,Z.visible=!0},il=A=>{if(!oe.value||!A?.currentTarget)return;const X=A.currentTarget;if(ee.remainderTooltipSummary){const Ce=at(X);Z.x=Ce.x,Z.y=Ce.y,Z.content=V.value,Z.visible=!!Z.content;return}const ae=ge(X);Z.x=ae.x,Z.y=ae.y,j.value&&(Z.content=`${ee.remainderLabel}: ${bt(oe.value)}`,Z.visible=!0)},St=()=>{Z.visible=!1},Dt=()=>{Z.visible&&St()};e.onMounted(()=>{window.addEventListener("scroll",Dt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",Dt,!0)});const pe=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":qe.value?ze.value:void 0,"--dss-step-bar-side-label-max-width":ye.value,"--dss-step-bar-side-label-wrap-width":Ue.value}));return(A,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${S.orientation}`,`dss-step-bar--label-${S.labelPosition}`]]),style:e.normalizeStyle(pe.value)},[e.createElementVNode("div",dr,[e.createElementVNode("div",mr,[e.createElementVNode("span",pr,[e.renderSlot(A.$slots,"label",{label:S.label},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])]),S.showCounter?(e.openBlock(),e.createElementBlock("span",vr,[e.renderSlot(A.$slots,"counter",{counterDisplay:lt.value},()=>[e.createTextVNode(e.toDisplayString(lt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",fr,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":Qe.value,"aria-valuenow":rt.value,"aria-label":S.label},[ot.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(ae,Ce)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Ce}-${ae.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":dt(ae),"dss-step-bar__segment--marker-enabled":Ye(ae).enabled}]),style:e.normalizeStyle(Ft(ae)),onMouseenter:je=>Yt(ae,je),onMouseleave:At},[Ye(ae).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Pt(ae)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(It(ae))},[e.renderSlot(A.$slots,"segment-marker-icon",{segment:ae,index:Ce,marker:Ye(ae)},()=>[e.renderSlot(A.$slots,"max-segment-icon",{segment:ae,index:Ce,marker:Ye(ae)},()=>[e.createTextVNode(e.toDisplayString(Ye(ae).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,gr))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ft.value),onMouseenter:X[0]||(X[0]=ae=>it(ae)),onMouseleave:At},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(H.value,ae=>(e.openBlock(),e.createElementBlock("div",{key:ae,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":ae<=me.value}])},null,2))),128))],8,hr)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[!S.disableTooltips&&Z.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(Z.content),5)):e.createCommentVNode("",!0)]))],6))}},yr=["data-chart-type"],kr={class:"dss-chart-header-titles"},Cr={key:0,class:"dss-chart-title"},br={key:1,class:"dss-chart-subtitle"},wr=["onClick","onMouseenter"],xr={class:"dss-legend-text"},Er=["onClick","onMouseenter"],Sr={class:"dss-legend-text"},Vr=["title"],Nr=["src"],Br={class:"dss-chart-area-wrapper"},Mr={key:0,class:"dss-chart-z-axis-label"},_r=["width","height","data-smooth","data-animated"],$r=["id"],Lr=["y","width","height"],Tr=["id"],Ar=["d"],Dr=["id"],Hr=["d"],Rr={key:0},Fr=["clip-path"],Ir=["x1","x2","y1","y2"],zr=["clip-path"],Pr=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray","opacity"],Or={class:"dss-axes"},Wr=["x1","x2","y1","y2"],qr=["x1","x2","y1","y2"],Zr=["x1","x2","y1","y2"],Ur={class:"dss-axis-labels"},Xr=["x","y"],Yr=["x","y"],jr=["x","y"],Kr=["x","y"],Gr=["y","transform"],Qr=["x","y","transform"],Jr={key:2,class:"dss-flag-markers"},ei=["clip-path"],ti=["x1","x2","y1","y2","onMouseover"],li=["x1","x2","y1","y2","onMouseover"],ni=["x1","x2","y1","y2","onMouseover"],oi=["cx","cy","onMouseover"],ai=["cx","cy","fill","onMouseover"],si=["x","y"],ri=["clip-path"],ii={key:0},ci=["d","onMouseover"],ui=["x","y","width","height","fill","onMouseover"],di={class:"dss-line-chart"},mi=["d","stroke","stroke-width","stroke-dasharray"],pi=["d","stroke","stroke-width","opacity"],vi=["cx","cy","r","fill","onMouseover"],fi={key:1},hi=["d","stroke","stroke-width","stroke-dasharray"],gi=["d","stroke","stroke-width","stroke-dasharray"],yi=["d","stroke","stroke-width","opacity"],ki=["cx","cy","r","fill","onMouseover"],Ci={key:2},bi=["id"],wi=["x","y","width","height"],xi=["d","fill","fill-opacity","mask"],Ei=["d","stroke","stroke-width"],Si=["d","fill","onMouseover"],Vi=["x","y","width","height","onMouseover"],Ni=["clip-path"],Bi=["x1","x2","y1","y2","stroke"],Mi=["cx","cy","r","fill"],_i={key:1,class:"dss-bubble-chart"},$i={key:0,class:"dss-bubble-group"},Li=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Ti=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Ai=["transform"],Di=["cx","cy","r"],Hi=["data-chart-type","clip-path"],Ri=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Fi={key:1,class:"dss-radial-segment-data-labels"},Ii=["x","y"],zi=["x","y","font-size","fill"],Pi=["x1","y1","x2","y2","stroke"],Oi=["x1","y1","x2","y2","stroke"],Wi=["x","y","text-anchor","font-size"],qi=["transform"],Zi={key:0,class:"dss-spider-grid"},Ui=["cx","cy","r"],Xi={class:"dss-spider-grid-labels"},Yi=["x","y"],ji=["x","y"],Ki=["x1","x2","y1","y2"],Gi={class:"dss-spider-labels"},Qi=["x","y","text-anchor","dominant-baseline"],Ji=["points","fill","fill-opacity","stroke","stroke-width","stroke-dasharray"],ec=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],tc={class:"dss-chart-logos"},lc=["cx","cy","r","fill"],nc=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],oc={key:0,class:"dss-stepbar-grid-lines","aria-hidden":"true"},ac=["onClick","onMouseenter"],sc=["src"],rc={class:"dss-marker-tooltip-category"},ic={key:0,class:"dss-marker-tooltip-description"},cc={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},uc={class:"dss-tooltip-title dss-spider-tooltip-area-title"},dc={class:"dss-tooltip-series-name"},mc={class:"dss-tooltip-series-value"},pc={key:1,class:"dss-tooltip-section"},vc={key:0,class:"dss-tooltip-title"},fc={class:"dss-bubble-tooltip-data"},hc={key:2,class:"dss-tooltip-section"},gc={class:"dss-tooltip-title"},yc={class:"dss-tooltip-value"},kc={key:0,class:"dss-tooltip-section"},Cc={class:"dss-tooltip-section-title"},bc={class:"dss-tooltip-group-header"},wc={class:"dss-tooltip-item-content"},xc={class:"dss-tooltip-item-text"},Ec={key:1,class:"dss-tooltip-section"},Sc={class:"dss-tooltip-section-title"},Vc={class:"dss-tooltip-item-content"},Nc={class:"dss-tooltip-item-title"},Bc={key:0,class:"dss-tooltip-item-description"},Mc={class:"dss-tooltip-section"},_c={class:"dss-tooltip-title"},$c={key:0,class:"dss-bubble-tooltip-data"},Lc={class:"dss-tooltip-series-name"},Tc={class:"dss-tooltip-series-value"},Ac={key:0,class:"dss-tooltip-section"},Dc={class:"dss-tooltip-section-title"},Hc={class:"dss-tooltip-group-header"},Rc={class:"dss-tooltip-item-content"},Fc={class:"dss-tooltip-item-text"},Ic={key:1,class:"dss-tooltip-section"},zc={class:"dss-tooltip-section-title"},Pc={class:"dss-tooltip-item-content"},Oc={class:"dss-tooltip-item-title"},Wc={key:0,class:"dss-tooltip-item-description"},qc=["onClick","onMouseenter"],Zc={class:"dss-legend-text"},Uc={key:1,class:"dss-context-menu-separator"},Xc={key:0,class:"dss-context-menu-separator"},Yc={key:0,class:"dss-context-menu-separator"},jc=["onClick"],Kc=["innerHTML"],Gc={key:0,class:"dss-context-menu-icon"},Qc={class:"dss-marker-modal-header"},Jc={class:"dss-marker-modal-body"},eu={class:"dss-form-group"},tu={class:"dss-form-group"},lu={for:"dss-marker-description"},nu={key:0,class:"dss-form-text-display"},ou=["placeholder"],au={class:"dss-marker-modal-footer"},su={class:"modal-footer-left"},ru={class:"dss-modal-footer-right"},iu=["disabled"],cu={name:"DSSChart"},uu=Object.assign(cu,{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:S=>typeof S=="object"&&S!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(S,{emit:ee}){const{t:L,locale:N}=so.useI18n(),ue=ee,O=e.ref(null),H=e.ref(null),me=e.ref(null),ot=e.ref(null),ne=e.ref(0),f=e.ref(0);let be=null,he=null;const oe=20,j=e.computed(()=>{if(f.value,ne.value,!O.value||!me.value)return 0;try{const t=O.value.getBoundingClientRect();return me.value.getBoundingClientRect().top-t.top}catch{return 0}}),fe=e.computed(()=>`chart-clip-${V.chartId}`),_e=e.computed(()=>`url(#${fe.value})`),V=S,$e={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,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 lt(t,o){const l=Object.assign({},t);return Qe(t)&&Qe(o)&&Object.keys(o).forEach(r=>{Qe(o[r])?r in t?l[r]=lt(t[r],o[r]):Object.assign(l,{[r]:o[r]}):Object.assign(l,{[r]:o[r]})}),l}const rt=()=>{let t=20,o=0,l=0;if(dt.value&&(t+=30),Ye.value&&(t+=25),A.value&&V.series.length>0){const r=V.series.filter((m,v)=>!st.value.has(v)).length;if(X.value==="top"||X.value==="bottom"){if(ae.value==="horizontal"){const v=Math.floor(ye.value/100);o=Math.ceil(r/v)*25+10}else o=r*25+10;t+=o}else l=150}return{height:t,legendHeight:o,legendWidth:l}};function Qe(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>lt($e,V.options)),qe=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"}),ye=e.computed(()=>{const t=Z.value;return qe.value?ne.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ue=e.ref(oe),ke=e.computed(()=>{if(ze.value){const t=ke.value;return t??Math.max(0,(f.value||400)-Ue.value*5)}}),Te=e.computed(()=>{const t=Z.value;if(ge.value==="mini-radial")return ye.value;if(ze.value){const o=ke.value;return o??Math.max(0,(f.value||400)-Ue.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),at=e.computed(()=>{if(ze.value&&ge.value==="semi-radial"&&ke.value!=null)return Ue.value+Te.value+"px";if(ze.value)return"100%";if(Cl.value)return Ue.value+Te.value+"px";if(A.value&&X.value==="bottom"){const t=rt();return Te.value+(t.legendHeight||35)+"px"}return Te.value+(A.value?20:0)+"px"}),ge=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Ft=e.computed(()=>{const t=V.series.map(o=>o.type||ge.value);return new Set(t).size>1}),dt=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),Ye=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Pt=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const o=t.zAxis;return typeof o=="string"?o:o&&typeof o.label=="string"?o.label:""}),It=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),bt=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ft=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),Yt=e.computed(()=>{const t=ft.value;return t&&t.title&&t.title.text?t.title.text:""}),it=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Ml;const o=t.yAxis.min;return typeof o=="number"||o===Ml?o:Ml}),At=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return Ml;const o=t.yAxis.max;return typeof o=="number"||o===Ml?o:Ml}),ht=e.computed(()=>{const t=ft.value;if(!t)return Ml;const o=t.min;return typeof o=="number"||o===Ml?o:Ml}),il=e.computed(()=>{const t=ft.value;if(!t)return Ml;const o=t.max;return typeof o=="number"||o===Ml?o:Ml}),St=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),pe=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),A=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),X=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),ae=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ce=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),je=e.computed(()=>{const t=Z.value;if(!t)return!1;if(jt.value){if(!t.crosshair)return!0;const l=t.crosshair.show;return l!==!1&&l!=="false"}if(!t.crosshair)return!1;const o=t.crosshair.show;return o===!0||o==="true"}),Ge=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Vt=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Pe=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ke=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),nt=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),qt=e.computed(()=>{if(!Cl.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),te=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),K=e.computed(()=>{const{maxX:t}=Wt.value;return t===0}),Q=(t,o)=>K.value&&o===0?5:o,ce=t=>{const o=Number(t);return!Number.isFinite(o)||o<=0?0:o},Ve=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),We=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Nt=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ot=e.computed(()=>{const t=Z.value;return We.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),pt=e.computed(()=>{const t=Z.value,o=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return o.length>0?o:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),wt=e.computed(()=>Z.value?.stepbar||{}),B=e.computed(()=>{const t=wt.value?.segmentOrder;return["asc","desc","input"].includes(t)?t:"input"}),w=e.computed(()=>{const t=Number(wt.value?.totalValue);return Number.isFinite(t)&&t>0?t:100}),T=e.computed(()=>wt.value?.showRemainder!==!1),ie=e.computed(()=>wt.value?.remainderLabel||"Remaining"),re=e.computed(()=>wt.value?.remainderColor||"#E5E7EB"),He=e.computed(()=>{const t=Number(wt.value?.barWidth);return Number.isFinite(t)&&t>0?t:42}),gt=e.computed(()=>{const t=Number(wt.value?.minBarWidth);return Number.isFinite(t)&&t>0?t:12}),et=e.computed(()=>{const t=Number(wt.value?.maxBarWidth);return Number.isFinite(t)&&t>0?t:58});e.computed(()=>{const t=Number(wt.value?.barRadius);return Number.isFinite(t)&&t>=0?t:6});const Ae=e.computed(()=>wt.value?.axisBars||{}),yt=e.computed(()=>Ae.value?.show!==!1);e.computed(()=>Ae.value?.showVertical===!0);const Et=e.computed(()=>Ae.value?.color||"#d6d6d6"),xt=e.computed(()=>{const t=Number(Ae.value?.opacity);return Number.isFinite(t)?Math.min(Math.max(t,0),1):.75}),$t=e.computed(()=>{const t=Number(Ae.value?.width);return Number.isFinite(t)&&t>0?t:1}),Ht=e.computed(()=>Ae.value?.dashArray||"3,4"),kt=e.computed(()=>{const t=Number(wt.value?.columnGap);return Number.isFinite(t)&&t>=0?t:16}),Gt=e.computed(()=>{const t=Number(wt.value?.labelReserve);return Number.isFinite(t)&&t>0?t:48}),Ll=e.computed(()=>Math.max(z.value.height,0)),hl=e.computed(()=>{const t=Number(wt.value?.columnWidth);if(Number.isFinite(t)&&t>0)return t;const o=He.value,l=gt.value,r=et.value;return Math.max(l,Math.min(r,o))}),Nl=e.computed(()=>{const t=Number(wt.value?.trackWidth);if(Number.isFinite(t)&&t>0)return Math.min(t,hl.value);const o=Number(wt.value?.barWidth);return Number.isFinite(Number(wt.value?.columnWidth))&&Number(wt.value?.columnWidth)>0&&Number.isFinite(o)&&o>0?Math.min(o,hl.value):Math.min(hl.value,Math.max(10,Math.round(hl.value*.32)))}),cl=e.computed(()=>({width:`${hl.value}px`,flex:`0 0 ${hl.value}px`,"--dss-step-bar-track-thickness":`${Nl.value}px`,"--dss-stepbar-label-height":`${Gt.value}px`})),nn=e.computed(()=>{const t=Ul.value.length;return t?t*hl.value+Math.max(0,t-1)*kt.value:0}),un=e.computed(()=>({maxSegment:{marker:{enabled:!1}}})),Ul=e.computed(()=>jt.value?Qn.value.map(t=>({key:t.key,label:t.axisLabel||t.label,totalValue:t.totalValue,segments:t.segments.filter(o=>!o.isRemainder).map(o=>({label:o.label,value:o.value,color:o.color,marker:o.marker}))})):[]),Tl=e.computed(()=>{if(!jt.value)return[];const{minY:t,maxY:o}=Wt.value,l=5,r=[];for(let m=0;m<=l;m++){const v=t+(o-t)*(m/l);r.push({top:Vl(v)-z.value.top,value:v})}return r}),dn=e.computed(()=>({top:`${z.value.top}px`,left:`${z.value.left}px`,width:`${z.value.width}px`,height:`${Ll.value+Gt.value}px`})),Al=e.computed(()=>({width:`${nn.value}px`,minHeight:`${Ll.value+Gt.value}px`})),Wn=e.computed(()=>jt.value&&je.value&&$.value.show&&!U.value.isZooming),Ln=e.computed(()=>{const t=hl.value+kt.value;return{left:`${$.value.categoryIndex*t+hl.value/2}px`,height:`${Ll.value}px`,borderColor:Ge.value}}),El=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),on=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Dl=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Ol=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Hl=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),ul=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Tn=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),R=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),W=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),D=e.computed(()=>Z.value?.spider?.gridSteps||5),se=e.computed(()=>{const t=[],o=D.value;for(let l=1;l<=o;l++)t.push(vt.value/o*l);return t}),De=t=>{const o=mt.value;if(o&&Array.isArray(o)&&o[t]!==void 0)return o[t].toString();const l=se.value[t];return Math.round(l/vt.value*100)+"%"},mt=e.computed(()=>Z.value?.spider?.gridLabels||null),ut=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ze=e.computed(()=>{const t=Z.value,o={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...o,...t.contextMenu.items}:o}),Je=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),dl=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Ql.value}),ml=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Tt=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),ll=e.computed(()=>{const o=Z.value?.valueFormat?.extension;return typeof o=="string"?o:""}),Bt=t=>{const o=ll.value;if(t==null)return"";const l=String(t);return o?l+o:l},Bl=e.computed(()=>!U.value.isZooming);e.computed(()=>tt.value.map(t=>{if(t.categoryIndex!==void 0&&(kl.value||el.value)){const o=tl(t.categoryIndex),l=j.value+z.value.bottom-Tt.value/2;return{...t,x:o,y:l}}return t}));function mn(t,o){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[v,C,b]=t.split("-"),q=Number(b?.length===2?`20${b}`:b);l=new Date(q,Number(C)-1,Number(v))}else return 0;let r=0,m=1/0;return o.forEach((v,C)=>{const[b,q,_]=v.split("-"),I=Number(_?.length===2?`20${_}`:_),M=new Date(I,Number(q)-1,Number(b)),G=Math.abs(M-l);G<m&&(m=G,r=C)}),r}const Qt=e.computed(()=>{const t=V.markers.map(l=>{const r=mn(l.marker_date,V.categories),m=tl(r),v=j.value+z.value.bottom-Tt.value/2;return{...l,x:m,y:v,categoryIndex:r,source:"props"}}),o=tt.value.map(l=>{if(l.categoryIndex!==void 0&&(kl.value||el.value)){const r=tl(l.categoryIndex),m=j.value+z.value.bottom-Tt.value/2;return{...l,x:r,y:m,source:"internal"}}return{...l,source:"internal"}});return[...t,...o]}),Mt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),wn=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),An=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),_l=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),an=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let o,l;const r=String(An.value);if(r.includes("%")){const m=parseFloat(r)/100;o=t.width*m,l=o*(96/499)}else{const m=parseFloat(r)||25;o=Math.min(t.width*.25,200)*(m/25),l=o*(96/499)}return{width:o,height:l,area:t}}),pn=e.computed(()=>{const{width:t,height:o}=an.value,l=_l.value;let r,m;const v=z.value.left,C=z.value.right,b=z.value.top,q=z.value.bottom,_=z.value.width,I=z.value.height;switch(l){case"center":r=v+(_-t)/2,m=b+(I-o)/2;break;case"top-left":r=v+15,m=b+5;break;case"top-right":r=C-t-15,m=b+5;break;case"bottom-left":r=v+15,m=q-o-5;break;case"bottom-right":default:r=C-t-15,m=q-o-5;break}return{backgroundPositionX:r+"px",backgroundPositionY:m+"px",backgroundSize:`${t}px ${o}px`}}),qn=t=>!V.flags||!V.flags.length?[]:V.flags.filter(o=>o.categoryIndex===t),Rl=t=>{const o=qn(t),l=Go(t),r=o.filter(C=>C.manual),m=o.filter(C=>!C.manual),v=[];return r.length>0&&v.push({type:L("chart.tooltip.manualFlags"),color:"#698dbe",flags:r.map(C=>({text:C.text,color:"#698dbe"}))}),m.length>0&&v.push({type:L("chart.tooltip.autoFlags"),color:"#a1d499",flags:m.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:v,markers:l.map(C=>({title:C.title,description:C.description,type:L("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Ql=e.computed(()=>{const t=V.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Jt=e.computed(()=>{const t=V.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),Dn=e.ref({show:!1,x:0,y:0,content:"",count:0}),nl=e.computed(()=>U.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),zl=e.computed(()=>{const t=U.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),On=e.computed(()=>U.value?.bubbles?.tooltip?.formatters||{}),zt=e.ref(new Set),Me=e.ref(null),El=e.ref(!1),kt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Ml=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),nt=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ft=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ie=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return sn.value&&t.push(...Object.keys(sn.value)),t}),e.computed(()=>{if(!F.categories||F.categories.length===0){const{maxX:t}=He.value;return Array.from({length:t+1},(o,l)=>$("chart.fallback.item",{number:l+1}))}return F.categories});const Jl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Cl=e.computed(()=>{if(!F.categories||F.categories.length===0)return null;const t=F.categories[F.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;return!f||!l||!m?null:new Date(m,C,f)}),Al=e.computed(()=>De.value.editingMarkerId!==null),y=e.computed(()=>De.value.readonly),g=t=>{zt.value.has(t)||(ia.value=!0,Me.value=t)},w=()=>{ia.value=!1,Me.value=null},Z=t=>{if(go.value||Io.value){nt.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,f=ul.value?r>=R.value.left-50&&r<=R.value.right+50&&m>=R.value.top-50&&m<=R.value.bottom+100:r>=R.value.left&&r<=R.value.right&&m>=R.value.top&&m<=R.value.bottom;if(El.value=f,ul.value){if(!Xe.value||!f||ie.value.isDragging||ie.value.isZooming){nt.value.show=!1;return}if(Ro.value.find(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-r,2)+Math.pow(pe.y-m,2))<=pe.radius+3))nt.value.show=!1;else{const pe=Ro.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2))<=250);if(pe.length>0){let ye=pe[0],Se=Math.sqrt(Math.pow(ye.x-r,2)+Math.pow(ye.y-m,2));pe.forEach(Oe=>{const Ae=Math.sqrt(Math.pow(Oe.x-r,2)+Math.pow(Oe.y-m,2));Ae<Se&&(Se=Ae,ye=Oe)});const ve=30,Ye=Ro.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-ye.x)<=ve).sort((Oe,Ae)=>Oe.y-Ae.y);nt.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Oe=nl.value,Ae=zl.value,Ee=[];return Ye.forEach(Re=>{Oe.forEach(Vt=>{const Ft=Ae[Vt]||Vt,Dl=ka(Vt,Re);Dl&&Ee.push({seriesName:Re.seriesName,label:Re.label,value:`${Ft}: ${Dl}`,color:Re.color,y:Re.y})})}),Ee})()}}else nt.value.show=!1}return}if(ie.value.isDragging&&ie.value.scale>1&&ol.value&&Ge.value){nt.value.show=!1;const Ze=t.clientX-ie.value.lastMouseX,{minX:pe,maxX:ye}=He.value,Se=ye-pe||1,Ye=Ze*.8;ie.value.offsetX+=Ye;const Oe=Se/ie.value.scale,Ae=Se-Oe,Ee=0,Re=-Ae/Se*R.value.width,Vt=Ee;ie.value.offsetX=Math.max(Re,Math.min(Vt,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY;return}if(!Xe.value||!ol.value||ie.value.isDragging||ie.value.isZooming||!f){nt.value.show=!1;return}const{minX:C,maxX:b}=He.value,P=b-C||1,B=P/ie.value.scale,H=C-ie.value.offsetX/R.value.width*P,S=(r-R.value.left)/R.value.width,q=H+S*B,we=Math.round(q);if(we>=0&&we<=b){const Ze=vt(we),pe=a.value.map((ye,Se)=>{const ve=F.series.findIndex(Oe=>Oe===ye),Ye=ye.data[we];return{seriesName:ye.name,value:Ye!==void 0?Ye:null,color:$t(ve),y:Ye!==void 0?gl(ye,Ye):null}}).filter(ye=>ye.value!==null);nt.value={show:!0,x:Ze,categoryIndex:we,data:pe}}},he=()=>{nt.value.show=!1,El.value=!1,Io.value=!1,go.value||(Dn.value.show=!1),ie.value.isDragging&&(ie.value.isDragging=!1),ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1,setTimeout(()=>{Me.value=null,kt.value.show=!1},150)},at=t=>{if(t.preventDefault(),t.stopPropagation(),!ql.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(al.value){ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null});return}const m=Math.max(0,R.value.left-20),f=R.value.right,C=R.value.top,b=R.value.bottom+80;l>=m&&l<=f&&r>=C&&r<=b&&(ft.value.show=!1,e.nextTick(()=>{ft.value.show=!0,ft.value.x=t.clientX,ft.value.y=t.clientY,ft.value.categoryIndex=null;const P=Math.max(R.value.left,Math.min(l,R.value.right))-R.value.left,H=R.value.width/To.value.length,S=Math.floor(P/H);S>=0&&S<To.value.length&&(ft.value.categoryIndex=S)}))},Bt=t=>{if(!(t&&t.button===2)){if(ft.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}ft.value.show=!1}},bl=t=>{if(typeof t.template=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:ft.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Pl=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},Ul=t=>t.style||{},gn=t=>t.type&&sn.value[t.type]?sn.value[t.type]:t.customIcon?t.customIcon:Kl.value,mo=t=>t==null?"":F.categories&&F.categories[t]?F.categories[t]:"",Xo=t=>Tt.value.length?Tt.value.filter(o=>o.categoryIndex===t):[],Co=t=>{if(!ol.value&&!ul.value)return{x:0,y:0};const o=vt(t),l=J.value+R.value.bottom-T.value/2;return{x:o,y:l}},bo=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(ol.value||ul.value)){const o=Co(t.categoryIndex);t.x=o.x,t.y=o.y}})},Yo=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(Al.value){const t=Tt.value.findIndex(o=>o.id===De.value.editingMarkerId);t!==-1?(Tt.value[t].description=De.value.description||"",Tt.value[t].color=De.value.color||"",Tt.value[t].type=De.value.type||"default",ce("update-marker",Tt.value[t])):ce("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=Te(De.value.date,F.categories||[]);if(ul.value){const{maxX:C}=He.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else ol.value&&(o=Math.max(0,Math.min(o,He.value.maxX)));const l=vt(o),r=J.value+R.value.bottom-T.value/2,m=Array.isArray(F.categories)?F.categories[o]:null,f={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};De.value.categoryIndex=o,Tt.value.push(f),ce("add-marker",f)}Sn(),wo()}},Sn=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},po=()=>{Al.value&&(xo(De.value.editingMarkerId),Sn())},xo=t=>{const o=Tt.value.findIndex(l=>l.id===t);o!==-1&&(Tt.value.splice(o,1),wo()),ce("delete-marker",t)},jo=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),f=Number(o),C=Number(l)-1;f&&l&&m?De.value.date=new Date(m,C,f):De.value.date=null}else De.value.date=null},wo=()=>{try{const t=`dss-chart-markers-${F.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Eo=()=>{try{const t=`dss-chart-markers-${F.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(Tt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Hn=t=>{const o=ut.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},fo=()=>{const t=nt.value.show,o=kt.value.show;return nt.value.show=!1,kt.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Vn=t=>{nt.value.show=t.originalCrosshair,kt.value.show=t.originalTooltip},Ko=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const f=new Image;f.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);f.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),P=b.getContext("2d");b.width=o,b.height=l,P.fillStyle="#fafafa",P.fillRect(0,0,o,l),P.drawImage(f,0,0,o,l);const B=b.toDataURL("image/png");r(B)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},f.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},f.src=t}),Go=async()=>{try{const t=fo();setTimeout(async()=>{try{const o=L.value;if(!o){console.error("Chart SVG element not found"),Vn(t);return}const l=tt(),r=Ve.value,m=re.value+l.height,f=o.cloneNode(!0);f.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ve=>ve.remove());const b=f.querySelectorAll("image"),P=Array.from(b).map(async ve=>{const Ye=ve.getAttribute("xlink:href")||ve.getAttribute("href");if(Ye&&!Ye.startsWith("data:"))try{const Oe=await Ko(Ye,32,32);ve.setAttribute("xlink:href",Oe),ve.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(P);const H=new XMLSerializer().serializeToString(f).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",q=30;if(ut.value&&(S+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Dn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Fl=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 Xt=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Zn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),nl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Il=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels;return o&&(o.show===!0||o.enabled===!0)}),Un=e.computed(()=>{const o=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof o=="number"&&o>=0?o:20}),Hn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter;return Kn.value?!0:xl.value&&o&&(o.show===!0||o.enabled===!0)}),xn=e.computed(()=>{if(!Hn.value||!_n.value.length)return"";if(Kn.value){const r=_n.value[1]??_n.value[0];return Bt(r?.value??0)}const l=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?_n.value[0]?.value??0:_n.value.reduce((r,m)=>r+(m.value??0),0);return Bt(l)}),wl=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.fontSize;return typeof o=="number"&&o>0?o:24}),Xn=e.computed(()=>({x:Lt.value,y:Kn.value?Ct.value:Ct.value-wl.value/2})),sn=e.computed(()=>{const o=Z.value?.radialBar?.dataCenter?.color;return typeof o=="string"&&o?o:"#333"}),Yn=e.computed(()=>{if(!Il.value||!Cl.value||!_n.value.length)return[];const t=Un.value*Math.PI/180,o=(sl.value+vt.value)/2;return _n.value.map(l=>{const m=l.endAngle-l.startAngle>=t&&!l.isHidden,v=Lt.value+Math.cos(l.midAngle)*o,C=Ct.value+Math.sin(l.midAngle)*o;return{value:Bt(l.value),x:v,y:C,show:m,color:l.color,contrastColor:Oa(l.color)}})}),rn=e.computed(()=>{if(!V.flags||!V.flags.length)return[];const t=new Map;return V.flags.forEach(o=>{const l=o.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(o)}),Array.from(t.entries()).map(([o,l])=>{const r=tl(o),m=l.filter(C=>C.manual),v=l.filter(C=>!C.manual);return{categoryIndex:parseInt(o),x:r,flags:l,manualCount:m.length,autoCount:v.length,totalCount:l.length,hasManual:m.length>0,hasAuto:v.length>0,texts:l.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),Rn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Sl=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Jl=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Xl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),st=e.ref(new Set),Ne=e.ref(null),y=e.ref(!1),h=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),x=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),$=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Y=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),U=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),tt=e.ref([]),Se=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 ml.value&&t.push(...Object.keys(ml.value)),t}),e.computed(()=>{if(!V.categories||V.categories.length===0){const{maxX:t}=Wt.value;return Array.from({length:t+1},(o,l)=>L("chart.fallback.item",{number:l+1}))}return V.categories});const zl=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[0],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),Wl=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[V.categories.length-1],[o,l,r]=String(t).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;return!v||!l||!m?null:new Date(m,C,v)}),ql=e.computed(()=>Se.value.editingMarkerId!==null),vn=e.computed(()=>Se.value.readonly),uo=t=>{st.value.has(t)||(ca.value=!0,Ne.value=t)},Jn=()=>{ca.value=!1,Ne.value=null},Uo=t=>{if(Co.value||Fo.value){$.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top,v=el.value?r>=z.value.left-50&&r<=z.value.right+50&&m>=z.value.top-50&&m<=z.value.bottom+100:jt.value?r>=z.value.left&&r<=z.value.right&&m>=z.value.top&&m<=z.value.bottom+Gt.value:r>=z.value.left&&r<=z.value.right&&m>=z.value.top&&m<=z.value.bottom;if(y.value=v,el.value){if(!je.value||!v||U.value.isDragging||U.value.isZooming){$.value.show=!1;return}if(Ho.value.find(ve=>!ve||ve.isHidden?!1:Math.sqrt(Math.pow(ve.x-r,2)+Math.pow(ve.y-m,2))<=ve.radius+3))$.value.show=!1;else{const ve=Ho.value.filter(xe=>!xe||xe.isHidden?!1:Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-m,2))<=250);if(ve.length>0){let xe=ve[0],Ee=Math.sqrt(Math.pow(xe.x-r,2)+Math.pow(xe.y-m,2));ve.forEach(Ie=>{const Le=Math.sqrt(Math.pow(Ie.x-r,2)+Math.pow(Ie.y-m,2));Le<Ee&&(Ee=Le,xe=Ie)});const de=30,Xe=Ho.value.filter(Ie=>!Ie||Ie.isHidden?!1:Math.abs(Ie.x-xe.x)<=de).sort((Ie,Le)=>Ie.y-Le.y);$.value={show:!0,x:xe.x,categoryIndex:Math.round(xe.originalX),data:(()=>{const Ie=Sl.value,Le=Jl.value,Me=[];return Xe.forEach(Re=>{Ie.forEach(_t=>{const zt=Le[_t]||_t,Kl=xa(_t,Re);Kl&&Me.push({seriesName:Re.seriesName,label:Re.label,value:`${zt}: ${Kl}`,color:Re.color,y:Re.y})})}),Me})()}}else $.value.show=!1}return}if(jt.value){if(!je.value||!v||U.value.isDragging||U.value.isZooming){$.value.show=!1;return}const Oe=H.value;if(!Oe){$.value.show=!1;return}const ve=Oe.getBoundingClientRect(),xe=t.clientX-ve.left+Oe.scrollLeft,Ee=hl.value+kt.value,de=Math.floor(xe/Ee);if(de<0||de>=Ul.value.length){$.value.show=!1;return}const Xe=Qn.value[de];if(!Xe){$.value.show=!1;return}const Ie=de*Ee+hl.value/2,Le=ve.left+Ie-Oe.scrollLeft-l.left;$.value={show:!0,x:Le,categoryIndex:de,data:Xe.segments.filter(Me=>!Me.isRemainder).map(Me=>({seriesName:Me.label,value:Me.value,color:Me.color,y:null}))};return}if(U.value.isDragging&&U.value.scale>1&&kl.value&&Vt.value&&!jt.value){$.value.show=!1;const Oe=t.clientX-U.value.lastMouseX,{minX:ve,maxX:xe}=Wt.value,Ee=xe-ve||1,Xe=Oe*.8;U.value.offsetX+=Xe;const Ie=Ee/U.value.scale,Le=Ee-Ie,Me=0,Re=-Le/Ee*z.value.width,_t=Me;U.value.offsetX=Math.max(Re,Math.min(_t,U.value.offsetX)),U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY;return}if(!je.value||!kl.value||jt.value||U.value.isDragging||U.value.isZooming||!v){$.value.show=!1;return}const{minX:C,maxX:b}=Wt.value,q=b-C||1,_=q/U.value.scale,I=C-U.value.offsetX/z.value.width*q,M=(r-z.value.left)/z.value.width,G=I+M*_,Be=Math.round(G);if(Be>=0&&Be<=b){const Oe=tl(Be),ve=le.value.map((xe,Ee)=>{const de=V.series.findIndex(Ie=>Ie===xe),Xe=xe.data[Be];return{seriesName:xe.name,value:Xe!==void 0?Xe:null,color:Kt(de),y:Xe!==void 0?rl(xe,Xe):null}}).filter(xe=>xe.value!==null);$.value={show:!0,x:Oe,categoryIndex:Be,data:ve}}},Xo=()=>{$.value.show&&($.value.show=!1)},Yo=()=>Ul.value[$.value.categoryIndex]?.label||L("chart.fallback.item",{number:$.value.categoryIndex+1}),mo=()=>{$.value.show=!1,y.value=!1,Fo.value=!1,Co.value||(Rn.value.show=!1),U.value.isDragging&&(U.value.isDragging=!1),U.value.zoomTimeout&&(clearTimeout(U.value.zoomTimeout),U.value.zoomTimeout=null),U.value.isZooming=!1,setTimeout(()=>{Ne.value=null,h.value.show=!1},150)},xo=t=>{if(t.preventDefault(),t.stopPropagation(),!ut.value)return;const o=t.currentTarget.getBoundingClientRect(),l=t.clientX-o.left,r=t.clientY-o.top;if(Cl.value){Y.value.show=!1,e.nextTick(()=>{Y.value.show=!0,Y.value.x=t.clientX,Y.value.y=t.clientY,Y.value.categoryIndex=null});return}const m=Math.max(0,z.value.left-20),v=z.value.right,C=z.value.top,b=z.value.bottom+80;l>=m&&l<=v&&r>=C&&r<=b&&(Y.value.show=!1,e.nextTick(()=>{Y.value.show=!0,Y.value.x=t.clientX,Y.value.y=t.clientY,Y.value.categoryIndex=null;const q=Math.max(z.value.left,Math.min(l,z.value.right))-z.value.left,I=z.value.width/la.value.length,M=Math.floor(q/I);M>=0&&M<la.value.length&&(Y.value.categoryIndex=M)}))},fn=t=>{if(!(t&&t.button===2)){if(Y.value.show&&t&&t.type==="click"){const o=document.querySelector(".dss-context-menu");if(o&&o.contains(t.target))return}Y.value.show=!1}},jo=t=>{if(typeof t.template=="function"){const o={series:V.series,categories:V.categories,markers:tt.value},l={chartX:Y.value.chartX,chartY:Y.value.chartY,dataX:Y.value.mouseDataX,dataY:Y.value.mouseDataY,categoryIndex:Y.value.categoryIndex};return t.template(o,l)}return t.template||t.label||""},Eo=t=>{const o=["dss-context-menu-item"];return t.cssClass&&o.push(t.cssClass),o},So=t=>t.style||{},Vo=t=>t.type&&ml.value[t.type]?ml.value[t.type]:t.customIcon?t.customIcon:dl.value,Ko=t=>t==null?"":V.categories&&V.categories[t]?V.categories[t]:"",Go=t=>tt.value.length?tt.value.filter(o=>o.categoryIndex===t):[],Qo=t=>{if(!kl.value&&!el.value)return{x:0,y:0};const o=tl(t),l=j.value+z.value.bottom-Tt.value/2;return{x:o,y:l}},po=()=>{tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(kl.value||el.value)){const o=Qo(t.categoryIndex);t.x=o.x,t.y=o.y}})},Fn=()=>{if(Se.value.description&&Se.value.description.length&&Se.value.date){if(ql.value){const t=tt.value.findIndex(o=>o.id===Se.value.editingMarkerId);t!==-1?(tt.value[t].description=Se.value.description||"",tt.value[t].color=Se.value.color||"",tt.value[t].type=Se.value.type||"default",ue("update-marker",tt.value[t])):ue("update-marker",{id:Se.value.editingMarkerId,description:Se.value.description||"",color:Se.value.color||"",type:Se.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let o=mn(Se.value.date,V.categories||[]);if(el.value){const{maxX:C}=Wt.value;o=Math.max(0,Math.min(o,Math.floor(C)))}else kl.value&&(o=Math.max(0,Math.min(o,Wt.value.maxX)));const l=tl(o),r=j.value+z.value.bottom-Tt.value/2,m=Array.isArray(V.categories)?V.categories[o]:null,v={id:t,title:"",description:Se.value.description||"",color:Se.value.color||"",type:Se.value.type||"default",categoryIndex:o,x:l,y:r,marker_date:m||null};Se.value.categoryIndex=o,tt.value.push(v),ue("add-marker",v)}en(),vo()}},en=()=>{Se.value.show=!1,Se.value.title="",Se.value.description="",Se.value.color="#FF6B6B",Se.value.type="default",Se.value.editingMarkerId=null,Se.value.readonly=!1,Se.value.categoryIndex=null,Se.value.fromButton=!1,Se.value.date=null},eo=()=>{ql.value&&(Jo(Se.value.editingMarkerId),en())},Jo=t=>{const o=tt.value.findIndex(l=>l.id===t);o!==-1&&(tt.value.splice(o,1),vo()),ue("delete-marker",t)},ea=t=>{if(Se.value.show=!0,Se.value.title=t?.title??t?.comment??"",Se.value.description=t?.description??t?.comment??"",Se.value.color=t?.color??"",Se.value.type=t?.type??"default",Se.value.editingMarkerId=t?.id??t?.marker_id??null,Se.value.readonly=t?.readonly??!1,Se.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[o,l,r]=String(t.marker_date).split("-"),m=Number(r?.length===2?`20${r}`:r),v=Number(o),C=Number(l)-1;v&&l&&m?Se.value.date=new Date(m,C,v):Se.value.date=null}else Se.value.date=null},vo=()=>{try{const t=`dss-chart-markers-${V.chartId}`;localStorage.setItem(t,JSON.stringify(tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},hn=()=>{try{const t=`dss-chart-markers-${V.chartId}`,o=localStorage.getItem(t);if(o){const l=JSON.parse(o);Array.isArray(l)&&(tt.value=l.map(r=>({...r,originalYOffset:r.originalYOffset!==void 0?r.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),tt.value=[]}},Zl=t=>{const o=dt.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${o.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},gn=()=>{const t=$.value.show,o=h.value.show;return $.value.show=!1,h.value.show=!1,{originalCrosshair:t,originalTooltip:o}},Yl=t=>{$.value.show=t.originalCrosshair,h.value.show=t.originalTooltip},ol=async(t,o=32,l=32)=>new Promise((r,m)=>{if(t.startsWith("data:")){r(t);return}const v=new Image;v.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),r(t)},5e3);v.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),q=b.getContext("2d");b.width=o,b.height=l,q.fillStyle="#fafafa",q.fillRect(0,0,o,l),q.drawImage(v,0,0,o,l);const _=b.toDataURL("image/png");r(_)}catch(b){console.warn("Canvas conversion failed:",b),r(t)}},v.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),r(t)},v.src=t}),No=async()=>{try{const t=gn();setTimeout(async()=>{try{const o=me.value;if(!o){console.error("Chart SVG element not found"),Yl(t);return}const l=rt(),r=ye.value,m=Te.value+l.height,v=o.cloneNode(!0);v.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(de=>de.remove());const b=v.querySelectorAll("image"),q=Array.from(b).map(async de=>{const Xe=de.getAttribute("xlink:href")||de.getAttribute("href");if(Xe&&!Xe.startsWith("data:"))try{const Ie=await ol(Xe,32,32);de.setAttribute("xlink:href",Ie),de.setAttribute("href",Ie)}catch(Ie){console.warn("Failed to convert logo to base64:",Ie)}});await Promise.all(q);const I=new XMLSerializer().serializeToString(v).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",G=30;if(dt.value&&(M+=`
|
|
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
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${dt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,G+=30),Ye.value&&(M+=`
|
|
53
|
+
<text x="24" y="${G}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${Ye.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),A.value&&V.series.length>0){let de=r-200,Xe=dt.value||Ye.value?35:25;const Ie=Math.floor((r-250)/120);let Le=0;V.series.forEach((Me,Re)=>{if(!st.value.has(Re)){const _t=Kt(Re),zt=Me.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");M+=`<circle cx="${de+6}" cy="${Xe-4}" r="6" fill="${_t}"/>`,M+=`<text x="${de+18}" y="${Xe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${zt}</text>`,Le++,Le%Ie===0?(de=r-200,Xe+=20):de+=Math.min(120,zt.length*8+35)}})}let Be="";if(Mt.value)try{const{width:de,height:Xe}=an.value,Ie=_l.value,Le=z.value.left,Me=z.value.right,Re=z.value.top,_t=z.value.bottom,zt=z.value.width,Kl=z.value.height;let yl,Gl;switch(Ie){case"center":yl=Le+(zt-de)/2,Gl=Re+(Kl-Xe)/2;break;case"top-left":yl=Le+15,Gl=Re+5;break;case"top-right":yl=Me-de-5,Gl=Re+5;break;case"bottom-left":yl=Le+15,Gl=_t-Xe-5;break;case"bottom-right":default:yl=Me-de-5,Gl=_t-Xe-5;break}Be=`
|
|
59
|
+
<g opacity="${wn.value}">
|
|
60
|
+
<g transform="translate(${yl}, ${Gl}) scale(${de/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(
|
|
75
|
+
</g>`}catch(de){console.warn("Watermark processing failed, skipping watermark in SVG:",de),Be=""}const Oe=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${r}" height="${m}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -84,37 +84,37 @@
|
|
|
84
84
|
</style>
|
|
85
85
|
</defs>
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
|
-
${
|
|
87
|
+
${M}
|
|
88
88
|
<g transform="translate(0, ${l.height})">
|
|
89
|
-
${
|
|
90
|
-
${
|
|
89
|
+
${I}
|
|
90
|
+
${Be}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
94
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ee=document.createElement("a");Ee.href=xe,Ee.download=Zl("svg"),document.body.appendChild(Ee),Ee.click(),document.body.removeChild(Ee),URL.revokeObjectURL(xe),Yl(t),fn()}catch(o){console.error("Error downloading SVG:",o),Yl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Bo=async()=>{try{const t=gn();O.value&&O.value.offsetHeight,await new Promise(de=>setTimeout(de,300));const o=rt(),l=ye.value,r=Te.value+o.height,m=document.createElement("canvas"),v=m.getContext("2d"),C=2;m.width=l*C,m.height=r*C,m.style.width=l+"px",m.style.height=r+"px",v.scale(C,C),v.fillStyle="#fafafa",v.fillRect(0,0,l,r);let b=30;if(dt.value&&(v.fillStyle="#333",v.font="bold 18px Arial, sans-serif",v.fillText(dt.value,24,b),b+=30),Ye.value&&(v.fillStyle="#666",v.font="14px Arial, sans-serif",v.fillText(Ye.value,24,b),b+=25),A.value&&V.series.length>0){let de=l-200,Xe=dt.value||Ye.value?35:25;const Ie=Math.floor((l-250)/120);let Le=0;v.font="12px Arial, sans-serif",V.series.forEach((Me,Re)=>{if(!st.value.has(Re)){const _t=Kt(Re);v.beginPath(),v.arc(de+6,Xe-4,6,0,2*Math.PI),v.fillStyle=_t,v.fill(),v.fillStyle="#333",v.fillText(Me.name,de+18,Xe),Le++,Le%Ie===0?(de=l-200,Xe+=20):de+=Math.min(120,Me.name.length*8+35)}})}const _=me.value.cloneNode(!0),I=_.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=_.querySelectorAll(".dss-crosshair"),G=_.querySelectorAll('[class*="tooltip"]');I.forEach(de=>de.remove()),M.forEach(de=>de.remove()),G.forEach(de=>de.remove()),_.querySelectorAll("image").forEach((de,Xe)=>{const Ie=de.getAttribute("xlink:href")||de.getAttribute("href");if(Ie&&!Ie.startsWith("data:")){const Le=Ro.value[Xe],Me=Le?Kt(Le.seriesIndex):"#3B82F6",Re=de.getAttribute("x")||0,_t=de.getAttribute("y")||0,zt=de.getAttribute("width")||32,Kl=de.getAttribute("height")||32,yl=document.createElementNS("http://www.w3.org/2000/svg","circle");yl.setAttribute("cx",parseFloat(Re)+parseFloat(zt)/2),yl.setAttribute("cy",parseFloat(_t)+parseFloat(Kl)/2),yl.setAttribute("r",Math.min(parseFloat(zt),parseFloat(Kl))/2-1),yl.setAttribute("fill",Me),yl.setAttribute("stroke","#fafafa"),yl.setAttribute("stroke-width","2"),de.parentNode.replaceChild(yl,de)}});const Oe=new XMLSerializer().serializeToString(_),ve=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),xe=URL.createObjectURL(ve),Ee=new Image;return new Promise((de,Xe)=>{Ee.onload=async()=>{try{if(v.drawImage(Ee,0,o.height),Ro.value.forEach(Ie=>{const Le=Ie.x,Me=Ie.y+o.height,Re=(Ie.width||32)/2,_t=Kt(Ie.seriesIndex);v.save(),v.beginPath(),v.arc(Le,Me,Re-1,0,2*Math.PI),v.fillStyle=_t,v.fill(),v.strokeStyle="#fafafa",v.lineWidth=2,v.stroke(),v.restore()}),Mt.value){const Ie=new Image,Le=()=>{const{width:Re,height:_t}=an.value,zt=_l.value,Kl=z.value.left,yl=z.value.right,Gl=z.value.top,zo=z.value.bottom,fs=z.value.width,hs=z.value.height;let oo,ao;switch(zt){case"center":oo=Kl+(fs-Re)/2,ao=Gl+o.height+(hs-_t)/2;break;case"top-left":oo=Kl+15,ao=Gl+o.height+10;break;case"top-right":oo=yl-Re-5,ao=Gl+o.height+10;break;case"bottom-left":oo=Kl+15,ao=zo+o.height-_t-5;break;case"bottom-right":default:oo=yl-Re-5,ao=zo+o.height-_t-5;break}v.globalAlpha=wn.value,v.drawImage(Ie,oo,ao,Re,_t),v.globalAlpha=1,Me()},Me=()=>{m.toBlob(Re=>{const _t=URL.createObjectURL(Re),zt=document.createElement("a");zt.href=_t,zt.download=Zl("png"),document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(_t),URL.revokeObjectURL(xe),Yl(t),fn(),de()},"image/png")};Ie.onload=Le,Ie.onerror=Me,Ie.src=Jt.value}else m.toBlob(Ie=>{const Le=URL.createObjectURL(Ie),Me=document.createElement("a");Me.href=Le,Me.download=Zl("png"),document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL(Le),URL.revokeObjectURL(xe),Yl(t),fn(),de()},"image/png")}catch(Ie){URL.revokeObjectURL(xe),Yl(t),Xe(Ie)}},Ee.onerror=()=>{URL.revokeObjectURL(xe),Yl(t),Xe(new Error("Failed to load SVG image"))},Ee.src=xe})}catch(t){console.error("Error downloading PNG:",t)}},En=()=>{try{let t="";if(dt.value&&(t+=`# ${L("chart.csv.chartTitle")}: ${dt.value}
|
|
93
|
+
`),Ye.value&&(t+=`# ${L("chart.csv.chartSubtitle")}: ${Ye.value}
|
|
94
|
+
`),t+=`# ${L("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
|
-
`,
|
|
97
|
-
`,
|
|
98
|
-
`})});const
|
|
99
|
-
`;const o=Math.max(...
|
|
100
|
-
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=Hn("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),Bt()}catch(t){console.error("Error downloading CSV:",t)}},Yn=t=>{if(typeof t.action=="function"){const o={series:F.series,categories:F.categories,markers:Tt.value},l={chartX:ft.value.chartX,chartY:ft.value.chartY,dataX:ft.value.mouseDataX,dataY:ft.value.mouseDataY,categoryIndex:clampedCategoryIndex||ft.value.categoryIndex};t.action(o,l)}Bt()},jn=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=ft.value.categoryIndex,De.value.fromButton=!1,Bt()},Qo=()=>{Sn(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},Vo=t=>{if(ft.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(ft.value.show=!1)}},Kn=t=>{ft.value.show&&!t.target.closest(".context-menu")&&(ft.value.show=!1)},rn=t=>{if(!ol.value||!Ge.value)return;t.preventDefault(),t.stopPropagation(),ie.value.isZooming=!0,nt.value.show=!1,ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<R.value.left-50||r>R.value.right+50||m<R.value.top-50||m>R.value.bottom+100){ie.value.isZooming=!1;return}const f=t.deltaY>0?.9:1.1,C=Math.max(ie.value.minScale,Math.min(ie.value.maxScale,ie.value.scale*f));if(C!==ie.value.scale){const{minX:b,maxX:P}=He.value,B=P-b||1,H=B/ie.value.scale,S=b-ie.value.offsetX/R.value.width*B,q=(r-R.value.left)/R.value.width,we=S+q*H;ie.value.scale=C;const Ze=B/ie.value.scale,pe=we-q*Ze;ie.value.offsetX=-(pe-b)/B*R.value.width,ie.value.scale<=1.01&&(ie.value.scale=1,ie.value.offsetX=0)}ie.value.zoomTimeout=setTimeout(()=>{ie.value.isZooming=!1,ie.value.zoomTimeout=null},300)},yn=t=>{if(!ol.value||!Ge.value||ie.value.scale<=1)return;nt.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,ie.value.isDragging=!0,ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY,t.preventDefault()},Nn=()=>{ie.value.isDragging=!1},Bn=()=>{!ol.value||!Ge.value||(ie.value.scale=1,ie.value.offsetX=0,ie.value.isDragging=!1,ie.value.zoomTimeout&&(clearTimeout(ie.value.zoomTimeout),ie.value.zoomTimeout=null),ie.value.isZooming=!1)},cl=()=>!ol.value||!El.value||!Ge.value?"default":ie.value.isDragging?"grabbing":ie.value.scale>1?"grab":"dss-crosshair",Gn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],f=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(f.x-r.x)/6*Ke.value,P=m.y+(f.y-r.y)/6*Ke.value,B=f.x-(C.x-m.x)/6*Ke.value,H=f.y-(C.y-m.y)/6*Ke.value;o+=` C ${b} ${P} ${B} ${H} ${f.x} ${f.y}`}return o},Tl=e.computed(()=>{const o=U.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let f=m+(Wt.value?30:0)+60;if(Bl.value){const S={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??S.left,top:r.top??S.top,right:r.right??S.right,bottom:r.bottom??S.bottom}:S}if(al.value){const S=!W.value,q=Qt.value,we=q?Ln.value+En.value+Math.max(24,_t.value+16):0,Ze=S?12:m;let pe=0;ut.value&&(pe+=S?8:15),ht.value&&(pe+=S?6:10);const ye=tt();let Se=Ze+(S?4:16)+(q?we:0),ve=Ze+(q?we:0);W.value&&G.value==="left"?Se+=ye.legendWidth||150:W.value&&G.value==="right"&&(ve+=ye.legendWidth||150);const Oe=Ce.value==="semi-radial"?q?we:8:q?we:S?8:m+80,Ae=q?14:0,Ee=Ze+pe+Ae,Re={left:Se,top:Ee,right:ve,bottom:Oe};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;ut.value&&(C+=15),ht.value&&(C+=10);const b=tt();let P=m+16+(qt.value?30:0),B=m+(wt.value?30:0);W.value&&G.value==="left"?P+=b.legendWidth||150:W.value&&G.value==="right"&&(B+=b.legendWidth||150),D.value&&(B+=44);const H={left:P,top:m+C,right:B,bottom:f};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??H.left,top:r.top??H.top,right:r.right??H.right,bottom:r.bottom??H.bottom}:H}),R=e.computed(()=>({left:Tl.value.left,top:Tl.value.top,right:Ve.value-Tl.value.right,bottom:re.value-Tl.value.bottom,width:Ve.value-(Tl.value.left+Tl.value.right),height:re.value-(Tl.value.top+Tl.value.bottom)})),ol=e.computed(()=>["line","area","bar","stepbar"].includes(Ce.value)||Je.value),_l=e.computed(()=>Je.value),en=e.computed(()=>Ce.value==="mini-radial"),al=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Ce.value)),Bl=e.computed(()=>Ce.value==="spider"),ul=e.computed(()=>Ce.value==="bubble"),Ol=e.computed(()=>Ce.value==="stepbar"),dl=e.computed(()=>U.value?.chart?.orientation==="horizontal"&&(Ce.value==="bar"||_l.value)),Xl=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.left+(t-o)/r*R.value.width},kn=t=>{const{maxX:o}=He.value,l=o+1,m=R.value.height/l;return R.value.top+(t+.5)*m},Ut=e.computed(()=>al.value?Tl.value.left+(Ve.value-Tl.value.left-Tl.value.right)/2:Ve.value/2),Pt=e.computed(()=>Bl.value?re.value/2-40:al.value?Tl.value.top+(re.value-Tl.value.top-Tl.value.bottom)/2:re.value/2),gt=e.computed(()=>{if(Bl.value){const t=R.value.width-80,o=R.value.height-80;return Math.min(t,o)/2}return Math.min(R.value.width,R.value.height)/2}),sl=e.computed(()=>{const t=U.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return gt.value*l}),vo=e.computed(()=>{const t=U.value,o=typeof F.innerSize=="number"?F.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(al.value||Bl.value)?1:1+o/100}),No=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const o=Ut.value,l=Pt.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Fn=e.ref(0),Wn=e.computed(()=>`semi-radial-fill-clip-${F.chartId}`),Cn=e.computed(()=>Ce.value==="semi-radial"),ho=e.computed(()=>Cn.value&&Vl.value&&!$n.value),qn=e.computed(()=>Cn.value&&Vl.value&&!$n.value&&Nl.value==="fill"),Bo=e.computed(()=>{const t=ho.value?Fn.value:1,o=Ut.value,l=Pt.value,r=sl.value,m=gt.value,f=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(f),P=l+m*Math.sin(f),B=o+m*Math.cos(C),H=l+m*Math.sin(C),S=o+r*Math.cos(C),q=l+r*Math.sin(C),we=o+r*Math.cos(f),Ze=l+r*Math.sin(f),pe=t>.5?1:0;return`M ${o} ${l} L ${b} ${P} A ${m} ${m} 0 ${pe} 1 ${B} ${H} L ${S} ${q} A ${r} ${r} 0 ${pe} 1 ${we} ${Ze} Z`}),Mo=e.computed(()=>{if(!(!Cn.value||!ho.value)&&!qn.value)return`url(#${Wn.value})`}),Zn=t=>{if(!(!qn.value||t!==0))return`url(#${Wn.value})`},Rl=e.ref(0),Qn=e.computed(()=>`radial-reveal-clip-${F.chartId}`),an=e.computed(()=>Ce.value==="radial"),Jo=e.computed(()=>{const t=an.value?Rl.value:1,o=Ut.value,l=Pt.value,r=Math.max(gt.value*1.5,Ve.value,re.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const S=o-r,q=o+r;return`M ${S} ${l} A ${r} ${r} 0 0 1 ${q} ${l} A ${r} ${r} 0 0 1 ${S} ${l} Z`}const m=-Math.PI/2,f=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),P=o+r*Math.cos(f),B=l+r*Math.sin(f),H=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${H} 1 ${P} ${B} Z`}),ea=e.computed(()=>{if(Mo.value)return Mo.value;if(an.value)return`url(#${Qn.value})`});let Un=null;const Jn=()=>{if(!ho.value)return;Fn.value=0;const t=tl.value,o=performance.now(),l=r=>{const m=r-o,f=Math.min(1,m/t);Fn.value=ca(on.value,f),f<1&&(Un=requestAnimationFrame(l))};Un=requestAnimationFrame(l)},Yl=e.computed(()=>U.value?.bubbles?.minSize||8),ta=e.computed(()=>U.value?.bubbles?.maxSize||50),bn=e.computed(()=>U.value?.bubbles?.opacity||.7),eo=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},la=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},_o=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},tn=e.computed(()=>F.series),a=e.computed(()=>F.series.filter((t,o)=>!zt.value.has(o))),n=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},s=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,i=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,c=e.computed(()=>{const o=U.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),d=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?c.value.bubbleSize:Lt.value,u=(t,o)=>i(t)&&c.value.usePrimaryColor?$t(0):$t(o),p=(t,o)=>Bl.value&&i(t)?u(t,o):$t(o),h=e.computed(()=>a.value.filter(t=>n(t)==="primary")),k=e.computed(()=>a.value.filter(t=>n(t)==="secondary")),D=e.computed(()=>!dl.value&&!!Ct.value&&k.value.length>0),I=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},N=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,f)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=I(C?m.value:m,0);return b<=0?null:{key:`${l}-${f}-${C&&m.label||f}`,label:C?m.label||o?.name||`Segment ${f+1}`:o?.name||`Segment ${f+1}`,value:b,color:C?m.color||$t(f):$t(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return vl.value==="asc"?r.sort((m,f)=>m.value-f.value):vl.value==="desc"?r.sort((m,f)=>f.value-m.value):r},se=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),f=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:$t(r)}],C=N(f,l,r),b=C.reduce((S,q)=>S+q.value,0),P=I(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,M.value),B=Math.max(P,b,1);x.value&&B>b&&C.push({key:`${r}-${o}-remainder`,label:A.value,value:B-b,color:ae.value,marker:null,isRemainder:!0});const H=C.filter(S=>!S.isRemainder).reduce((S,q)=>!S||q.value>S.value?q:S,null);return{key:`${r}-${o}`,label:m?t.label||t.name||F.categories?.[o]||$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??F.categories?.[o]??$("chart.fallback.item",{number:o+1}):F.categories?.[o]||$("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:B,usedValue:b,segments:C,maxSegmentKey:H?.key||null,seriesName:l?.name||"",seriesIndex:r}},Q=e.computed(()=>{if(!Ol.value)return[];const t=[];return tn.value.forEach((o,l)=>{zt.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=se(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Be="auto",_e=(t,o,l,r=0,m=100)=>{let f=1/0,C=-1/0;if(t.forEach(B=>{B?.data?.length&&B.data.forEach(H=>{typeof H=="number"&&Number.isFinite(H)&&(f=Math.min(f,H),C=Math.max(C,H))})}),f===1/0)return{minY:r,maxY:m};let b;if(o===Be){const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}else if(typeof o=="number")b=o;else{const B=C-f,H=B>0?B*.1:1;b=Math.max(0,f-H)}let P;if(l===Be){const B=C-f,H=B>0?B*.1:2;P=C+H}else if(typeof l=="number")P=l;else{const B=C-f,H=B>0?B*.1:2;P=C+H}return{minY:b,maxY:P}},He=e.computed(()=>{if(ul.value)return ml();if(Ol.value)return Sl();if(!a.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;a.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),F.categories.length>0&&(t=Math.max(t,F.categories.length-1));const o=_e(h.value.length?h.value:a.value,Yt.value,it.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),Sl=()=>{const t=Q.value,o=t.reduce((f,C)=>Math.max(f,C.totalValue),M.value),l=typeof Yt.value=="number"?Yt.value:0,r=typeof it.value=="number"?it.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},hl=e.computed(()=>D.value?_e(k.value,Kt.value,yt.value,He.value.minY,He.value.maxY):{minY:He.value.minY,maxY:He.value.maxY}),ml=()=>{if(!a.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,f=-1/0,C=!1;if(a.value.forEach((we,Ze)=>{we?.data?.length&&we.data.forEach((pe,ye)=>{let Se,ve,Ye;if(typeof pe=="object"&&pe!==null&&!Array.isArray(pe))Se=typeof pe.x=="number"?pe.x:ye,ve=typeof pe.y=="number"?pe.y:0,Ye=typeof pe.size=="number"?pe.size:20;else if(Array.isArray(pe)&&pe.length>=3)Se=typeof pe[0]=="number"?pe[0]:ye,ve=typeof pe[1]=="number"?pe[1]:0,Ye=typeof pe[2]=="number"?pe[2]:20;else if(typeof pe=="number")Se=ye,ve=pe,Ye=eo(Ze,ye);else return;isFinite(Se)&&isFinite(ve)&&isFinite(Ye)&&(t=Math.min(t,Se),o=Math.max(o,Se),l=Math.min(l,ve),r=Math.max(r,ve),m=Math.min(m,Ye),f=Math.max(f,Ye),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,F.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,P=r-l;let B,H,S,q;return el.value!==null?B=el.value:B=t-b*.1,X.value!==null?H=X.value:H=o+b*.1,Yt.value!==null&&typeof Yt.value=="number"?S=Yt.value:S=Math.max(0,l-P*.1),it.value!==null&&typeof it.value=="number"?q=it.value:q=r+P*.1,{minX:B,maxX:H,minY:S,maxY:q,minSize:m,maxSize:f}},vt=t=>{if(ul.value){const{minX:b,maxX:P}=He.value,B=P-b||1;return R.value.left+(t-b)/B*R.value.width}const{minX:o,maxX:l}=He.value,r=l-o;if(l===0||r===0)return R.value.left+R.value.width/2;const m=r/ie.value.scale,f=o-ie.value.offsetX/R.value.width*r,C=(t-f)/m;return R.value.left+C*R.value.width},Xt=t=>{const{minY:o,maxY:l}=He.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},pl=t=>{const{minY:o,maxY:l}=hl.value,r=l-o||1;return R.value.bottom-(t-o)/r*R.value.height},gl=(t,o)=>D.value&&n(t)==="secondary"?pl(o):Xt(o),xn=t=>{if(!ul.value)return Lt.value||4;const{maxSize:o}=He.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return Yl.value+r*(ta.value-Yl.value)},Wl=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);Wl.canvas||(Wl.canvas=document.createElement("canvas"));const r=Wl.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},to=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||Wl(t,l)<=o)return t;const r="..";if(Wl(r,l)>=o)return r;let f=t.length;for(;f>0;){const C=`${t.slice(0,f)}${r}`;if(Wl(C,l)<=o)return C;f-=1}return r},$o=e.computed(()=>no.value.map(t=>({y:t.y}))),Lo=e.computed(()=>!Ol.value||!xt.value?[]:no.value.map(t=>({y:t.y}))),Ao=e.computed(()=>!Ol.value||!xt.value||!Mt.value?[]:sa.value.map(t=>({x:t.centerX}))),To=e.computed(()=>{if(ul.value)return Do();if(Ol.value)return lo();if(Ce.value==="bar"){if(dl.value){const Ee=[],{minY:Re,maxY:Vt}=He.value,Ft=5,Dl=Vt-Re||1;for(let fl=0;fl<=Ft;fl++){const $l=Re+Dl*(fl/Ft),ao=Xl($l);Ee.push({x:ao,y:R.value.bottom+20,text:_(Math.round($l))})}return Ee}const ye=[],{maxX:Se}=He.value,ve=Se+1,Ye=5,Ae=(R.value.width-Ye*2)/ve;for(let Ee=0;Ee<=Se;Ee++){const Re=R.value.left+Ye+(Ee+.5)*Ae;ye.push({x:Re,y:R.value.bottom+20,text:to(F.categories[Ee]||$("chart.fallback.item",{number:Ee+1}),Math.max(Ae-8,24))})}return ye}const t=[],{minX:o,maxX:l}=He.value,r=el.value!==null?el.value:o,m=X.value!==null?X.value:l,f=m-r||1,C=f/ie.value.scale,b=r-ie.value.offsetX/R.value.width*f,P=b+C,B=Math.max(0,Math.floor(b-2)),H=Math.min(m,Math.ceil(P+2)),S=H-B,q=R.value.width,Ze=Math.floor(q/60);let pe=1;S>Ze&&(pe=Math.ceil(S/Ze));for(let ye=B;ye<=H;ye+=pe)if(ye>=0&&ye<=m){const Se=vt(ye);Se>=R.value.left-100&&Se<=R.value.right+100&&t.push({x:Se,y:R.value.bottom+20,text:F.categories[ye]||`Item ${ye+1}`})}return t}),Do=()=>{const t=[],{minX:o,maxX:l}=He.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(R.value.width/80)));for(let f=0;f<=m;f++){const C=o+r*f/m,b=vt(C);if(b>=R.value.left-10&&b<=R.value.right+10){const P=Math.round(C),B=F.categories?.[P];t.push({x:b,y:R.value.bottom+20,text:B||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},lo=()=>sa.value.map(o=>({x:o.centerX,y:R.value.bottom+20,text:to(o.axisLabel||o.label,Math.max(o.categoryWidth-8,24))})),no=e.computed(()=>{if(dl.value){const m=[],{maxX:f}=He.value;for(let C=0;C<=f;C++)m.push({x:R.value.left-10,y:kn(C),text:to(F.categories[C]||`Item ${C+1}`,Math.max(R.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=He.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.left-10,y:Xt(f),text:_(C)})}return t}),cn=e.computed(()=>{if(!D.value||dl.value)return[];const t=[],{minY:o,maxY:l}=hl.value,r=5;for(let m=0;m<=r;m++){const f=o+(l-o)*(m/r),C=Math.round(f);t.push({x:R.value.right+10,y:pl(f),text:_(C)})}return t}),$t=t=>{const o=jt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},ln=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const f=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(f)l=Number(f[1])/255,r=Number(f[2])/255,m=Number(f[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const P=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(P){let B=P[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),l=parseInt(B.slice(0,2),16)/255,r=parseInt(B.slice(2,4),16)/255,m=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=o,B.style.display="none",document.body.appendChild(B);const H=getComputedStyle(B).color;document.body.removeChild(B);const S=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)l=Number(S[1])/255,r=Number(S[2])/255,m=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},Ho=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const f=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${f}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const f=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${f}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let f=m[1];f.length===3&&(f=f[0]+f[0]+f[1]+f[1]+f[2]+f[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(2,4),16)*.65))),P=Math.max(0,Math.min(255,Math.floor(parseInt(f.slice(4,6),16)*.65)));return`#${[C,b,P].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return o},na=(t,o)=>{const r=U.value?.stroke?.color;return r==null?Ho(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??Ho(o):Ho(o)},oa=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},fa=e.computed(()=>Ce.value==="line"||_l.value?(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(S=>S===o),m=[];let f=[];o.data.forEach((S,q)=>{S==null?f.length>0&&(m.push([...f]),f=[]):f.push({x:dl.value?Xl(S):vt(q),y:dl.value?kn(q):gl(o,S),index:q})}),f.length>0&&m.push(f);let C="";m.forEach(S=>{if(S.length>0){let q="";xe.value?q=Gn(S):q=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(we=>` L ${we.x} ${we.y}`).join(""),C+=(C?" ":"")+q}});const b=m.reduce((S,q)=>S+oa(q),0),P=zt.value.has(r),B=Me.value===r,H=Me.value!==null&&Me.value!==r;return{path:C,color:$t(r),strokeDasharray:s(o),pathLength:b,seriesIndex:r,animationDelay:l*xl.value,isHighlighted:B,isDimmed:H,isHidden:P}}):[]),va=e.computed(()=>{if(!(Ce.value==="line"||_l.value))return[];const t=_l.value?F.series.filter(l=>(l.type||Ce.value)==="line"):tn.value,o=[];return t.forEach((l,r)=>{const m=F.series.findIndex(f=>f===l);for(let f=0;f<l.data.length-1;f++){const C=l.data[f];if(C!=null){let b=-1,P=0;for(let B=f+1;B<l.data.length;B++){const H=l.data[B];if(H==null)P++;else{b=B;break}}if(P>0&&b!==-1){const B=l.data[b],H=dl.value?Xl(C):vt(f),S=dl.value?kn(f):gl(l,C),q=dl.value?Xl(B):vt(b),we=dl.value?kn(b):gl(l,B),Ze=zt.value.has(m),pe=Me.value===m,ye=Me.value!==null&&Me.value!==m;o.push({path:`M ${H} ${S} L ${q} ${we}`,color:$t(m),seriesIndex:m,animationDelay:r*xl.value,isHighlighted:pe,isDimmed:ye,isHidden:Ze,gapSize:P}),f=b-1}}}}),o}),Ta=e.computed(()=>Ce.value==="line"||_l.value?!Vl.value||$n.value||Ot.value.hasAnimated?[]:(_l.value?F.series.filter(o=>(o.type||Ce.value)==="line"):tn.value).map((o,l)=>{const r=F.series.findIndex(P=>P===o);let m="",f=null;o.data.forEach((P,B)=>{if(P!=null){const H={x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)};f===null?m+=`M ${H.x} ${H.y}`:m+=` L ${H.x} ${H.y}`,f=H}else if(f!==null){const H=o.data.findIndex((S,q)=>q>B&&S!==null&&S!==void 0);if(H!==-1){const S={x:dl.value?Xl(o.data[H]):vt(H),y:dl.value?kn(H):gl(o,o.data[H])};m+=` L ${S.x} ${S.y}`,f=S}}});const C=o.data.map((P,B)=>P==null?null:{x:dl.value?Xl(P):vt(B),y:dl.value?kn(B):gl(o,P)}).filter(P=>P!==null),b=oa(C);return{path:m,pathLength:b,color:$t(r),strokeDasharray:s(o),animationDelay:l*xl.value,seriesIndex:r}}):[]),Da=e.computed(()=>{if(Ce.value!=="line")return[];const t=[];return tn.value.forEach((o,l)=>{const r=Me.value===l,m=Me.value!==null&&Me.value!==l,f=zt.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:vt(b),y:gl(o,C),color:$t(l),value:C,label:F.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(xl.value/8),isHighlighted:r,isDimmed:m,isHidden:f})})}),t}),Ha=e.computed(()=>{if(!_l.value)return[];const t=[];return F.series.filter(l=>(l.type||Ce.value)==="line").forEach((l,r)=>{const m=F.series.findIndex(P=>P===l),f=Me.value===m,C=Me.value!==null&&Me.value!==m,b=zt.value.has(m);l.data.forEach((P,B)=>{P!=null&&t.push({x:vt(B),y:gl(l,P),color:$t(m),value:P,label:F.categories[B]||B.toString(),seriesName:l.name,categoryIndex:B,dataIndex:B,animationDelay:(r*l.data.length+B)*(xl.value/8),isHighlighted:f,isDimmed:C,isHidden:b})})}),t}),Ro=e.computed(()=>{if(!ul.value)return[];const t=[];return tn.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=Me.value,m=r!==null&&r===l,f=r!==null&&r!==l,C=zt.value.has(l);o.data.forEach((b,P)=>{let B,H,S,q,we;if(typeof b=="object"&&b!==null&&!Array.isArray(b))B=typeof b.x=="number"?b.x:P,H=typeof b.y=="number"?b.y:0,S=typeof b.size=="number"?b.size:20,q=b.label||F.categories?.[P]||`Point ${P+1}`,we=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)B=typeof b[0]=="number"?b[0]:P,H=typeof b[1]=="number"?b[1]:0,S=typeof b[2]=="number"?b[2]:20,q=b[3]||F.categories?.[P]||`Point ${P+1}`,we=b[4];else if(typeof b=="number")B=P,H=b,S=eo(l,P),q=F.categories?.[P]||`Point ${P+1}`;else return;!isFinite(B)||!isFinite(H)||!isFinite(S)||t.push({x:vt(B),y:Xt(H),radius:xn(S),originalX:B,originalY:H,originalSize:S,color:$t(l),seriesName:o.name||`Series ${l+1}`,label:q,imageUrl:we,seriesIndex:l,dataIndex:P,categoryIndex:Math.round(B),isHighlighted:m,isDimmed:f,isHidden:C,opacity:bn.value})})}),t}),aa=e.computed(()=>Ce.value!=="area"?[]:tn.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((S,q)=>{S==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:vt(q),y:gl(t,S),index:q})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:$t(o),isHidden:zt.value.has(o)};const m=R.value.bottom+1;let f="",C="";l.forEach((S,q)=>{if(S.length===0)return;let we=`M ${S[0].x} ${S[0].y}`;xe.value&&S.length>1?we=Gn(S):S.slice(1).forEach(pe=>{we+=` L ${pe.x} ${pe.y}`}),f+=(f?" ":"")+we;let Ze=`M ${S[0].x} ${m}`;if(Ze+=` L ${S[0].x} ${S[0].y}`,xe.value&&S.length>1){const pe=Gn(S),ye=pe.substring(pe.indexOf("C")||pe.indexOf("Q")||pe.indexOf("L"));ye?Ze+=" "+ye:S.slice(1).forEach(Se=>{Ze+=` L ${Se.x} ${Se.y}`})}else S.slice(1).forEach(pe=>{Ze+=` L ${pe.x} ${pe.y}`});Ze+=` L ${S[S.length-1].x} ${m} Z`,C+=(C?" ":"")+Ze});const b=Me.value===o,P=Me.value!==null&&Me.value!==o,B=zt.value.has(o),H=l.reduce((S,q)=>S+oa(q),0);return{linePath:f,areaPath:C,color:$t(o),pathLength:H,isHighlighted:b,isDimmed:P,isHidden:B}})),sa=e.computed(()=>{if(!Ol.value)return[];const t=Q.value,o=t.length;if(!o)return[];const l=Math.max(R.value.width,0),r=o>0?l/o:l,m=Math.max(Fe.value,bt.value),f=Math.min(oe.value,m),C=Math.max(4,Math.min(m,Math.max(Fe.value,f),Math.max(4,r*.62))),b=yl.value,P=Number.isFinite(Number(b.radius))?Math.max(Number(b.radius),0):8,B=Number.isFinite(Number(b.borderWidth))?Math.max(Number(b.borderWidth),0):2,H=Number.isFinite(Number(b.fontSize))?Math.max(Number(b.fontSize),1):10,S=typeof b.icon=="string"?b.icon:"";return t.map((q,we)=>{const Ze=R.value.left+(we+.5)*r,pe=Ze-C/2;let ye=0,Se=null;const ve=Me.value===q.seriesIndex,Ye=Me.value!==null&&Me.value!==q.seriesIndex,Oe=zt.value.has(q.seriesIndex),Ae=q.segments.map((Ee,Re)=>{const Vt=ye,Ft=ye+Ee.value;ye=Ft;const Dl=Xt(Ft),fl=Xt(Vt),$l=Math.max(0,fl-Dl),ao=Math.min(ot.value,C/2,$l/2),Po=(we*q.segments.length+Re)*(xl.value/5),da={key:`${q.key}-${Ee.key}`,x:pe,y:Dl,width:C,height:$l,radius:ao,color:Ee.color,value:Ee.value,label:q.label,axisLabel:q.axisLabel,yLabel:q.yLabel,segmentLabel:Ee.label,seriesName:Ee.label,tooltipTitle:`${Ee.label} - ${q.label}`,categoryIndex:we,dataIndex:we,animationDelay:Po,isHighlighted:ve,isDimmed:Ye,isHidden:Oe,isRemainder:Ee.isRemainder};if(nn.value&&Ee.key===q.maxSegmentKey&&$l>0){const In=b.backgroundColor&&b.backgroundColor!=="inherit"?b.backgroundColor:Ee.color;Se={x:Ze,y:Dl+$l/2,radius:P,backgroundColor:In,borderColor:b.borderColor||"#fafafa",borderWidth:B,color:b.color||"#fafafa",fontSize:H,icon:S,animationDelay:Po}}return da});return{key:q.key,label:q.label,axisLabel:q.axisLabel,centerX:Ze,categoryWidth:r,segments:Ae,maxMarker:Se}})}),ha=e.computed(()=>{if(!(["bar"].includes(Ce.value)||_l.value))return[];const t=[],{maxX:o}=He.value,l=_l.value?F.series.filter(m=>(m.type||Ce.value)==="bar"):tn.value,r=l.length;if(dl.value){const m=o+1,C=R.value.height/m,b=C*(2/3),P=Math.min(4,b/r*.15),B=b-(r-1)*P,H=Math.max(4,B/r);l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.top+(ve+.5)*C-b/2+q*(H+P),Ee=R.value.left,Re=Math.abs(Xl(Se)-R.value.left);let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ee} ${Ae}`,`L ${Ee+Re-Ft} ${Ae}`,`Q ${Ee+Re} ${Ae} ${Ee+Re} ${Ae+Ft}`,`L ${Ee+Re} ${Ae+H-Ft}`,`Q ${Ee+Re} ${Ae+H} ${Ee+Re-Ft} ${Ae+H}`,`L ${Ee} ${Ae+H}`,"Z"].join(" ")}t.push({x:Ee,y:Ae,width:Re,height:H,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}else{const m=o+1,C=R.value.width/m,b=C*.8,P=b/r,B=P*.05,H=P-B;l.forEach((S,q)=>{const we=F.series.findIndex(Se=>Se===S),Ze=Me.value===we,pe=Me.value!==null&&Me.value!==we,ye=zt.value.has(we);S.data.forEach((Se,ve)=>{if(Se==null||typeof Se!="number"||!isFinite(Se))return;const Ae=R.value.left+(ve+.5)*C-b/2+q*P+B/2,Ee=Xt(Math.max(0,Se)),Re=Math.abs(Xt(0)-Xt(Se));let Vt="";if(xe.value&&Re>0){const Ft=Math.min(Ht.value,H/2,Re/2);Vt=[`M ${Ae} ${Ee+Re}`,`L ${Ae} ${Ee+Ft}`,`Q ${Ae} ${Ee} ${Ae+Ft} ${Ee}`,`L ${Ae+H-Ft} ${Ee}`,`Q ${Ae+H} ${Ee} ${Ae+H} ${Ee+Ft}`,`L ${Ae+H} ${Ee+Re}`,"Z"].join(" ")}t.push({x:Ae,y:Ee,width:H,height:Re,color:$t(r===1?ve:we),value:Se,label:F.categories[ve]||ve.toString(),seriesName:S.name,animationDelay:(q*l.length+ve)*(xl.value/4),isHighlighted:Ze,isDimmed:pe,isHidden:ye,barPath:Vt,isSmooth:xe.value&&Re>0})})})}return t}),Mn=e.computed(()=>{if(!al.value)return[];const t=tn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!zt.value.has(C));if(t.length===0)return[];let o=Ce.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ce.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,P,B,H,S)=>{const q=C+(b-C)/2,we=b-C,Ze=Ut.value+Math.cos(C)*sl.value,pe=Pt.value+Math.sin(C)*sl.value,ye=Ut.value+Math.cos(b)*sl.value,Se=Pt.value+Math.sin(b)*sl.value,ve=Ut.value+Math.cos(b)*gt.value,Ye=Pt.value+Math.sin(b)*gt.value,Oe=Ut.value+Math.cos(C)*gt.value,Ae=Pt.value+Math.sin(C)*gt.value,Ee=we>Math.PI?1:0,Re=[`M ${Ze} ${pe}`,`A ${sl.value} ${sl.value} 0 ${Ee} 1 ${ye} ${Se}`,`L ${ve} ${Ye}`,`A ${gt.value} ${gt.value} 0 ${Ee} 0 ${Oe} ${Ae}`,"Z"].join(" "),Vt=S||$t(P);return{path:Re,color:Vt,strokeWidth:Dt.value,strokeColor:na(r.length,Vt),value:H,seriesName:B,opacity:.8,isHighlighted:Me.value===P,isDimmed:Me.value!==null&&Me.value!==P,isHidden:!1,startAngle:C,endAngle:b,midAngle:q}};if(en.value){const{series:C,originalIndex:b}=t[0],P=Number(C?.data?.[0]??0),B=Number.isFinite(P)?Math.min(Math.max(P,0),100):0,H=U.value,S=Math.min(Math.max(Number(H?.miniRadial?.minVisiblePercent??1),0),100),we=(B<=0?S:B)/100*l,Ze=Number(H?.miniRadial?.thresholds?.low??33),pe=Number(H?.miniRadial?.thresholds?.medium??66),ye=H?.miniRadial?.colors?.low||"#E53E3E",Se=H?.miniRadial?.colors?.medium||"#ED8936",ve=H?.miniRadial?.colors?.high||"#38A169",Ye=B<=Ze?ye:B<=pe?Se:ve,Oe=H?.miniRadial?.trackColor||"#E5E7EB",Ae=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,Oe)),r.push(m(o,o+we,b,Ae,B,Ye)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],P=C.data[0]||0,B=o,H=o+l-.001,S=B+l/2,q=Ut.value+Math.cos(B)*sl.value,we=Pt.value+Math.sin(B)*sl.value,Ze=Ut.value+Math.cos(H)*sl.value,pe=Pt.value+Math.sin(H)*sl.value,ye=Ut.value+Math.cos(H)*gt.value,Se=Pt.value+Math.sin(H)*gt.value,ve=Ut.value+Math.cos(B)*gt.value,Ye=Pt.value+Math.sin(B)*gt.value,Oe=1,Ae=[`M ${q} ${we}`,`A ${sl.value} ${sl.value} 0 ${Oe} 1 ${Ze} ${pe}`,`L ${ye} ${Se}`,`A ${gt.value} ${gt.value} 0 ${Oe} 0 ${ve} ${Ye}`,"Z"].join(" "),Ee=$t(b);return r.push({path:Ae,color:Ee,strokeWidth:Dt.value,strokeColor:na(0,Ee),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:!1,isHidden:!1,startAngle:B,endAngle:H,midAngle:S}),r}if(qn.value&&t.length===2){const C=t[0],b=t[1],P=Math.min(100,Math.max(0,C.series.data[0]||0)),B=P/100*l;return r.push(m(o,o+B,C.originalIndex,C.series.name,P)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const f=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return f===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const P=C.data[0]||0,B=P/f*l,H=o,S=o+B,q=H+B/2,we=Ut.value+Math.cos(H)*sl.value,Ze=Pt.value+Math.sin(H)*sl.value,pe=Ut.value+Math.cos(S)*sl.value,ye=Pt.value+Math.sin(S)*sl.value,Se=Ut.value+Math.cos(S)*gt.value,ve=Pt.value+Math.sin(S)*gt.value,Ye=Ut.value+Math.cos(H)*gt.value,Oe=Pt.value+Math.sin(H)*gt.value,Ae=B>Math.PI?1:0,Ee=[`M ${we} ${Ze}`,`A ${sl.value} ${sl.value} 0 ${Ae} 1 ${pe} ${ye}`,`L ${Se} ${ve}`,`A ${gt.value} ${gt.value} 0 ${Ae} 0 ${Ye} ${Oe}`,"Z"].join(" "),Re=$t(b);r.push({path:Ee,color:Re,strokeWidth:Dt.value,strokeColor:na(r.length,Re),value:P,seriesName:C.name,opacity:.8,isHighlighted:Me.value===b,isDimmed:Me.value!==null&&Me.value!==b,isHidden:!1,startAngle:H,endAngle:S,midAngle:q}),o=S}),r)}),Ra=e.computed(()=>{const t=Mn.value;return qn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Fa=e.computed(()=>{if(!Qt.value||!al.value)return[];const t=_t.value,o=Ln.value,l=En.value,r=Zl.value,m=15,f=t*1.3,C=.55,b=(S,q)=>{const we=Ut.value+Math.cos(S.midAngle)*gt.value,Ze=Pt.value+Math.sin(S.midAngle)*gt.value,pe=Ut.value+Math.cos(S.midAngle)*(gt.value+o),ye=Pt.value+Math.sin(S.midAngle)*(gt.value+o),ve=pe+l*(q?1:-1),Ye=q?pe+m:pe-m,Oe=ye-r,Ae=`${S.seriesName}: ${_(S.value)}`,Ee=Ae.length*t*C;return{pointerStartX:we,pointerStartY:Ze,pointerEndX:pe,pointerEndY:ye,horizontalEndX:ve,horizontalEndY:ye,textX:Ye,textY:Oe,text:Ae,textWidth:Ee,textAnchor:q?"start":"end",isRightSide:q,pointerLineLength:Math.hypot(pe-we,ye-Ze),horizontalLineLength:Math.hypot(ve-pe,0)}},P=(S,q)=>{const we=Math.abs(S.textY-q.textY)<f,Ze=S.isRightSide?S.textX:S.textX-S.textWidth,pe=S.isRightSide?S.textX+S.textWidth:S.textX,ye=q.isRightSide?q.textX:q.textX-q.textWidth,Se=q.isRightSide?q.textX+q.textWidth:q.textX,ve=Ze<Se&&ye<pe;return we&&ve},B=Mn.value.filter(S=>!S.isHidden),H=[];for(let S=0;S<B.length;S++){const q=B[S];let we=Math.cos(q.midAngle)>=0;if(S>0){const pe=H[S-1],ye=b(q,we);P(pe,ye)&&(we=!we)}const Ze=b(q,we);H.push({...Ze,color:q.color,isHighlighted:q.isHighlighted,isDimmed:q.isDimmed})}return H}),Ia=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||bn.value||.7;return Me.value===null||Me.value===void 0?o:Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},za=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return Me.value!==null?t.seriesIndex===Me.value?Math.min(1,o+.1):o*.7:o},ga=(t,o)=>{if(t)try{if(Me.value===t.seriesIndex?Me.value=null:Me.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:F.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Pa=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},ya=(t,o)=>{if(!t||(o.stopPropagation(),Io.value=!0,Me.value=t.seriesIndex,nt.value.show=!1,!Pe.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120;m+C>Ve.value&&(m=o.clientX-r.left-C-10),f+b>r.height&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);const P=nl.value,B=zl.value,H=P.map(S=>{const q=B[S]||S,we=ka(S,t);return we?{seriesName:t.seriesName,label:t.label,value:`${q}: ${we}`,color:t.color}:null}).filter(Boolean);kt.value={show:!0,x:m,y:f,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderAreas:[]}},ka=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=On.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return z.value?m+z.value:m}return l?.toString()||""},Oa=()=>{if(!ul.value||!nt.value.data||nt.value.data.length===0)return"Bubbles";const t=[],o=new Set;return nt.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Ca=(t,o)=>{t&&(Io.value=!1,Me.value=null,kt.value.show=!1,kt.value.bubbleData=[])},Wa=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=mo(t.categoryIndex),f=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const P=200,B=f?80:50;C+P>Ve.value&&(C=o.clientX-r.left-P-15),b+B>re.value&&(b=o.clientY-r.top-B-10),C<0&&(C=10),b<0&&(b=10),Ml.value={show:!0,x:C,y:b,categoryValue:m,description:f}},qa=()=>{Ml.value.show=!1},oo=e.computed(()=>F.categories.length||Math.max(...a.value.map(t=>t.data.length))),Za=e.computed(()=>{let t=0;return a.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),ba=e.computed(()=>{const t=[],o=oo.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Ut.value+Math.cos(r)*gt.value,f=Pt.value+Math.sin(r)*gt.value;t.push({x:m,y:f,angle:r,index:l})}return t}),Ua=e.computed(()=>{const t=[],o=oo.value;return ba.value.forEach((l,r)=>{const m=gt.value+15,f=r*2*Math.PI/o-Math.PI/2,C=Ut.value+Math.cos(f)*m,b=Pt.value+Math.sin(f)*m+5;let P="middle",B="middle";Math.abs(Math.cos(f))>.5&&(P=Math.cos(f)>0?"start":"end"),Math.abs(Math.sin(f))>.5&&(B=Math.sin(f)>0?"hanging":"auto"),t.push({x:C,y:b,text:F.categories[r]||`Axis ${r+1}`,anchor:P,baseline:B})}),t}),Xa=e.ref(new Set),Ya=(t,o,l)=>{const r=`current-${l}`,m=Xa.value.has(r),f=o.fillOpacity??Hl.value;return!m&&Me.value===null?f:o.isHighlighted||m?o.isComparison?f:f+.15:o.isDimmed?f*.3:f},xa=e.computed(()=>{if(!Bl.value)return[];const t=[],o=oo.value;return tn.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const f=i(r.series)?0:1,C=i(m.series)?0:1;return f-C}).forEach(({series:r,seriesIndex:m})=>{const f=i(r),C=[],b=[],P=[],B=Me.value===m,H=Me.value!==null&&Me.value!==m,S=zt.value.has(m);for(let q=0;q<o;q++){const we=r.data[q]||0,pe=we/Za.value*gt.value,ye=q*2*Math.PI/o-Math.PI/2,Se=Ut.value+Math.cos(ye)*pe,ve=Pt.value+Math.sin(ye)*pe;C.push(`${Se},${ve}`),b.push({x:Se,y:ve}),P.push({x:Se,y:ve,value:we,label:F.categories[q]||`Axis ${q+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:P,color:u(r,m),fillOpacity:f?c.value.fillOpacity:Hl.value,strokeDasharray:f?s(r)||c.value.strokeDasharray:null,pointRadius:d(r,f),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:B,isDimmed:H,isHidden:S,isComparison:f,seriesIndex:m})}),t}),ja=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const f=o[r].x,C=o[r].y,b=o[m].x,P=o[m].y;C>t.y!=P>t.y&&t.x<(b-f)*(t.y-C)/(P-C)+f&&(l=!l)}return l},Ka=t=>{if(!Bl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=L.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,f=t.clientY-r.top,C=xa.value.filter(b=>b.isHidden?!1:ja({x:m,y:f},b.polygonPoints));if(C.length>0){C.length,Me.value=C[0].seriesIndex;const b=t.clientX-l.left+10,P=t.clientY-l.top-10,B=C.length>1?460:260,H=70+oo.value*20;let S=b,q=P;S+B>Ve.value&&(S=t.clientX-l.left-B-10),q+H>re.value&&(q=t.clientY-l.top-H-10),S<0&&(S=10),q<0&&(q=10);const we=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(pe=>({label:pe.label,value:_(pe.value)}))}));kt.value={show:!0,x:S,y:q,title:"",value:"",bubbleData:[],spiderAreas:we}}else un()},Fo=e.computed(()=>{const t=U.value;return t.logos.map((o,l)=>{const r=F.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||zt.value.has(o.seriesIndex))return null;let m,f;if(ol.value){let b=-1,P=null;for(let H=r.data.length-1;H>=0;H--)if(r.data[H]!==null&&r.data[H]!==void 0){b=H,P=r.data[H];break}if(b===-1||P===null)return null;const B=r.data.map((H,S)=>H==null?null:{x:vt(S),y:gl(r,H),index:S}).filter(H=>H!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ot.value.isAnimating||!Ot.value.hasAnimated))if(Ot.value.isAnimating){const H=Ot.value.currentFrame/Ot.value.totalFrames,S=ca(t.animations.easing,Math.min(H,1)),q=as(B,S);m=q.x+(o.offsetX||0),f=q.y+(o.offsetY||0)}else m=B[0].x+(o.offsetX||0),f=B[0].y+(o.offsetY||0);else m=vt(b)+(o.offsetX||0),f=Xt(P)+(o.offsetY||0)}else if(al.value||Bl.value){const b=Math.PI*2/t.logos.length*l;m=Ut.value+Math.cos(b)*(gt.value+30)+(o.offsetX||0),f=Pt.value+Math.sin(b)*(gt.value+30)+(o.offsetY||0)}return{...o,x:m,y:f,seriesIndex:o.seriesIndex}}).filter(Boolean)}),Ga=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},Qa=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ra=t=>{zt.value.has(t)?zt.value.delete(t):zt.value.add(t)},Ja=e.computed(()=>{if(!kt.value.show&&!(Xe.value&&nt.value.show&&!ie.value.isZooming))return{display:"none"};let t,o;if(Xe.value&&nt.value.show&&!ie.value.isZooming){t=nt.value.x+15,o=R.value.top;const l=ul.value?200:150;t+l>Ve.value&&(t=nt.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=kt.value.x,o=kt.value.y;return{left:t+"px",top:o+"px"}}),_n=(t,o)=>{if(!Pe.value||go.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,f=o.clientY-r.top-10;const C=200,b=120,P=Ve.value,B=re.value;m+C>P&&(m=o.clientX-r.left-C-10),f+b>B&&(f=o.clientY-r.top-b-10),m<0&&(m=10),f<0&&(f=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&F.categories.includes(t.label)&&(H=F.categories.indexOf(t.label));let S=t.seriesName||t.label||"";(dl.value||Ce.value==="bar")&&t.label&&(S=t.label),t.tooltipTitle&&(S=t.tooltipTitle),kt.value={show:!0,x:m,y:f,title:S,value:_(t.value)||"",categoryIndex:H,spiderAreas:[]}},ia=e.ref(!1),Io=e.ref(!1),un=()=>{kt.value.show=!1,kt.value.spiderAreas=[],kt.value.bubbleData=[],nt.value.show=!1,ia.value||(Me.value=null)},go=e.ref(!1),yo=(t,o)=>{go.value=!0,kt.value.show=!1,nt.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,f=o.clientY-r.top-10;const C=250;m+C>Ve.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),f<0&&(f=10),Dn.value={show:!0,x:m,y:f,content:t.texts,count:t.totalCount}},ko=()=>{go.value=!1,Dn.value.show=!1},Ot=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ca=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},$n=e.computed(()=>dn.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),wa=()=>{if(!Vl.value||$n.value){Ot.value.hasAnimated=!0,an.value&&(Rl.value=1);return}an.value&&(Rl.value=0),Ot.value.isAnimating=!0,Ot.value.currentFrame=0,Ot.value.totalFrames=Math.ceil(tl.value/16.67);const t=()=>{const o=Ot.value.currentFrame/Ot.value.totalFrames,l=ca(on.value,Math.min(o,1));es(l),an.value&&(Rl.value=l),o<1?(Ot.value.currentFrame++,Ot.value.animationId=requestAnimationFrame(t)):ts()};Ot.value.animationId=requestAnimationFrame(t)},es=t=>{const o=O.value;o&&o.style.setProperty("--dss-animation-progress",t)},ts=()=>{Ot.value.isAnimating=!1,Ot.value.hasAnimated=!0,an.value&&(Rl.value=1),Ot.value.animationId&&(cancelAnimationFrame(Ot.value.animationId),Ot.value.animationId=null)},ua=e.computed(()=>!al.value||Ot.value.hasAnimated?!0:an.value?Rl.value>=1:Cn.value?Fn.value>=1:!0),Ea=e.computed(()=>Qt.value&&ua.value),zo=e.ref(!1);e.watch(Ea,t=>{t?(zo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{zo.value=!0})})):zo.value=!1},{immediate:!0});const ls=e.computed(()=>{if(!Vl.value||$n.value||Ot.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${tl.value}ms`,t["--dss-animation-easing"]=ns(on.value),t["--dss-stagger-delay"]=`${xl.value}ms`,t}),ns=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",os=()=>{if(!Vl.value||$n.value)return"";const t=["dss-chart-animated"];return Ot.value.hasAnimated||t.push(`dss-animate-${Nl.value}`),Ot.value.hasAnimated||(al.value&&Ce.value!=="semi-radial"?t.push("dss-animate-fill"):al.value||t.push(`dss-animate-${Nl.value}`)),Ot.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>F.series,(t,o)=>{Fl.value&&o&&Ot.value.hasAnimated&&(Ot.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>wa(),jl.value)}))},{deep:!0}),e.watch(()=>ie.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{bo()},50)}),e.watch(()=>[ie.value.scale,ie.value.offsetX],()=>{!ie.value.isZooming&&!ie.value.isDragging&&bo()},{flush:"post"}),e.watch([Zt,Ue],([t,o])=>{ie.value.minScale=t,ie.value.maxScale=o,(ie.value.scale<t||ie.value.scale>o)&&Bn()},{immediate:!0}),e.watch(()=>F.locale,t=>{t&&t!==V.value&&(V.value=t)},{immediate:!0}),e.watch(()=>ft.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Kn)}):document.removeEventListener("click",Kn)}),e.onMounted(()=>{Me.value=null,an.value&&(!Vl.value||$n.value)&&(Rl.value=1),Eo(),O.value&&typeof ResizeObserver<"u"&&(v=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:r}=o.contentRect;rt.value=Math.round(l),ee.value=Math.round(r),fe.value&&(Le.value=fe.value.offsetHeight||ke)}))}),v.observe(O.value)),Vl.value&&!$n.value?Ce.value==="semi-radial"?setTimeout(()=>Jn(),jl.value):setTimeout(()=>wa(),jl.value):(Ot.value.hasAnimated=!0,Ce.value==="semi-radial"&&(Fn.value=1)),document.addEventListener("mousemove",Sa),document.addEventListener("mouseup",Va),document.addEventListener("click",Vo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),v&&O.value&&(v.unobserve(O.value),v.disconnect(),v=null),Ot.value.animationId&&cancelAnimationFrame(Ot.value.animationId),Un&&(cancelAnimationFrame(Un),Un=null),ie.value.zoomTimeout&&clearTimeout(ie.value.zoomTimeout),document.removeEventListener("mousemove",Sa),document.removeEventListener("mouseup",Va),document.removeEventListener("click",Vo),document.removeEventListener("click",Kn)});const Sa=t=>{if(ie.value.isDragging&&ie.value.scale>1&&ol.value){nt.value.show=!1;const o=t.clientX-ie.value.lastMouseX,{minX:l,maxX:r}=He.value,m=r-l||1,C=o*.8;ie.value.offsetX+=C;const b=m/ie.value.scale,P=m-b,B=0,H=-P/m*R.value.width,S=B;ie.value.offsetX=Math.max(H,Math.min(S,ie.value.offsetX)),ie.value.lastMouseX=t.clientX,ie.value.lastMouseY=t.clientY}},Va=()=>{ie.value.isDragging&&(ie.value.isDragging=!1,setTimeout(()=>{!ie.value.isDragging&&ie.value.isZooming},100))},as=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const P=l[b].x-l[b-1].x,B=l[b].y-l[b-1].y,H=Math.sqrt(P*P+B*B);m.push(H),r+=H}const f=r*o;let C=0;for(let b=0;b<m.length;b++){const P=C+m[b];if(f<=P){const B=(f-C)/m[b],H=l[b],S=l[b+1];return{x:H.x+(S.x-H.x)*B,y:H.y+(S.y-H.y)*B}}C=P}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[os(),{"dss-chart-fill-width":ze.value,"dss-chart-fill-height":qe.value,"dss-chart-compact":al.value&&!W.value}]]),style:e.normalizeStyle({width:ze.value?"100%":Ve.value+"px",height:Qe.value,...ze.value||qe.value?{overflow:al.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ls.value,cursor:cl()}),"data-chart-type":Ce.value,ref_key:"containerEl",ref:O,onWheel:rn,onMousedown:yn,onMousemove:Z,onMouseup:Nn,onMouseleave:he,onDblclick:Bn,onContextmenu:e.withModifiers(at,["prevent"]),onClick:e.withModifiers(Bt,["left"]),onWheelCapture:rn},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:fe},[e.createElementVNode("div",tr,[ut.value?(e.openBlock(),e.createElementBlock("div",lr,e.toDisplayString(ut.value),1)):e.createCommentVNode("",!0),ht.value?(e.openBlock(),e.createElementBlock("div",nr,e.toDisplayString(ht.value),1)):e.createCommentVNode("",!0)]),W.value&&G.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-top":G.value==="top","dss-legend-bottom":G.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",ar,e.toDisplayString(l.name),1)],46,or))),128))],2)):e.createCommentVNode("",!0),W.value&&(G.value==="left"||G.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":G.value==="left","dss-legend-right":G.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",rr,e.toDisplayString(l.name),1)],46,sr))),128))],2)):e.createCommentVNode("",!0)],512),E.showAddMarkerButton&&ql.value&&rl.value.addMarker&&(ol.value||ul.value)&&!Ol.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Qo,title:e.unref($)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Kl.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,cr),o[4]||(o[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,ir)):e.createCommentVNode("",!0),e.createElementVNode("div",ur,[ul.value&&dt.value?(e.openBlock(),e.createElementBlock("div",dr,"Bubble size: "+e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ve.value,height:re.value,class:"dss-chart-svg","data-smooth":xe.value,"data-animated":Vl.value,ref_key:"svgEl",ref:L},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:Y.value},[e.createElementVNode("rect",{x:0,y:R.value.top,width:Ve.value,height:R.value.height*4},null,8,fr)],8,pr),Cn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Wn.value},[e.createElementVNode("path",{d:Bo.value},null,8,hr)],8,vr)):e.createCommentVNode("",!0),an.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Qn.value},[e.createElementVNode("path",{d:Jo.value},null,8,yr)],8,gr)):e.createCommentVNode("",!0)]),ol.value||ul.value?(e.openBlock(),e.createElementBlock("g",kr,[ge.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${r}`,x1:R.value.left,x2:R.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,br))),128))],8,Cr)):e.createCommentVNode("",!0),Ol.value&&Lo.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars","clip-path":me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-axis-bar-${r}`,x1:R.value.left,x2:R.value.right,y1:l.y,y2:l.y,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value},null,8,wr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ao.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`stepbar-vertical-axis-bar-${r}`,x1:l.x,x2:l.x,y1:R.value.top,y2:R.value.bottom,stroke:St.value,"stroke-width":It.value,"stroke-dasharray":Nt.value,opacity:At.value*.7},null,8,Er))),128))],8,xr)):e.createCommentVNode("",!0),e.createElementVNode("g",Sr,[e.createElementVNode("line",{x1:R.value.left,x2:R.value.right,y1:R.value.bottom,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Vr),e.createElementVNode("line",{x1:R.value.left,x2:R.value.left,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Nr),D.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:R.value.right,x2:R.value.right,y1:R.value.top,y2:R.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Br)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.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,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(no.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,$r))),128)),D.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(cn.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,Lr))),128)):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:R.value.left+R.value.width/2,y:R.value.bottom+45,"text-anchor":"middle","font-size":"14",fill:"#666"},e.toDisplayString(Wt.value),9,Ar)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:2,x:15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(-90, 15, ${R.value.top+R.value.height/2})`},e.toDisplayString(qt.value),9,Tr)):e.createCommentVNode("",!0),D.value&&wt.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ve.value-15,y:R.value.top+12+R.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${Ve.value-15}, ${R.value.top+R.value.height/2})`},e.toDisplayString(wt.value),9,Dr)):e.createCommentVNode("",!0)]),Jt.value.length>0?(e.openBlock(),e.createElementBlock("g",Hr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jt.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":me.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Fr)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Ir)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:R.value.bottom,y2:R.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,zr)):e.createCommentVNode("",!0)],8,Rr),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,R.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:r=>yo(l,r),onMouseleave:ko},null,40,Pr)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,R.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=>yo(l,r),onMouseleave:ko},null,40,Or),e.createElementVNode("text",{x:l.x,y:Math.max(15,R.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Wr)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":me.value},[_l.value?(e.openBlock(),e.createElementBlock("g",Zr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":dl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Ur)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Xr))],64))),128))],2),e.createElementVNode("g",Yr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.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,jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.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,Kr))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ha.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,Gr))),128)):e.createCommentVNode("",!0)])])):Ce.value==="line"?(e.openBlock(),e.createElementBlock("g",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ta.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":We.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ot.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Jr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.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,ei))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(va.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?We.value+2:We.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,ti))),128)),Lt.value>0||ne.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Da.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:K(l.isHighlighted?j(l,Lt.value)+2:j(l,Lt.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,li))),128)):e.createCommentVNode("",!0)])):Ce.value==="area"?(e.openBlock(),e.createElementBlock("g",ni,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${E.chartId}`},[e.createElementVNode("rect",{x:R.value.left-10,y:R.value.top-10,width:R.value.width+20,height:R.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${R.value.width+20}px`})},null,12,ai)],8,oi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?de.value+.2:de.value,mask:`url(#area-mask-${r}-${E.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,si))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(aa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.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*xl.value}ms`})},null,14,ri))),128))])):Ce.value==="stepbar"?(e.openBlock(),e.createElementBlock("g",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sa.value,l=>(e.openBlock(),e.createElementBlock("g",{key:l.key,class:"dss-stepbar-column"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.segments,r=>(e.openBlock(),e.createElementBlock("rect",{key:r.key,x:r.x,y:r.y,width:r.width,height:r.height,rx:r.radius,ry:r.radius,fill:r.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":r.isHighlighted,"dss-bar-dimmed":r.isDimmed,"dss-bar-hidden":r.isHidden}),style:e.normalizeStyle({fillOpacity:r.isDimmed?.4:1,animationDelay:`${r.animationDelay}ms`}),onMouseover:m=>_n(r,m),onMouseleave:un},null,46,ci))),128)),l.maxMarker?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-stepbar-marker",transform:`translate(${l.maxMarker.x}, ${l.maxMarker.y})`,style:e.normalizeStyle({animationDelay:`${l.maxMarker.animationDelay}ms`})},[e.createElementVNode("circle",{r:l.maxMarker.radius,fill:l.maxMarker.backgroundColor,stroke:l.maxMarker.borderColor,"stroke-width":l.maxMarker.borderWidth},null,8,di),l.maxMarker.icon?(e.openBlock(),e.createElementBlock("text",{key:0,x:"0",y:"0","text-anchor":"middle","dominant-baseline":"central","font-size":l.maxMarker.fontSize,"font-weight":"700",fill:l.maxMarker.color},e.toDisplayString(l.maxMarker.icon),9,mi)):e.createCommentVNode("",!0)],12,ui)):e.createCommentVNode("",!0)]))),128))])):Ce.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:4,class:e.normalizeClass({"dss-horizontal-bars":dl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ha.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,pi)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>_n(l,m),onMouseleave:un},null,46,fi))],64))),128))],2)):e.createCommentVNode("",!0)],8,qr),Xe.value&&nt.value.show&&!ie.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":me.value},[e.createElementVNode("line",{x1:nt.value.x,x2:nt.value.x,y1:R.value.top,y2:R.value.bottom,stroke:Et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,hi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:nt.value.x,cy:l.y,r:K(Lt.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,gi))),128))],8,vi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ul.value?(e.openBlock(),e.createElementBlock("g",yi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",ki,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:K(l.radius),fill:l.color,"fill-opacity":Ia(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Pa(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,42,Ci),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:za(l)}),onLoad:m=>la(r),onError:m=>_o(r),onMouseenter:m=>ya(l,m),onMouseleave:m=>Ca(l),onClick:m=>ga(l,m)},null,46,bi)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),al.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:No.value},[Ce.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Ut.value,cy:Pt.value,r:gt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,wi)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ce.value,"clip-path":ea.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ra.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":Zn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>_n(l.segment,m),onMouseleave:un},null,42,Si))),128))],8,Ei),vn.value&&ua.value?(e.openBlock(),e.createElementBlock("g",Vi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.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,Ni)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),An.value&&(ua.value||Cn.value||en.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:ll.value.x,y:ll.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Gl.value,fill:Xn.value,class:"dss-radial-data-center"},e.toDisplayString(Tn.value),9,Bi)):e.createCommentVNode("",!0),Ea.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":zo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fa.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,Mi),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,_i),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":_t.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,$i)],6))),128))],2)):e.createCommentVNode("",!0)],8,xi)):e.createCommentVNode("",!0),Bl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:No.value},[ge.value?(e.openBlock(),e.createElementBlock("g",Ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Ut.value,cy:Pt.value,r:K(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Ti))),128)),e.createElementVNode("g",Di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mn.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Ut.value-16,y:Pt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Hi),e.createElementVNode("text",{x:Ut.value,y:Pt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(pn(r)),9,Ri)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ba.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Ut.value,x2:l.x,y1:Pt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Fi))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ua.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/oo.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/oo.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,zi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Ka,onMouseleave:un},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xa.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Ya("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?We.value+1:We.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*xl.value}ms`,transition:"all 0.2s ease"})},null,14,Pi),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,f)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${f}`,cx:m.x,cy:m.y,r:K(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*xl.value+f*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>_n(m,C),onMouseleave:un},null,46,Oi))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,Li)):e.createCommentVNode("",!0),e.createElementVNode("g",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:K(l.width/2),fill:$t(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,qi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fo.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>Ga(r),onError:m=>Qa(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,Zi))),128))])],8,mr))]),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ve.value+"px",height:re.value+"px",backgroundImage:`url('${fn.value}')`,backgroundRepeat:"no-repeat",...Gt.value,opacity:lt.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.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:T.value+"px",height:T.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>jo(l),["stop"]),onMouseenter:m=>Wa(l,m),onMouseleave:qa},[e.createElementVNode("img",{src:gn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Xi)],44,Ui)),[[e.vShow,le.value]])),128)),Ml.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Ml.value.x+"px",top:Ml.value.y+"px"})},[e.createElementVNode("div",Yi,e.toDisplayString(Ml.value.categoryValue),1),Ml.value.description?(e.openBlock(),e.createElementBlock("div",ji,e.toDisplayString(Ml.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Pe.value&&(kt.value.show||Xe.value&&nt.value.show&&!ie.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Xe.value&&nt.value.show&&!ie.value.isZooming,"dss-spider-tooltip":Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0}]),style:e.normalizeStyle(Ja.value)},[!Xe.value||!nt.value.show||ie.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Bl.value&&kt.value.spiderAreas&&kt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Ki,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Gi,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${f}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Qi,e.toDisplayString(m.label),1),e.createElementVNode("span",Ji,e.toDisplayString(m.value),1)]))),128))]))),128))])):ul.value&&kt.value.bubbleData&&kt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",ec,[kt.value.title?(e.openBlock(),e.createElementBlock("div",tc,e.toDisplayString(kt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",lc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.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",nc,[e.createElementVNode("div",oc,e.toDisplayString(kt.value.title),1),e.createElementVNode("div",ac,e.toDisplayString(kt.value.value),1)])),kt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Rt(kt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",sc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",rc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",ic,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",cc,[e.createElementVNode("div",uc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(kt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",dc,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",mc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(kt.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",pc,[e.createElementVNode("div",fc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",vc,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",hc,[e.createElementVNode("div",gc,e.toDisplayString(ul.value?Oa():E.categories[nt.value.categoryIndex]||`Category ${nt.value.categoryIndex+1}`),1),ul.value?(e.openBlock(),e.createElementBlock("div",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(nt.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(nt.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",kc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Cc,e.toDisplayString(_(l.value)),1)]))),128))]),Rt(nt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",bc,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",xc,e.toDisplayString(e.unref($)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",wc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,f)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${f}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Ec,[e.createElementVNode("div",Sc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rt(nt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Vc,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Nc,e.toDisplayString(e.unref($)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt(nt.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",Bc,[e.createElementVNode("div",Mc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",_c,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),ol.value&&Ge.value&&ie.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Bn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ie.value.scale*100))+"% "+e.toDisplayString(e.unref($)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,er),W.value&&G.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ne.value==="horizontal","dss-legend-vertical":Ne.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":zt.value.has(r),"dss-legend-hovered":Me.value===r,"dss-legend-dimmed":Me.value!==null&&Me.value!==r}]),onClick:m=>ra(r),onMouseenter:m=>g(r),onMouseleave:w,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":Bl.value&&i(l)}]),style:e.normalizeStyle({backgroundColor:Bl.value&&i(l)?"transparent":p(l,r),borderColor:p(l,r)})},null,6),e.createElementVNode("span",Lc,e.toDisplayString(l.name),1)],46,$c))),128))],2)):e.createCommentVNode("",!0),ft.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ft.value.x+"px",top:ft.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[rl.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:jn},e.toDisplayString(e.unref($)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),rl.value.addMarker&&(rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv||Il.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ac)):e.createCommentVNode("",!0),rl.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Go},e.toDisplayString(e.unref($)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),rl.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:So},e.toDisplayString(e.unref($)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Rn},e.toDisplayString(e.unref($)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Il.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[rl.value.downloadSvg||rl.value.downloadPng||rl.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Tc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Dc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Pl(l)),style:e.normalizeStyle(Ul(l)),onClick:m=>Yn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:bl(l),class:"dss-custom-menu-content"},null,8,Rc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Fc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,Hc)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Sn},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ic,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref($)("chart.modalMarker.viewMarker"):Al.value?e.unref($)("chart.modalMarker.editMarker"):e.unref($)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Sn},"×")]),e.createElementVNode("div",zc,[e.createElementVNode("div",Pc,[e.createVNode(pa,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>De.value.date=l),"min-date":Jl.value,"max-date":Cl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Oc,[e.createElementVNode("label",Wc,e.toDisplayString(e.unref($)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",qc,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>De.value.description=l),placeholder:e.unref($)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Zc)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Uc,[e.createElementVNode("div",Xc,[Al.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:po},e.toDisplayString(e.unref($)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Yc,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Sn},e.toDisplayString(y.value?e.unref($)("chart.modalMarker.close"):e.unref($)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Yo,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(Al.value?e.unref($)("chart.modalMarker.save"):e.unref($)("chart.contextMenu.addMarker")),9,jc))])])])])):e.createCommentVNode("",!0)],64))}}),Qc={class:"dss-modal-title"},Jc={class:"dss-modal-actions"},ma={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(null),O=e.ref(null),L=e.computed(()=>{const Y={"max-width":$.width};return $.height!=="auto"&&(Y.height=$.height,Y["min-height"]="0"),Y}),fe=e.computed(()=>({}));function rt(){V("close-modal")}function ee(){$.backDrop&&!ce.value&&V("close-modal")}function v(Y){Y.target.tagName==="INPUT"&&(ce.value=Y.target.tagName)}function be(){setTimeout(()=>{ce.value=null},300)}function ke(){const Y=document.body,me=document.documentElement;O.value={bodyOverflow:Y.style.overflow,bodyPosition:Y.style.position,bodyTop:Y.style.top,bodyWidth:Y.style.width,htmlOverflow:me.style.overflow,scrollY:window.scrollY},Y.style.overflow="hidden",Y.style.position="fixed",Y.style.top=`-${O.value.scrollY}px`,Y.style.width="100%",Y.style.left="0",me.style.overflow="hidden"}function J(){if(!O.value)return;const Y=document.body,me=document.documentElement,{bodyOverflow:F,bodyPosition:ue,bodyTop:$e,bodyWidth:tt,htmlOverflow:mt,scrollY:U}=O.value;Y.style.overflow=F||"",Y.style.position=ue||"",Y.style.top=$e||"",Y.style.width=tt||"",Y.style.left="",me.style.overflow=mt||"",window.scrollTo(0,U||0)}return e.watch(()=>$.showModal,Y=>{if(Y)ke(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const me=document.getElementById("dss-modal-backdrop");me&&(me.addEventListener("focusin",v),me.addEventListener("focusout",be))},100);else{J(),document.body.classList.remove("dss-modal-open");const me=document.getElementById("dss-modal-backdrop");me&&(me.removeEventListener("focusin",v),me.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{$.showModal&&J()}),(Y,me)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.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(L.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:me[0]||(me[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":E.headerType,"font-size":E.titleSize})},[e.createElementVNode("h1",Qc,[e.renderSlot(Y.$slots,"title",{},()=>[me[1]||(me[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(Y.$slots,"title-data"),E.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(fe.value)},[e.renderSlot(Y.$slots,"content",{},()=>[me[2]||(me[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Jc,[e.renderSlot(Y.$slots,"actions")])])],4),[[e.vShow,E.showModal]])])):e.createCommentVNode("",!0)]))}},eu={key:0,class:"dss-table-toolbar"},tu={class:"dss-table-toolbar-left"},lu=["aria-expanded"],nu={class:"dss-pagination-select-dropdown",role:"listbox"},ou={class:"dss-table-column-visibility-label"},au={class:"dss-table-checkbox-wrapper"},su=["checked","onChange"],ru={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},iu={class:"dss-table-column-visibility-text"},cu={class:"dss-table-toolbar-right"},uu=["placeholder","aria-label"],du=["aria-label"],mu=["aria-label","aria-expanded"],pu={key:1,class:"dss-table-toolbar-extra"},fu={class:"dss-table-thead"},vu={key:0,class:"dss-table-th dss-table-selection-column"},hu={key:0,class:"dss-table-checkbox-wrapper"},gu=["checked","indeterminate"],yu={key:0,class:"dss-table-checkbox__indeterminate"},ku={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Cu=["aria-label"],bu=["onClick"],xu={class:"dss-table-th-content"},wu={class:"dss-table-th-text"},Eu={key:0},Su={key:1},Vu={key:2},Nu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Bu={class:"dss-table-tbody"},Mu=["onClick"],_u={class:"dss-table-checkbox-wrapper"},$u=["type","name","checked","disabled","onChange"],Lu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Au={key:1,class:"dss-table-checkbox__dot"},Tu=["onClick"],Du=["aria-expanded","aria-label"],Hu={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ru={key:0,class:"dss-table-expansion-row"},Fu=["colspan"],Iu=["colspan"],zu={key:1,class:"dss-table-pagination"},Pu={class:"dss-table-pagination-left"},Ou={key:0},Wu={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},qu={class:"dss-table-pagination-center"},Zu={key:0,class:"dss-pagination-controls"},Uu=["disabled","title"],Xu=["disabled","title"],Yu=["aria-label","onKeydown"],ju={class:"dss-pagination-of"},Ku=["disabled","title"],Gu=["disabled","title"],Qu={class:"dss-table-pagination-right"},Ju={class:"dss-pagination-rows-label"},ed=["aria-expanded"],td=["aria-selected","onClick"],ld={key:0,class:"dss-table-filter-row"},nd=["value","placeholder"],od=["min","max","value"],ad=["min","max","value"],sd={class:"dss-table-filter-double-range-values"},rd={key:2,class:"dss-table-filter-daterange"},id={class:"dss-table-filter-daterange-row"},cd={class:"dss-table-filter-daterange-label"},ud=["value"],dd={class:"dss-table-filter-daterange-row"},md={class:"dss-table-filter-daterange-label"},pd=["value"],fd=["value","placeholder"],vd={class:"dss-table-filter-list"},hd=["checked","onChange"],gd={class:"dss-table-filter-actions"},yd={name:"DSSTable"},kd=Object.assign(yd,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},columnVisibility:{type:Array,default:null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search","update:columnVisibility"],setup(E,{emit:te}){const{t:$,locale:V}=ro.useI18n(),ce=E,O=te,L={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 fe(y,g){const w=Object.assign({},y);return rt(y)&&rt(g)&&Object.keys(g).forEach(Z=>{rt(g[Z])?Z in y?w[Z]=fe(y[Z],g[Z]):Object.assign(w,{[Z]:g[Z]}):Object.assign(w,{[Z]:g[Z]})}),w}function rt(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ee=e.computed(()=>fe(L,ce.options)),v=e.computed(()=>{const y=ee.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ee.value.table.height),ke=e.computed(()=>ee.value.table.rowHeight??"auto"),J=e.computed(()=>({height:ke.value})),Y=e.computed(()=>ee.value.table.expandable===!0),me=e.computed(()=>ee.value.table.expandableRowData??null),F=e.computed(()=>ee.value.table.expandableRowCondition??null),ue=e.computed(()=>ee.value.table.truncated===!0),$e=e.computed(()=>ee.value.table.striped),tt=e.computed(()=>ee.value.table.bordered),mt=e.computed(()=>ee.value.table.hoverable),U=e.computed(()=>ee.value.table.size),ze=e.computed(()=>ee.value.table.align||"left");e.computed(()=>ee.value.title.text),e.computed(()=>ee.value.subtitle.text);const qe=e.computed(()=>ee.value.selection.enabled),Ve=e.computed(()=>ee.value.selection.mode),Le=e.computed(()=>ee.value.selection.rowCondition??null),je=e.computed(()=>ee.value.sorting.enabled),re=e.computed(()=>ee.value.sorting.mode),Qe=e.computed(()=>ee.value.pagination.enabled),Ce=e.computed(()=>ee.value.pagination.rows),Je=e.computed(()=>ee.value.pagination.rowsPerPageOptions),ut=e.computed(()=>ee.value.pagination.showCounter!==!1),ht=e.computed(()=>ee.value.pagination.showControlsGroup),dt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showControls!==!1),Wt=e.computed(()=>ht.value===!1?!1:ee.value.pagination.showRowsPerPage!==!1),qt=e.computed(()=>Qe.value&&(ut.value||dt.value||Wt.value)),Ct=e.computed(()=>ee.value.scrollable),wt=e.computed(()=>ee.value.emptyMessage||$("table.emptyMessage")),Yt=e.computed(()=>ee.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>ee.value.toolbar?.downloads?.excel!==!1),Kt=e.computed(()=>ee.value.toolbar?.search!==!1),yt=e.computed(()=>Yt.value||it.value||Kt.value||el.value),el=e.computed(()=>ee.value.toolbar?.columnVisibility!==!1),X=e.ref(""),ge=e.ref(!1),W=e.ref(null);let G=null;function Ne(){ge.value?(G&&(clearTimeout(G),G=null),ge.value=!1,X.value="",O("search",""),W.value?.blur()):(ge.value=!0,G=setTimeout(()=>{G=null,W.value?.focus()},80))}function Pe(){X.value||(ge.value=!1)}function Xe(){X.value="",O("search",""),W.value?.focus()}const Et=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":tt.value,"dss-table-hoverable":mt.value,[`dss-table-${U.value}`]:U.value!=="default","dss-table-truncated":ue.value})),Ge=(y,g)=>y?.field??y?.key??g,Zt=e.ref(new Set);function Ue(){const y=new Set;return ce.columns.forEach((g,w)=>{g?.hidden!==!0&&y.add(Ge(g,w))}),y}function We(){const y=new Set;return ce.columns.forEach((g,w)=>{y.add(Ge(g,w))}),y}function Dt(y){if(!Array.isArray(y))return null;const g=We(),w=[];return y.forEach(Z=>{g.has(Z)&&w.push(Z)}),w}function Lt(){Zt.value=Ue()}const ne=e.computed(()=>{const y=Dt(ce.columnVisibility);return y===null?null:new Set(y)}),j=e.computed(()=>ne.value??Zt.value),K=e.computed(()=>ce.columns.filter((y,g)=>j.value.has(Ge(y,g)))),de=y=>{const g=ce.columns.findIndex(w=>w===y);return Ge(y,g>=0?g:0)},xe=(y,g)=>j.value.has(Ge(y,g));function Ke(y){O("update:columnVisibility",Array.from(y))}function Ht(y,g){const w=Ge(y,g),Z=new Set(j.value);Z.has(w)?Z.delete(w):Z.add(w),ne.value===null&&(Zt.value=Z),Ke(Z)}const jt=e.ref(null),et=e.ref(!1);function vl(y){jt.value&&!jt.value.contains(y.target)&&(et.value=!1)}const M=e.computed(()=>K.value.length+(qe.value?1:0)+(Y.value?1:0)),x=(y,g)=>y?.id??y?.key??g,A=e.ref(new Set),ae=e.ref(null),oe=(y,g)=>A.value.has(x(y,g)),Fe=(y,g)=>{if(!Y.value)return!1;if(typeof F.value=="function")return!!F.value(y,g);if(typeof me.value=="string"&&me.value.trim()){const w=Jl(y,me.value.trim());return Array.isArray(w)?w.length>0:w&&typeof w=="object"?Object.keys(w).length>0:w!=null&&w!==""}return!0},bt=(y,g,w)=>{if(w&&w.stopPropagation(),!Fe(y,g))return;const Z=x(y,g),he=new Set(A.value);he.has(Z)?(he.delete(Z),O("row-collapse",{data:y,index:g})):(he.add(Z),O("row-expand",{data:y,index:g})),A.value=he},ot=(y,g)=>{if(!ue.value)return;const w=x(y,g);ae.value!==w&&(ae.value=w)},Ie=e.ref(null),xt=e.ref(0),Mt=e.ref([]),St=y=>{if(re.value==="single")return Ie.value===y.field?xt.value:0;{const g=Mt.value.find(w=>w.field===y.field);return g?g.order:0}},At=y=>{const g=St(y);return{"dss-sort-active":g!==0,"dss-sort-asc":g===1,"dss-sort-desc":g===-1}},It=e.ref({}),Nt=e.ref(null),yl=e.ref(null),nn=220,Vl=e.ref(null),Nl=e.computed(()=>K.value.find(y=>de(y)===Nt.value)??null),tl=e.computed(()=>{if(!Nl.value||Nl.value.filter!=="range")return null;const y=Nl.value,g=Nt.value,{min:w,max:Z}=sn(y),he=y.filterMin??w,at=y.filterMax??Z,Bt=Fl(g),bl=Bt.min??he,Pl=Bt.max??at,Ul=at-he,gn=Ul===0?0:(bl-he)/Ul*100,mo=Ul===0?100:(Pl-he)/Ul*100;return{rangeMin:he,rangeMax:at,currentMin:bl,currentMax:Pl,minPct:gn,maxPct:mo}}),jl=e.ref(null),on=e.ref("max");function xl(y){const g=jl.value,w=tl.value;if(!g||!w)return;const Z=g.getBoundingClientRect(),at=(y.clientX-Z.left)/Z.width*100,Bt=(w.minPct+w.maxPct)/2;on.value=at<Bt?"min":"max"}function Fl(y){return It.value[y]??{}}function dn(y,g){It.value={...It.value,[y]:g}}function Hl(y){const g=It.value[y];return g?g.type==="string"?!!g.value?.trim():g.type==="range"?g.min!=null||g.max!=null:g.type==="dateRange"?!!(g.from||g.to):g.type==="list"?g.selected?.length>0:!1:!1}function Pn(y){const g={...It.value};delete g[y],It.value=g,Nt.value=null,yl.value=null}function mn(){if(!Nt.value){yl.value=null;return}const y=Vl.value;if(!y)return;const g=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Nt.value}"]`);if(!g)return;const w=g.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}const pn=e.computed(()=>{const y=String(X.value??"").trim().toLowerCase();return y?ce.data.filter(g=>K.value.some(w=>ql(De(g,w)).some(he=>String(he).toLowerCase().includes(y)))):ce.data}),wn=e.computed(()=>{let y=[...pn.value];const g=(X.value??"").trim().toLowerCase();return g&&(y=y.filter(w=>ce.columns.some(Z=>{if(!Z||!Z.field)return!1;const he=De(w,Z);return String(he??"").toLowerCase().includes(g)}))),K.value.forEach(w=>{const Z=de(w),he=It.value[Z];if(!he)return;const at=w.field;if(at){if(he.type==="string"&&he.value?.trim()){const Bt=he.value.trim().toLowerCase();y=y.filter(bl=>{const Pl=De(bl,w);return String(Pl??"").toLowerCase().includes(Bt)})}else if(he.type==="range")y=y.filter(Bt=>{const bl=Jl(Bt,at),Pl=Number(bl);return!(Number.isNaN(Pl)||he.min!=null&&Pl<he.min||he.max!=null&&Pl>he.max)});else if(he.type==="dateRange"){const Bt=he.from?new Date(he.from).getTime():null,bl=he.to?new Date(he.to).getTime():null;y=y.filter(Pl=>{const Ul=Jl(Pl,at),gn=Ul?new Date(Ul).getTime():NaN;return!(Number.isNaN(gn)||Bt!=null&&gn<Bt||bl!=null&&gn>bl)})}else if(he.type==="list"&&he.selected?.length){const Bt=new Set(he.selected);y=y.filter(bl=>ql(De(bl,w)).some(Ul=>Bt.has(Ul)))}}}),y});function ql(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(ql);if(typeof y=="object"){const g=y?.label??y?.name??y?.value??y?.title;return[g!=null?String(g):String(y)]}return[String(y)]}function rl(y){const g=new Set;return ce.data.forEach(w=>{ql(De(w,y)).forEach(he=>g.add(he))}),Array.from(g).sort((w,Z)=>String(w).localeCompare(String(Z)))}function Il(y,g){if(Nt.value===y){Nt.value=null,yl.value=null;return}if(Nt.value=y,g?.currentTarget){const w=g.currentTarget.getBoundingClientRect();yl.value={top:w.bottom+6,left:Math.max(8,w.right-nn)}}else mn()}function Kl(y,g){dn(y,{type:"string",value:g})}function sn(y){const g=y.field;if(!g)return{min:0,max:100};let w=1/0,Z=-1/0;return ce.data.forEach(he=>{const at=Jl(he,g),Bt=Number(at);Number.isNaN(Bt)||(w=Math.min(w,Bt),Z=Math.max(Z,Bt))}),{min:w===1/0?0:w,max:Z===-1/0?100:Z}}function T(y,g,w){const Z={...Fl(y),type:"range"},he=w===""?null:Number(w),at=he===null||Number.isNaN(he)?null:he;Z[g]=at,at!=null&&(g==="min"&&Z.max!=null&&at>Z.max&&(Z.max=at),g==="max"&&Z.min!=null&&at<Z.min&&(Z.min=at)),dn(y,Z)}function z(y,g,w){const Z={...Fl(y),type:"dateRange"};Z[g]=w||"",dn(y,Z)}const _=e.reactive({});function le(y,g){_[y]=g}function Te(y){const g=de(y),w=(_[g]??"").trim().toLowerCase(),Z=rl(y);return w?Z.filter(he=>String(he).toLowerCase().includes(w)):Z}function pt(y,g){return(Fl(y).selected??[]).includes(g!=null?String(g):"")}function ct(y,g){const Z=[...Fl(y).selected??[]],he=g!=null?String(g):"",at=Z.indexOf(he);at>=0?Z.splice(at,1):Z.push(he),dn(y,{type:"list",selected:Z})}function lt(y){Nt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(Nt.value=null,yl.value=null)}function st(){mn(),Rt.value&&Zl()}const il=y=>{if(!(y.sortable===!1||!je.value))if(re.value==="single")Ie.value===y.field?xt.value=xt.value===1?-1:xt.value===-1?0:1:(Ie.value=y.field,xt.value=1),xt.value===0&&(Ie.value=null),O("sort",{field:Ie.value,order:xt.value});else{const g=Mt.value.findIndex(w=>w.field===y.field);g>=0?Mt.value[g].order===1?Mt.value[g].order=-1:Mt.value.splice(g,1):Mt.value.push({field:y.field,order:1}),O("sort",{multiSortMeta:Mt.value})}},kl=e.computed(()=>{if(!je.value)return wn.value;let y=[...wn.value];return re.value==="single"&&Ie.value&&xt.value!==0?y.sort((g,w)=>{const Z=Jl(g,Ie.value),he=Jl(w,Ie.value);return Z===he?0:Z==null?1:he==null?-1:(Z<he?-1:Z>he?1:0)*xt.value}):re.value==="multiple"&&Mt.value.length>0&&y.sort((g,w)=>{for(const Z of Mt.value){const he=Jl(g,Z.field),at=Jl(w,Z.field);if(he===at)continue;if(he==null)return 1;if(at==null)return-1;const Bt=he<at?-1:he>at?1:0;if(Bt!==0)return Bt*Z.order}return 0}),y}),Gt=e.ref(0),wl=e.ref(Ce.value),Rt=e.ref(!1),Ll=e.ref(null),fn=e.ref(null),Qt=e.ref("bottom"),_t=e.ref(null),Ln=y=>{wl.value=y,Rt.value=!1,Gt.value=0,O("page",{page:0,rows:wl.value})};function En(y){Ll.value&&!Ll.value.contains(y.target)&&(Rt.value=!1)}function Zl(){const y=Ll.value,g=fn.value;if(!y||!g)return;const w=y.querySelector(".dss-pagination-select-dropdown");if(!w)return;const Z=g.getBoundingClientRect(),he=w.offsetHeight||0,Bt=(window.innerHeight||document.documentElement.clientHeight)-Z.bottom,bl=Z.top;Qt.value=Bt<he+8&&bl>Bt?"top":"bottom",_t.value={width:`${Math.ceil(Z.width)}px`,left:`${Math.max(0,Math.round(g.offsetLeft))}px`}}const vn=e.computed(()=>kl.value.length),hn=e.computed(()=>Math.ceil(vn.value/wl.value)),An=e.computed(()=>Math.max(hn.value,1)),Tn=e.computed(()=>vn.value===0?0:ll.value+1),Gl=e.computed(()=>Xn.value),ll=e.computed(()=>Qe.value?Gt.value*wl.value:0),Xn=e.computed(()=>Qe.value?Math.min((Gt.value+1)*wl.value,vn.value):vn.value),Ql=e.computed(()=>{if(!Qe.value)return kl.value;const y=ll.value,g=Xn.value;return kl.value.slice(y,g)}),Jt=e.ref(new Set),Dn=e.computed(()=>kl.value.filter((y,g)=>Jt.value.has(x(y,g)))),nl=(y,g)=>{const w=Le.value;return typeof w!="function"?!0:!!w(y,g)},zl=e.computed(()=>kl.value.map((y,g)=>({row:y,index:g})).filter(({row:y,index:g})=>nl(y,g))),On=e.computed(()=>{const y=zl.value;return y.length===0?!1:y.every(({row:g,index:w})=>Jt.value.has(x(g,w)))}),zt=e.computed(()=>{const y=zl.value;if(y.length===0)return!1;const g=y.filter(({row:w,index:Z})=>Jt.value.has(x(w,Z))).length;return g>0&&g<y.length}),Me=(y,g)=>Jt.value.has(x(y,g)),El=()=>{if(On.value)Jt.value=new Set,O("unselect-all");else{const y=new Set;zl.value.forEach(({row:g,index:w})=>y.add(x(g,w))),Jt.value=y,O("select-all",Dn.value)}},kt=(y,g)=>{if(!nl(y,g))return;const w=x(y,g),Z=new Set(Jt.value),he=Z.has(w);Ve.value==="single"?he?(Z.delete(w),O("row-unselect",y)):(Z.clear(),Z.add(w),O("row-select",y)):he?(Z.delete(w),O("row-unselect",y)):(Z.add(w),O("row-select",y)),Jt.value=Z},Ml=e.ref("1"),nt=()=>{const y=Number.parseInt(String(Ml.value),10);if(!Number.isFinite(y)){Ml.value=String(Gt.value+1);return}const g=Math.min(An.value,Math.max(1,y));g!==Gt.value+1?ft(g-1):Ml.value=String(g)},ft=y=>{y<0||y>=hn.value||(Gt.value=y,O("page",{page:y,rows:wl.value}))},ie=(y,g,w)=>{O("row-click",{data:y,index:g,originalEvent:w}),ot(y,ll.value+g)},Tt=(y,g)=>{const w=ll.value+g;return{"dss-table-row-selected":Me(y,w),"dss-table-row-even":g%2===0,"dss-table-row-odd":g%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":ae.value===x(y,w)}},De=(y,g)=>g.field?Jl(y,g.field):"",Jl=(y,g)=>g.split(".").reduce((w,Z)=>w&&w[Z],y),Cl=y=>{const g=y.align??ze.value;return{"dss-table-sortable":y.sortable!==!1&&je.value,"dss-table-align-left":g==="left","dss-table-align-center":g==="center","dss-table-align-right":g==="right",[y.className]:y.className}},Al=y=>{const g={};return y.width&&(g.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(g.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(g.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),g};return e.watch(()=>ce.locale,y=>{y&&y!==V.value&&(V.value=y)},{immediate:!0}),e.watch(Ce,y=>{wl.value=y,Gt.value=0}),e.watch(Rt,async y=>{y&&(await e.nextTick(),Zl())}),e.watch(Gt,y=>{Ml.value=String(y+1)},{immediate:!0}),e.watch(X,y=>{O("search",y??"")}),e.watch(()=>ce.columns,()=>{if(ne.value===null){Lt();return}const y=Dt(ce.columnVisibility)??[];y.length!==ce.columnVisibility.length&&O("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",En),document.addEventListener("click",vl),document.addEventListener("click",lt),window.addEventListener("resize",st),window.addEventListener("scroll",st,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",En),document.removeEventListener("click",vl),document.removeEventListener("click",lt),window.removeEventListener("resize",st),window.removeEventListener("scroll",st,!0)}),(y,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vl,style:e.normalizeStyle({width:v.value+"px",height:be.value?be.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",eu,[e.createElementVNode("div",tu,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:g[0]||(g[0]=w=>O("download-pdf"))},[g[22]||(g[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:g[1]||(g[1]=w=>O("download-excel"))},[g[23]||(g[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref($)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:jt},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":et.value}]),onClick:g[2]||(g[2]=w=>et.value=!et.value),"aria-expanded":et.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref($)("table.columnVisibility"))+" ",1),g[24]||(g[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,lu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",nu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,(w,Z)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(w,Z),role:"option",class:"dss-table-column-visibility-option",onClick:g[3]||(g[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",ou,[e.createElementVNode("span",au,[e.createElementVNode("input",{type:"checkbox",checked:xe(w,Z),onChange:he=>Ht(w,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,su),xe(w,Z)?(e.openBlock(),e.createElementBlock("span",ru,[...g[25]||(g[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",iu,e.toDisplayString(w.header),1)])]))),128))],512),[[e.vShow,et.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",cu,[Kt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ge.value||X.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:W,"onUpdate:modelValue":g[4]||(g[4]=w=>X.value=w),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref($)("table.searchPlaceholder"),"aria-label":e.unref($)("table.searchTableAriaLabel"),onFocus:g[5]||(g[5]=w=>ge.value=!0),onBlur:Pe},null,40,uu),[[e.vModelText,X.value]]),X.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref($)("table.clearSearchAriaLabel"),onClick:Xe},[...g[26]||(g[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,du)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref($)("table.searchAriaLabel"),"aria-expanded":ge.value||!!X.value,onMousedown:e.withModifiers(Ne,["prevent"])},[...g[27]||(g[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,mu)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ct.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Et.value])},[e.createElementVNode("thead",fu,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",vu,[Ve.value==="multiple"?(e.openBlock(),e.createElementBlock("span",hu,[e.createElementVNode("input",{type:"checkbox",checked:On.value,indeterminate:zt.value,onChange:El,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,gu),zt.value?(e.openBlock(),e.createElementBlock("span",yu)):On.value?(e.openBlock(),e.createElementBlock("span",ku,[...g[28]||(g[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref($)("table.expandRowAriaLabel")},null,8,Cu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(w,Z)=>(e.openBlock(),e.createElementBlock("th",{key:de(w),class:e.normalizeClass(["dss-table-th",Cl(w)]),style:e.normalizeStyle(Al(w)),onClick:he=>il(w)},[e.createElementVNode("div",xu,[e.createElementVNode("span",wu,e.toDisplayString(w.header),1),w.sortable!==!1&&je.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",At(w)])},[St(w)===0?(e.openBlock(),e.createElementBlock("span",Eu,[...g[29]||(g[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):St(w)===1?(e.openBlock(),e.createElementBlock("span",Su,[...g[30]||(g[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):St(w)===-1?(e.openBlock(),e.createElementBlock("span",Vu,[...g[31]||(g[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),w.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Nt.value===de(w)}]),onClick:g[6]||(g[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Hl(de(w))}]),"data-filter-column-key":de(w),"aria-expanded":Nt.value===de(w),"aria-label":e.unref($)("table.filterColumnAriaLabel"),onClick:he=>Il(de(w),he)},[...g[32]||(g[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Nu)],2)):e.createCommentVNode("",!0)])],14,bu))),128))])]),e.createElementVNode("tbody",Bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ql.value,(w,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:x(w,ll.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Tt(w,Z)]),style:e.normalizeStyle(J.value),onClick:he=>ie(w,Z,he)},[qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:g[7]||(g[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",_u,[e.createElementVNode("input",{type:Ve.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${E.tableId}`,checked:Me(w,ll.value+Z),disabled:!nl(w,ll.value+Z),onChange:he=>kt(w,ll.value+Z),class:e.normalizeClass(["dss-table-checkbox",Ve.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(w,ll.value+Z)}])},null,42,$u),Ve.value==="multiple"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Lu,[...g[33]||(g[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ve.value==="single"&&Me(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("span",Au)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(he=>bt(w,ll.value+Z,he),["stop"])},[Fe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":oe(w,ll.value+Z),"aria-label":oe(w,ll.value+Z)?e.unref($)("table.collapseRowAriaLabel"):e.unref($)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":oe(w,ll.value+Z)}]),"aria-hidden":"true"},[...g[34]||(g[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Du)):(e.openBlock(),e.createElementBlock("span",Hu))],8,Tu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(he,at)=>(e.openBlock(),e.createElementBlock("td",{key:de(he),class:e.normalizeClass(["dss-table-td",Cl(he)]),style:e.normalizeStyle(Al(he))},[e.renderSlot(y.$slots,`cell-${he.field}`,{data:w,column:he,rowIndex:Z,isExpanded:ae.value===x(w,ll.value+Z)},()=>[e.createTextVNode(e.toDisplayString(De(w,he)),1)])],6))),128))],14,Mu),Y.value&&Fe(w,ll.value+Z)&&oe(w,ll.value+Z)?(e.openBlock(),e.createElementBlock("tr",Ru,[e.createElementVNode("td",{colspan:M.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:w,rowIndex:Z})],8,Fu)])):e.createCommentVNode("",!0)],64))),128)),Ql.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(J.value)},[e.createElementVNode("td",{colspan:M.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,Iu)],4))])],2)],2),qt.value?(e.openBlock(),e.createElementBlock("div",zu,[e.createElementVNode("div",Pu,[ut.value?(e.openBlock(),e.createElementBlock("span",Ou,e.toDisplayString(e.unref($)("table.showingRange",{start:Tn.value,end:Gl.value,total:vn.value})),1)):(e.openBlock(),e.createElementBlock("span",Wu," "))]),e.createElementVNode("div",qu,[dt.value?(e.openBlock(),e.createElementBlock("div",Zu,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[8]||(g[8]=w=>ft(0)),title:e.unref($)("table.firstPage")},[...g[35]||(g[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Uu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value===0,onClick:g[9]||(g[9]=w=>ft(Gt.value-1)),title:e.unref($)("table.previousPage")}," ‹ ",8,Xu),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":g[10]||(g[10]=w=>Ml.value=w),type:"text",class:"dss-pagination-page-input","aria-label":e.unref($)("table.currentPageAriaLabel"),onBlur:nt,onKeydown:e.withKeys(e.withModifiers(nt,["prevent"]),["enter"])},null,40,Yu),[[e.vModelText,Ml.value]]),e.createElementVNode("span",ju,e.toDisplayString(e.unref($)("table.ofPages",{total:An.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[11]||(g[11]=w=>ft(Gt.value+1)),title:e.unref($)("table.nextPage")}," › ",8,Ku),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Gt.value>=hn.value-1,onClick:g[12]||(g[12]=w=>ft(hn.value-1)),title:e.unref($)("table.lastPage")},[...g[36]||(g[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Gu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Qu,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Ll},[e.createElementVNode("span",Ju,e.toDisplayString(e.unref($)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Rt.value}]),onClick:g[13]||(g[13]=w=>Rt.value=!Rt.value),"aria-expanded":Rt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:fn},[e.createTextVNode(e.toDisplayString(wl.value)+" ",1),g[37]||(g[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ed),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(_t.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,w=>(e.openBlock(),e.createElementBlock("li",{key:w,role:"option","aria-selected":w===wl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":w===wl.value}]),onClick:Z=>Ln(w)},e.toDisplayString(w),11,td))),128))],6),[[e.vShow,Rt.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(yl.value?{top:yl.value.top+"px",left:yl.value.left+"px",width:nn+"px"}:void 0),onClick:g[21]||(g[21]=e.withModifiers(()=>{},["stop"]))},[Nl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",ld,[e.createElementVNode("input",{type:"text",value:Fl(Nt.value).value??"",onInput:g[14]||(g[14]=w=>Kl(Nt.value,w.target.value)),class:"dss-table-filter-input",placeholder:e.unref($)("table.search")},null,40,nd)])):Nl.value.filter==="range"&&tl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":tl.value.minPct+"%","--range-max-pct":tl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:jl,class:"dss-table-filter-double-range-track",onMousemove:xl,onMouseenter:xl},[e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMin,onInput:g[15]||(g[15]=w=>T(Nt.value,"min",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:on.value==="min"?2:1})},null,44,od),e.createElementVNode("input",{type:"range",min:tl.value.rangeMin,max:tl.value.rangeMax,value:tl.value.currentMax,onInput:g[16]||(g[16]=w=>T(Nt.value,"max",w.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:on.value==="max"?2:1})},null,44,ad)],544),e.createElementVNode("div",sd,e.toDisplayString(tl.value.currentMin)+" – "+e.toDisplayString(tl.value.currentMax),1)],4)):Nl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",rd,[e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref($)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).from??"",onInput:g[17]||(g[17]=w=>z(Nt.value,"from",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ud)]),e.createElementVNode("div",dd,[e.createElementVNode("label",md,e.toDisplayString(e.unref($)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Fl(Nt.value).to??"",onInput:g[18]||(g[18]=w=>z(Nt.value,"to",w.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,pd)])])):Nl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:_[Nt.value]??"",onInput:g[19]||(g[19]=w=>le(Nt.value,w.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref($)("table.search")},null,40,fd),e.createElementVNode("div",vd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te(Nl.value),w=>(e.openBlock(),e.createElementBlock("label",{key:w,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:pt(Nt.value,w),onChange:Z=>ct(Nt.value,w)},null,40,hd),e.createElementVNode("span",null,e.toDisplayString(w),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",gd,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:g[20]||(g[20]=w=>Pn(Nt.value))},e.toDisplayString(e.unref($)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Nt.value&&Nl.value&&yl.value]])]),_:1})]))],64))}}),Cd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",bd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='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",xd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.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",wd="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Ed="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",Sd="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",Vd={class:"dss-toolbar-left"},Nd=["title"],Bd=["title"],Md={class:"dss-toolbar-dropdown-wrapper"},_d=["title"],$d=["src"],Ld=["src"],Ad=["src"],Td=["src"],Dd=["src"],Hd=["src"],Rd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Fd=["src"],Id=["src"],zd=["src"],Pd=["src"],Od=["src"],Wd=["src"],qd=["title"],Zd=["title"],Ud=["title"],Xd=["title"],Yd=["title"],jd=["title"],Kd=["title"],Gd=["title"],Qd=["title"],Jd={key:2,class:"dss-toolbar-separator"},e1=["title"],t1={key:4,class:"dss-toolbar-separator"},l1={key:5,class:"dss-toolbar-dropdown-wrapper"},n1=["title"],o1={class:"dss-toolbar-dropdown-ai"},a1={class:"dss-toolbar-right"},s1={key:0,class:"dss-toolbar-custom-group"},r1={key:1,class:"dss-toolbar-separator"},i1={class:"dss-link-modal-content"},c1={class:"dss-link-modal-field"},u1={class:"dss-link-modal-label"},d1=["placeholder"],m1={class:"dss-link-modal-field"},p1={class:"dss-link-modal-label"},f1=["placeholder"],v1={class:"dss-image-modal-tabs"},h1={key:0,class:"dss-image-tab-content"},g1={class:"dss-link-modal-content"},y1={class:"dss-link-modal-field"},k1={key:0,class:"dss-link-modal-label"},C1=["src"],b1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},w1=["placeholder"],E1={class:"dss-link-modal-field"},S1={class:"dss-link-modal-label"},V1=["placeholder"],N1={class:"dss-link-modal-field"},B1={class:"dss-link-modal-label"},M1=["placeholder"],_1={key:1,class:"dss-image-tab-content"},$1={class:"dss-link-modal-content"},L1={class:"dss-link-modal-field"},A1={class:"dss-link-modal-label"},T1=["placeholder"],D1={class:"dss-link-modal-field"},H1={class:"dss-link-modal-label"},R1=["placeholder"],F1={class:"dss-link-modal-field"},I1={class:"dss-link-modal-label"},z1=["placeholder"],P1={class:"dss-link-modal-field"},O1={class:"dss-link-modal-label"},W1=["placeholder"],q1={class:"dss-text-editor-title-input-container"},Z1={key:0,class:"dss-text-editor-title-preview"},U1={key:0},X1={key:1,class:"dss-text-editor-preview-placeholder"},Y1=["value","placeholder","disabled"],j1={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},K1={class:"dss-text-editor-description-input-container"},G1={key:0,class:"dss-text-editor-description-preview"},Q1={key:0},J1={key:1,class:"dss-text-editor-preview-placeholder"},em=["value","placeholder","disabled"],tm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},lm=["data-comment-id","onMouseenter"],nm=["onClick"],om=["src","alt"],am={key:1},sm=["onClick"],rm=["src","alt"],im={key:1},cm=["data-has-second-user","onClick"],um={class:"editor-comment-marker-count"},dm={key:7,class:"dss-text-editor-textarea-wrapper"},mm=["value","placeholder","rows","disabled"],pm={class:"dss-text-editor-footer"},fm={class:"dss-text-editor-footer-content"},vm={class:"dss-text-editor-footer-stat"},hm={class:"dss-text-editor-footer-stat"},gm={key:8,class:"dss-text-editor-content-wrapper"},ym={key:0,class:"dss-comment-overlay-body"},km={class:"dss-comment-selection-wrapper"},Cm=["innerHTML"],bm={class:"dss-comment-messages-wrapper"},xm={key:0,class:"dss-comment-avatar-wrapper"},wm={class:"dss-comment-avatar"},Em=["src","alt"],Sm={key:1},Vm={class:"dss-comment-header"},Nm={class:"dss-comment-header-text"},Bm={class:"dss-comment-author"},Mm={key:0,class:"dss-comment-date"},_m=["onClick","title"],$m={class:"dss-comment-overlay-inner"},Lm=["placeholder","onKeydown"],Am={class:"dss-text-editor-footer"},Tm={class:"dss-text-editor-footer-content"},Dm={class:"dss-text-editor-footer-stat"},Hm={class:"dss-text-editor-footer-stat"},Rm=["title"],Fm=["title"],Im={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:""},zm={class:"dss-image-popup-content"},Pm={key:0,class:"dss-image-popup-no-alt-icon"},Om=["title"],Wm=["title"],qm={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:""},Zm={class:"dss-toolbar-left"},Um=["title"],Xm=["title"],Ym={class:"dss-toolbar-dropdown-wrapper"},jm=["title"],Km=["src"],Gm=["src"],Qm=["src"],Jm=["src"],e2=["src"],t2=["src"],l2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},n2=["title"],o2=["title"],a2=["title"],s2=["title"],r2=["title"],i2=["title"],c2=["title"],u2=["title"],d2=["title"],m2={key:2,class:"dss-toolbar-separator"},p2=["title"],f2={key:4,class:"dss-toolbar-separator"},v2={key:5,class:"dss-toolbar-dropdown-wrapper"},h2=["title"],g2={class:"dss-toolbar-dropdown-ai"},y2={key:0,class:"dss-toolbar-right"},k2={key:0,class:"dss-toolbar-separator"},C2={key:0,class:"dss-toolbar-custom-group"},b2={key:1,class:"dss-toolbar-separator"},x2={name:"DSSTextEditor"},w2=Object.assign(x2,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},showTitle:{type:Boolean,default:!0},showDescription:{type:Boolean,default:!0},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:E=>typeof E=="object"&&E!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(E,{expose:te,emit:$}){const{t:V,locale:ce}=ro.useI18n(),O={h1:Cd,h2:bd,h3:xd,h4:wd,h5:Ed,h6:Sd},L=E,fe=$,rt=e.useSlots(),ee=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,jt.value){t+=`Category,Segment,Value
|
|
97
|
+
`,Qn.value.forEach(q=>{q.segments.forEach(_=>{const I=String(q.label||"").replace(/"/g,'""'),M=String(_.label||"").replace(/"/g,'""');t+=`"${I}","${M}",${_.value}
|
|
98
|
+
`})});const v=new Blob([t],{type:"text/csv;charset=utf-8;"}),C=URL.createObjectURL(v),b=document.createElement("a");b.href=C,b.download=Zl("csv"),document.body.appendChild(b),b.click(),document.body.removeChild(b),URL.revokeObjectURL(C),fn();return}t+="Category",V.series.forEach(v=>{const C=v.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
99
|
+
`;const o=Math.max(...V.series.map(v=>v.data?.length||0));for(let v=0;v<o;v++){let q='"'+(V.categories[v]||L("chart.fallback.item",{number:v+1})).toString().replace(/"/g,'""')+'"';V.series.forEach(_=>{const I=_.data&&_.data[v]!==void 0?_.data[v]:"";q+=","+I}),t+=q+`
|
|
100
|
+
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),r=URL.createObjectURL(l),m=document.createElement("a");m.href=r,m.download=Zl("csv"),document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(r),fn()}catch(t){console.error("Error downloading CSV:",t)}},Sn=t=>{if(typeof t.action=="function"){const o={series:V.series,categories:V.categories,markers:tt.value},l={chartX:Y.value.chartX,chartY:Y.value.chartY,dataX:Y.value.mouseDataX,dataY:Y.value.mouseDataY,categoryIndex:clampedCategoryIndex||Y.value.categoryIndex};t.action(o,l)}fn()},In=()=>{en(),Se.value.show=!0,Se.value.categoryIndex=Y.value.categoryIndex,Se.value.fromButton=!1,fn()},Vn=()=>{en(),Se.value.show=!0,Se.value.categoryIndex=0,Se.value.fromButton=!0},Nn=t=>{if(Y.value.show){const o=document.querySelector(".dss-context-menu");o&&!o.contains(t.target)&&(Y.value.show=!1)}},fo=t=>{Y.value.show&&!t.target.closest(".context-menu")&&(Y.value.show=!1)},Mo=t=>{if(!kl.value||!Vt.value||jt.value)return;t.preventDefault(),t.stopPropagation(),U.value.isZooming=!0,$.value.show=!1,U.value.zoomTimeout&&clearTimeout(U.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),r=t.clientX-l.left,m=t.clientY-l.top;if(r<z.value.left-50||r>z.value.right+50||m<z.value.top-50||m>z.value.bottom+100){U.value.isZooming=!1;return}const v=t.deltaY>0?.9:1.1,C=Math.max(U.value.minScale,Math.min(U.value.maxScale,U.value.scale*v));if(C!==U.value.scale){const{minX:b,maxX:q}=Wt.value,_=q-b||1,I=_/U.value.scale,M=b-U.value.offsetX/z.value.width*_,G=(r-z.value.left)/z.value.width,Be=M+G*I;U.value.scale=C;const Oe=_/U.value.scale,ve=Be-G*Oe;U.value.offsetX=-(ve-b)/_*z.value.width,U.value.scale<=1.01&&(U.value.scale=1,U.value.offsetX=0)}U.value.zoomTimeout=setTimeout(()=>{U.value.isZooming=!1,U.value.zoomTimeout=null},300)},jn=t=>{if(!kl.value||!Vt.value||U.value.scale<=1)return;$.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,U.value.isDragging=!0,U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY,t.preventDefault()},_o=()=>{U.value.isDragging=!1},Bn=()=>{!kl.value||!Vt.value||(U.value.scale=1,U.value.offsetX=0,U.value.isDragging=!1,U.value.zoomTimeout&&(clearTimeout(U.value.zoomTimeout),U.value.zoomTimeout=null),U.value.isZooming=!1)},$o=()=>!kl.value||!y.value||!Vt.value?"default":U.value.isDragging?"grabbing":U.value.scale>1?"grab":"dss-crosshair",ho=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let o=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const r=t[Math.max(l-1,0)],m=t[l],v=t[l+1],C=t[Math.min(l+2,t.length-1)],b=m.x+(v.x-r.x)/6*Nt.value,q=m.y+(v.y-r.y)/6*Nt.value,_=v.x-(C.x-m.x)/6*Nt.value,I=v.y-(C.y-m.y)/6*Nt.value;o+=` C ${b} ${q} ${_} ${I} ${v.x} ${v.y}`}return o},$l=e.computed(()=>{const o=Z.value?.chart?.padding,l=typeof o=="number"?o:null,r=o&&typeof o=="object"?o:null,m=50;let v=m+(It.value?30:0)+60;if(gl.value){const M={left:m+40,top:m+40,right:m+40,bottom:m+40};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??M.left,top:r.top??M.top,right:r.right??M.right,bottom:r.bottom??M.bottom}:M}if(Cl.value){const M=!A.value,G=Dn.value,Be=G?Xt.value+Zn.value+Math.max(24,Fl.value+16):0,Oe=M?12:m;let ve=0;dt.value&&(ve+=M?8:15),Ye.value&&(ve+=M?6:10);const xe=rt();let Ee=Oe+(M?4:16)+(G?Be:0),de=Oe+(G?Be:0);A.value&&X.value==="left"?Ee+=xe.legendWidth||150:A.value&&X.value==="right"&&(de+=xe.legendWidth||150);const Ie=ge.value==="semi-radial"?G?Be:8:G?Be:M?8:m+80,Le=G?14:0,Me=Oe+ve+Le,Re={left:Ee,top:Me,right:de,bottom:Ie};return l!=null?{left:l,top:l,right:l,bottom:l}:r?{left:r.left??Re.left,top:r.top??Re.top,right:r.right??Re.right,bottom:r.bottom??Re.bottom}:Re}let C=0;dt.value&&(C+=15),Ye.value&&(C+=10);const b=rt();let q=m+16+(bt.value?30:0),_=m+(Yt.value?30:0);A.value&&X.value==="left"?q+=b.legendWidth||150:A.value&&X.value==="right"&&(_+=b.legendWidth||150),Ut.value&&(_+=44),jt.value&&(v+=Gt.value);const I={left:q,top:m+C,right:_,bottom:v};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:$l.value.left,top:$l.value.top,right:ye.value-$l.value.right,bottom:Te.value-$l.value.bottom,width:ye.value-($l.value.left+$l.value.right),height:Te.value-($l.value.top+$l.value.bottom)})),kl=e.computed(()=>["line","area","bar","stepbar"].includes(ge.value)||Ft.value),Pl=e.computed(()=>Ft.value),Kn=e.computed(()=>ge.value==="mini-radial"),Cl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(ge.value)),gl=e.computed(()=>ge.value==="spider"),el=e.computed(()=>ge.value==="bubble"),jt=e.computed(()=>ge.value==="stepbar"),al=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Pl.value)),cn=t=>{const{minY:o,maxY:l}=Wt.value,r=l-o||1;return z.value.left+(t-o)/r*z.value.width},Mn=t=>{const{maxX:o}=Wt.value,l=o+1,m=z.value.height/l;return z.value.top+(t+.5)*m},Lt=e.computed(()=>Cl.value?$l.value.left+(ye.value-$l.value.left-$l.value.right)/2:ye.value/2),Ct=e.computed(()=>gl.value?Te.value/2-40:Cl.value?$l.value.top+(Te.value-$l.value.top-$l.value.bottom)/2:Te.value/2),vt=e.computed(()=>{if(gl.value){const t=z.value.width-80,o=z.value.height-80;return Math.min(t,o)/2}return Math.min(z.value.width,z.value.height)/2}),sl=e.computed(()=>{const t=Z.value,o=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof o=="number"&&o>=0&&o<=1?o:.45;return vt.value*l}),ta=e.computed(()=>{const t=Z.value,o=typeof V.innerSize=="number"?V.innerSize:t?.innerSize;return typeof o!="number"||o<=-100||!(Cl.value||gl.value)?1:1+o/100}),Lo=e.computed(()=>{const t=ta.value;if(t===1||t<=0)return;const o=Lt.value,l=Ct.value;return`translate(${o}, ${l}) scale(${t}) translate(${-o}, ${-l})`}),Gn=e.ref(0),zn=e.computed(()=>`semi-radial-fill-clip-${V.chartId}`),xl=e.computed(()=>ge.value==="semi-radial"),go=e.computed(()=>xl.value&&El.value&&!$n.value),tn=e.computed(()=>xl.value&&El.value&&!$n.value&&on.value==="fill"),yo=e.computed(()=>{const t=go.value?Gn.value:1,o=Lt.value,l=Ct.value,r=sl.value,m=vt.value,v=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;const b=o+m*Math.cos(v),q=l+m*Math.sin(v),_=o+m*Math.cos(C),I=l+m*Math.sin(C),M=o+r*Math.cos(C),G=l+r*Math.sin(C),Be=o+r*Math.cos(v),Oe=l+r*Math.sin(v),ve=t>.5?1:0;return`M ${o} ${l} L ${b} ${q} A ${m} ${m} 0 ${ve} 1 ${_} ${I} L ${M} ${G} A ${r} ${r} 0 ${ve} 1 ${Be} ${Oe} Z`}),To=e.computed(()=>{if(!(!xl.value||!go.value)&&!tn.value)return`url(#${zn.value})`}),Ao=t=>{if(!(!tn.value||t!==0))return`url(#${zn.value})`},yn=e.ref(0),a=e.computed(()=>`radial-reveal-clip-${V.chartId}`),n=e.computed(()=>ge.value==="radial"),s=e.computed(()=>{const t=n.value?yn.value:1,o=Lt.value,l=Ct.value,r=Math.max(vt.value*1.5,ye.value,Te.value);if(t<=0)return`M ${o} ${l} L ${o} ${l} Z`;if(t>=1){const M=o-r,G=o+r;return`M ${M} ${l} A ${r} ${r} 0 0 1 ${G} ${l} A ${r} ${r} 0 0 1 ${M} ${l} Z`}const m=-Math.PI/2,v=m+t*Math.PI*2,C=o+r*Math.cos(m),b=l+r*Math.sin(m),q=o+r*Math.cos(v),_=l+r*Math.sin(v),I=t>=.5?1:0;return`M ${o} ${l} L ${C} ${b} A ${r} ${r} 0 ${I} 1 ${q} ${_} Z`}),i=e.computed(()=>{if(To.value)return To.value;if(n.value)return`url(#${a.value})`});let c=null;const d=()=>{if(!go.value)return;Gn.value=0;const t=Dl.value,o=performance.now(),l=r=>{const m=r-o,v=Math.min(1,m/t);Gn.value=ua(Hl.value,v),v<1&&(c=requestAnimationFrame(l))};c=requestAnimationFrame(l)},u=e.computed(()=>Z.value?.bubbles?.minSize||8),p=e.computed(()=>Z.value?.bubbles?.maxSize||50),g=e.computed(()=>Z.value?.bubbles?.opacity||.7),k=(t,o)=>{const l=[15,20,25,18,22],r=l[t%l.length]||20,m=1+Math.sin(o*.5)*.2;return Math.max(5,r*m)},F=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.opacity="1")},P=t=>{const o=document.querySelector(`.dss-bubble-image-${t}`);o&&(o.style.display="none")},E=e.computed(()=>V.series),le=e.computed(()=>V.series.filter((t,o)=>!st.value.has(o))),J=t=>{if(!t)return"primary";const o=t.yAxis??t.axis??t.yAxisId;return o==="secondary"||o==="right"||o===1?"secondary":"primary"},Fe=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,we=t=>t?t.old===!0||t.comparison===!0||t.dotted===!0:!1,ct=e.computed(()=>{const o=Z.value?.spider?.comparison||{};return{fillOpacity:typeof o.fillOpacity=="number"?o.fillOpacity:0,strokeDasharray:o.strokeDasharray||"6,4",usePrimaryColor:o.usePrimaryColor!==!1,bubbleSize:typeof o.bubbleSize=="number"?o.bubbleSize:0}}),bl=(t,o)=>typeof t?.bubbles?.size=="number"?t.bubbles.size:typeof t?.bubbleSize=="number"?t.bubbleSize:o?ct.value.bubbleSize:te.value,pl=(t,o)=>we(t)&&ct.value.usePrimaryColor?Kt(0):Kt(o),Zt=(t,o)=>gl.value&&we(t)?pl(t,o):Kt(o),vl=e.computed(()=>le.value.filter(t=>J(t)==="primary")),fl=e.computed(()=>le.value.filter(t=>J(t)==="secondary")),Ut=e.computed(()=>!al.value&&!!ft.value&&fl.value.length>0),jl=(t,o=0)=>{const l=Number(t);return Number.isFinite(l)?l:o},kn=(t,o,l)=>{if(!Array.isArray(t))return[];const r=t.map((m,v)=>{const C=m&&typeof m=="object"&&!Array.isArray(m),b=jl(C?m.value:m,0);return b<=0?null:{key:`${l}-${v}-${C&&m.label||v}`,label:C?m.label||o?.name||`Segment ${v+1}`:o?.name||`Segment ${v+1}`,value:b,color:C?m.color||Kt(v):Kt(l),marker:C?m.marker:null,isRemainder:!1}}).filter(Boolean);return B.value==="asc"?r.sort((m,v)=>m.value-v.value):B.value==="desc"?r.sort((m,v)=>v.value-m.value):r},Cn=(t,o,l,r)=>{const m=t&&typeof t=="object"&&!Array.isArray(t),v=m?t.segments:Array.isArray(t)?t:[{label:l?.name,value:t,color:Kt(r)}],C=kn(v,l,r),b=C.reduce((M,G)=>M+G.value,0),q=jl(m?t.totalValue??t.total??l?.totalValue??l?.total:l?.totalValue??l?.total,w.value),_=Math.max(q,b,1);T.value&&_>b&&C.push({key:`${r}-${o}-remainder`,label:ie.value,value:_-b,color:re.value,marker:null,isRemainder:!0});const I=C.filter(M=>!M.isRemainder).reduce((M,G)=>!M||G.value>M.value?G:M,null);return{key:`${r}-${o}`,label:m?t.label||t.name||V.categories?.[o]||L("chart.fallback.item",{number:o+1}):V.categories?.[o]||L("chart.fallback.item",{number:o+1}),axisLabel:m?t.xLabel??t.label??t.name??V.categories?.[o]??L("chart.fallback.item",{number:o+1}):V.categories?.[o]||L("chart.fallback.item",{number:o+1}),yLabel:m?t.yLabel??null:null,totalValue:_,usedValue:b,segments:C,maxSegmentKey:I?.key||null,seriesName:l?.name||"",seriesIndex:r}},Qn=e.computed(()=>{if(!jt.value)return[];const t=[];return E.value.forEach((o,l)=>{st.value.has(l)||!Array.isArray(o?.data)||o.data.forEach(r=>{const m=Cn(r,t.length,o,l);m.segments.length>0&&t.push(m)})}),t}),Ml="auto",Do=(t,o,l,r=0,m=100)=>{let v=1/0,C=-1/0;if(t.forEach(_=>{_?.data?.length&&_.data.forEach(I=>{typeof I=="number"&&Number.isFinite(I)&&(v=Math.min(v,I),C=Math.max(C,I))})}),v===1/0)return{minY:r,maxY:m};let b;if(o===Ml){const _=C-v,I=_>0?_*.1:1;b=Math.max(0,v-I)}else if(typeof o=="number")b=o;else{const _=C-v,I=_>0?_*.1:1;b=Math.max(0,v-I)}let q;if(l===Ml){const _=C-v,I=_>0?_*.1:2;q=C+I}else if(typeof l=="number")q=l;else{const _=C-v,I=_>0?_*.1:2;q=C+I}return{minY:b,maxY:q}},Wt=e.computed(()=>{if(el.value)return to();if(jt.value)return va();if(!le.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;le.value.forEach(l=>{l.data&&l.data.length&&(t=Math.max(t,l.data.length-1))}),V.categories.length>0&&(t=Math.max(t,V.categories.length-1));const o=Do(vl.value.length?vl.value:le.value,it.value,At.value);return{minX:0,maxX:t,minY:o.minY,maxY:o.maxY}}),va=()=>{const t=Qn.value,o=t.reduce((v,C)=>Math.max(v,C.totalValue),w.value),l=typeof it.value=="number"?it.value:0,r=typeof At.value=="number"?At.value:o,m=Math.max(r,l+1);return{minX:0,maxX:Math.max(t.length-1,0),minY:l,maxY:m}},ko=e.computed(()=>Ut.value?Do(fl.value,ht.value,il.value,Wt.value.minY,Wt.value.maxY):{minY:Wt.value.minY,maxY:Wt.value.maxY}),to=()=>{if(!le.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,o=-1/0,l=1/0,r=-1/0,m=1/0,v=-1/0,C=!1;if(le.value.forEach((Be,Oe)=>{Be?.data?.length&&Be.data.forEach((ve,xe)=>{let Ee,de,Xe;if(typeof ve=="object"&&ve!==null&&!Array.isArray(ve))Ee=typeof ve.x=="number"?ve.x:xe,de=typeof ve.y=="number"?ve.y:0,Xe=typeof ve.size=="number"?ve.size:20;else if(Array.isArray(ve)&&ve.length>=3)Ee=typeof ve[0]=="number"?ve[0]:xe,de=typeof ve[1]=="number"?ve[1]:0,Xe=typeof ve[2]=="number"?ve[2]:20;else if(typeof ve=="number")Ee=xe,de=ve,Xe=k(Oe,xe);else return;isFinite(Ee)&&isFinite(de)&&isFinite(Xe)&&(t=Math.min(t,Ee),o=Math.max(o,Ee),l=Math.min(l,de),r=Math.max(r,de),m=Math.min(m,Xe),v=Math.max(v,Xe),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===o&&(t=Math.min(t,0),o=Math.max(o,V.categories?.length-1||8)),l===r&&(l=Math.max(0,l-10),r=l+20);const b=o-t,q=r-l;let _,I,M,G;return St.value!==null?_=St.value:_=t-b*.1,Dt.value!==null?I=Dt.value:I=o+b*.1,it.value!==null&&typeof it.value=="number"?M=it.value:M=Math.max(0,l-q*.1),At.value!==null&&typeof At.value=="number"?G=At.value:G=r+q*.1,{minX:_,maxX:I,minY:M,maxY:G,minSize:m,maxSize:v}},tl=t=>{if(el.value){const{minX:b,maxX:q}=Wt.value,_=q-b||1;return z.value.left+(t-b)/_*z.value.width}const{minX:o,maxX:l}=Wt.value,r=l-o;if(l===0||r===0)return z.value.left+z.value.width/2;const m=r/U.value.scale,v=o-U.value.offsetX/z.value.width*r,C=(t-v)/m;return z.value.left+C*z.value.width},Vl=t=>{const{minY:o,maxY:l}=Wt.value,r=l-o||1;return z.value.bottom-(t-o)/r*z.value.height},ln=t=>{const{minY:o,maxY:l}=ko.value,r=l-o||1;return z.value.bottom-(t-o)/r*z.value.height},rl=(t,o)=>Ut.value&&J(t)==="secondary"?ln(o):Vl(o),fa=t=>{if(!el.value)return te.value||4;const{maxSize:o}=Wt.value,l=Math.max(1,o),r=Math.min(1,Math.max(0,t/l));return u.value+r*(p.value-u.value)},lo=(t,o=12,l="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(o*.62);lo.canvas||(lo.canvas=document.createElement("canvas"));const r=lo.canvas.getContext("2d");return r?(r.font=`${o}px ${l}`,r.measureText(t).width):t.length*(o*.62)},ha=(t,o,l=12)=>{if(typeof t!="string"||typeof o!="number"||o<=0||lo(t,l)<=o)return t;const r="..";if(lo(r,l)>=o)return r;let v=t.length;for(;v>0;){const C=`${t.slice(0,v)}${r}`;if(lo(C,l)<=o)return C;v-=1}return r},Ia=e.computed(()=>na.value.map(t=>({y:t.y}))),ga=e.computed(()=>!jt.value||!yt.value?[]:na.value.map(t=>({y:t.y}))),la=e.computed(()=>{if(el.value)return za();if(jt.value)return[];if(ge.value==="bar"){if(al.value){const Me=[],{minY:Re,maxY:_t}=Wt.value,zt=5,Kl=_t-Re||1;for(let yl=0;yl<=zt;yl++){const Gl=Re+Kl*(yl/zt),zo=cn(Gl);Me.push({x:zo,y:z.value.bottom+20,text:Bt(Math.round(Gl))})}return Me}const xe=[],{maxX:Ee}=Wt.value,de=Ee+1,Xe=5,Le=(z.value.width-Xe*2)/de;for(let Me=0;Me<=Ee;Me++){const Re=z.value.left+Xe+(Me+.5)*Le;xe.push({x:Re,y:z.value.bottom+20,text:ha(V.categories[Me]||L("chart.fallback.item",{number:Me+1}),Math.max(Le-8,24))})}return xe}const t=[],{minX:o,maxX:l}=Wt.value,r=St.value!==null?St.value:o,m=Dt.value!==null?Dt.value:l,v=m-r||1,C=v/U.value.scale,b=r-U.value.offsetX/z.value.width*v,q=b+C,_=Math.max(0,Math.floor(b-2)),I=Math.min(m,Math.ceil(q+2)),M=I-_,G=z.value.width,Oe=Math.floor(G/60);let ve=1;M>Oe&&(ve=Math.ceil(M/Oe));for(let xe=_;xe<=I;xe+=ve)if(xe>=0&&xe<=m){const Ee=tl(xe);Ee>=z.value.left-100&&Ee<=z.value.right+100&&t.push({x:Ee,y:z.value.bottom+20,text:V.categories[xe]||`Item ${xe+1}`})}return t}),za=()=>{const t=[],{minX:o,maxX:l}=Wt.value,r=l-o||1,m=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let v=0;v<=m;v++){const C=o+r*v/m,b=tl(C);if(b>=z.value.left-10&&b<=z.value.right+10){const q=Math.round(C),_=V.categories?.[q];t.push({x:b,y:z.value.bottom+20,text:_||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},na=e.computed(()=>{if(al.value){const m=[],{maxX:v}=Wt.value;for(let C=0;C<=v;C++)m.push({x:z.value.left-10,y:Mn(C),text:ha(V.categories[C]||`Item ${C+1}`,Math.max(z.value.left-28,40))});return m}const t=[],{minY:o,maxY:l}=Wt.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:z.value.left-10,y:Vl(v),text:Bt(C)})}return t}),Pa=e.computed(()=>{if(!Ut.value||al.value)return[];const t=[],{minY:o,maxY:l}=ko.value,r=5;for(let m=0;m<=r;m++){const v=o+(l-o)*(m/r),C=Math.round(v);t.push({x:z.value.right+10,y:ln(v),text:Bt(C)})}return t}),Kt=t=>{const o=pt.value;if(!o||o.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return o[t%o.length]},Oa=t=>{if(!t||typeof t!="string")return"#3a3a3a";const o=t.trim();let l=0,r=0,m=0;const v=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(v)l=Number(v[1])/255,r=Number(v[2])/255,m=Number(v[3])/255;else{const b=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(b)l=Number(b[1])/255,r=Number(b[2])/255,m=Number(b[3])/255;else{const q=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(q){let _=q[1];_.length===3&&(_=_[0]+_[0]+_[1]+_[1]+_[2]+_[2]),l=parseInt(_.slice(0,2),16)/255,r=parseInt(_.slice(2,4),16)/255,m=parseInt(_.slice(4,6),16)/255}else if(typeof document<"u"){const _=document.createElement("span");_.style.color=o,_.style.display="none",document.body.appendChild(_);const I=getComputedStyle(_).color;document.body.removeChild(_);const M=I.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)l=Number(M[1])/255,r=Number(M[2])/255,m=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*r+.0722*m>.5?"#3a3a3a":"#fafafa"},oa=t=>{if(!t||typeof t!="string")return t;const o=t.trim(),l=o.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const v=Math.max(0,Math.floor(Number(l[1])*.65)),C=Math.max(0,Math.floor(Number(l[2])*.65)),b=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${v}, ${C}, ${b})`}const r=o.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(r){const v=Math.max(0,Math.floor(Number(r[1])*.65)),C=Math.max(0,Math.floor(Number(r[2])*.65)),b=Math.max(0,Math.floor(Number(r[3])*.65));return`rgba(${v}, ${C}, ${b}, ${r[4]})`}const m=o.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(m){let v=m[1];v.length===3&&(v=v[0]+v[0]+v[1]+v[1]+v[2]+v[2]);const C=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(0,2),16)*.65))),b=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(2,4),16)*.65))),q=Math.max(0,Math.min(255,Math.floor(parseInt(v.slice(4,6),16)*.65)));return`#${[C,b,q].map(_=>_.toString(16).padStart(2,"0")).join("")}`}return o},aa=(t,o)=>{const r=Z.value?.stroke?.color;return r==null?oa(o):typeof r=="string"?r:Array.isArray(r)&&r.length?r[t%r.length]??oa(o):oa(o)},sa=t=>{let o=0;for(let l=1;l<t.length;l++){const r=t[l].x-t[l-1].x,m=t[l].y-t[l-1].y;o+=Math.sqrt(r*r+m*m)}return o},ya=e.computed(()=>ge.value==="line"||Pl.value?(Pl.value?V.series.filter(o=>(o.type||ge.value)==="line"):E.value).map((o,l)=>{const r=V.series.findIndex(M=>M===o),m=[];let v=[];o.data.forEach((M,G)=>{M==null?v.length>0&&(m.push([...v]),v=[]):v.push({x:al.value?cn(M):tl(G),y:al.value?Mn(G):rl(o,M),index:G})}),v.length>0&&m.push(v);let C="";m.forEach(M=>{if(M.length>0){let G="";We.value?G=ho(M):G=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(Be=>` L ${Be.x} ${Be.y}`).join(""),C+=(C?" ":"")+G}});const b=m.reduce((M,G)=>M+sa(G),0),q=st.value.has(r),_=Ne.value===r,I=Ne.value!==null&&Ne.value!==r;return{path:C,color:Kt(r),strokeDasharray:Fe(o),pathLength:b,seriesIndex:r,animationDelay:l*ul.value,isHighlighted:_,isDimmed:I,isHidden:q}}):[]),ka=e.computed(()=>{if(!(ge.value==="line"||Pl.value))return[];const t=Pl.value?V.series.filter(l=>(l.type||ge.value)==="line"):E.value,o=[];return t.forEach((l,r)=>{const m=V.series.findIndex(v=>v===l);for(let v=0;v<l.data.length-1;v++){const C=l.data[v];if(C!=null){let b=-1,q=0;for(let _=v+1;_<l.data.length;_++){const I=l.data[_];if(I==null)q++;else{b=_;break}}if(q>0&&b!==-1){const _=l.data[b],I=al.value?cn(C):tl(v),M=al.value?Mn(v):rl(l,C),G=al.value?cn(_):tl(b),Be=al.value?Mn(b):rl(l,_),Oe=st.value.has(m),ve=Ne.value===m,xe=Ne.value!==null&&Ne.value!==m;o.push({path:`M ${I} ${M} L ${G} ${Be}`,color:Kt(m),seriesIndex:m,animationDelay:r*ul.value,isHighlighted:ve,isDimmed:xe,isHidden:Oe,gapSize:q}),v=b-1}}}}),o}),Wa=e.computed(()=>ge.value==="line"||Pl.value?!El.value||$n.value||Rt.value.hasAnimated?[]:(Pl.value?V.series.filter(o=>(o.type||ge.value)==="line"):E.value).map((o,l)=>{const r=V.series.findIndex(q=>q===o);let m="",v=null;o.data.forEach((q,_)=>{if(q!=null){const I={x:al.value?cn(q):tl(_),y:al.value?Mn(_):rl(o,q)};v===null?m+=`M ${I.x} ${I.y}`:m+=` L ${I.x} ${I.y}`,v=I}else if(v!==null){const I=o.data.findIndex((M,G)=>G>_&&M!==null&&M!==void 0);if(I!==-1){const M={x:al.value?cn(o.data[I]):tl(I),y:al.value?Mn(I):rl(o,o.data[I])};m+=` L ${M.x} ${M.y}`,v=M}}});const C=o.data.map((q,_)=>q==null?null:{x:al.value?cn(q):tl(_),y:al.value?Mn(_):rl(o,q)}).filter(q=>q!==null),b=sa(C);return{path:m,pathLength:b,color:Kt(r),strokeDasharray:Fe(o),animationDelay:l*ul.value,seriesIndex:r}}):[]),qa=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return E.value.forEach((o,l)=>{const r=Ne.value===l,m=Ne.value!==null&&Ne.value!==l,v=st.value.has(l);o.data.forEach((C,b)=>{C!=null&&t.push({x:tl(b),y:rl(o,C),color:Kt(l),value:C,label:V.categories[b]||b.toString(),seriesName:o.name,categoryIndex:b,dataIndex:b,animationDelay:(l*o.data.length+b)*(ul.value/8),isHighlighted:r,isDimmed:m,isHidden:v})})}),t}),Za=e.computed(()=>{if(!Pl.value)return[];const t=[];return V.series.filter(l=>(l.type||ge.value)==="line").forEach((l,r)=>{const m=V.series.findIndex(q=>q===l),v=Ne.value===m,C=Ne.value!==null&&Ne.value!==m,b=st.value.has(m);l.data.forEach((q,_)=>{q!=null&&t.push({x:tl(_),y:rl(l,q),color:Kt(m),value:q,label:V.categories[_]||_.toString(),seriesName:l.name,categoryIndex:_,dataIndex:_,animationDelay:(r*l.data.length+_)*(ul.value/8),isHighlighted:v,isDimmed:C,isHidden:b})})}),t}),Ho=e.computed(()=>{if(!el.value)return[];const t=[];return E.value.forEach((o,l)=>{if(!o?.data?.length)return;const r=Ne.value,m=r!==null&&r===l,v=r!==null&&r!==l,C=st.value.has(l);o.data.forEach((b,q)=>{let _,I,M,G,Be;if(typeof b=="object"&&b!==null&&!Array.isArray(b))_=typeof b.x=="number"?b.x:q,I=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,G=b.label||V.categories?.[q]||`Point ${q+1}`,Be=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)_=typeof b[0]=="number"?b[0]:q,I=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,G=b[3]||V.categories?.[q]||`Point ${q+1}`,Be=b[4];else if(typeof b=="number")_=q,I=b,M=k(l,q),G=V.categories?.[q]||`Point ${q+1}`;else return;!isFinite(_)||!isFinite(I)||!isFinite(M)||t.push({x:tl(_),y:Vl(I),radius:fa(M),originalX:_,originalY:I,originalSize:M,color:Kt(l),seriesName:o.name||`Series ${l+1}`,label:G,imageUrl:Be,seriesIndex:l,dataIndex:q,categoryIndex:Math.round(_),isHighlighted:m,isDimmed:v,isHidden:C,opacity:g.value})})}),t}),ra=e.computed(()=>ge.value!=="area"?[]:E.value.map((t,o)=>{const l=[];let r=[];if(t.data.forEach((M,G)=>{M==null?r.length>0&&(l.push([...r]),r=[]):r.push({x:tl(G),y:rl(t,M),index:G})}),r.length>0&&l.push(r),l.length===0)return{linePath:"",areaPath:"",color:Kt(o),isHidden:st.value.has(o)};const m=z.value.bottom+1;let v="",C="";l.forEach((M,G)=>{if(M.length===0)return;let Be=`M ${M[0].x} ${M[0].y}`;We.value&&M.length>1?Be=ho(M):M.slice(1).forEach(ve=>{Be+=` L ${ve.x} ${ve.y}`}),v+=(v?" ":"")+Be;let Oe=`M ${M[0].x} ${m}`;if(Oe+=` L ${M[0].x} ${M[0].y}`,We.value&&M.length>1){const ve=ho(M),xe=ve.substring(ve.indexOf("C")||ve.indexOf("Q")||ve.indexOf("L"));xe?Oe+=" "+xe:M.slice(1).forEach(Ee=>{Oe+=` L ${Ee.x} ${Ee.y}`})}else M.slice(1).forEach(ve=>{Oe+=` L ${ve.x} ${ve.y}`});Oe+=` L ${M[M.length-1].x} ${m} Z`,C+=(C?" ":"")+Oe});const b=Ne.value===o,q=Ne.value!==null&&Ne.value!==o,_=st.value.has(o),I=l.reduce((M,G)=>M+sa(G),0);return{linePath:v,areaPath:C,color:Kt(o),pathLength:I,isHighlighted:b,isDimmed:q,isHidden:_}})),Ca=e.computed(()=>{if(!(["bar"].includes(ge.value)||Pl.value))return[];const t=[],{maxX:o}=Wt.value,l=Pl.value?V.series.filter(m=>(m.type||ge.value)==="bar"):E.value,r=l.length;if(al.value){const m=o+1,C=z.value.height/m,b=C*(2/3),q=Math.min(4,b/r*.15),_=b-(r-1)*q,I=Math.max(4,_/r);l.forEach((M,G)=>{const Be=V.series.findIndex(Ee=>Ee===M),Oe=Ne.value===Be,ve=Ne.value!==null&&Ne.value!==Be,xe=st.value.has(Be);M.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.top+(de+.5)*C-b/2+G*(I+q),Me=z.value.left,Re=Math.abs(cn(Ee)-z.value.left);let _t="";if(We.value&&Re>0){const zt=Math.min(Ot.value,I/2,Re/2);_t=[`M ${Me} ${Le}`,`L ${Me+Re-zt} ${Le}`,`Q ${Me+Re} ${Le} ${Me+Re} ${Le+zt}`,`L ${Me+Re} ${Le+I-zt}`,`Q ${Me+Re} ${Le+I} ${Me+Re-zt} ${Le+I}`,`L ${Me} ${Le+I}`,"Z"].join(" ")}t.push({x:Me,y:Le,width:Re,height:I,color:Kt(r===1?de:Be),value:Ee,label:V.categories[de]||de.toString(),seriesName:M.name,animationDelay:(G*l.length+de)*(ul.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:We.value&&Re>0})})})}else{const m=o+1,C=z.value.width/m,b=C*.8,q=b/r,_=q*.05,I=q-_;l.forEach((M,G)=>{const Be=V.series.findIndex(Ee=>Ee===M),Oe=Ne.value===Be,ve=Ne.value!==null&&Ne.value!==Be,xe=st.value.has(Be);M.data.forEach((Ee,de)=>{if(Ee==null||typeof Ee!="number"||!isFinite(Ee))return;const Le=z.value.left+(de+.5)*C-b/2+G*q+_/2,Me=Vl(Math.max(0,Ee)),Re=Math.abs(Vl(0)-Vl(Ee));let _t="";if(We.value&&Re>0){const zt=Math.min(Ot.value,I/2,Re/2);_t=[`M ${Le} ${Me+Re}`,`L ${Le} ${Me+zt}`,`Q ${Le} ${Me} ${Le+zt} ${Me}`,`L ${Le+I-zt} ${Me}`,`Q ${Le+I} ${Me} ${Le+I} ${Me+zt}`,`L ${Le+I} ${Me+Re}`,"Z"].join(" ")}t.push({x:Le,y:Me,width:I,height:Re,color:Kt(r===1?de:Be),value:Ee,label:V.categories[de]||de.toString(),seriesName:M.name,animationDelay:(G*l.length+de)*(ul.value/4),isHighlighted:Oe,isDimmed:ve,isHidden:xe,barPath:_t,isSmooth:We.value&&Re>0})})})}return t}),_n=e.computed(()=>{if(!Cl.value)return[];const t=E.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!st.value.has(C));if(t.length===0)return[];let o=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const l=ge.value==="semi-radial"?Math.PI:Math.PI*2,r=[],m=(C,b,q,_,I,M)=>{const G=C+(b-C)/2,Be=b-C,Oe=Lt.value+Math.cos(C)*sl.value,ve=Ct.value+Math.sin(C)*sl.value,xe=Lt.value+Math.cos(b)*sl.value,Ee=Ct.value+Math.sin(b)*sl.value,de=Lt.value+Math.cos(b)*vt.value,Xe=Ct.value+Math.sin(b)*vt.value,Ie=Lt.value+Math.cos(C)*vt.value,Le=Ct.value+Math.sin(C)*vt.value,Me=Be>Math.PI?1:0,Re=[`M ${Oe} ${ve}`,`A ${sl.value} ${sl.value} 0 ${Me} 1 ${xe} ${Ee}`,`L ${de} ${Xe}`,`A ${vt.value} ${vt.value} 0 ${Me} 0 ${Ie} ${Le}`,"Z"].join(" "),_t=M||Kt(q);return{path:Re,color:_t,strokeWidth:qt.value,strokeColor:aa(r.length,_t),value:I,seriesName:_,opacity:.8,isHighlighted:Ne.value===q,isDimmed:Ne.value!==null&&Ne.value!==q,isHidden:!1,startAngle:C,endAngle:b,midAngle:G}};if(Kn.value){const{series:C,originalIndex:b}=t[0],q=Number(C?.data?.[0]??0),_=Number.isFinite(q)?Math.min(Math.max(q,0),100):0,I=Z.value,M=Math.min(Math.max(Number(I?.miniRadial?.minVisiblePercent??1),0),100),Be=(_<=0?M:_)/100*l,Oe=Number(I?.miniRadial?.thresholds?.low??33),ve=Number(I?.miniRadial?.thresholds?.medium??66),xe=I?.miniRadial?.colors?.low||"#E53E3E",Ee=I?.miniRadial?.colors?.medium||"#ED8936",de=I?.miniRadial?.colors?.high||"#38A169",Xe=_<=Oe?xe:_<=ve?Ee:de,Ie=I?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return r.push(m(o,o+l-.001,b+1,"Track",100,Ie)),r.push(m(o,o+Be,b,Le,_,Xe)),r}if(t.length===1){const{series:C,originalIndex:b}=t[0],q=C.data[0]||0,_=o,I=o+l-.001,M=_+l/2,G=Lt.value+Math.cos(_)*sl.value,Be=Ct.value+Math.sin(_)*sl.value,Oe=Lt.value+Math.cos(I)*sl.value,ve=Ct.value+Math.sin(I)*sl.value,xe=Lt.value+Math.cos(I)*vt.value,Ee=Ct.value+Math.sin(I)*vt.value,de=Lt.value+Math.cos(_)*vt.value,Xe=Ct.value+Math.sin(_)*vt.value,Ie=1,Le=[`M ${G} ${Be}`,`A ${sl.value} ${sl.value} 0 ${Ie} 1 ${Oe} ${ve}`,`L ${xe} ${Ee}`,`A ${vt.value} ${vt.value} 0 ${Ie} 0 ${de} ${Xe}`,"Z"].join(" "),Me=Kt(b);return r.push({path:Le,color:Me,strokeWidth:qt.value,strokeColor:aa(0,Me),value:q,seriesName:C.name,opacity:.8,isHighlighted:Ne.value===b,isDimmed:!1,isHidden:!1,startAngle:_,endAngle:I,midAngle:M}),r}if(tn.value&&t.length===2){const C=t[0],b=t[1],q=Math.min(100,Math.max(0,C.series.data[0]||0)),_=q/100*l;return r.push(m(o,o+_,C.originalIndex,C.series.name,q)),r.push(m(o,o+l,b.originalIndex,b.series.name,100)),r}const v=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return v===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const q=C.data[0]||0,_=q/v*l,I=o,M=o+_,G=I+_/2,Be=Lt.value+Math.cos(I)*sl.value,Oe=Ct.value+Math.sin(I)*sl.value,ve=Lt.value+Math.cos(M)*sl.value,xe=Ct.value+Math.sin(M)*sl.value,Ee=Lt.value+Math.cos(M)*vt.value,de=Ct.value+Math.sin(M)*vt.value,Xe=Lt.value+Math.cos(I)*vt.value,Ie=Ct.value+Math.sin(I)*vt.value,Le=_>Math.PI?1:0,Me=[`M ${Be} ${Oe}`,`A ${sl.value} ${sl.value} 0 ${Le} 1 ${ve} ${xe}`,`L ${Ee} ${de}`,`A ${vt.value} ${vt.value} 0 ${Le} 0 ${Xe} ${Ie}`,"Z"].join(" "),Re=Kt(b);r.push({path:Me,color:Re,strokeWidth:qt.value,strokeColor:aa(r.length,Re),value:q,seriesName:C.name,opacity:.8,isHighlighted:Ne.value===b,isDimmed:Ne.value!==null&&Ne.value!==b,isHidden:!1,startAngle:I,endAngle:M,midAngle:G}),o=M}),r)}),Ua=e.computed(()=>{const t=_n.value;return tn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((o,l)=>({segment:o,originalIndex:l}))}),Xa=e.computed(()=>{if(!Dn.value||!Cl.value)return[];const t=Fl.value,o=Xt.value,l=Zn.value,r=nl.value,m=15,v=t*1.3,C=.55,b=(M,G)=>{const Be=Lt.value+Math.cos(M.midAngle)*vt.value,Oe=Ct.value+Math.sin(M.midAngle)*vt.value,ve=Lt.value+Math.cos(M.midAngle)*(vt.value+o),xe=Ct.value+Math.sin(M.midAngle)*(vt.value+o),de=ve+l*(G?1:-1),Xe=G?ve+m:ve-m,Ie=xe-r,Le=`${M.seriesName}: ${Bt(M.value)}`,Me=Le.length*t*C;return{pointerStartX:Be,pointerStartY:Oe,pointerEndX:ve,pointerEndY:xe,horizontalEndX:de,horizontalEndY:xe,textX:Xe,textY:Ie,text:Le,textWidth:Me,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ve-Be,xe-Oe),horizontalLineLength:Math.hypot(de-ve,0)}},q=(M,G)=>{const Be=Math.abs(M.textY-G.textY)<v,Oe=M.isRightSide?M.textX:M.textX-M.textWidth,ve=M.isRightSide?M.textX+M.textWidth:M.textX,xe=G.isRightSide?G.textX:G.textX-G.textWidth,Ee=G.isRightSide?G.textX+G.textWidth:G.textX,de=Oe<Ee&&xe<ve;return Be&&de},_=_n.value.filter(M=>!M.isHidden),I=[];for(let M=0;M<_.length;M++){const G=_[M];let Be=Math.cos(G.midAngle)>=0;if(M>0){const ve=I[M-1],xe=b(G,Be);q(ve,xe)&&(Be=!Be)}const Oe=b(G,Be);I.push({...Oe,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return I}),Ya=t=>{if(!t||t.isHidden)return 0;const o=t.opacity||g.value||.7;return Ne.value===null||Ne.value===void 0?o:Ne.value!==null?t.seriesIndex===Ne.value?Math.min(1,o+.1):Math.max(.5,o*.8):o},ja=t=>{if(!t||t.isHidden)return 0;const o=t.radius>20?.9:.8;return Ne.value!==null?t.seriesIndex===Ne.value?Math.min(1,o+.1):o*.7:o},ba=(t,o)=>{if(t)try{if(Ne.value===t.seriesIndex?Ne.value=null:Ne.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:o,chartId:V.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},Ka=(t,o)=>{const l=[`dss-bubble-fallback-${o}`];return t.isHighlighted&&l.push("dss-bubble-highlighted"),t.isDimmed&&l.push("dss-bubble-dimmed"),t.isHidden&&l.push("dss-bubble-hidden"),l.push(`dss-bubble-series-${t.seriesIndex}`),l.join(" ")},wa=(t,o)=>{if(!t||(o.stopPropagation(),Fo.value=!0,Ne.value=t.seriesIndex,$.value.show=!1,!Ce.value))return;const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120;m+C>ye.value&&(m=o.clientX-r.left-C-10),v+b>r.height&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);const q=Sl.value,_=Jl.value,I=q.map(M=>{const G=_[M]||M,Be=xa(M,t);return Be?{seriesName:t.seriesName,label:t.label,value:`${G}: ${Be}`,color:t.color}:null}).filter(Boolean);h.value={show:!0,x:m,y:v,title:t.label||t.seriesName||"",value:"",bubbleData:I,categoryIndex:void 0,spiderAreas:[]}},xa=(t,o)=>{let l;switch(t){case"x":l=o.originalX;break;case"y":l=o.originalY;break;case"size":l=o.originalSize;break;case"label":l=o.label;break;case"seriesName":l=o.seriesName;break;default:l=o[t]||""}const r=Xl.value[t];if(typeof r=="function")return r(l,o);if(typeof l=="number"){const m=l.toFixed(1);return ll.value?m+ll.value:m}return l?.toString()||""},Ga=()=>{if(!el.value||!$.value.data||$.value.data.length===0)return"Bubbles";const t=[],o=new Set;return $.value.data.forEach(l=>{if(l.seriesName&&l.label){const r=`${l.seriesName} - ${l.label}`;o.has(r)||(t.push(r),o.add(r))}else l.seriesName&&(o.has(l.seriesName)||(t.push(l.seriesName),o.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},Ea=(t,o)=>{t&&(Fo.value=!1,Ne.value=null,h.value.show=!1,h.value.bubbleData=[])},Qa=(t,o)=>{const l=o.target.closest(".dss-custom-chart-container");if(!l)return;const r=l.getBoundingClientRect(),m=Ko(t.categoryIndex),v=t.description||t.comment||"";let C=o.clientX-r.left+15,b=o.clientY-r.top-10;const q=200,_=v?80:50;C+q>ye.value&&(C=o.clientX-r.left-q-15),b+_>Te.value&&(b=o.clientY-r.top-_-10),C<0&&(C=10),b<0&&(b=10),x.value={show:!0,x:C,y:b,categoryValue:m,description:v}},Ja=()=>{x.value.show=!1},no=e.computed(()=>V.categories.length||Math.max(...le.value.map(t=>t.data.length))),es=e.computed(()=>{let t=0;return le.value.forEach(o=>{o.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Sa=e.computed(()=>{const t=[],o=no.value;for(let l=0;l<o;l++){const r=l*2*Math.PI/o-Math.PI/2,m=Lt.value+Math.cos(r)*vt.value,v=Ct.value+Math.sin(r)*vt.value;t.push({x:m,y:v,angle:r,index:l})}return t}),ts=e.computed(()=>{const t=[],o=no.value;return Sa.value.forEach((l,r)=>{const m=vt.value+15,v=r*2*Math.PI/o-Math.PI/2,C=Lt.value+Math.cos(v)*m,b=Ct.value+Math.sin(v)*m+5;let q="middle",_="middle";Math.abs(Math.cos(v))>.5&&(q=Math.cos(v)>0?"start":"end"),Math.abs(Math.sin(v))>.5&&(_=Math.sin(v)>0?"hanging":"auto"),t.push({x:C,y:b,text:V.categories[r]||`Axis ${r+1}`,anchor:q,baseline:_})}),t}),ls=e.ref(new Set),ns=(t,o,l)=>{const r=`current-${l}`,m=ls.value.has(r),v=o.fillOpacity??W.value;return!m&&Ne.value===null?v:o.isHighlighted||m?o.isComparison?v:v+.15:o.isDimmed?v*.3:v},Va=e.computed(()=>{if(!gl.value)return[];const t=[],o=no.value;return E.value.map((r,m)=>({series:r,seriesIndex:m})).sort((r,m)=>{const v=we(r.series)?0:1,C=we(m.series)?0:1;return v-C}).forEach(({series:r,seriesIndex:m})=>{const v=we(r),C=[],b=[],q=[],_=Ne.value===m,I=Ne.value!==null&&Ne.value!==m,M=st.value.has(m);for(let G=0;G<o;G++){const Be=r.data[G]||0,ve=Be/es.value*vt.value,xe=G*2*Math.PI/o-Math.PI/2,Ee=Lt.value+Math.cos(xe)*ve,de=Ct.value+Math.sin(xe)*ve;C.push(`${Ee},${de}`),b.push({x:Ee,y:de}),q.push({x:Ee,y:de,value:Be,label:V.categories[G]||`Axis ${G+1}`,seriesName:r.name})}t.push({points:C.join(" "),polygonPoints:b,dataPoints:q,color:pl(r,m),fillOpacity:v?ct.value.fillOpacity:W.value,strokeDasharray:v?Fe(r)||ct.value.strokeDasharray:null,pointRadius:bl(r,v),seriesName:r.name,value:`${r.name}: ${r.data.join(", ")}`,isHighlighted:_,isDimmed:I,isHidden:M,isComparison:v,seriesIndex:m})}),t}),os=(t,o)=>{if(!o||o.length<3)return!1;let l=!1;for(let r=0,m=o.length-1;r<o.length;m=r++){const v=o[r].x,C=o[r].y,b=o[m].x,q=o[m].y;C>t.y!=q>t.y&&t.x<(b-v)*(t.y-C)/(q-C)+v&&(l=!l)}return l},as=t=>{if(!gl.value)return;const o=t.currentTarget.closest(".dss-custom-chart-container");if(!o)return;const l=o.getBoundingClientRect(),r=me.value?.getBoundingClientRect();if(!r)return;const m=t.clientX-r.left,v=t.clientY-r.top,C=Va.value.filter(b=>b.isHidden?!1:os({x:m,y:v},b.polygonPoints));if(C.length>0){C.length,Ne.value=C[0].seriesIndex;const b=t.clientX-l.left+10,q=t.clientY-l.top-10,_=C.length>1?460:260,I=70+no.value*20;let M=b,G=q;M+_>ye.value&&(M=t.clientX-l.left-_-10),G+I>Te.value&&(G=t.clientY-l.top-I-10),M<0&&(M=10),G<0&&(G=10);const Be=C.map(Oe=>({seriesName:Oe.seriesName,color:Oe.color,points:Oe.dataPoints.map(ve=>({label:ve.label,value:Bt(ve.value)}))}));h.value={show:!0,x:M,y:G,title:"",value:"",bubbleData:[],spiderAreas:Be}}else bn()},Ro=e.computed(()=>{const t=Z.value;return t.logos.map((o,l)=>{const r=V.series[o.seriesIndex];if(!r||!r.data||r.data.length===0||st.value.has(o.seriesIndex))return null;let m,v;if(kl.value){let b=-1,q=null;for(let I=r.data.length-1;I>=0;I--)if(r.data[I]!==null&&r.data[I]!==void 0){b=I,q=r.data[I];break}if(b===-1||q===null)return null;const _=r.data.map((I,M)=>I==null?null:{x:tl(M),y:rl(r,I),index:M}).filter(I=>I!==null);if(t.animations.enabled&&!$n.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Rt.value.isAnimating||!Rt.value.hasAnimated))if(Rt.value.isAnimating){const I=Rt.value.currentFrame/Rt.value.totalFrames,M=ua(t.animations.easing,Math.min(I,1)),G=vs(_,M);m=G.x+(o.offsetX||0),v=G.y+(o.offsetY||0)}else m=_[0].x+(o.offsetX||0),v=_[0].y+(o.offsetY||0);else m=tl(b)+(o.offsetX||0),v=Vl(q)+(o.offsetY||0)}else if(Cl.value||gl.value){const b=Math.PI*2/t.logos.length*l;m=Lt.value+Math.cos(b)*(vt.value+30)+(o.offsetX||0),v=Ct.value+Math.sin(b)*(vt.value+30)+(o.offsetY||0)}return{...o,x:m,y:v,seriesIndex:o.seriesIndex}}).filter(Boolean)}),ss=t=>{const o=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.opacity="0"),l&&(l.style.opacity="1")},rs=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const o=document.querySelector(`.dss-logo-image-${t}`);o&&(o.style.display="none")},ia=t=>{st.value.has(t)?st.value.delete(t):st.value.add(t)},is=e.computed(()=>{if(!h.value.show&&!(je.value&&$.value.show&&!U.value.isZooming))return{display:"none"};let t,o;if(je.value&&$.value.show&&!U.value.isZooming){t=$.value.x+15,o=z.value.top;const l=el.value?200:150;t+l>ye.value&&(t=$.value.x-l-15),t<0&&(t=10),o<10&&(o=10)}else t=h.value.x,o=h.value.y;return{left:t+"px",top:o+"px"}}),Pn=(t,o)=>{if(!Ce.value||Co.value)return;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+10,v=o.clientY-r.top-10;const C=200,b=120,q=ye.value,_=Te.value;m+C>q&&(m=o.clientX-r.left-C-10),v+b>_&&(v=o.clientY-r.top-b-10),m<0&&(m=10),v<0&&(v=10);let I;typeof t.categoryIndex=="number"?I=t.categoryIndex:typeof t.dataIndex=="number"?I=t.dataIndex:t.label&&V.categories.includes(t.label)&&(I=V.categories.indexOf(t.label));let M=t.seriesName||t.label||"";(al.value||ge.value==="bar")&&t.label&&(M=t.label),t.tooltipTitle&&(M=t.tooltipTitle),h.value={show:!0,x:m,y:v,title:M,value:Bt(t.value)||"",categoryIndex:I,spiderAreas:[]}},ca=e.ref(!1),Fo=e.ref(!1),bn=()=>{h.value.show=!1,h.value.spiderAreas=[],h.value.bubbleData=[],$.value.show=!1,ca.value||(Ne.value=null)},Co=e.ref(!1),bo=(t,o)=>{Co.value=!0,h.value.show=!1,$.value.show=!1;const r=o.target.closest(".dss-custom-chart-container").getBoundingClientRect();let m=o.clientX-r.left+15,v=o.clientY-r.top-10;const C=250;m+C>ye.value&&(m=o.clientX-r.left-C-15),m<0&&(m=10),v<0&&(v=10),Rn.value={show:!0,x:m,y:v,content:t.texts,count:t.totalCount}},wo=()=>{Co.value=!1,Rn.value.show=!1},Rt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),ua=(t,o)=>{switch(t){case"linear":return o;case"ease":return o<.5?2*o*o:-1+(4-2*o)*o;case"ease-in":return o*o;case"ease-out":return o*(2-o);case"ease-in-out":return o<.5?2*o*o:-1+(4-2*o)*o;default:return o}},$n=e.computed(()=>R.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Na=()=>{if(!El.value||$n.value){Rt.value.hasAnimated=!0,n.value&&(yn.value=1);return}n.value&&(yn.value=0),Rt.value.isAnimating=!0,Rt.value.currentFrame=0,Rt.value.totalFrames=Math.ceil(Dl.value/16.67);const t=()=>{const o=Rt.value.currentFrame/Rt.value.totalFrames,l=ua(Hl.value,Math.min(o,1));cs(l),n.value&&(yn.value=l),o<1?(Rt.value.currentFrame++,Rt.value.animationId=requestAnimationFrame(t)):us()};Rt.value.animationId=requestAnimationFrame(t)},cs=t=>{const o=O.value;o&&o.style.setProperty("--dss-animation-progress",t)},us=()=>{Rt.value.isAnimating=!1,Rt.value.hasAnimated=!0,n.value&&(yn.value=1),Rt.value.animationId&&(cancelAnimationFrame(Rt.value.animationId),Rt.value.animationId=null)},da=e.computed(()=>!Cl.value||Rt.value.hasAnimated?!0:n.value?yn.value>=1:xl.value?Gn.value>=1:!0),Ba=e.computed(()=>Dn.value&&da.value),Io=e.ref(!1);e.watch(Ba,t=>{t?(Io.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Io.value=!0})})):Io.value=!1},{immediate:!0});const ds=e.computed(()=>{if(!El.value||$n.value||Rt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Dl.value}ms`,t["--dss-animation-easing"]=ms(Hl.value),t["--dss-stagger-delay"]=`${ul.value}ms`,t}),ms=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ps=()=>{if(!El.value||$n.value)return"";const t=["dss-chart-animated"];return Rt.value.hasAnimated||t.push(`dss-animate-${on.value}`),Rt.value.hasAnimated||(Cl.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):Cl.value||t.push(`dss-animate-${on.value}`)),Rt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>V.series,(t,o)=>{Tn.value&&o&&Rt.value.hasAnimated&&(Rt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Na(),Ol.value)}))},{deep:!0}),e.watch(()=>U.value.isZooming,(t,o)=>{o&&!t&&setTimeout(()=>{po()},50)}),e.watch(()=>[U.value.scale,U.value.offsetX],()=>{!U.value.isZooming&&!U.value.isDragging&&po()},{flush:"post"}),e.watch([Pe,Ke],([t,o])=>{U.value.minScale=t,U.value.maxScale=o,(U.value.scale<t||U.value.scale>o)&&Bn()},{immediate:!0}),e.watch(()=>V.locale,t=>{t&&t!==N.value&&(N.value=t)},{immediate:!0}),e.watch(()=>Y.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",fo)}):document.removeEventListener("click",fo)}),e.onMounted(()=>{Ne.value=null,n.value&&(!El.value||$n.value)&&(yn.value=1),hn(),O.value&&typeof ResizeObserver<"u"&&(be=new ResizeObserver(t=>{const o=t[0];!o||!o.contentRect||(he&&cancelAnimationFrame(he),he=requestAnimationFrame(()=>{he=null;const{width:l,height:r}=o.contentRect;ne.value=Math.round(l),f.value=Math.round(r),ot.value&&(Ue.value=ot.value.offsetHeight||oe)}))}),be.observe(O.value)),El.value&&!$n.value?ge.value==="semi-radial"?setTimeout(()=>d(),Ol.value):setTimeout(()=>Na(),Ol.value):(Rt.value.hasAnimated=!0,ge.value==="semi-radial"&&(Gn.value=1)),document.addEventListener("mousemove",Ma),document.addEventListener("mouseup",_a),document.addEventListener("click",Nn)}),e.onUnmounted(()=>{he&&cancelAnimationFrame(he),be&&O.value&&(be.unobserve(O.value),be.disconnect(),be=null),Rt.value.animationId&&cancelAnimationFrame(Rt.value.animationId),c&&(cancelAnimationFrame(c),c=null),U.value.zoomTimeout&&clearTimeout(U.value.zoomTimeout),document.removeEventListener("mousemove",Ma),document.removeEventListener("mouseup",_a),document.removeEventListener("click",Nn),document.removeEventListener("click",fo)});const Ma=t=>{if(U.value.isDragging&&U.value.scale>1&&kl.value){$.value.show=!1;const o=t.clientX-U.value.lastMouseX,{minX:l,maxX:r}=Wt.value,m=r-l||1,C=o*.8;U.value.offsetX+=C;const b=m/U.value.scale,q=m-b,_=0,I=-q/m*z.value.width,M=_;U.value.offsetX=Math.max(I,Math.min(M,U.value.offsetX)),U.value.lastMouseX=t.clientX,U.value.lastMouseY=t.clientY}},_a=()=>{U.value.isDragging&&(U.value.isDragging=!1,setTimeout(()=>{!U.value.isDragging&&U.value.isZooming},100))},vs=(t,o)=>{const l=t.filter(b=>b!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||o<=0)return l[0];if(o>=1)return l[l.length-1];let r=0;const m=[];for(let b=1;b<l.length;b++){const q=l[b].x-l[b-1].x,_=l[b].y-l[b-1].y,I=Math.sqrt(q*q+_*_);m.push(I),r+=I}const v=r*o;let C=0;for(let b=0;b<m.length;b++){const q=C+m[b];if(v<=q){const _=(v-C)/m[b],I=l[b],M=l[b+1];return{x:I.x+(M.x-I.x)*_,y:I.y+(M.y-I.y)*_}}C=q}return l[l.length-1]};return(t,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ps(),{"dss-chart-fill-width":qe.value,"dss-chart-fill-height":ze.value,"dss-chart-compact":Cl.value&&!A.value}]]),style:e.normalizeStyle({width:qe.value?"100%":ye.value+"px",height:at.value,...qe.value||ze.value?{overflow:Cl.value||jt.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ds.value,cursor:$o()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:O,onWheel:Mo,onMousedown:jn,onMousemove:Uo,onMouseup:_o,onMouseleave:mo,onDblclick:Bn,onContextmenu:e.withModifiers(xo,["prevent"]),onClick:e.withModifiers(fn,["left"]),onWheelCapture:Mo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ot},[e.createElementVNode("div",kr,[dt.value?(e.openBlock(),e.createElementBlock("div",Cr,e.toDisplayString(dt.value),1)):e.createCommentVNode("",!0),Ye.value?(e.openBlock(),e.createElementBlock("div",br,e.toDisplayString(Ye.value),1)):e.createCommentVNode("",!0)]),A.value&&X.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":ae.value==="horizontal","dss-legend-vertical":ae.value==="vertical","dss-legend-top":X.value==="top","dss-legend-bottom":X.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",xr,e.toDisplayString(l.name),1)],46,wr))),128))],2)):e.createCommentVNode("",!0),A.value&&(X.value==="left"||X.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":X.value==="left","dss-legend-right":X.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",Sr,e.toDisplayString(l.name),1)],46,Er))),128))],2)):e.createCommentVNode("",!0)],512),S.showAddMarkerButton&&ut.value&&Ze.value.addMarker&&(kl.value||el.value)&&!jt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Vn,title:e.unref(L)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:dl.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,Nr),o[4]||(o[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,Vr)):e.createCommentVNode("",!0),e.createElementVNode("div",Br,[el.value&&Pt.value?(e.openBlock(),e.createElementBlock("div",Mr,"Bubble size: "+e.toDisplayString(Pt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ye.value,height:Te.value,class:"dss-chart-svg","data-smooth":We.value,"data-animated":El.value,ref_key:"svgEl",ref:me},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:fe.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:ye.value,height:z.value.height*4},null,8,Lr)],8,$r),xl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:zn.value},[e.createElementVNode("path",{d:yo.value},null,8,Ar)],8,Tr)):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:a.value},[e.createElementVNode("path",{d:s.value},null,8,Hr)],8,Dr)):e.createCommentVNode("",!0)]),kl.value||el.value?(e.openBlock(),e.createElementBlock("g",Rr,[pe.value&&!jt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ia.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,Ir))),128))],8,Fr)):e.createCommentVNode("",!0),jt.value&&ga.value.length?(e.openBlock(),e.createElementBlock("g",{key:1,class:"dss-stepbar-axis-bars dss-stepbar-axis-bars--y-only","clip-path":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ga.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:Et.value,"stroke-width":$t.value,"stroke-dasharray":Ht.value,opacity:xt.value},null,8,Pr))),128))],8,zr)):e.createCommentVNode("",!0),e.createElementVNode("g",Or,[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,Wr),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,qr),Ut.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,Zr)):e.createCommentVNode("",!0)]),e.createElementVNode("g",Ur,[jt.value?e.createCommentVNode("",!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(la.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,Xr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(na.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,Yr))),128)),Ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Pa.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,jr))),128)):e.createCommentVNode("",!0),It.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(It.value),9,Kr)):e.createCommentVNode("",!0),bt.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(bt.value),9,Gr)):e.createCommentVNode("",!0),Ut.value&&Yt.value?(e.openBlock(),e.createElementBlock("text",{key:4,x:ye.value-15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14",fill:"#666",transform:`rotate(90, ${ye.value-15}, ${z.value.top+z.value.height/2})`},e.toDisplayString(Yt.value),9,Qr)):e.createCommentVNode("",!0)]),rn.value.length>0?(e.openBlock(),e.createElementBlock("g",Jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rn.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":_e.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=>bo(l,r),onMouseleave:wo},null,40,ti)):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=>bo(l,r),onMouseleave:wo},null,40,li)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:z.value.bottom,y2:z.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:r=>bo(l,r),onMouseleave:wo},null,40,ni)):e.createCommentVNode("",!0)],8,ei),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=>bo(l,r),onMouseleave:wo},null,40,oi)):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=>bo(l,r),onMouseleave:wo},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,si)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":_e.value},[Pl.value?(e.openBlock(),e.createElementBlock("g",ii,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":al.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ca.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,ci)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,ui))],64))),128))],2),e.createElementVNode("g",di,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,mi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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)),te.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Za.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${r}`,cx:l.x,cy:l.y,r:ce(l.isHighlighted?Q(l,te.value)+2:Q(l,te.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,vi))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wa.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${r}`,d:l.path,stroke:l.color,"stroke-width":nt.value,"stroke-dasharray":l.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Rt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,hi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ya.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,gi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ka.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${r}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+2:nt.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,yi))),128)),te.value>0||K.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(qa.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${r}`,cx:l.x,cy:l.y,r:ce(l.isHighlighted?Q(l,te.value)+2:Q(l,te.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,ki))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",Ci,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${r}`,id:`area-mask-${r}-${S.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,wi)],8,bi))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${r}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Ve.value+.2:Ve.value,mask:`url(#area-mask-${r}-${S.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,xi))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ra.value,(l,r)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${r}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?nt.value+1:nt.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*ul.value}ms`})},null,14,Ei))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":al.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ca.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${r}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,Si)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:m=>Pn(l,m),onMouseleave:bn},null,46,Vi))],64))),128))],2)):e.createCommentVNode("",!0)],8,ri),je.value&&$.value.show&&!U.value.isZooming&&!jt.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-crosshair","clip-path":_e.value},[e.createElementVNode("line",{x1:$.value.x,x2:$.value.x,y1:z.value.top,y2:z.value.bottom,stroke:Ge.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Bi),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value.data,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${r}`,cx:$.value.x,cy:l.y,r:ce(te.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Mi))),128))],8,Ni)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),el.value?(e.openBlock(),e.createElementBlock("g",_i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ho.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${r}`},[l?(e.openBlock(),e.createElementBlock("g",$i,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:ce(l.radius),fill:l.color,"fill-opacity":Ya(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(Ka(l,r)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:m=>wa(l,m),onMouseleave:m=>Ea(l),onClick:m=>ba(l,m)},null,42,Li),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:ja(l)}),onLoad:m=>F(r),onError:m=>P(r),onMouseenter:m=>wa(l,m),onMouseleave:m=>Ea(l),onClick:m=>ba(l,m)},null,46,Ti)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),Cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Lo.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Lt.value,cy:Ct.value,r:vt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Di)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":i.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ua.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":Ao(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:m=>Pn(l.segment,m),onMouseleave:bn},null,42,Ri))),128))],8,Hi),Il.value&&da.value?(e.openBlock(),e.createElementBlock("g",Fi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.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,Ii)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Hn.value&&(da.value||xl.value||Kn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Xn.value.x,y:Xn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":wl.value,fill:sn.value,class:"dss-radial-data-center"},e.toDisplayString(xn.value),9,zi)):e.createCommentVNode("",!0),Ba.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Io.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xa.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,Pi),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,Oi),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":Fl.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,Wi)],6))),128))],2)):e.createCommentVNode("",!0)],8,Ai)):e.createCommentVNode("",!0),gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Lo.value},[pe.value?(e.openBlock(),e.createElementBlock("g",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${r}`,cx:Lt.value,cy:Ct.value,r:ce(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*150}ms`})},null,12,Ui))),128)),e.createElementVNode("g",Xi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(se.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${r}`},[e.createElementVNode("rect",{x:Lt.value-16,y:Ct.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Yi),e.createElementVNode("text",{x:Lt.value,y:Ct.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(De(r)),9,ji)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sa.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${r}`,x1:Lt.value,x2:l.x,y1:Ct.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${r*100}ms`})},null,12,Ki))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Gi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ts.value,(l,r)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${r}`,x:l.x+Math.cos(r*2*Math.PI/no.value-Math.PI/2)*16,y:l.y+Math.sin(r*2*Math.PI/no.value-Math.PI/2)*16,"text-anchor":l.anchor,"dominant-baseline":l.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${r*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,Qi))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:as,onMouseleave:bn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Va.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${r}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":ns("current",l,r),stroke:l.color,"stroke-width":l.isHighlighted?nt.value+1:nt.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*ul.value}ms`,transition:"all 0.2s ease"})},null,14,Ji),l.pointRadius>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(l.dataPoints,(m,v)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${r}-${v}`,cx:m.x,cy:m.y,r:ce(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*ul.value+v*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Pn(m,C),onMouseleave:bn},null,46,ec))),128)):e.createCommentVNode("",!0)]))),128))],32)],8,qi)):e.createCommentVNode("",!0),e.createElementVNode("g",tc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${r}`,cx:l.x,cy:l.y,r:ce(l.width/2),fill:Kt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${r}`),style:e.normalizeStyle({animationDelay:`${r*200}ms`})},null,14,lc))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.value,(l,r)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${r}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:m=>ss(r),onError:m=>rs(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,nc))),128))])],8,_r)),jt.value&&Ul.value.length?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-chart-host",style:e.normalizeStyle(dn.value)},[e.createElementVNode("div",{ref_key:"stepbarScrollEl",ref:H,class:"dss-stepbar-scroll",onScroll:Xo},[e.createElementVNode("div",{class:"dss-stepbar-scroll-content",style:e.normalizeStyle(Al.value)},[yt.value?(e.openBlock(),e.createElementBlock("div",oc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.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:Et.value,borderTopWidth:`${$t.value}px`,borderTopStyle:"dashed",opacity:xt.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(Ul.value,l=>(e.openBlock(),e.createBlock(Ta,{key:l.key,class:"dss-stepbar-chart-column",style:e.normalizeStyle(cl.value),label:l.label,segments:l.segments,"total-value":l.totalValue,"show-counter":!1,"value-label":ll.value,orientation:"vertical","label-position":"down","bar-height":Ll.value,"segment-order":B.value,"remainder-label":ie.value,"inactive-color":re.value,options:un.value,"disable-tooltips":""},null,8,["style","label","segments","total-value","value-label","bar-height","segment-order","remainder-label","inactive-color","options"]))),128))],4),Wn.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-stepbar-crosshair-line",style:e.normalizeStyle(Ln.value)},null,4)):e.createCommentVNode("",!0)],4)],544)],4)):e.createCommentVNode("",!0)]),Mt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ye.value+"px",height:Te.value+"px",backgroundImage:`url('${Jt.value}')`,backgroundRepeat:"no-repeat",...pn.value,opacity:wn.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qt.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:Tt.value+"px",height:Tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(m=>ea(l),["stop"]),onMouseenter:m=>Qa(l,m),onMouseleave:Ja},[e.createElementVNode("img",{src:Vo(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,sc)],44,ac)),[[e.vShow,Bl.value]])),128)),x.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:x.value.x+"px",top:x.value.y+"px"})},[e.createElementVNode("div",rc,e.toDisplayString(x.value.categoryValue),1),x.value.description?(e.openBlock(),e.createElementBlock("div",ic,e.toDisplayString(x.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ce.value&&(h.value.show||je.value&&$.value.show&&!U.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":je.value&&$.value.show&&!U.value.isZooming,"dss-spider-tooltip":gl.value&&h.value.spiderAreas&&h.value.spiderAreas.length>0}]),style:e.normalizeStyle(is.value)},[!je.value||!$.value.show||U.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[gl.value&&h.value.spiderAreas&&h.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value.spiderAreas,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${r}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",uc,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${r}-${v}`,class:"dss-tooltip-series"},[e.createElementVNode("span",dc,e.toDisplayString(m.label),1),e.createElementVNode("span",mc,e.toDisplayString(m.value),1)]))),128))]))),128))])):el.value&&h.value.bubbleData&&h.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",pc,[h.value.title?(e.openBlock(),e.createElementBlock("div",vc,e.toDisplayString(h.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.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",hc,[e.createElementVNode("div",gc,e.toDisplayString(h.value.title),1),e.createElementVNode("div",yc,e.toDisplayString(h.value.value),1)])),h.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Rl(h.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",kc,[o[5]||(o[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Cc,e.toDisplayString(e.unref(L)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl(h.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${r}`},[e.createElementVNode("div",bc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",wc,[e.createElementVNode("div",xc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rl(h.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ec,[o[6]||(o[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Sc,e.toDisplayString(e.unref(L)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl(h.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",Vc,[e.createElementVNode("div",Nc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Bc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Mc,[e.createElementVNode("div",_c,e.toDisplayString(jt.value?Yo():el.value?Ga():S.categories[$.value.categoryIndex]||`Category ${$.value.categoryIndex+1}`),1),el.value?(e.openBlock(),e.createElementBlock("div",$c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.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($.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",Lc,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Tc,e.toDisplayString(Bt(l.value)),1)]))),128))]),Rl($.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ac,[o[7]||(o[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Dc,e.toDisplayString(e.unref(L)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl($.value.categoryIndex).flagGroups,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${r}`},[e.createElementVNode("div",Hc,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(m,v)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${r}-${v}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Rc,[e.createElementVNode("div",Fc,e.toDisplayString(m.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Rl($.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Ic,[o[8]||(o[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",zc,e.toDisplayString(e.unref(L)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl($.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",Pc,[e.createElementVNode("div",Oc,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",Wc,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),kl.value&&Vt.value&&U.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Bn},[o[9]||(o[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(U.value.scale*100))+"% "+e.toDisplayString(e.unref(L)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,yr),A.value&&X.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":ae.value==="horizontal","dss-legend-vertical":ae.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(V.series,(l,r)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${r}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":st.value.has(r),"dss-legend-hovered":Ne.value===r,"dss-legend-dimmed":Ne.value!==null&&Ne.value!==r}]),onClick:m=>ia(r),onMouseenter:m=>uo(r),onMouseleave:Jn,style:e.normalizeStyle({animationDelay:`${r*100}ms`})},[e.createElementVNode("div",{class:e.normalizeClass(["dss-legend-color",{"dss-legend-color--comparison":gl.value&&we(l)}]),style:e.normalizeStyle({backgroundColor:gl.value&&we(l)?"transparent":Zt(l,r),borderColor:Zt(l,r)})},null,6),e.createElementVNode("span",Zc,e.toDisplayString(l.name),1)],46,qc))),128))],2)):e.createCommentVNode("",!0),Y.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Y.value.x+"px",top:Y.value.y+"px"}),onClick:o[0]||(o[0]=e.withModifiers(()=>{},["stop"]))},[Ze.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:In},e.toDisplayString(e.unref(L)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ze.value.addMarker&&(Ze.value.downloadSvg||Ze.value.downloadPng||Ze.value.downloadCsv||Je.value.length>0)?(e.openBlock(),e.createElementBlock("div",Uc)):e.createCommentVNode("",!0),Ze.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:No},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ze.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Bo},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ze.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:En},e.toDisplayString(e.unref(L)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Je.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ze.value.downloadSvg||Ze.value.downloadPng||Ze.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",Xc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,(l,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+r},[l.separator?(e.openBlock(),e.createElementBlock("div",Yc)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(Eo(l)),style:e.normalizeStyle(So(l)),onClick:m=>Sn(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:jo(l),class:"dss-custom-menu-content"},null,8,Kc)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Gc,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,jc)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Se.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:en},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:o[3]||(o[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Qc,[e.createElementVNode("h3",null,e.toDisplayString(vn.value?e.unref(L)("chart.modalMarker.viewMarker"):ql.value?e.unref(L)("chart.modalMarker.editMarker"):e.unref(L)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:en},"×")]),e.createElementVNode("div",Jc,[e.createElementVNode("div",eu,[e.createVNode(pa,{id:"dss-marker-date",mode:"single",modelValue:Se.value.date,"onUpdate:modelValue":o[1]||(o[1]=l=>Se.value.date=l),"min-date":zl.value,"max-date":Wl.value,disabled:vn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",tu,[e.createElementVNode("label",lu,e.toDisplayString(e.unref(L)("chart.modalMarker.description")),1),vn.value?(e.openBlock(),e.createElementBlock("div",nu,e.toDisplayString(Se.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":o[2]||(o[2]=l=>Se.value.description=l),placeholder:e.unref(L)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ou)),[[e.vModelText,Se.value.description]])])]),e.createElementVNode("div",au,[e.createElementVNode("div",su,[ql.value&&!vn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:eo},e.toDisplayString(e.unref(L)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ru,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:en},e.toDisplayString(vn.value?e.unref(L)("chart.modalMarker.close"):e.unref(L)("chart.modalMarker.cancel")),1),vn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Fn,disabled:!(Se.value.description&&Se.value.description.length)},e.toDisplayString(ql.value?e.unref(L)("chart.modalMarker.save"):e.unref(L)("chart.contextMenu.addMarker")),9,iu))])])])])):e.createCommentVNode("",!0)],64))}}),du={class:"dss-modal-title"},mu={class:"dss-modal-actions"},ma={__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(S,{emit:ee}){const L=S,N=ee,ue=e.ref(null),O=e.ref(null),H=e.computed(()=>{const j={"max-width":L.width};return L.height!=="auto"&&(j.height=L.height,j["min-height"]="0"),j}),me=e.computed(()=>({}));function ot(){N("close-modal")}function ne(){L.backDrop&&!ue.value&&N("close-modal")}function f(j){j.target.tagName==="INPUT"&&(ue.value=j.target.tagName)}function be(){setTimeout(()=>{ue.value=null},300)}function he(){const j=document.body,fe=document.documentElement;O.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=`-${O.value.scrollY}px`,j.style.width="100%",j.style.left="0",fe.style.overflow="hidden"}function oe(){if(!O.value)return;const j=document.body,fe=document.documentElement,{bodyOverflow:_e,bodyPosition:V,bodyTop:$e,bodyWidth:lt,htmlOverflow:rt,scrollY:Qe}=O.value;j.style.overflow=_e||"",j.style.position=V||"",j.style.top=$e||"",j.style.width=lt||"",j.style.left="",fe.style.overflow=rt||"",window.scrollTo(0,Qe||0)}return e.watch(()=>L.showModal,j=>{if(j)he(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",be))},100);else{oe(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{L.showModal&&oe()}),(j,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ne},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(H.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":S.headerType,"font-size":S.titleSize})},[e.createElementVNode("h1",du,[e.renderSlot(j.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(j.$slots,"title-data"),S.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:ot,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(me.value)},[e.renderSlot(j.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",mu,[e.renderSlot(j.$slots,"actions")])])],4),[[e.vShow,S.showModal]])])):e.createCommentVNode("",!0)]))}},pu={key:0,class:"dss-table-toolbar"},vu={class:"dss-table-toolbar-left"},fu=["aria-expanded"],hu={class:"dss-pagination-select-dropdown",role:"listbox"},gu={class:"dss-table-column-visibility-label"},yu={class:"dss-table-checkbox-wrapper"},ku=["checked","onChange"],Cu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},bu={class:"dss-table-column-visibility-text"},wu={class:"dss-table-toolbar-right"},xu=["placeholder","aria-label"],Eu=["aria-label"],Su=["aria-label","aria-expanded"],Vu={key:1,class:"dss-table-toolbar-extra"},Nu={class:"dss-table-thead"},Bu={key:0,class:"dss-table-th dss-table-selection-column"},Mu={key:0,class:"dss-table-checkbox-wrapper"},_u=["checked","indeterminate"],$u={key:0,class:"dss-table-checkbox__indeterminate"},Lu={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Tu=["aria-label"],Au=["onClick"],Du={class:"dss-table-th-content"},Hu={class:"dss-table-th-text"},Ru={key:0},Fu={key:1},Iu={key:2},zu=["data-filter-column-key","aria-expanded","aria-label","onClick"],Pu={class:"dss-table-tbody"},Ou=["onClick"],Wu={class:"dss-table-checkbox-wrapper"},qu=["type","name","checked","disabled","onChange"],Zu={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Uu={key:1,class:"dss-table-checkbox__dot"},Xu=["onClick"],Yu=["aria-expanded","aria-label"],ju={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ku={key:0,class:"dss-table-expansion-row"},Gu=["colspan"],Qu=["colspan"],Ju={key:1,class:"dss-table-pagination"},ed={class:"dss-table-pagination-left"},td={key:0},ld={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},nd={class:"dss-table-pagination-center"},od={key:0,class:"dss-pagination-controls"},ad=["disabled","title"],sd=["disabled","title"],rd=["aria-label","onKeydown"],id={class:"dss-pagination-of"},cd=["disabled","title"],ud=["disabled","title"],dd={class:"dss-table-pagination-right"},md={class:"dss-pagination-rows-label"},pd=["aria-expanded"],vd=["aria-selected","onClick"],fd={key:0,class:"dss-table-filter-row"},hd=["value","placeholder"],gd=["min","max","value"],yd=["min","max","value"],kd={class:"dss-table-filter-double-range-values"},Cd={key:2,class:"dss-table-filter-daterange"},bd={class:"dss-table-filter-daterange-row"},wd={class:"dss-table-filter-daterange-label"},xd=["value"],Ed={class:"dss-table-filter-daterange-row"},Sd={class:"dss-table-filter-daterange-label"},Vd=["value"],Nd=["value","placeholder"],Bd={class:"dss-table-filter-list"},Md=["checked","onChange"],_d={class:"dss-table-filter-actions"},$d={name:"DSSTable"},Ld=Object.assign($d,{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:S=>typeof S=="object"&&S!==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(S,{emit:ee}){const{t:L,locale:N}=so.useI18n(),ue=S,O=ee,H={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 me(y,h){const x=Object.assign({},y);return ot(y)&&ot(h)&&Object.keys(h).forEach($=>{ot(h[$])?$ in y?x[$]=me(y[$],h[$]):Object.assign(x,{[$]:h[$]}):Object.assign(x,{[$]:h[$]})}),x}function ot(y){return y&&typeof y=="object"&&!Array.isArray(y)}const ne=e.computed(()=>me(H,ue.options)),f=e.computed(()=>{const y=ne.value.table.width;return y==="auto"?null:typeof y=="number"?y:null}),be=e.computed(()=>ne.value.table.height),he=e.computed(()=>ne.value.table.rowHeight??"auto"),oe=e.computed(()=>({height:he.value})),j=e.computed(()=>ne.value.table.expandable===!0),fe=e.computed(()=>ne.value.table.expandableRowData??null),_e=e.computed(()=>ne.value.table.expandableRowCondition??null),V=e.computed(()=>ne.value.table.truncated===!0),$e=e.computed(()=>ne.value.table.striped),lt=e.computed(()=>ne.value.table.bordered),rt=e.computed(()=>ne.value.table.hoverable),Qe=e.computed(()=>ne.value.table.size),Z=e.computed(()=>ne.value.table.align||"left");e.computed(()=>ne.value.title.text),e.computed(()=>ne.value.subtitle.text);const qe=e.computed(()=>ne.value.selection.enabled),ze=e.computed(()=>ne.value.selection.mode),ye=e.computed(()=>ne.value.selection.rowCondition??null),Ue=e.computed(()=>ne.value.sorting.enabled),ke=e.computed(()=>ne.value.sorting.mode),Te=e.computed(()=>ne.value.pagination.enabled),at=e.computed(()=>ne.value.pagination.rows),ge=e.computed(()=>ne.value.pagination.rowsPerPageOptions),Ft=e.computed(()=>ne.value.pagination.showCounter!==!1),dt=e.computed(()=>ne.value.pagination.showControlsGroup),Ye=e.computed(()=>dt.value===!1?!1:ne.value.pagination.showControls!==!1),Pt=e.computed(()=>dt.value===!1?!1:ne.value.pagination.showRowsPerPage!==!1),It=e.computed(()=>Te.value&&(Ft.value||Ye.value||Pt.value)),bt=e.computed(()=>ne.value.scrollable),ft=e.computed(()=>ne.value.emptyMessage||L("table.emptyMessage")),Yt=e.computed(()=>ne.value.toolbar?.downloads?.pdf!==!1),it=e.computed(()=>ne.value.toolbar?.downloads?.excel!==!1),At=e.computed(()=>ne.value.toolbar?.search!==!1),ht=e.computed(()=>Yt.value||it.value||At.value||il.value),il=e.computed(()=>ne.value.toolbar?.columnVisibility!==!1),St=e.ref(""),Dt=e.ref(!1),pe=e.ref(null);let A=null;function X(){Dt.value?(A&&(clearTimeout(A),A=null),Dt.value=!1,St.value="",O("search",""),pe.value?.blur()):(Dt.value=!0,A=setTimeout(()=>{A=null,pe.value?.focus()},80))}function ae(){St.value||(Dt.value=!1)}function Ce(){St.value="",O("search",""),pe.value?.focus()}const je=e.computed(()=>({"dss-table-striped":$e.value,"dss-table-bordered":lt.value,"dss-table-hoverable":rt.value,[`dss-table-${Qe.value}`]:Qe.value!=="default","dss-table-truncated":V.value})),Ge=(y,h)=>y?.field??y?.key??h,Vt=e.ref(new Set);function Pe(){const y=new Set;return ue.columns.forEach((h,x)=>{h?.hidden!==!0&&y.add(Ge(h,x))}),y}function Ke(){const y=new Set;return ue.columns.forEach((h,x)=>{y.add(Ge(h,x))}),y}function nt(y){if(!Array.isArray(y))return null;const h=Ke(),x=[];return y.forEach($=>{h.has($)&&x.push($)}),x}function qt(){Vt.value=Pe()}const te=e.computed(()=>{const y=nt(ue.columnVisibility);return y===null?null:new Set(y)}),K=e.computed(()=>te.value??Vt.value),Q=e.computed(()=>ue.columns.filter((y,h)=>K.value.has(Ge(y,h)))),ce=y=>{const h=ue.columns.findIndex(x=>x===y);return Ge(y,h>=0?h:0)},Ve=(y,h)=>K.value.has(Ge(y,h));function We(y){O("update:columnVisibility",Array.from(y))}function Nt(y,h){const x=Ge(y,h),$=new Set(K.value);$.has(x)?$.delete(x):$.add(x),te.value===null&&(Vt.value=$),We($)}const Ot=e.ref(null),pt=e.ref(!1);function wt(y){Ot.value&&!Ot.value.contains(y.target)&&(pt.value=!1)}const B=e.computed(()=>Q.value.length+(qe.value?1:0)+(j.value?1:0)),w=(y,h)=>y?.id??y?.key??h,T=e.ref(new Set),ie=e.ref(null),re=(y,h)=>T.value.has(w(y,h)),He=(y,h)=>{if(!j.value)return!1;if(typeof _e.value=="function")return!!_e.value(y,h);if(typeof fe.value=="string"&&fe.value.trim()){const x=Xl(y,fe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},gt=(y,h,x)=>{if(x&&x.stopPropagation(),!He(y,h))return;const $=w(y,h),Y=new Set(T.value);Y.has($)?(Y.delete($),O("row-collapse",{data:y,index:h})):(Y.add($),O("row-expand",{data:y,index:h})),T.value=Y},et=(y,h)=>{if(!V.value)return;const x=w(y,h);ie.value!==x&&(ie.value=x)},Ae=e.ref(null),yt=e.ref(0),Et=e.ref([]),xt=y=>{if(ke.value==="single")return Ae.value===y.field?yt.value:0;{const h=Et.value.find(x=>x.field===y.field);return h?h.order:0}},$t=y=>{const h=xt(y);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},Ht=e.ref({}),kt=e.ref(null),Gt=e.ref(null),Ll=220,hl=e.ref(null),Nl=e.computed(()=>Q.value.find(y=>ce(y)===kt.value)??null),cl=e.computed(()=>{if(!Nl.value||Nl.value.filter!=="range")return null;const y=Nl.value,h=kt.value,{min:x,max:$}=Tn(y),Y=y.filterMin??x,U=y.filterMax??$,tt=Tl(h),Se=tt.min??Y,zl=tt.max??U,Wl=U-Y,ql=Wl===0?0:(Se-Y)/Wl*100,vn=Wl===0?100:(zl-Y)/Wl*100;return{rangeMin:Y,rangeMax:U,currentMin:Se,currentMax:zl,minPct:ql,maxPct:vn}}),nn=e.ref(null),un=e.ref("max");function Ul(y){const h=nn.value,x=cl.value;if(!h||!x)return;const $=h.getBoundingClientRect(),U=(y.clientX-$.left)/$.width*100,tt=(x.minPct+x.maxPct)/2;un.value=U<tt?"min":"max"}function Tl(y){return Ht.value[y]??{}}function dn(y,h){Ht.value={...Ht.value,[y]:h}}function Al(y){const h=Ht.value[y];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function Wn(y){const h={...Ht.value};delete h[y],Ht.value=h,kt.value=null,Gt.value=null}function Ln(){if(!kt.value){Gt.value=null;return}const y=hl.value;if(!y)return;const h=y.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${kt.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Gt.value={top:x.bottom+6,left:Math.max(8,x.right-Ll)}}const El=e.computed(()=>{const y=String(St.value??"").trim().toLowerCase();return y?ue.data.filter(h=>Q.value.some(x=>Dl(Jl(h,x)).some(Y=>String(Y).toLowerCase().includes(y)))):ue.data}),on=e.computed(()=>{let y=[...El.value];const h=(St.value??"").trim().toLowerCase();return h&&(y=y.filter(x=>ue.columns.some($=>{if(!$||!$.field)return!1;const Y=Jl(x,$);return String(Y??"").toLowerCase().includes(h)}))),Q.value.forEach(x=>{const $=ce(x),Y=Ht.value[$];if(!Y)return;const U=x.field;if(U){if(Y.type==="string"&&Y.value?.trim()){const tt=Y.value.trim().toLowerCase();y=y.filter(Se=>{const zl=Jl(Se,x);return String(zl??"").toLowerCase().includes(tt)})}else if(Y.type==="range")y=y.filter(tt=>{const Se=Xl(tt,U),zl=Number(Se);return!(Number.isNaN(zl)||Y.min!=null&&zl<Y.min||Y.max!=null&&zl>Y.max)});else if(Y.type==="dateRange"){const tt=Y.from?new Date(Y.from).getTime():null,Se=Y.to?new Date(Y.to).getTime():null;y=y.filter(zl=>{const Wl=Xl(zl,U),ql=Wl?new Date(Wl).getTime():NaN;return!(Number.isNaN(ql)||tt!=null&&ql<tt||Se!=null&&ql>Se)})}else if(Y.type==="list"&&Y.selected?.length){const tt=new Set(Y.selected);y=y.filter(Se=>Dl(Jl(Se,x)).some(Wl=>tt.has(Wl)))}}}),y});function Dl(y){if(y==null)return[""];if(Array.isArray(y))return y.flatMap(Dl);if(typeof y=="object"){const h=y?.label??y?.name??y?.value??y?.title;return[h!=null?String(h):String(y)]}return[String(y)]}function Ol(y){const h=new Set;return ue.data.forEach(x=>{Dl(Jl(x,y)).forEach(Y=>h.add(Y))}),Array.from(h).sort((x,$)=>String(x).localeCompare(String($)))}function Hl(y,h){if(kt.value===y){kt.value=null,Gt.value=null;return}if(kt.value=y,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Gt.value={top:x.bottom+6,left:Math.max(8,x.right-Ll)}}else Ln()}function ul(y,h){dn(y,{type:"string",value:h})}function Tn(y){const h=y.field;if(!h)return{min:0,max:100};let x=1/0,$=-1/0;return ue.data.forEach(Y=>{const U=Xl(Y,h),tt=Number(U);Number.isNaN(tt)||(x=Math.min(x,tt),$=Math.max($,tt))}),{min:x===1/0?0:x,max:$===-1/0?100:$}}function R(y,h,x){const $={...Tl(y),type:"range"},Y=x===""?null:Number(x),U=Y===null||Number.isNaN(Y)?null:Y;$[h]=U,U!=null&&(h==="min"&&$.max!=null&&U>$.max&&($.max=U),h==="max"&&$.min!=null&&U<$.min&&($.min=U)),dn(y,$)}function W(y,h,x){const $={...Tl(y),type:"dateRange"};$[h]=x||"",dn(y,$)}const D=e.reactive({});function se(y,h){D[y]=h}function De(y){const h=ce(y),x=(D[h]??"").trim().toLowerCase(),$=Ol(y);return x?$.filter(Y=>String(Y).toLowerCase().includes(x)):$}function mt(y,h){return(Tl(y).selected??[]).includes(h!=null?String(h):"")}function ut(y,h){const $=[...Tl(y).selected??[]],Y=h!=null?String(h):"",U=$.indexOf(Y);U>=0?$.splice(U,1):$.push(Y),dn(y,{type:"list",selected:$})}function Ze(y){kt.value&&!y.target.closest(".dss-table-filter-wrap")&&!y.target.closest(".dss-table-filter-dropdown")&&(kt.value=null,Gt.value=null)}function Je(){Ln(),Bt.value&&_l()}const dl=y=>{if(!(y.sortable===!1||!Ue.value))if(ke.value==="single")Ae.value===y.field?yt.value=yt.value===1?-1:yt.value===-1?0:1:(Ae.value=y.field,yt.value=1),yt.value===0&&(Ae.value=null),O("sort",{field:Ae.value,order:yt.value});else{const h=Et.value.findIndex(x=>x.field===y.field);h>=0?Et.value[h].order===1?Et.value[h].order=-1:Et.value.splice(h,1):Et.value.push({field:y.field,order:1}),O("sort",{multiSortMeta:Et.value})}},ml=e.computed(()=>{if(!Ue.value)return on.value;let y=[...on.value];return ke.value==="single"&&Ae.value&&yt.value!==0?y.sort((h,x)=>{const $=Xl(h,Ae.value),Y=Xl(x,Ae.value);return $===Y?0:$==null?1:Y==null?-1:($<Y?-1:$>Y?1:0)*yt.value}):ke.value==="multiple"&&Et.value.length>0&&y.sort((h,x)=>{for(const $ of Et.value){const Y=Xl(h,$.field),U=Xl(x,$.field);if(Y===U)continue;if(Y==null)return 1;if(U==null)return-1;const tt=Y<U?-1:Y>U?1:0;if(tt!==0)return tt*$.order}return 0}),y}),Tt=e.ref(0),ll=e.ref(at.value),Bt=e.ref(!1),Bl=e.ref(null),mn=e.ref(null),Qt=e.ref("bottom"),Mt=e.ref(null),wn=y=>{ll.value=y,Bt.value=!1,Tt.value=0,O("page",{page:0,rows:ll.value})};function An(y){Bl.value&&!Bl.value.contains(y.target)&&(Bt.value=!1)}function _l(){const y=Bl.value,h=mn.value;if(!y||!h)return;const x=y.querySelector(".dss-pagination-select-dropdown");if(!x)return;const $=h.getBoundingClientRect(),Y=x.offsetHeight||0,tt=(window.innerHeight||document.documentElement.clientHeight)-$.bottom,Se=$.top;Qt.value=tt<Y+8&&Se>tt?"top":"bottom",Mt.value={width:`${Math.ceil($.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const an=e.computed(()=>ml.value.length),pn=e.computed(()=>Math.ceil(an.value/ll.value)),qn=e.computed(()=>Math.max(pn.value,1)),Rl=e.computed(()=>an.value===0?0:Jt.value+1),Ql=e.computed(()=>Dn.value),Jt=e.computed(()=>Te.value?Tt.value*ll.value:0),Dn=e.computed(()=>Te.value?Math.min((Tt.value+1)*ll.value,an.value):an.value),Fl=e.computed(()=>{if(!Te.value)return ml.value;const y=Jt.value,h=Dn.value;return ml.value.slice(y,h)}),Xt=e.ref(new Set),Zn=e.computed(()=>ml.value.filter((y,h)=>Xt.value.has(w(y,h)))),nl=(y,h)=>{const x=ye.value;return typeof x!="function"?!0:!!x(y,h)},Il=e.computed(()=>ml.value.map((y,h)=>({row:y,index:h})).filter(({row:y,index:h})=>nl(y,h))),Un=e.computed(()=>{const y=Il.value;return y.length===0?!1:y.every(({row:h,index:x})=>Xt.value.has(w(h,x)))}),Hn=e.computed(()=>{const y=Il.value;if(y.length===0)return!1;const h=y.filter(({row:x,index:$})=>Xt.value.has(w(x,$))).length;return h>0&&h<y.length}),xn=(y,h)=>Xt.value.has(w(y,h)),wl=()=>{if(Un.value)Xt.value=new Set,O("unselect-all");else{const y=new Set;Il.value.forEach(({row:h,index:x})=>y.add(w(h,x))),Xt.value=y,O("select-all",Zn.value)}},Xn=(y,h)=>{if(!nl(y,h))return;const x=w(y,h),$=new Set(Xt.value),Y=$.has(x);ze.value==="single"?Y?($.delete(x),O("row-unselect",y)):($.clear(),$.add(x),O("row-select",y)):Y?($.delete(x),O("row-unselect",y)):($.add(x),O("row-select",y)),Xt.value=$},sn=e.ref("1"),Yn=()=>{const y=Number.parseInt(String(sn.value),10);if(!Number.isFinite(y)){sn.value=String(Tt.value+1);return}const h=Math.min(qn.value,Math.max(1,y));h!==Tt.value+1?rn(h-1):sn.value=String(h)},rn=y=>{y<0||y>=pn.value||(Tt.value=y,O("page",{page:y,rows:ll.value}))},Rn=(y,h,x)=>{O("row-click",{data:y,index:h,originalEvent:x}),et(y,Jt.value+h)},Sl=(y,h)=>{const x=Jt.value+h;return{"dss-table-row-selected":xn(y,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":V.value,"dss-table-row-truncated-expanded":ie.value===w(y,x)}},Jl=(y,h)=>h.field?Xl(y,h.field):"",Xl=(y,h)=>h.split(".").reduce((x,$)=>x&&x[$],y),st=y=>{const h=y.align??Z.value;return{"dss-table-sortable":y.sortable!==!1&&Ue.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[y.className]:y.className}},Ne=y=>{const h={};return y.width&&(h.width=typeof y.width=="number"?`${y.width}px`:y.width),y.minWidth&&(h.minWidth=typeof y.minWidth=="number"?`${y.minWidth}px`:y.minWidth),y.maxWidth&&(h.maxWidth=typeof y.maxWidth=="number"?`${y.maxWidth}px`:y.maxWidth),h};return e.watch(()=>ue.locale,y=>{y&&y!==N.value&&(N.value=y)},{immediate:!0}),e.watch(at,y=>{ll.value=y,Tt.value=0}),e.watch(Bt,async y=>{y&&(await e.nextTick(),_l())}),e.watch(Tt,y=>{sn.value=String(y+1)},{immediate:!0}),e.watch(St,y=>{O("search",y??"")}),e.watch(()=>ue.columns,()=>{if(te.value===null){qt();return}const y=nt(ue.columnVisibility)??[];y.length!==ue.columnVisibility.length&&O("update:columnVisibility",y)},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",An),document.addEventListener("click",wt),document.addEventListener("click",Ze),window.addEventListener("resize",Je),window.addEventListener("scroll",Je,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",An),document.removeEventListener("click",wt),document.removeEventListener("click",Ze),window.removeEventListener("resize",Je),window.removeEventListener("scroll",Je,!0)}),(y,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:hl,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[ht.value?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",vu,[Yt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>O("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(L)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),it.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>O("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(L)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),il.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Ot},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":pt.value}]),onClick:h[2]||(h[2]=x=>pt.value=!pt.value),"aria-expanded":pt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(L)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,fu),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,(x,$)=>(e.openBlock(),e.createElementBlock("li",{key:Ge(x,$),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",gu,[e.createElementVNode("span",yu,[e.createElementVNode("input",{type:"checkbox",checked:Ve(x,$),onChange:Y=>Nt(x,$),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,ku),Ve(x,$)?(e.openBlock(),e.createElementBlock("span",Cu,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",bu,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,pt.value]])]),_:1})],512)):e.createCommentVNode("",!0),e.renderSlot(y.$slots,"header")]),e.createElementVNode("div",wu,[At.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Dt.value||St.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:pe,"onUpdate:modelValue":h[4]||(h[4]=x=>St.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(L)("table.searchPlaceholder"),"aria-label":e.unref(L)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>Dt.value=!0),onBlur:ae},null,40,xu),[[e.vModelText,St.value]]),St.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(L)("table.clearSearchAriaLabel"),onClick:Ce},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Eu)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(L)("table.searchAriaLabel"),"aria-expanded":Dt.value||!!St.value,onMousedown:e.withModifiers(X,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Su)],2)):e.createCommentVNode("",!0),y.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Vu,[e.renderSlot(y.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":bt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",je.value])},[e.createElementVNode("thead",Nu,[e.createElementVNode("tr",null,[qe.value?(e.openBlock(),e.createElementBlock("th",Bu,[ze.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Mu,[e.createElementVNode("input",{type:"checkbox",checked:Un.value,indeterminate:Hn.value,onChange:wl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,_u),Hn.value?(e.openBlock(),e.createElementBlock("span",$u)):Un.value?(e.openBlock(),e.createElementBlock("span",Lu,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(L)("table.expandRowAriaLabel")},null,8,Tu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(x,$)=>(e.openBlock(),e.createElementBlock("th",{key:ce(x),class:e.normalizeClass(["dss-table-th",st(x)]),style:e.normalizeStyle(Ne(x)),onClick:Y=>dl(x)},[e.createElementVNode("div",Du,[e.createElementVNode("span",Hu,e.toDisplayString(x.header),1),x.sortable!==!1&&Ue.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",$t(x)])},[xt(x)===0?(e.openBlock(),e.createElementBlock("span",Ru,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):xt(x)===1?(e.openBlock(),e.createElementBlock("span",Fu,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):xt(x)===-1?(e.openBlock(),e.createElementBlock("span",Iu,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":kt.value===ce(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Al(ce(x))}]),"data-filter-column-key":ce(x),"aria-expanded":kt.value===ce(x),"aria-label":e.unref(L)("table.filterColumnAriaLabel"),onClick:Y=>Hl(ce(x),Y)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,zu)],2)):e.createCommentVNode("",!0)])],14,Au))),128))])]),e.createElementVNode("tbody",Pu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,(x,$)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w(x,Jt.value+$)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Sl(x,$)]),style:e.normalizeStyle(oe.value),onClick:Y=>Rn(x,$,Y)},[qe.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Wu,[e.createElementVNode("input",{type:ze.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${S.tableId}`,checked:xn(x,Jt.value+$),disabled:!nl(x,Jt.value+$),onChange:Y=>Xn(x,Jt.value+$),class:e.normalizeClass(["dss-table-checkbox",ze.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!nl(x,Jt.value+$)}])},null,42,qu),ze.value==="multiple"&&xn(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("span",Zu,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):ze.value==="single"&&xn(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("span",Uu)):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(Y=>gt(x,Jt.value+$,Y),["stop"])},[He(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(x,Jt.value+$),"aria-label":re(x,Jt.value+$)?e.unref(L)("table.collapseRowAriaLabel"):e.unref(L)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(x,Jt.value+$)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Yu)):(e.openBlock(),e.createElementBlock("span",ju))],8,Xu)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(Y,U)=>(e.openBlock(),e.createElementBlock("td",{key:ce(Y),class:e.normalizeClass(["dss-table-td",st(Y)]),style:e.normalizeStyle(Ne(Y))},[e.renderSlot(y.$slots,`cell-${Y.field}`,{data:x,column:Y,rowIndex:$,isExpanded:ie.value===w(x,Jt.value+$)},()=>[e.createTextVNode(e.toDisplayString(Jl(x,Y)),1)])],6))),128))],14,Ou),j.value&&He(x,Jt.value+$)&&re(x,Jt.value+$)?(e.openBlock(),e.createElementBlock("tr",Ku,[e.createElementVNode("td",{colspan:B.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(y.$slots,"expansion",{data:x,rowIndex:$})],8,Gu)])):e.createCommentVNode("",!0)],64))),128)),Fl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(oe.value)},[e.createElementVNode("td",{colspan:B.value,class:"dss-table-empty-cell"},[e.renderSlot(y.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ft.value),1)])],8,Qu)],4))])],2)],2),It.value?(e.openBlock(),e.createElementBlock("div",Ju,[e.createElementVNode("div",ed,[Ft.value?(e.openBlock(),e.createElementBlock("span",td,e.toDisplayString(e.unref(L)("table.showingRange",{start:Rl.value,end:Ql.value,total:an.value})),1)):(e.openBlock(),e.createElementBlock("span",ld," "))]),e.createElementVNode("div",nd,[Ye.value?(e.openBlock(),e.createElementBlock("div",od,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value===0,onClick:h[8]||(h[8]=x=>rn(0)),title:e.unref(L)("table.firstPage")},[...h[35]||(h[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:Tt.value===0,onClick:h[9]||(h[9]=x=>rn(Tt.value-1)),title:e.unref(L)("table.previousPage")}," ‹ ",8,sd),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>sn.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(L)("table.currentPageAriaLabel"),onBlur:Yn,onKeydown:e.withKeys(e.withModifiers(Yn,["prevent"]),["enter"])},null,40,rd),[[e.vModelText,sn.value]]),e.createElementVNode("span",id,e.toDisplayString(e.unref(L)("table.ofPages",{total:qn.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=pn.value-1,onClick:h[11]||(h[11]=x=>rn(Tt.value+1)),title:e.unref(L)("table.nextPage")}," › ",8,cd),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:Tt.value>=pn.value-1,onClick:h[12]||(h[12]=x=>rn(pn.value-1)),title:e.unref(L)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,ud)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",dd,[Pt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Bl},[e.createElementVNode("span",md,e.toDisplayString(e.unref(L)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Bt.value}]),onClick:h[13]||(h[13]=x=>Bt.value=!Bt.value),"aria-expanded":Bt.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:mn},[e.createTextVNode(e.toDisplayString(ll.value)+" ",1),h[37]||(h[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":Qt.value==="top"}]),style:e.normalizeStyle(Mt.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===ll.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===ll.value}]),onClick:$=>wn(x)},e.toDisplayString(x),11,vd))),128))],6),[[e.vShow,Bt.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(Gt.value?{top:Gt.value.top+"px",left:Gt.value.left+"px",width:Ll+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[Nl.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Nl.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",fd,[e.createElementVNode("input",{type:"text",value:Tl(kt.value).value??"",onInput:h[14]||(h[14]=x=>ul(kt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(L)("table.search")},null,40,hd)])):Nl.value.filter==="range"&&cl.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":cl.value.minPct+"%","--range-max-pct":cl.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:nn,class:"dss-table-filter-double-range-track",onMousemove:Ul,onMouseenter:Ul},[e.createElementVNode("input",{type:"range",min:cl.value.rangeMin,max:cl.value.rangeMax,value:cl.value.currentMin,onInput:h[15]||(h[15]=x=>R(kt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:un.value==="min"?2:1})},null,44,gd),e.createElementVNode("input",{type:"range",min:cl.value.rangeMin,max:cl.value.rangeMax,value:cl.value.currentMax,onInput:h[16]||(h[16]=x=>R(kt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:un.value==="max"?2:1})},null,44,yd)],544),e.createElementVNode("div",kd,e.toDisplayString(cl.value.currentMin)+" – "+e.toDisplayString(cl.value.currentMax),1)],4)):Nl.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Cd,[e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(L)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Tl(kt.value).from??"",onInput:h[17]||(h[17]=x=>W(kt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,xd)]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Sd,e.toDisplayString(e.unref(L)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Tl(kt.value).to??"",onInput:h[18]||(h[18]=x=>W(kt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Vd)])])):Nl.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:D[kt.value]??"",onInput:h[19]||(h[19]=x=>se(kt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(L)("table.search")},null,40,Nd),e.createElementVNode("div",Bd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De(Nl.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:mt(kt.value,x),onChange:$=>ut(kt.value,x)},null,40,Md),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",_d,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>Wn(kt.value))},e.toDisplayString(e.unref(L)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,kt.value&&Nl.value&&Gt.value]])]),_:1})]))],64))}}),Td="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",Ad="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",Dd="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",Hd="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",Rd="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",Fd="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",Id={class:"dss-toolbar-left"},zd=["title"],Pd=["title"],Od={class:"dss-toolbar-dropdown-wrapper"},Wd=["title"],qd=["src"],Zd=["src"],Ud=["src"],Xd=["src"],Yd=["src"],jd=["src"],Kd={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Gd=["src"],Qd=["src"],Jd=["src"],e1=["src"],t1=["src"],l1=["src"],n1=["title"],o1=["title"],a1=["title"],s1=["title"],r1=["title"],i1=["title"],c1=["title"],u1=["title"],d1=["title"],m1={key:2,class:"dss-toolbar-separator"},p1=["title"],v1={key:4,class:"dss-toolbar-separator"},f1={key:5,class:"dss-toolbar-dropdown-wrapper"},h1=["title"],g1={class:"dss-toolbar-dropdown-ai"},y1={class:"dss-toolbar-right"},k1={key:0,class:"dss-toolbar-custom-group"},C1={key:1,class:"dss-toolbar-separator"},b1={class:"dss-link-modal-content"},w1={class:"dss-link-modal-field"},x1={class:"dss-link-modal-label"},E1=["placeholder"],S1={class:"dss-link-modal-field"},V1={class:"dss-link-modal-label"},N1=["placeholder"],B1={class:"dss-image-modal-tabs"},M1={key:0,class:"dss-image-tab-content"},_1={class:"dss-link-modal-content"},$1={class:"dss-link-modal-field"},L1={key:0,class:"dss-link-modal-label"},T1=["src"],A1={class:"dss-link-modal-field"},D1={class:"dss-link-modal-label"},H1=["placeholder"],R1={class:"dss-link-modal-field"},F1={class:"dss-link-modal-label"},I1=["placeholder"],z1={class:"dss-link-modal-field"},P1={class:"dss-link-modal-label"},O1=["placeholder"],W1={key:1,class:"dss-image-tab-content"},q1={class:"dss-link-modal-content"},Z1={class:"dss-link-modal-field"},U1={class:"dss-link-modal-label"},X1=["placeholder"],Y1={class:"dss-link-modal-field"},j1={class:"dss-link-modal-label"},K1=["placeholder"],G1={class:"dss-link-modal-field"},Q1={class:"dss-link-modal-label"},J1=["placeholder"],em={class:"dss-link-modal-field"},tm={class:"dss-link-modal-label"},lm=["placeholder"],nm={class:"dss-text-editor-title-input-container"},om={key:0,class:"dss-text-editor-title-preview"},am={key:0},sm={key:1,class:"dss-text-editor-preview-placeholder"},rm=["value","placeholder","disabled"],im={key:3,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},cm={class:"dss-text-editor-description-input-container"},um={key:0,class:"dss-text-editor-description-preview"},dm={key:0},mm={key:1,class:"dss-text-editor-preview-placeholder"},pm=["value","placeholder","disabled"],vm={key:5,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fm=["data-comment-id","onMouseenter"],hm=["onClick"],gm=["src","alt"],ym={key:1},km=["onClick"],Cm=["src","alt"],bm={key:1},wm=["data-has-second-user","onClick"],xm={class:"editor-comment-marker-count"},Em={key:7,class:"dss-text-editor-textarea-wrapper"},Sm=["value","placeholder","rows","disabled"],Vm={class:"dss-text-editor-footer"},Nm={class:"dss-text-editor-footer-content"},Bm={class:"dss-text-editor-footer-stat"},Mm={class:"dss-text-editor-footer-stat"},_m={key:8,class:"dss-text-editor-content-wrapper"},$m={key:0,class:"dss-comment-overlay-body"},Lm={class:"dss-comment-selection-wrapper"},Tm=["innerHTML"],Am={class:"dss-comment-messages-wrapper"},Dm={key:0,class:"dss-comment-avatar-wrapper"},Hm={class:"dss-comment-avatar"},Rm=["src","alt"],Fm={key:1},Im={class:"dss-comment-header"},zm={class:"dss-comment-header-text"},Pm={class:"dss-comment-author"},Om={key:0,class:"dss-comment-date"},Wm=["onClick","title"],qm={class:"dss-comment-overlay-inner"},Zm=["placeholder","onKeydown"],Um={class:"dss-text-editor-footer"},Xm={class:"dss-text-editor-footer-content"},Ym={class:"dss-text-editor-footer-stat"},jm={class:"dss-text-editor-footer-stat"},Km=["title"],Gm=["title"],Qm={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:""},Jm={class:"dss-image-popup-content"},e2={key:0,class:"dss-image-popup-no-alt-icon"},t2=["title"],l2=["title"],n2={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:""},o2={class:"dss-toolbar-left"},a2=["title"],s2=["title"],r2={class:"dss-toolbar-dropdown-wrapper"},i2=["title"],c2=["src"],u2=["src"],d2=["src"],m2=["src"],p2=["src"],v2=["src"],f2={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},h2=["title"],g2=["title"],y2=["title"],k2=["title"],C2=["title"],b2=["title"],w2=["title"],x2=["title"],E2=["title"],S2={key:2,class:"dss-toolbar-separator"},V2=["title"],N2={key:4,class:"dss-toolbar-separator"},B2={key:5,class:"dss-toolbar-dropdown-wrapper"},M2=["title"],_2={class:"dss-toolbar-dropdown-ai"},$2={key:0,class:"dss-toolbar-right"},L2={key:0,class:"dss-toolbar-separator"},T2={key:0,class:"dss-toolbar-custom-group"},A2={key:1,class:"dss-toolbar-separator"},D2={name:"DSSTextEditor"},H2=Object.assign(D2,{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:S=>typeof S=="object"&&S!==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:S=>typeof S=="object"&&S!==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(S,{expose:ee,emit:L}){const{t:N,locale:ue}=so.useI18n(),O={h1:Td,h2:Ad,h3:Dd,h4:Hd,h5:Rd,h6:Fd},H=S,me=L,ot=e.useSlots(),ne=`<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>`,v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(!1),me=e.ref(""),F=e.ref({}),ue=e.ref(!1),$e=e.ref(!1),tt=e.ref(""),mt=e.ref(""),U=e.ref(null),ze=e.ref(null),qe=e.ref(null),Ve=e.ref(null),Le=e.ref(""),je=e.ref(!1),re=e.ref({}),Qe=e.ref(!1),Ce=e.ref({}),Je=e.ref(null),ut=e.ref(null),ht=e.ref(!1),dt=e.ref(""),Wt=e.ref(null),qt=e.ref(""),Ct=e.ref(""),wt=e.ref(""),Yt=e.ref(null),it=e.ref(null),Kt=e.ref(null),yt=e.ref(null),el=e.ref(null),X=e.ref(!1),ge=e.ref(""),W=e.ref({}),G=e.ref(!1),Ne=e.ref("upload"),Pe=e.ref(""),Xe=e.ref(null),Et=e.ref(null),Ge=e.ref([]),Zt=e.ref([]),Ue=e.ref(null),We=e.ref(!1),Dt=e.ref(""),Lt=e.ref(""),ne=e.ref(""),j=e.ref(""),K=e.ref(""),de=e.ref(""),xe=e.ref(null),Ke=e.ref(null),Ht=e.ref(null),jt=e.ref(!1),et=e.ref(null),vl=e.ref(!1),M=e.ref(!1),x=e.ref(null),A=e.ref("p"),ae=e.ref(!1),oe=e.ref([]),Fe=e.ref(null),bt=e.ref(null),ot=e.ref(null),Ie=e.ref(!1),xt=e.ref(0),Mt=100,St=e.ref(null),At=e.computed(()=>!!L.commentUser),It=e.computed(()=>({"dss-text-editor-no-border":!L.border,"dss-text-editor-rounded":L.rounded,"dss-text-editor-full-height":L.fullHeight,"dss-comment-overlay-open":At.value&&Cl.value!==null})),Nt=e.computed(()=>({})),yl=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+24+2}px`,resize:"none",overflowY:"auto"}),nn=e.computed(()=>!L.fixedHeight||L.fullHeight?{}:{height:`${1.6*14*L.rows+32}px`,overflowY:"auto"}),Vl=e.computed(()=>L.richText&&Zt.value.length>0),Nl=e.computed(()=>{if(!L.modelValue)return"";if(L.richText){let a=L.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return L.modelValue}),tl=e.computed(()=>{const a=Nl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),jl=e.computed(()=>Nl.value.length),on=e.computed(()=>yt.value!==null&&Ne.value==="upload"&&qt.value&&qt.value.startsWith("data:")),xl=e.computed(()=>L.titlePlaceholder||V("textEditor.placeholders.title")),Fl=e.computed(()=>L.descriptionPlaceholder||V("textEditor.placeholders.description")),dn=e.computed(()=>L.placeholder||V("textEditor.placeholders.startTyping")),Hl=a=>rt&&rt[a]!==void 0,Pn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++)if(Hl(L.customToolbarSlots[n]))return!0;return!1},mn=a=>{for(let n=a+1;n<L.customToolbarSlots.length;n++){const s=L.customToolbarSlots[n];if(Hl(s)&&pn(s))return!0}return!1},pn=a=>L.customToolbarFloatingMap.hasOwnProperty(a)?L.customToolbarFloatingMap[a]===!0:!0,wn=e.computed(()=>L.customToolbarSlots.some(a=>Hl(a)&&pn(a))),ql=e.computed(()=>Hl("title-slot")),rl=e.computed(()=>Hl("description-slot")),Il=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},Kl=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},sn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},T=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},z=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=V("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"},_=a=>{const n=a.target.value;fe("update:modelValue",n),fe("change",n)},le=()=>{if(!xe.value)return;const a=xe.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},Te=()=>{vl.value=!0,le()},pt=()=>{vl.value=!1,ct()},ct=()=>{if(!xe.value)return;const a=xe.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},lt=a=>{const s=a.target.value;vl.value&&le(),fe("update:title",s),fe("title-change",s),Ht.value="title",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},st=()=>{if(!Ke.value)return;const a=Ke.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},il=()=>{M.value=!0,st()},kl=()=>{M.value=!1,Gt()},Gt=()=>{if(!Ke.value)return;const a=Ke.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},wl=a=>{const s=a.target.value;M.value&&st(),fe("update:description",s),fe("description-change",s),Ht.value="description",L.richText&&(We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt()},500))},Rt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(v.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Ll=a=>{if(!(!a||!v.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(v.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{v.value.focus();return}let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}n.removeAllRanges(),n.addRange(s)}catch{v.value.focus()}},fn=()=>{if(!v.value)return;v.value.focus();const a=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],p=s(u);if(p)return p}return c},i=s(v.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},Qt=(a=!1)=>{if(!v.value)return;const n=v.value.innerHTML,s=L.title||"",i=L.description||"";if(!a&&n===Dt.value&&s===ne.value&&i===j.value)return;const c={content:Lt.value||Dt.value,title:K.value!==void 0?K.value:ne.value,description:de.value!==void 0?de.value:j.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Zt.value=[]),Dt.value=n,ne.value=s,j.value=i,Lt.value=n,K.value=s,de.value=i},_t=a=>{if(!v.value)return;Ln(),v.value&&sn(v.value);let n=null;v.value&&(v.value.querySelector("p")||(n=Rt(),En()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&x.value&&(x.value=null),J.value=!0;const i=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Il(i);fe("update:modelValue",c),fe("change",c),Ht.value="editor",We.value||(Lt.value=Dt.value,K.value=ne.value,de.value=j.value),Ue.value&&clearTimeout(Ue.value),We.value=!0,Ue.value=setTimeout(()=>{We.value=!1,Qt(),vo(),Fn()},500),e.nextTick(()=>{n&&Ll(n),Ln();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,h=p&&p.collapsed;if(d.forEach(k=>{try{if(h&&x.value?.command===k){re.value[k]=x.value.state;return}if(k==="bold")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D;let N=!1;if(I&&((I.tagName==="STRONG"||I.tagName==="B"||I.closest&&I.closest("strong, b"))&&(N=!0),!N&&I.style&&parseInt(I.style.fontWeight)>=600&&(N=!0),!N))try{const se=window.getComputedStyle(I);parseInt(se.fontWeight)>=600&&(N=!0)}catch{}re.value[k]=N}else re.value.hasOwnProperty(k)||(re.value[k]=!1);else if(k==="italic")if(p){const D=p.commonAncestorContainer,I=D.nodeType===3?D.parentElement:D,N=I&&(I.tagName==="EM"||I.tagName==="I"||I.closest&&I.closest("em, i"));re.value[k]=!!N}else{const D=document.queryCommandState(k);re.value[k]=D}else{const D=document.queryCommandState(k);re.value[k]=D}}catch{}}),Tt(),Zl(),Gl(),cl(),rn(),Yl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Fn(k),0),(k===" "||k===`
|
|
103
|
-
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{vo()},100)}J.value=!1})},Ln=()=>{if(!v.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const h=document.createRange();h.setStartAfter(c),h.collapse(!0),a.removeAllRanges(),a.addRange(h)}}}},En=()=>{if(!v.value)return;const a=v.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},Zl=()=>{if(v.value&&!jt.value){jt.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),v.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),D=c===d||c===k;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||D||D)&&(c="")}i.setAttribute("alt",c),i.setAttribute("data-alt",c);const u=!c||c.trim()==="";let p=i.parentElement;const h=p&&p.classList.contains("dss-image-wrapper");if(h){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){h?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ee,p.appendChild(k)}else if(h&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{jt.value=!1}}},vn=a=>{vo(),fe("blur",a),Bn()},hn=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value&&(Qt(),We.value=!1);const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Ge.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Zt.value.push(i);const c=Ge.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},An=()=>{if(L.disabled||!L.richText||!v.value)return;nl();const a=Ht.value==="title",n=Ht.value==="description",s=Ht.value==="editor";if(Zt.value.length===0){a&&xe.value?xe.value.focus():n&&Ke.value?Ke.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{_t()});return}const i={content:v.value.innerHTML,title:L.title||"",description:L.description||""};Ge.value.push(i);const c=Zt.value.pop();if(c!==void 0){J.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";v.value.innerHTML=d,Dt.value=d,ne.value=u,j.value=p,Lt.value=d,K.value=u,de.value=p,e.nextTick(()=>{Tt(),El(),yn(),cl();const h=Il(d);fe("update:modelValue",h),fe("update:title",u),fe("update:description",p),fe("change",h),fe("title-change",u),fe("description-change",p),J.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(xe.value){xe.value.focus();const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}}else if(n){if(Ke.value){Ke.value.focus();const k=p.length;Ke.value.setSelectionRange(k,k)}}else if(s)fn();else if(xe.value&&document.activeElement===xe.value){const k=u.length;xe.value.setSelectionRange&&xe.value.setSelectionRange(k,k),le()}else if(Ke.value&&document.activeElement===Ke.value){const k=p.length;Ke.value.setSelectionRange(k,k)}else v.value&&fn()},10)})})}},Tn=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),v.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Gl=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},ll=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{Gl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Gl()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Gl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Gl()})}return!0},Xn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Tn()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const h=document.createElement("b");h.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);h.appendChild(k),u.parentNode&&u.parentNode.replaceChild(h,u),c.setStart(h,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Tn()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Tn()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Tn()})}return!0},Ql=(a,n=null)=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Nn(d)&&(i=Rt())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const h=document.createTextNode(n);u.insertNode(h),u.selectNodeContents(h)}}}if(a==="bold"){const d=Xn();re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("bold");re.value.bold=p})),_t(),El(),cl()});return}if(a==="italic"){const d=ll();re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(x.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Ll(i),e.nextTick(()=>{const p=Jt("italic");re.value.italic=p})),_t(),Gl(),El(),cl()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Ll(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Jt("bold");re.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Jt("italic");re.value.italic=u});else{const u=document.queryCommandState(a);re.value[a]=u}else{const u=document.queryCommandState(a);re.value[a]=u}}catch{re.value.hasOwnProperty(a)?re.value[a]=!re.value[a]:re.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const h=u.getRangeAt(0),k=h.commonAncestorContainer.nodeType===1?h.commonAncestorContainer.closest("a"):h.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}v.value.querySelectorAll("a").forEach(h=>{const k=h.getAttribute("href");(!k||k===""||k==="#")&&h.setAttribute("href",n)})}_t(),El(),cl()})},Jt=(a,n=null)=>{if(L.disabled||!v.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="STRONG"||h.tagName==="B"||h.closest&&h.closest("strong, b"))&&(u=!0),!u&&h.style&&parseInt(h.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(h);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="STRONG"||I.tagName==="B"){u=!0;break}if(I.style&&parseInt(I.style.fontWeight)>=600){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,h=p.nodeType===3?p.parentElement:p;if(h&&((h.tagName==="EM"||h.tagName==="I"||h.closest&&h.closest("em, i"))&&(u=!0),!u&&h.style&&h.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(h).fontStyle==="italic"&&(u=!0)}catch{}return re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let h=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let D;for(;D=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(D))){if(D.nodeType===3){if(!(D.textContent||"").trim())continue;h=!0;let N=D.parentElement;for(;N&&N!==v.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(D.nodeType===1){const I=D;if(I.tagName==="EM"||I.tagName==="I"){u=!0;break}if(I.style&&I.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return re.value[a]=u&&h,u&&h}}const d=document.queryCommandState(a);return c.collapsed&&re.value.hasOwnProperty(a)?re.value[a]:(re.value[a]=d,d)}return re.value.hasOwnProperty(a)?re.value[a]:!1}catch{return re.value.hasOwnProperty(a)?re.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Dn=a=>{L.disabled||!L.richText||(be.value=be.value===a?null:a,a==="askAi"&&(ut.value=null))},nl=()=>{be.value=null,Xe.value=null},zl=a=>{Ql("formatBlock",a),nl()},On=a=>{if(!a||!v.value)return a;const n=Be=>{let _e=Be.nodeType===Node.TEXT_NODE?Be.parentElement:Be;for(;_e&&_e!==v.value;){const He=_e.tagName;if(He==="P"){const Sl=_e.parentElement;if(Sl===v.value||Sl.tagName==="BLOCKQUOTE")return _e}if(He==="BLOCKQUOTE")break;_e=_e.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Be=>{const _e=Be.tagName;if(_e==="P"){const He=Be.parentElement;if(He===v.value||He.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return _e==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),h=c.indexOf(i);if(p===-1||h===-1)return a;const k=Math.min(p,h),D=Math.max(p,h),I=c.slice(k,D+1);if(I.length===0)return a;const N=I[0],se=I[I.length-1],Q=document.createRange();return Q.setStartBefore(N),Q.setEndAfter(se),Q},zt=()=>{if(L.disabled||!L.richText||!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&Nn(n)&&(n=On(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&Nn(n)&&(s=Rt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(h=>{if(h.nodeType===Node.ELEMENT_NODE)if(h.tagName==="P"||h.tagName==="DIV")u.insertBefore(h,c);else{const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}else if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim()){const k=document.createElement("p");k.appendChild(h.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const h=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let D;for(;D=k.nextNode();)h.push(D);if(h.forEach(N=>{const se=document.createElement("p");N.parentNode.insertBefore(se,N),se.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{s&&Ll(s),yn(),_t(),cl()})},Me=()=>{if(!v.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!v.value.contains(i))return;const c=D=>{if(!D)return!1;const I=D.textContent||"",se=(D.innerHTML||"").trim();return I.trim()===""||se===""||se==="<br>"||se==="<br/>"||se==="<p></p>"||se==="<p><br></p>"||se==="<p><br/></p>"||se==="<p> </p>"||se==="<p><br> </p>"||se==="<div></div>"||se==="<div><br></div>"||se==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const D=i.lastChild;if(D.nodeType===1&&D.tagName==="BR")D.remove();else if(D.nodeType===3)if((D.textContent||"").trim()==="")D.remove();else break;else break}if(i.children.length>0)for(let D=i.children.length-1;D>=0;D--){const I=i.children[D];if((I.tagName==="P"||I.tagName==="DIV")&&c(I))I.remove();else break}let u=i.innerHTML;const p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const h=document.createElement("p");h.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(h,i.nextSibling):i.parentNode.appendChild(h):v.value&&v.value.appendChild(h);const k=document.createRange();k.selectNodeContents(h),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{yn(),_t()})},El=()=>{if(!v.value){ke.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ke.value=!!i}else ke.value=!1}catch{ke.value=!1}},kt=()=>{if(!v.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),Ve.value=Rt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),tt.value="",mt.value=s,Le.value="",qe.value=null,$e.value=!0,nl(),e.nextTick(()=>{U.value&&U.value.focus()})},Ml=()=>{if(!v.value)return;We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}qe.value=null}else Ql("unlink");ke.value=!1,nl(),e.nextTick(()=>{_t(),El()})},nt=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ft=()=>{L.disabled||!L.richText||v.value&&(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),nl(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Tt(),_t(),cl()}))},ie=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Tt=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=ie(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},De=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=ie(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Tt();const h=document.createRange();h.selectNodeContents(s),h.collapse(!1),a.removeAllRanges(),a.addRange(h),e.nextTick(()=>{_t(),cl()})}else document.execCommand("indent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Jl=()=>{if(L.disabled||!L.richText||!v.value)return;nl(),v.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Tt();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{_t(),cl()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Tt(),_t(),cl()})},Cl=e.ref(null),Al=e.ref(null),y=e.ref({}),g=e.ref(""),w=e.ref(null),Z=e.ref("");e.ref("");const he=e.ref(null);e.ref("");const at=e.ref([]),Bt=e.ref(!1),bl=e.ref(!1),Pl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Ul=()=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;if(Cl.value!==null){Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0);return}nl(),v.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!Nn(n))return;Z.value=Pl(n)||"",he.value=Rt();const s=n.getBoundingClientRect(),i=v.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},Cl.value=Date.now(),e.nextTick(()=>{if(g.value="",w.value){const k=w.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const h=i.querySelector(".dss-comment-overlay");if(h&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const D=i.getBoundingClientRect(),I=h.getBoundingClientRect(),N=k.getBoundingClientRect(),se=I.bottom-D.top,Q=N.top-D.top,Be=8;if(se>Q-Be){const _e=N.height;y.value={bottom:`${_e+Be}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},gn=()=>{if(!g.value.trim())return;const a=g.value.trim(),n=new Date,s={text:a,selectionText:Z.value,selectionRange:he.value,commentId:Cl.value,user:L.commentUser||null,createdAt:n.toISOString()};at.value=[...at.value,s],fe("comment-submitted",s),Yo(s),he.value&&!Xo(he.value)&&bo(Cl.value,he.value),g.value="",e.nextTick(()=>{if(w.value){const i=w.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}Yl("sendComment")})},mo=(a,n)=>{if(!(!L.commentUser||!a.user||a.user.id!==L.commentUser.id)){if(at.value=at.value.filter((s,i)=>i!==n),Cl.value!==null&&v.value){const s=String(Cl.value),i=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&at.value.length>0){const c=[],d=new Set;at.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(at.value.length))}else i&&at.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(fe("comment-deleted",{comment:a,index:n,commentId:Cl.value}),L.comments&&Array.isArray(L.comments)){const s=L.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));fe("update:comments",s)}e.nextTick(()=>{Yl("deleteComment")})}},Xo=a=>{if(!a||!v.value)return!1;try{const n=Co(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Co=a=>{if(!a||!v.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return v.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},bo=(a,n)=>{if(!(!a||!n||!v.value))try{const s=Co(n);if(!s||s.collapsed)return;const i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,h=s.endContainer,k=s.startOffset,D=s.endOffset,I=p.nodeType===3?p.parentNode:p,N=h.nodeType===3?h.parentNode:h;if(I===N&&k===0&&D===(h.nodeType===3?h.length:N.childNodes.length)&&(I.tagName==="P"||I.tagName==="DIV"||I.tagName==="H1"||I.tagName==="H2"||I.tagName==="H3"||I.tagName==="H4"||I.tagName==="H5"||I.tagName==="H6")){const Q=s.extractContents();d.appendChild(Q),s.insertNode(d)}else s.surroundContents(d)}catch{const h=s.extractContents();d.appendChild(h),s.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{Yl("wrapSelectionWithCommentMarker"),_t()})}catch{}},Yo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(L.comments)?[...L.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(h=>h.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}Bt.value=!0,fe("update:comments",n)},Sn=(a,n=[])=>{if(!L.commentUser||L.disabled||!L.richText||!v.value)return;const s=v.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),Z.value=i.innerHTML||"",he.value=Rt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const D=p.getBoundingClientRect(),I=u.bottom-D.top,se=Math.max(I+8,0);y.value={top:`${se}px`,bottom:"auto"}}const h=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(h&&L.comments&&Array.isArray(L.comments)){const D=L.comments.find(I=>String(I.conversation_id)===String(h));if(D&&D.conversation&&Array.isArray(D.conversation)){const I=D.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:D.id||D.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));k.push(...I)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((D,I)=>{const N=Be=>{if(!Be)return 0;const _e=new Date(Be).getTime();return isNaN(_e)?0:_e},se=N(D.createdAt),Q=N(I.createdAt);return se===Q?0:se-Q}),at.value=k,bn(!0),Cl.value=h||null,i&&(Al.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(g.value="",w.value){const D=w.value;D.style.height="auto",D.style.height=`${D.scrollHeight}px`,D.focus()}if(p){const D=p.querySelector(".dss-comment-overlay");if(D){const I=p.querySelector(".dss-text-editor-footer");if(I){const N=p.getBoundingClientRect(),se=D.getBoundingClientRect(),Q=I.getBoundingClientRect(),Be=se.bottom-N.top,_e=Q.top-N.top,He=8;if(Be>_e-He){const Sl=Q.height;y.value={bottom:`${Sl+He}px`,top:"auto"}}}}}Yl("openCommentOverlayForSelector")})},po=e.ref(null),xo=e.ref(0),jo=a=>{if(!(L.disabled||!L.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{Me()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,h=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(h)&&h!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const h=c.contains(u)||u===c,k=c.contains(p)||p===c,I=s.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!h||!k||I.length>N.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{_t()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Jl():De();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=h=>{if(!h)return!1;let k=h.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const D=h.parentElement;return D&&D!==v.value?p(D):!1};if(u.nodeType===3){const h=u.parentElement;if(h&&(p(h)||p(u))){const k=h.closest("p, div");if(k&&k!==v.value){a.preventDefault(),a.stopPropagation();let D=null;const I=s.startOffset;I<u.length&&(D=u.splitText(I));const N=document.createElement("p");if(D?N.appendChild(D):N.innerHTML="<br>",u.length===0){const Q=u.parentElement;Q&&(Q.removeChild(u),Q.childNodes.length===0&&Q.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(N,k.nextSibling):k.parentNode.appendChild(N);const se=document.createRange();D?se.setStart(D,0):se.setStart(N,0),se.collapse(!0),n.removeAllRanges(),n.addRange(se),e.nextTick(()=>{_t()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=Q=>{if(!Q)return!1;const Be=Q.textContent||"",He=(Q.innerHTML||"").trim(),Sl=He.replace(/<br\s*\/?>/gi,"").trim();return Be.trim()===""||He===""||Sl===""||He==="<br>"||He==="<br/>"||He==="<p></p>"||He==="<p><br></p>"||He==="<p><br/></p>"||He==="<p> </p>"||He==="<p><br> </p>"||He==="<div></div>"||He==="<div><br></div>"||He==="<div><br/></div>"},h=c.lastChild,k=h&&h.nodeType===1&&h.tagName==="BR",D=s.startContainer,I=D.nodeType===3?D.parentElement:D,N=I===c||I&&I.parentElement===c;if(u&&p(u)||k&&N){a.preventDefault(),setTimeout(()=>{Me()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-xo.value;if(po.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),De();return}}}}po.value=" ",xo.value=n}else po.value=a.key}},wo=a=>{if(L.disabled||!L.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const h=new DOMParser().parseFromString(u,"text/html");let k=v.value.querySelector("h1")?1:0;if(h.querySelectorAll("h1").forEach(I=>{if(k>0){const N=h.createElement("p");N.innerHTML=I.innerHTML,I.parentNode.replaceChild(N,I)}else k++}),c){const I=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(h.body.children).filter(se=>I.includes(se.tagName));if(N.length===1){const se=N[0].tagName,Q=c.tagName,Be=c.textContent.trim()===""&&!c.querySelector("img");let _e=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Q)?_e=!0:Be||(se===Q||se==="P")&&(_e=!0),_e)return N[0].innerHTML.trim()}}return h.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);_t()},Eo=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(Qe.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=v.value&&s.closest(".dss-text-editor-content");!i&&!c&&Bn()}if(ut.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Tl()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Xe.value=null),!v.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&&Nn(i)}else ae.value=!1}if(Cl.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,h=a.clientY;i=p>=u.left&&p<=u.right&&h>=u.top&&h<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(Cl.value=null,g.value="",Z.value="",he.value=null,at.value=[],bn(!0))}},Hn=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),Et.value&&(clearTimeout(Et.value),Et.value=null),Xe.value=n},fo=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}Et.value&&clearTimeout(Et.value),Et.value=setTimeout(()=>{Xe.value=null,Et.value=null},150)},Vn=a=>{Xe.value=null};let Ko=0;const Go=a=>{if(!a)return;const n=Array.from(a.children);n.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),n.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Ko}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let h=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),h=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),h=d),h&&(h.setAttribute("data-submenu-id",p),h.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?h.dataset.originalParentRef="inside":h.dataset.originalParentRef="sibling",Array.from(h.children).forEach(D=>{(D.tagName==="BUTTON"||D.tagName==="DIV")&&!D.classList.contains("dss-toolbar-dropdown-item")&&D.classList.add("dss-toolbar-dropdown-item")}))}})},So=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Go(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const k=c.getAttribute("data-submenu-id");k&&Hn(h,k)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const D=c.getAttribute("data-submenu-id");D&&Hn(k,D)},p=fo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Vn)})})})};let Rn=null;const Yn=()=>{if(Xe.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Xe.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Xe.value}"]`);a&&n&&tn(a,n)}if(Qe.value&&cl(),L.richText){if(Rn!==null)return;Rn=setTimeout(()=>{Rn=null,Yl("handleWindowResize")},150)}},jn=()=>{if(!L.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")})})},Qo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{vl.value?le():ct(),M.value?st():Gt()})}),e.nextTick(()=>{Qo()}),L.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Eo),window.addEventListener("resize",Yn);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,Yn()},150))};window.addEventListener("scroll",n,!0),v.value._windowScrollHandler=n,v.value._windowScrollTimeout=a,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const s=v.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,Yn()},150))};s&&(s.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{So(),jn()}),v.value.addEventListener("click",p=>{const h=p.target;h.closest("a")&&!L.disabled&&p.preventDefault();const D=h.closest(".dss-image-no-alt-icon"),I=h.closest(".dss-image-wrapper");if(D||I&&h===I){p.preventDefault(),p.stopPropagation();const N=window.getSelection(),se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.removeAllRanges(),N.addRange(se)}else I&&h.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Q=N.getRangeAt(0).commonAncestorContainer,Be=Q.nodeType===3?Q.parentElement:Q;if(I.contains(Be)&&Be!==I.querySelector("img")){const _e=document.createRange();_e.setStartAfter(I),_e.collapse(!0),N.removeAllRanges(),N.addRange(_e)}}else{const se=document.createRange();se.setStartAfter(I),se.collapse(!0),N.addRange(se)}}))},!0),v.value.addEventListener("mousedown",p=>{const h=p.target,k=h.closest(".dss-image-no-alt-icon"),D=h.closest(".dss-image-wrapper");if(k||D&&h.tagName!=="IMG"){p.preventDefault();const I=window.getSelection(),N=document.createRange();D&&(N.setStartAfter(D),N.collapse(!0),I.removeAllRanges(),I.addRange(N))}},!0),v.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const I=k.getAttribute("alt")||k.alt||"";if(I){const N=k.getAttribute("src")||k.src||"",se=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Q=I===N||I===se;(I.startsWith("http://")||I.startsWith("https://")||I.startsWith("data:")||Q||Q)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),Zl()})}),v.value.addEventListener("dragstart",p=>{const h=p.target,k=h.tagName==="IMG"?h:h.closest("img"),D=k?.closest(".dss-image-wrapper");k&&v.value.contains(k)&&(et.value=D||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",p=>{et.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",p=>{et.value&&(p.preventDefault(),p.stopPropagation())}),v.value.addEventListener("drop",p=>{if(!et.value||!v.value)return;p.preventDefault(),p.stopPropagation();const h=et.value,k=h.classList?.contains("dss-image-wrapper"),D=k?h.querySelector("img"):h,I=k?h:D?.closest(".dss-image-wrapper");if(!D||!v.value.contains(D)){et.value=null;return}let N=null;const se=p.clientX,Q=p.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(se,Q);else{const ml=window.getSelection();ml.rangeCount>0?N=ml.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(v.value),N.collapse(!1))}if(!N){et.value=null;return}const Be=N.commonAncestorContainer,_e=Be.nodeType===3?Be.parentElement:Be;if(_e?.closest(".dss-image-wrapper")===I||I&&I.contains(_e)){et.value=null;return}if(I&&(_e===I||I.contains(_e))){et.value=null;return}const Sl=D.getAttribute("src");let hl=null;I?hl=I.cloneNode(!0):hl=D.cloneNode(!0);try{let ml=N.startContainer;if(ml.nodeType===3&&(ml=ml.parentElement),I&&(ml===I||I.contains(ml))){const pl=document.createRange();pl.setStartAfter(I),pl.collapse(!0),N=pl}N.insertNode(hl);const vt=document.createRange();vt.setStartAfter(hl),vt.collapse(!0);const Xt=window.getSelection();Xt.removeAllRanges(),Xt.addRange(vt)}catch{if(v.value.childNodes.length===0){const vt=document.createElement("p");vt.appendChild(hl),v.value.appendChild(vt)}else{const vt=v.value.lastChild;if(vt&&vt.nodeType===1)vt.appendChild(hl);else{const Xt=document.createElement("p");Xt.appendChild(hl),v.value.appendChild(Xt)}}}I?I.remove():D.remove(),et.value=null,e.nextTick(()=>{const ml=v.value.querySelectorAll("img");let vt=!1;ml.forEach(Xt=>{if(Xt.getAttribute("src")===Sl)if(!vt)vt=!0;else{const pl=Xt.closest(".dss-image-wrapper");pl?pl.remove():Xt.remove()}}),Zl(),_t()})}),v.value.addEventListener("dragend",p=>{et.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(h=>{h.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const D=k.querySelectorAll&&k.querySelectorAll("img");D&&D.forEach(I=>{I.removeAttribute("alt"),I.removeAttribute("data-alt"),I.setAttribute("alt",""),I.setAttribute("data-alt",""),I.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Zl(),jn(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const h=new MutationObserver(()=>{e.nextTick(()=>{jn()})});h.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=h}}),L.modelValue){const p=Kl(L.modelValue);v.value.innerHTML=p,En()}e.nextTick(()=>{const p=v.value.innerHTML||"",h=L.title||"",k=L.description||"";Dt.value=p,ne.value=h,j.value=k,K.value=h,de.value=k,Tt(),Zl(),Gl(),rn(),_o(),Qn()}),El(),yn(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Eo),window.removeEventListener("resize",Yn),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Rn!==null&&(clearTimeout(Rn),Rn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),Ue.value&&clearTimeout(Ue.value),Et.value&&clearTimeout(Et.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Fe.value&&Fe.value.disconnect(),bt.value!==null&&(cancelAnimationFrame(bt.value),bt.value=null),ot.value!==null&&(clearTimeout(ot.value),ot.value=null),St.value!==null&&(clearTimeout(St.value),St.value=null),bn(!0),v.value&&v.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=v.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const Vo=a=>{const n=a.target,s=n.closest("a");if(s&&!L.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const h=document.createRange();h.setStartAfter(i),h.collapse(!0),c.removeAllRanges(),c.addRange(h)}}Zl(),El(),yn(),cl(),rn()}):e.nextTick(()=>{Zl(),El(),yn(),cl(),rn()})},Kn=()=>{Ln();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ae.value=!s.collapsed&&Nn(s),!s.collapsed&&x.value&&(x.value=null)}else ae.value=!1;if(Zl(),El(),yn(),cl(),rn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),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 d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const h=window.getComputedStyle(u);parseInt(h.fontWeight)>=600&&(p=!0)}catch{}re.value[s]=p}else{const d=document.queryCommandState(s);re.value[s]=d}}}catch{}})},rn=()=>{if(!L.richText||L.disabled||!v.value){A.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){A.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!v.value.contains(i)){A.value="p";return}const c=i.closest("h1, h2, h3, h4, h5, h6, p");if(!c){A.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?A.value=d:A.value="p"}catch{A.value="p"}},yn=()=>{if(!v.value){je.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&v.value.contains(c))}je.value=n}catch{je.value=!1}},Nn=a=>{if(!a||!v.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?v.value.contains(s):!1},Bn=()=>{Qe.value=!1},cl=()=>{if(!L.floatingToolbar||!L.richText||L.disabled){Qe.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Qe.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!Nn(n)){Qe.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Qe.value=!1;return}const i=v.value;if(!i){Qe.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Qe.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let h=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let D=0;Je.value&&(D=Je.value.getBoundingClientRect().width);const I=(D||320)/2;let N=c.left+I,se=c.right-I;if(se<N){const Q=c.left+c.width/2;N=Q,se=Q}if(k>0){const Q=I+u,Be=k-I-u;if(N=Math.max(N,Q),se=Math.min(se,Be),se<N){const _e=k/2;N=_e,se=_e}}h<N?h=N:h>se&&(h=se),Ce.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${h}px`,transform:"translate(-50%, -100%)",zIndex:10003},Qe.value=!0},Gn=a=>{L.disabled||!L.richText||(ut.value=ut.value===a?null:a,a==="askAi"&&(be.value=null))},Tl=()=>{ut.value=null,Xe.value=null},R=a=>{zl(a),Tl()};let ol=null,_l=null,en=null,al=null;const Bl=a=>{if(L.disabled||!L.richText){Ol(),Xl();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),s&&s!==_l){Xl(),_l=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,me.value=c,Y.value=!0,ue.value=!0,dl(s)}else!s&&_l?(_l=null,ol=setTimeout(()=>{ue.value||Ol()},150)):s&&s===_l&&dl(s);if(i&&i!==al){Ol(),al=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),yt.value=i,ge.value=c.trim()||V("textEditor.image.noAlt"),X.value=!0,G.value=!0,kn(i)}else!i&&al?(al=null,en=setTimeout(()=>{G.value||Xl()},150)):i&&i===al&&kn(i)},ul=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(_l=null,al=null,ol&&(clearTimeout(ol),ol=null),en&&(clearTimeout(en),en=null),Ol(),Xl())},Ol=()=>{ue.value=!1,setTimeout(()=>{ue.value||(Y.value=!1,me.value="",$e.value||(qe.value=null))},100)},dl=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;F.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Xl=()=>{G.value=!1,setTimeout(()=>{G.value||(X.value=!1,ge.value="",ht.value||(yt.value=null))},100)},kn=a=>{if(!a||!v.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;W.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Ut=()=>{if(!me.value||!qe.value)return;let n=qe.value.getAttribute("href")||me.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Pt=()=>{if(qe.value){const a=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;tt.value=n,mt.value=a,Le.value=a,ue.value=!1,Y.value=!1,me.value="",qe.value=s,$e.value=!0}else if(ke.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";tt.value=d,mt.value=c,Le.value=c,qe.value=i,$e.value=!0}}}else{Ve.value=Rt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),tt.value="",mt.value=n,Le.value="",qe.value=null,$e.value=!0}e.nextTick(()=>{U.value&&(U.value.focus(),U.value.select())})},gt=()=>{$e.value=!1,tt.value="",mt.value="",Le.value="",qe.value=null,Ve.value=null},sl=()=>{if(!tt.value.trim()){gt();return}if(We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt(),mt.value.trim()||(mt.value=tt.value.trim()),qe.value&&v.value&&v.value.contains(qe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=qe.value;if(n.setAttribute("href",tt.value.trim()),mt.value.trim()!==Le.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=mt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),_t()}else if(v.value){v.value.focus();const a=window.getSelection();a.removeAllRanges(),Ve.value&&Ll(Ve.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=tt.value.trim(),s.textContent=mt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(v.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=tt.value.trim(),d.textContent=mt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const h=document.createTextNode(" ");p.appendChild(h);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),D=k[k.length-1];if(D&&D!==" "&&D!==" "&&D!==`
|
|
104
|
-
`){const
|
|
105
|
-
`){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}_t()}e.nextTick(()=>{El(),gt()})},vo=()=>{if(!v.value||J.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Rt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const h=p.parentElement;return!h||h.closest("a")||h.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const h=c[p],k=h.textContent;s.lastIndex=0;const D=[...k.matchAll(s)];if(D.length===0)continue;const I=D.filter(Q=>{const Be=Q[0],_e=Q.index;if(_e>0&&k[_e-1]==="@"||_e+Be.length<k.length&&k[_e+Be.length]==="@")return!1;const He=h.parentElement;return!(He&&He.closest("a"))});if(I.length===0)continue;if(I.length===1&&I[0][0]===k.trim()){const Q=I[0][0],Be=Q.startsWith("http://")||Q.startsWith("https://")?Q:`https://${Q}`,_e=document.createElement("a");_e.href=Be,_e.textContent=Q,_e.style.color="#60afdf",_e.style.textDecoration="underline",h.parentNode&&(h.parentNode.replaceChild(_e,h),u=!0);continue}let N=0;const se=document.createDocumentFragment();if(I.forEach(Q=>{const Be=Q.index,_e=Q[0];if(Be>N){const hl=k.substring(N,Be);hl&&se.appendChild(document.createTextNode(hl))}const He=_e.startsWith("http://")||_e.startsWith("https://")?_e:`https://${_e}`,Sl=document.createElement("a");Sl.href=He,Sl.textContent=_e,Sl.style.color="#60afdf",Sl.style.textDecoration="underline",se.appendChild(Sl),N=Be+_e.length}),N<k.length){const Q=k.substring(N);Q&&se.appendChild(document.createTextNode(Q))}h.parentNode&&se.childNodes.length>0&&(h.parentNode.replaceChild(se,h),u=!0)}u&&n&&e.nextTick(()=>{Ll(n),El()})},No=()=>{if(!v.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let h=0;const k=document.createDocumentFragment();p.forEach(D=>{const I=D.index,N=D[0].startsWith("<u>")?"u":"ins",se=D[1]||D[2]||"";I>h&&k.appendChild(document.createTextNode(u.substring(h,I)));const Q=document.createElement(N);Q.textContent=se,k.appendChild(Q),h=I+D[0].length}),h<u.length&&k.appendChild(document.createTextNode(u.substring(h))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Fn=a=>{if(!v.value||J.value)return;if(!a){No();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let hl="",ml=0,vt=!1;const Xt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:gl=>gl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let pl=0;for(;Xt.nextNode();){const gl=Xt.currentNode,xn=gl.textContent||"",Wl=pl;if(pl+=xn.length,gl===i.startContainer){hl+=xn.substring(0,i.startOffset),ml=Wl+i.startOffset,vt=!0;break}hl+=xn}return vt||(ml=hl.length),{textBeforeCursor:hl,cursorCharOffset:ml}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,h=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?h="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?h="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(h=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],D=p[1],I=u.length-k.length,se=(hl=>{let ml=0;const vt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:pl=>pl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Xt;for(;Xt=vt.nextNode();){const pl=(Xt.textContent||"").length;if(ml+pl>=hl)return{node:Xt,offset:hl-ml};ml+=pl}return null})(I);if(!se)return;const Q=document.createRange();Q.setStart(se.node,se.offset),Q.setEnd(i.endContainer,i.endOffset);const Be=document.createElement(h);Be.textContent=D,Q.deleteContents(),Q.insertNode(Be);const _e=window.getSelection(),He=document.createRange();He.setStartAfter(Be),He.collapse(!0),_e.removeAllRanges(),_e.addRange(He);const Sl=Rt();e.nextTick(()=>{_t(),Sl&&Ll(Sl)})},Wn=()=>{v.value&&(el.value=Rt(),dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,Ne.value="upload",ht.value=!0,nl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),it.value&&(it.value.value="")}))},Cn=a=>{const n=a.target?.files?.[0];if(!n){Wt.value=null,qt.value="";return}Wt.value=n;const s=new FileReader;s.onload=i=>{qt.value=i.target?.result||""},s.readAsDataURL(n)},ho=()=>{it.value&&it.value.click()},qn=()=>{Ct.value&&(wt.value="")},Bo=()=>{wt.value&&(Ct.value="")},Mo=()=>{let a=yt.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";yt.value=a,dt.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(Pe.value=s,qt.value="",Ne.value="url"):(qt.value=s,Pe.value="",Ne.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";Ct.value=c.endsWith("px")?c.replace("px",""):c,wt.value=d.endsWith("px")?d.replace("px",""):d,el.value=null}else{Wn();return}ht.value=!0,G.value=!1,X.value=!1,e.nextTick(()=>{Ne.value==="url"&&Kt.value?(Kt.value.focus(),Kt.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),it.value&&(it.value.value="")})},Zn=()=>{ht.value=!1,dt.value="",qt.value="",Pe.value="",Ct.value="",wt.value="",Wt.value=null,yt.value=null,el.value=null,Ne.value="upload"},Rl=()=>{const a=(dt.value||"").trim(),n=v.value?._mutationObserver;n&&n.disconnect(),We.value?(Ue.value&&(clearTimeout(Ue.value),Ue.value=null),Qt(),We.value=!1):Qt();const s=Ne.value==="url"?Pe.value.trim():qt.value;if(yt.value&&v.value&&v.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",a),yt.value.setAttribute("data-alt",a),Ct.value?(yt.value.style.width=`${Ct.value}px`,yt.value.setAttribute("width",Ct.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),wt.value?(yt.value.style.height=`${wt.value}px`,yt.value.setAttribute("height",wt.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),i.addRange(c)}_t()}else{if(!s){n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),Zn();return}if(v.value){v.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(el.value&&(Ll(el.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Zn();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!v.value.contains(p)){if(d=document.createRange(),v.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",v.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const h=document.createElement("img");h.src=s,h.setAttribute("alt",a),h.setAttribute("data-alt",a),Ct.value&&(h.style.width=`${Ct.value}px`,h.setAttribute("width",Ct.value)),wt.value&&(h.style.height=`${wt.value}px`,h.setAttribute("height",wt.value));try{d.insertNode(h),d.setStartAfter(h),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const I=document.createElement("p");v.value.appendChild(I),I.appendChild(h)}else{const I=v.value.lastChild;if(I&&I.nodeType===1)I.appendChild(h);else{const N=document.createElement("p");v.value.appendChild(N),N.appendChild(h)}}const D=document.createRange();D.setStartAfter(h),D.collapse(!0),c&&(c.removeAllRanges(),c.addRange(D))}}yt.value=h,_t()}}e.nextTick(()=>{n&&v.value&&n.observe(v.value,{childList:!0,subtree:!0}),El(),cl(),Zn()})};e.watch(()=>L.modelValue,a=>{if(L.richText&&v.value&&!J.value){const n=Kl(a||""),i=v.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=Rt();v.value.innerHTML=n,e.nextTick(()=>{En();const u=v.value.innerHTML||"",p=L.title||"",h=L.description||"";Dt.value=u,ne.value=p,j.value=h,Lt.value=u,K.value=p,de.value=h,Ge.value=[],Zt.value=[],Ue.value&&(clearTimeout(Ue.value),Ue.value=null),We.value=!1,d&&Ll(d),Tt(),Zl(),Gl(),El(),cl(),rn(),Yl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>L.richText,a=>{a?(cl(),e.nextTick(()=>{_o()})):(Bn(),oe.value=[],Fe.value&&(Fe.value.disconnect(),Fe.value=null)),rn()}),e.watch(()=>L.floatingToolbar,a=>{a?cl():Bn()}),e.watch(()=>L.disabled,a=>{a&&Bn(),rn()}),e.watch(()=>L.description,()=>{e.nextTick(()=>{M.value?st():Gt()})}),e.watch(()=>L.title,()=>{e.nextTick(()=>{vl.value?le():ct()})}),e.watch(()=>L.customToolbarSlots,()=>{e.nextTick(()=>{jn()})},{deep:!0}),e.watch(()=>L.comments,(a,n)=>{if(L.commentUser){if(Bt.value){Bt.value=!1;return}bl.value||L.richText&&v.value&&e.nextTick(()=>{Qn()})}},{deep:!0,immediate:!1});const Qn=()=>{if(L.commentUser&&!bl.value&&!(!L.comments||!Array.isArray(L.comments)||L.comments.length===0)&&!(!L.richText||!v.value)){bl.value=!0;try{const a=new Set,n=L.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const h=String(p);if(d.has(h))return;const k=v.value.querySelector(`[data-comment="${h}"]`);if(k){Jn(k,u),d.add(h);return}try{const D=Un(u.selection_range,u.selection_text);if(D&&!D.collapsed){const I=D.commonAncestorContainer,N=I.nodeType===3?I.parentElement:I;if(N){const Be=N.closest("[data-comment], [data-fake-comment]");if(Be){const _e=Be.getAttribute("data-comment")||Be.getAttribute("data-fake-comment");if(String(_e)===String(p)){Be.setAttribute("data-comment",h),Be.removeAttribute("data-fake-comment"),Jn(Be,u),d.add(h);return}else return}}const se=v.value.querySelector(`[data-comment="${h}"]`);if(se){Jn(se,u),d.add(h);return}const Q=document.createElement("span");Q.setAttribute("data-comment",h),Jn(Q,u);try{D.surroundContents(Q),c++,d.add(h)}catch{try{const _e=document.createRange();_e.setStart(D.startContainer,D.startOffset),_e.setEnd(D.endContainer,D.endOffset),an(_e),_e.surroundContents(Q),c++,d.add(h)}catch{try{const He=D.extractContents();Q.appendChild(He),D.insertNode(Q),c++,d.add(h)}catch(He){console.warn("Failed to create comment marker:",He)}}}}}catch{}}),e.nextTick(()=>{Yl("restoreCommentsFromModel"),_t(),bl.value=!1})}catch{bl.value=!1}}},an=a=>{if(!a||!v.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!Jo(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!ea(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},Jo=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},ea=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Un=(a,n)=>{if(!a||!v.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[v.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const h=i+d.length;!u&&a.start>=i&&a.start<=h&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=h&&(s.setEnd(d,a.end-i),p=!0),i=h}else{let h=d.childNodes.length;for(;h--;)c.push(d.childNodes[h])}return u?an(s):null}}catch{return null}return null},Jn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},Yl=(a="unknown")=>{if(!L.commentUser||!L.richText||!v.value){oe.value=[];return}Date.now()-xt.value<Mt&&bt.value!==null||bt.value===null&&(bt.value=requestAnimationFrame(()=>{if(bt.value=null,xt.value=Date.now(),Ie.value)return;Ie.value=!0;const s={},i=v.value;if(!i){Ie.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ie.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");se&&N.tagName==="SPAN"&&(p.has(se)||(u.push(N),p.add(se)))}),d.forEach(N=>{const se=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!se||p.has(se)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${se}"], span[data-fake-comment="${se}"]`)||(u.push(N),p.add(se)):N.tagName!=="SPAN"&&(u.push(N),p.add(se)))});const h=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((N,se)=>{let Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Q)return;if(typeof Q=="string"&&Q.startsWith("comment-")){const cn=N.textContent?.trim(),$t=L.comments?.find(ln=>(typeof ln.conversation_id=="string"&&ln.conversation_id.startsWith("comment-")?null:ln.conversation_id)&&ln.selection_text?.trim()===cn);$t?(Q=String($t.conversation_id),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment")):(Q=String(Date.now()),N.setAttribute("data-comment",Q),N.removeAttribute("data-fake-comment"))}const Be=N.getBoundingClientRect(),_e=window.getComputedStyle(N),He=parseFloat(_e.lineHeight)||parseFloat(_e.fontSize)*1.2,ml=Be.top-k.top+He/2-15,Xt=k.top-h.top+ml;let pl=null,gl=null,xn=0;const Wl=[],to=new Set;if(Q&&L.comments){const cn=L.comments.find($t=>String($t.conversation_id||$t.id)===String(Q));if(cn){const $t=cn.conversation||[];$t.length>0?($t.forEach(ln=>{ln.user&&ln.user.id&&!to.has(ln.user.id)&&(to.add(ln.user.id),Wl.push(ln.user))}),xn=$t.length):(xn=0,pl=null,gl=null),Wl.length>0?pl=Wl[0]:pl=null,Wl.length>1?gl=Wl[1]:gl=null}}const $o=Be.top+He/2-15,Lo=$o+30,Ao=5,Do=Lo>k.top+Ao&&$o<k.bottom-Ao?1:0;oe.value.find(cn=>cn.id===Q);let lo=N;if(!lo&&Q&&v.value){const cn=String(Q);lo=v.value.querySelector(`[data-comment="${cn}"], [data-fake-comment="${cn}"]`)}const no=Wl.length;s[Q]?(s[Q].top=Xt,s[Q].opacity=Do,s[Q].element=lo,s[Q].firstUser=pl,s[Q].secondUser=gl,s[Q].totalCount=xn,s[Q].uniqueUserCount=no):s[Q]={id:Q,top:Xt,opacity:Do,element:lo,firstUser:pl,secondUser:gl,totalCount:xn,uniqueUserCount:no}});const D=Object.values(s).map(N=>{const se=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&v.value){const Be=String(N.id);N.element=v.value.querySelector(`[data-comment="${Be}"], [data-fake-comment="${Be}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:se}});(oe.value.length!==D.length||D.some((N,se)=>{const Q=oe.value[se];if(!Q)return!0;const Be=(Q.firstUser?.id||null)!==(N.firstUser?.id||null),_e=(Q.secondUser?.id||null)!==(N.secondUser?.id||null);return Q.id!==N.id||Math.abs(Q.top-N.top)>1||Q.opacity!==N.opacity||Q.totalCount!==N.totalCount||Q.additionalCount!==N.additionalCount||Be||_e||Q.element!==N.element}))&&(oe.value=D),Ie.value=!1}))},ta=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&v.value){const s=String(a.id);n=v.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(bn(),Al.value=n,n.classList.add("editor-comment-highlighted"))},bn=(a=!1)=>{!a&&Cl.value!==null&&Al.value&&(Al.value.getAttribute("data-comment")||Al.value.getAttribute("data-fake-comment"))===Cl.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Al.value&&(Al.value.classList.remove("editor-comment-highlighted"),Al.value=null))},eo=a=>{if(!a||!a.element)return;bn(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;fe("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},la=()=>{bn()},_o=()=>{!L.richText||!v.value||(Fe.value&&Fe.value.disconnect(),St.value!==null&&(clearTimeout(St.value),St.value=null),Fe.value=new MutationObserver(()=>{St.value===null&&(St.value=setTimeout(()=>{St.value=null,e.nextTick(()=>{Yl("MutationObserver")})},200))}),Fe.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Yl("setupCommentMarkersObserver-initial"))},tn=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const h=s.left-d.width-4;a.style.left=`${h}px`}if(d.bottom>p){const h=Math.max(8,p-d.height-8);a.style.top=`${h}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Xe.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{tn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,ut.value],()=>{be.value==="askAi"||ut.value==="askAi"?e.nextTick(()=>{So()}):(Xe.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>L.locale,a=>{a&&a!==ce.value&&(ce.value=a)},{immediate:!0}),te({openCommentOverlayForSelector:Sn,updateCommentMarkers:Yl,restoreCommentsFromModel:Qn}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":At.value},It.value]]),style:e.normalizeStyle(Nt.value)},[E.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Vd,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:hn,title:e.unref(V)("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,Nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:An,title:e.unref(V)("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,Bd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Md,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Dn("paragraph")),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,$d)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Ld)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ad)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Td)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Dd)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Hd)):(e.openBlock(),e.createElementBlock("svg",Rd,[...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,_d),be.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=>zl("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Fd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>zl("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Id),e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>zl("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,zd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>zl("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Pd),e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>zl("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Od),e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>zl("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Wd),e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>zl("<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(V)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:n[9]||(n[9]=s=>Ql("bold")),title:e.unref(V)("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,qd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[10]||(n[10]=s=>Ql("italic")),title:e.unref(V)("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,Zd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[11]||(n[11]=s=>Ql("underline")),title:e.unref(V)("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,Ud),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":je.value}]),onClick:zt,title:e.unref(V)("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,Xd),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:Ml,title:e.unref(V)("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,jd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:kt,title:e.unref(V)("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,Yd)),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":Jt("insertUnorderedList")}]),onClick:nt,title:e.unref(V)("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,Kd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:ft,title:e.unref(V)("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,Gd),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Wn,title:e.unref(V)("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,Qd),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",Jd)):e.createCommentVNode("",!0),At.value&&ae.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:Ul},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,e1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",t1)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Dn("askAi")),title:e.unref(V)("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",o1,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,n1),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",a1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)?(e.openBlock(),e.createElementBlock("div",s1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&i<E.customToolbarSlots.length-1&&Pn(i)?(e.openBlock(),e.createElementBlock("div",r1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&E.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(ma,{showModal:$e.value,width:"500px",height:"55vh",onCloseModal:gt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",i1,[e.createElementVNode("div",c1,[e.createElementVNode("label",u1,e.toDisplayString(e.unref(V)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ze,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>mt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterAltText"),onKeyup:e.withKeys(sl,["enter"])},null,40,d1),[[e.vModelText,mt.value]])]),e.createElementVNode("div",m1,[e.createElementVNode("label",p1,e.toDisplayString(e.unref(V)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:U,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.link.enterUrl"),onKeyup:e.withKeys(sl,["enter"])},null,40,f1),[[e.vModelText,tt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gt},e.toDisplayString(e.unref(V)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:sl},e.toDisplayString(e.unref(V)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ma,{showModal:ht.value,width:"500px",height:"80vh",onCloseModal:Zn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(V)("textEditor.image.editImage"):e.unref(V)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",v1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="upload"}]),onClick:n[17]||(n[17]=s=>Ne.value="upload")},e.toDisplayString(e.unref(V)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ne.value==="url"}]),onClick:n[18]||(n[18]=s=>Ne.value="url")},e.toDisplayString(e.unref(V)("textEditor.image.imageLink")),3)]),Ne.value==="upload"?(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("div",g1,[e.createElementVNode("div",y1,[on.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",k1,e.toDisplayString(e.unref(V)("textEditor.image.uploadImage")),1)),on.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:ho},[e.createElementVNode("img",{src:qt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,C1),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:it,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Cn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Cn},null,544))]),e.createElementVNode("div",b1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,w1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",E1,[e.createElementVNode("label",S1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,V1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",N1,[e.createElementVNode("label",B1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,M1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0),Ne.value==="url"?(e.openBlock(),e.createElementBlock("div",_1,[e.createElementVNode("div",$1,[e.createElementVNode("div",L1,[e.createElementVNode("label",A1,e.toDisplayString(e.unref(V)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Kt,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>Pe.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Rl,["enter"])},null,40,T1),[[e.vModelText,Pe.value]])]),e.createElementVNode("div",D1,[e.createElementVNode("label",H1,e.toDisplayString(e.unref(V)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>dt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Rl,["enter"])},null,40,R1),[[e.vModelText,dt.value]])]),e.createElementVNode("div",F1,[e.createElementVNode("label",I1,e.toDisplayString(e.unref(V)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>Ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:qn},null,40,z1),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",P1,[e.createElementVNode("label",O1,e.toDisplayString(e.unref(V)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>wt.value=s),class:"dss-link-modal-input",placeholder:e.unref(V)("textEditor.image.auto"),onKeyup:e.withKeys(Rl,["enter"]),onInput:Bo},null,40,W1),[[e.vModelText,wt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Zn},e.toDisplayString(e.unref(V)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Rl},e.toDisplayString(e.unref(V)("textEditor.image.save")),1)]),_:1},8,["showModal"]),E.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ql.value&&vl.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.title")),1),e.createElementVNode("div",q1,[vl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z1,[E.title?(e.openBlock(),e.createElementBlock("span",U1,e.toDisplayString(E.title),1)):(e.openBlock(),e.createElementBlock("span",X1,e.toDisplayString(xl.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:xe,value:E.title,onInput:lt,onFocus:Te,onBlur:pt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!vl.value}]),placeholder:xl.value,disabled:E.disabled,rows:"1"},null,42,Y1)])],2)):e.createCommentVNode("",!0),E.showTitle&&ql.value&&vl.value?(e.openBlock(),e.createElementBlock("div",j1,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),E.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":rl.value&&M.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("textEditor.labels.description")),1),e.createElementVNode("div",K1,[M.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",G1,[E.description?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(E.description),1)):(e.openBlock(),e.createElementBlock("span",J1,e.toDisplayString(Fl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ke,value:E.description,onInput:wl,onFocus:il,onBlur:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!M.value}]),placeholder:Fl.value,disabled:E.disabled,rows:"1"},null,42,em)])],2)):e.createCommentVNode("",!0),E.showDescription&&rl.value&&M.value?(e.openBlock(),e.createElementBlock("div",tm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),At.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":Cl.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=>ta(s),onMouseleave:la},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,om)):(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,nm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>eo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,rm)):(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,sm)):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=>eo(s),["stop"])},[e.createElementVNode("span",um,"+"+e.toDisplayString(s.additionalCount),1)],12,cm)):e.createCommentVNode("",!0)],46,lm))),128)):e.createCommentVNode("",!0),E.richText?(e.openBlock(),e.createElementBlock("div",gm,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":E.disabled,"dss-text-editor-fixed-height":E.fixedHeight}]),style:e.normalizeStyle(nn.value),onInput:_t,onBlur:vn,onClick:Vo,onMouseup:Kn,onKeyup:Kn,onKeydown:jo,onPaste:wo,onMousemove:Bl,onMouseleave:ul},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[At.value&&Cl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[Z.value||at.value.length>0?(e.openBlock(),e.createElementBlock("div",ym,[e.createElementVNode("div",km,[Z.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Z.value},null,8,Cm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",bm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(s,i)=>(e.openBlock(),e.createElementBlock("div",{key:i,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",xm,[e.createElementVNode("div",wm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,Em)):(e.openBlock(),e.createElementBlock("span",Sm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("div",Bm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Mm,e.toDisplayString(T(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":z(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),L.commentUser&&s.user&&s.user.id===L.commentUser.id&&!z(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>mo(s,i),["stop"]),title:e.unref(V)("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,_m)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",$m,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:w,"onUpdate:modelValue":n[26]||(n[26]=s=>g.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(V)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(gn,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(w.value){const s=w.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,Lm),[[e.vModelText,g.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(gn,["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",Am,[e.createElementVNode("div",Tm,[e.createElementVNode("span",Dm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",dm,[e.createElementVNode("textarea",{value:E.modelValue,onInput:_,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":E.fixedHeight}]),placeholder:dn.value,rows:E.rows,disabled:E.disabled,style:e.normalizeStyle(yl.value)},null,46,mm),e.createElementVNode("div",pm,[e.createElementVNode("div",fm,[e.createElementVNode("span",vm,e.toDisplayString(tl.value)+" "+e.toDisplayString(tl.value===1?e.unref(V)("textEditor.footer.word"):e.unref(V)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",hm,e.toDisplayString(jl.value)+" "+e.toDisplayString(jl.value===1?e.unref(V)("textEditor.footer.character"):e.unref(V)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Y.value&&me.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(F.value),onMouseenter:n[28]||(n[28]=s=>ue.value=!0),onMouseleave:Ol},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Ut,["stop"]),title:me.value},e.toDisplayString(me.value),9,Rm),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Pt,["stop"]),title:e.unref(V)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Im,[...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,Fm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[X.value&&ge.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(W.value),onMouseenter:n[29]||(n[29]=s=>G.value=!0),onMouseleave:Xl},[e.createElementVNode("div",zm,[ge.value===e.unref(V)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Pm,[...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:ge.value},e.toDisplayString(ge.value),9,Om)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mo,["stop"]),title:e.unref(V)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",qm,[...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,Wm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[E.floatingToolbar&&E.richText&&Qe.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Je,class:"dss-floating-toolbar",style:e.normalizeStyle(Ce.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Zm,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(hn,["stop"]),title:e.unref(V)("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,Um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Vl.value}]),onClick:e.withModifiers(An,["stop"]),title:e.unref(V)("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,Xm),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Ym,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(s=>Gn("paragraph"),["stop"])),title:e.unref(V)("textEditor.toolbar.paragraphFormat")},[A.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Km)):A.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Gm)):A.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Qm)):A.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Jm)):A.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,e2)):A.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,t2)):(e.openBlock(),e.createElementBlock("svg",l2,[...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,jm),ut.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=>R("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>R("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>R("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>R("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>R("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>R("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(V)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>R("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(V)("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":Jt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Ql("bold"),["stop"])),title:e.unref(V)("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,n2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Ql("italic"),["stop"])),title:e.unref(V)("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,o2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Ql("underline"),["stop"])),title:e.unref(V)("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,a2),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":je.value}]),onClick:e.withModifiers(zt,["stop"]),title:e.unref(V)("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,s2),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(Ml,["stop"]),title:e.unref(V)("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,i2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(kt,["stop"]),title:e.unref(V)("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,r2)),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":Jt("insertUnorderedList")}]),onClick:e.withModifiers(nt,["stop"]),title:e.unref(V)("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,c2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:e.withModifiers(ft,["stop"]),title:e.unref(V)("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,u2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Wn,["stop"]),title:e.unref(V)("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,d2),At.value?(e.openBlock(),e.createElementBlock("div",m2)):e.createCommentVNode("",!0),At.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(V)("textEditor.toolbar.comment"),onClick:e.withModifiers(Ul,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,p2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",f2)):e.createCommentVNode("",!0),E.askAi?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>Gn("askAi"),["stop"])),title:e.unref(V)("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",g2,e.toDisplayString(e.unref(V)("textEditor.toolbar.askAi")),1)],8,h2),ut.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),wn.value?(e.openBlock(),e.createElementBlock("div",y2,[E.askAi&&wn.value?(e.openBlock(),e.createElementBlock("div",k2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Hl(s)&&pn(s)?(e.openBlock(),e.createElementBlock("div",C2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Hl(s)&&pn(s)&&i<E.customToolbarSlots.length-1&&mn(i)?(e.openBlock(),e.createElementBlock("div",b2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),E2={class:"dss-color-picker__section-title"},S2={class:"dss-color-picker__presets-row"},V2=["title","onClick"],N2={key:1,class:"dss-color-picker__section"},B2={class:"dss-color-picker__presets-row"},M2=["title","onClick"],_2={key:2,class:"dss-color-picker__section"},$2={class:"dss-color-picker__section-header"},L2={class:"dss-color-picker__presets-row"},A2=["title","onClick"],T2=["onClick"],D2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},H2=["title","onClick"],R2={class:"dss-color-picker__input-row"},F2=["value"],I2={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null},disableCustomColors:{type:Boolean,default:!1}},emits:["update:modelValue","update:presetColors"],setup(E,{emit:te}){function $(ne){const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(ne);if(!j)return{h:0,s:0,l:50};const K=parseInt(j[1],16)/255,de=parseInt(j[2],16)/255,xe=parseInt(j[3],16)/255,Ke=Math.max(K,de,xe),Ht=Math.min(K,de,xe);let jt=0,et=0;const vl=(Ke+Ht)/2;if(Ke!==Ht){const M=Ke-Ht;switch(et=vl>.5?M/(2-Ke-Ht):M/(Ke+Ht),Ke){case K:jt=((de-xe)/M+(de<xe?6:0))/6;break;case de:jt=((xe-K)/M+2)/6;break;case xe:jt=((K-de)/M+4)/6;break}}return{h:jt*360,s:et*100,l:vl*100}}function V(ne,j,K){j/=100,K/=100;const de=j*Math.min(K,1-K),xe=Ke=>{const Ht=(Ke+ne/30)%12,jt=K-de*Math.max(Math.min(Ht-3,9-Ht,1),-1);return Math.round(255*jt).toString(16).padStart(2,"0")};return`#${xe(0)}${xe(8)}${xe(4)}`}function ce(ne){const j=ne.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!j)return null;let K=j[1];return K.length===3&&(K=K.split("").map(de=>de+de).join("")),"#"+K}function O(ne){const j=ne.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!j)return null;const K=Math.max(0,Math.min(255,Number.parseInt(j[1],10))),de=Math.max(0,Math.min(255,Number.parseInt(j[2],10))),xe=Math.max(0,Math.min(255,Number.parseInt(j[3],10)));return`#${K.toString(16).padStart(2,"0")}${de.toString(16).padStart(2,"0")}${xe.toString(16).padStart(2,"0")}`}function L(ne){if(typeof ne!="string")return null;const j=ne.trim();return ce(j)||O(j)}function fe(ne,j,K){j/=100,K/=100;const de=K+j*Math.min(K,1-K),xe=de===0?0:2-2*K/de;return{h:ne,s:xe*100,v:de*100}}function rt(ne,j,K){j/=100,K/=100;const de=K*(1-j/2),xe=de===0||de===1?0:(K-de)/Math.min(de,1-de);return{h:ne,s:xe*100,l:de*100}}const ee=E,v=te,be=e.ref(!1),ke=e.ref(!1),J=e.ref(!1),Y=e.ref(-1),me=e.ref(-1),F=e.ref(null),ue=e.ref(null),$e=e.ref(null),tt=e.ref(null),mt=e.ref({top:0,left:0}),U=e.ref($(ee.modelValue||"#b8a5de")),ze=e.computed(()=>Array.isArray(ee.presetGroups)&&ee.presetGroups.length>0),qe=e.computed(()=>!ee.disableCustomColors),Ve=e.computed(()=>ze.value?0:ee.initialPresetCount!=null?ee.initialPresetCount:me.value<0?null:me.value),Le=e.computed(()=>{const ne=Ve.value;return ne==null?!0:Math.max(0,ee.presetColors.length-ne)<ee.max}),je=e.computed(()=>!!(ke.value||Y.value>=0||!re.value&&ee.presetColors.length===0));e.computed(()=>{const ne=Ve.value;return ne!=null&&ee.presetColors.length>ne});const re=e.computed(()=>ze.value||Ve.value!=null),Qe=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(0,ne)}),Ce=e.computed(()=>{const ne=Ve.value;return ne==null?[]:ee.presetColors.slice(ne)});function Je(ne){const j=Ve.value;return j!=null?j+ne:-1}function ut(ne){const j=Ve.value;return j!=null&&ne>=j}function ht(ne){ut(ne)&&(Y.value=ne,U.value=$(ee.presetColors[ne]),ke.value=!0,e.nextTick(()=>tt.value?.focus()))}function dt(ne){if(!ut(ne))return;const j=ee.presetColors.filter((xe,Ke)=>Ke!==ne);v("update:presetColors",j);const K=ce(ee.modelValue),de=ce(ee.presetColors[ne]);if(K&&de&&K.toLowerCase()===de.toLowerCase()){const xe=j[Math.max(0,ne-1)]||j[0];xe&&v("update:modelValue",xe)}}function Wt(){J.value=!J.value,J.value||(Y.value=-1,ke.value=!1)}function qt(){if(!qe.value||Y.value<0)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j),Y.value=-1,ke.value=!1}}function Ct(){ee.disabled||!qe.value||(Y.value=-1,ke.value=!ke.value,ke.value&&(G(),e.nextTick(()=>tt.value?.focus())))}function wt(ne){const j=L(ne),K=L(ee.modelValue);return j&&K&&j.toLowerCase()===K.toLowerCase()}function Yt(){if(ee.disabled||!qe.value||!Le.value)return;const ne=it.value,j=ce(ne);if(j){const K=[...ee.presetColors,j];v("update:presetColors",K),v("update:modelValue",j);const de=Ve.value??me.value;de>=0&&K.length-de>=ee.max&&(ke.value=!1)}}const it=e.computed(()=>{const{h:ne,s:j,l:K}=U.value;return V(ne,j,K)}),Kt=e.computed(()=>it.value.toLowerCase()),yt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${U.value.h}, 100%, 50%))`})),el=e.computed(()=>{const ne=fe(U.value.h,U.value.s,U.value.l);return{left:`${ne.s}%`,bottom:`${ne.v}%`,transform:"translate(-50%, 50%)"}}),X=e.computed(()=>({left:`${U.value.h/360*100}%`,transform:"translateX(-50%)"})),ge=e.computed(()=>({position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002}));function W(){if(!F.value||!be.value)return;const ne=F.value.getBoundingClientRect(),j=window.innerHeight||document.documentElement.clientHeight;let K=ne.bottom+4;const de=ue.value;de&&K+de.offsetHeight>j-8&&(K=ne.top-4-de.offsetHeight),mt.value={top:K,left:ne.left}}function G(){const ne=ee.modelValue||"#b8a5de",j=L(ne);j&&(U.value=$(j))}function Ne(){v("update:modelValue",it.value)}function Pe(){ee.disabled||(be.value=!be.value,be.value&&(G(),e.nextTick(()=>{W(),tt.value?.focus()})))}function Xe(){const ne=it.value,j=ce(ne);if(j){if(Y.value>=0){const K=[...ee.presetColors];K[Y.value]=j,v("update:presetColors",K),v("update:modelValue",j)}else if(qe.value&&(ee.presetColors.length>0||ze.value)&&ke.value&&Le.value&&!ee.presetColors.some(de=>ce(de)?.toLowerCase()===j.toLowerCase())){const de=[...ee.presetColors,j];v("update:presetColors",de),v("update:modelValue",j)}}be.value=!1,ke.value=!1,J.value=!1,Y.value=-1}function Et(ne){if(!$e.value)return;const j=$e.value.getBoundingClientRect(),K=de=>{const xe=Math.max(0,Math.min(1,(de.clientX-j.left)/j.width)),Ke=Math.max(0,Math.min(1,1-(de.clientY-j.top)/j.height)),Ht={h:U.value.h,s:xe*100,v:Ke*100};U.value=rt(Ht.h,Ht.s,Ht.v)};K(ne),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),Ne()},{once:!0})}function Ge(ne){if(!ne.currentTarget)return;const K=ne.currentTarget.getBoundingClientRect(),de=xe=>{const Ke=Math.max(0,Math.min(1,(xe.clientX-K.left)/K.width));U.value={...U.value,h:Ke*360}};de(ne),document.addEventListener("mousemove",de),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",de),Ne()},{once:!0})}function Zt(ne){const j=ne.target.value,K=L(j);K&&(U.value=$(K),v("update:modelValue",K))}function Ue(ne){if(ee.disabled)return;const j=L(ne);j&&(U.value=$(j),v("update:modelValue",j))}let We=null,Dt=null;function Lt(){We&&(document.removeEventListener("keydown",We),We=null),Dt&&(window.removeEventListener("resize",Dt),Dt=null)}return e.watch(be,ne=>{if(Lt(),ne){if(!ze.value&&ee.initialPresetCount==null){const j=ee.presetColors.length;j>0&&(me.value<0||j<me.value)&&(me.value=j)}We=j=>{j.key==="Escape"&&Xe()},Dt=W,document.addEventListener("keydown",We),window.addEventListener("resize",Dt)}}),e.watch(()=>ee.modelValue,()=>{be.value&&G()},{immediate:!1}),e.watch(Ce,ne=>{ne.length===0&&(J.value=!1,Y.value=-1,ke.value=!1)}),e.onBeforeUnmount(Lt),(ne,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":E.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:F,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:Pe},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:it.value})},[...j[0]||(j[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Xe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(ge.value)},[re.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ze.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.presetGroups,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+de,class:"dss-color-picker__section"},[e.createElementVNode("span",E2,e.toDisplayString(K.title),1),e.createElementVNode("div",S2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(xe,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+de+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(xe)}]),style:e.normalizeStyle({backgroundColor:xe,"--dss-preset-color":xe}),title:xe,onClick:e.withModifiers(Ht=>Ue(xe),["stop"])},null,14,V2))),128))])]))),128)):Qe.value.length?(e.openBlock(),e.createElementBlock("div",N2,[j[1]||(j[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",B2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,M2))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",_2,[e.createElementVNode("div",$2,[j[3]||(j[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.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(Wt,["stop"])},[...j[2]||(j[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",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(K,de)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+de,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&&wt(K),"dss-color-picker__preset-bubble--editing":J.value&&Y.value===Je(de)}]),style:e.normalizeStyle({backgroundColor:Y.value===Je(de)?it.value:K,"--dss-preset-color":Y.value===Je(de)?it.value:K}),title:Y.value===Je(de)?it.value:K,onClick:e.withModifiers(xe=>J.value?ht(Je(de)):Ue(K),["stop"])},null,14,A2),J.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(xe=>dt(Je(de)),["stop"])},[...j[4]||(j[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,T2)):e.createCommentVNode("",!0)],2))),128)),Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):E.presetColors.length?(e.openBlock(),e.createElementBlock("div",D2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.presetColors,(K,de)=>(e.openBlock(),e.createElementBlock("button",{key:de,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":wt(K)}]),style:e.normalizeStyle({backgroundColor:K,"--dss-preset-color":K}),title:K,onClick:e.withModifiers(xe=>Ue(K),["stop"])},null,14,H2))),128)),qe.value&&Le.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ke.value}]),onClick:e.withModifiers(Ct,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:$e,onMousedown:Et},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(yt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(el.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[j[5]||(j[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(X.value)},null,4)],32),e.createElementVNode("div",R2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:tt,type:"text",class:"dss-color-picker__hex-input",value:Kt.value,onInput:Zt},null,40,F2)]),qe.value&&re.value&&(E.presetColors.length||ze.value)&&Le.value&&Y.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),qe.value&&re.value&&Y.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:qt}," Save color ")):e.createCommentVNode("",!0),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Xe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},z2={key:0,class:"dss-loader"},P2={key:0,class:"dss-loader-label"},O2={key:1,class:"dss-loader"},W2={key:0,class:"dss-loader-label"},q2={key:2,class:"dss-loader"},Z2={key:0,class:"dss-loader-label"},U2={key:3,class:"dss-loader"},X2={key:0,class:"dss-loader-label"},Y2={key:4,class:"dss-loader"},j2={key:0,class:"dss-loader-label"},K2={key:5,class:"dss-loader dss-loader--inline"},G2={class:"dss-loader-inline-text"},Q2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(E){const te=E,$=e.computed(()=>te.size==="small"?"dss-loaders--size-small":te.size==="large"?"dss-loaders--size-large":te.size==="medium"||te.size==null?"dss-loaders--size-medium":null),V=e.computed(()=>{const ce={};if(!(te.size==="small"||te.size==="medium"||te.size==="large"||te.size==null)){const O=typeof te.size=="number"?`${te.size}px`:String(te.size);ce["--dss-loader-size"]=O}return te.color&&(ce["--dss-loader-accent"]=te.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${te.color} 30%, white)`),ce});return(ce,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",$.value]),style:e.normalizeStyle(V.value)},[E.type==="spinner"?(e.openBlock(),e.createElementBlock("div",z2,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",P2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="dots"?(e.openBlock(),e.createElementBlock("div",O2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",W2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="battery"?(e.openBlock(),e.createElementBlock("div",q2,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),E.label?(e.openBlock(),e.createElementBlock("span",Z2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",U2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",X2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="bars"?(e.openBlock(),e.createElementBlock("div",Y2,[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)),E.label?(e.openBlock(),e.createElementBlock("span",j2,e.toDisplayString(E.label),1)):e.createCommentVNode("",!0)])):E.type==="inline"?(e.openBlock(),e.createElementBlock("div",K2,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",G2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])])])):e.createCommentVNode("",!0)],6))}},Ba="dss-skeleton-item",J2={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:E=>["single","multiple"].includes(E)},targetClass:{type:String,default:Ba},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(E){const te=E,$=e.computed(()=>{const O={"dss-skeleton--loading":te.loading,"dss-skeleton--static":!te.shimmer,"dss-skeleton--multiple":te.mode==="multiple","dss-skeleton--dark":te.darkMode};return te.mode==="multiple"&&te.targetClass!==Ba&&(O[`dss-skeleton--target-${te.targetClass}`]=!0),O}),V=e.computed(()=>{const O={};return te.borderRadius&&(O.borderRadius=te.borderRadius),O}),ce=e.computed(()=>{const O={};return te.borderRadius&&(O["--dss-skeleton-border-radius"]=te.borderRadius),te.darkMode?(O["--dss-skeleton-bg"]=te.bgDark||"#322c3f",O["--dss-skeleton-shimmer"]=te.shimmerDark||"#3e3f41",O):(te.bgColor&&(O["--dss-skeleton-bg"]=te.bgColor),te.shimmerColor&&(O["--dss-skeleton-shimmer"]=te.shimmerColor),O)});return(O,L)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",$.value]),style:e.normalizeStyle(ce.value)},[E.loading&&E.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(V.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":E.loading&&E.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},e0={key:0,class:"dss-dnd-column-header"},t0={class:"dss-dnd-column-title"},l0={class:"dss-dnd-column-count"},n0=["data-column"],o0={key:0,class:"dss-dnd-indicator"},a0=["onPointerdown"],s0=["onPointerdown"],r0={class:"dss-dnd-item-content"},i0={class:"dss-dnd-item-default"},c0={key:0,class:"dss-dnd-empty"},u0={name:"DSSDnd"},d0=Object.assign(u0,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(E,{emit:te}){const $=E,V=te,ce=e.useSlots(),O=e.computed(()=>!!ce["delete-zone"]),L={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},fe=e.computed(()=>({...L,...$.options})),rt=e.computed(()=>({"--dss-dnd-col-min-w":fe.value.columnMinWidth,"--dss-dnd-col-max-w":fe.value.columnMaxWidth,"--dss-dnd-col-gap":fe.value.columnGap,"--dss-dnd-indicator-color":fe.value.indicatorColor,"--dss-dnd-body-max-h":fe.value.columnBodyMaxHeight}));function ee(W){if(!fe.value.ColColor||!W)return{};const G=W.background||W.color;return G?{background:G}:{}}const v=e.ref(null),be=e.ref(null),ke=e.ref(!1),J=e.ref(-1),Y=e.ref(null);let me=null,F=null,ue=null,$e=null,tt=0,mt=0,U="",ze=null;const qe=5,Ve=e.computed(()=>{const W={};for(const G of $.columns)W[G.value]=$.items.filter(Ne=>Ne[$.columnKey]===G.value).sort((Ne,Pe)=>(Ne[$.positionKey]??0)-(Pe[$.positionKey]??0));return W}),Le=e.computed(()=>{const W={},G=!!v.value,Ne=v.value?.[$.itemKey],Pe=be.value,Xe=J.value;for(const Et of $.columns){const Ge=Ve.value[Et.value]||[],Zt=[],Ue=Pe==Et.value;let We=0;for(let Dt=0;Dt<Ge.length;Dt++){const Lt=Ge[Dt],ne=G&&Lt[$.itemKey]===Ne;!ne&&Ue&&Xe===We&&Zt.push({type:"indicator",key:`ind-${We}`}),ne||We++,Zt.push({type:"item",item:Lt,isDragged:ne,key:`item-${Lt[$.itemKey]}`})}Ue&&Xe>=We&&Zt.push({type:"indicator",key:"ind-end"}),W[Et.value]=Zt}return W});function je(W,G){const Pe=(Ve.value[W]||[]).filter(Ge=>Ge[$.itemKey]!==v.value?.[$.itemKey]);if(Pe.length===0)return 1;if(G<=0){const Ge=Pe[0][$.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(G>=Pe.length){const Ge=Pe[Pe.length-1][$.positionKey];return(Ge??0)+1}const Xe=Pe[G-1][$.positionKey]??0,Et=Pe[G][$.positionKey]??0;return(Xe+Et)/2}function re(W,G,Ne){ue&&ue.remove();const Pe=W.getBoundingClientRect(),Xe=W.cloneNode(!0);Xe.classList.add("dss-dnd-ghost"),Xe.style.cssText=`
|
|
102
|
+
</svg>`,f=e.ref(null),be=e.ref(null),he=e.ref(!1),oe=e.ref(!1),j=e.ref(!1),fe=e.ref(""),_e=e.ref({}),V=e.ref(!1),$e=e.ref(!1),lt=e.ref(""),rt=e.ref(""),Qe=e.ref(null),Z=e.ref(null),qe=e.ref(null),ze=e.ref(null),ye=e.ref(""),Ue=e.ref(!1),ke=e.ref({}),Te=e.ref(!1),at=e.ref({}),ge=e.ref(null),Ft=e.ref(null),dt=e.ref(!1),Ye=e.ref(""),Pt=e.ref(null),It=e.ref(""),bt=e.ref(""),ft=e.ref(""),Yt=e.ref(null),it=e.ref(null),At=e.ref(null),ht=e.ref(null),il=e.ref(null),St=e.ref(!1),Dt=e.ref(""),pe=e.ref({}),A=e.ref(!1),X=e.ref("upload"),ae=e.ref(""),Ce=e.ref(null),je=e.ref(null),Ge=e.ref([]),Vt=e.ref([]),Pe=e.ref(null),Ke=e.ref(!1),nt=e.ref(""),qt=e.ref(""),te=e.ref(""),K=e.ref(""),Q=e.ref(""),ce=e.ref(""),Ve=e.ref(null),We=e.ref(null),Nt=e.ref(null),Ot=e.ref(!1),pt=e.ref(null),wt=e.ref(!1),B=e.ref(!1),w=e.ref(null),T=e.ref("p"),ie=e.ref(!1),re=e.ref([]),He=e.ref(null),gt=e.ref(null),et=e.ref(null),Ae=e.ref(!1),yt=e.ref(0),Et=100,xt=e.ref(null),$t=e.computed(()=>!!H.commentUser),Ht=e.computed(()=>({"dss-text-editor-no-border":!H.border,"dss-text-editor-rounded":H.rounded,"dss-text-editor-full-height":H.fullHeight,"dss-comment-overlay-open":$t.value&&st.value!==null})),kt=e.computed(()=>({})),Gt=e.computed(()=>!H.fixedHeight||H.fullHeight?{}:{height:`${1.6*14*H.rows+24+2}px`,resize:"none",overflowY:"auto"}),Ll=e.computed(()=>!H.fixedHeight||H.fullHeight?{}:{height:`${1.6*14*H.rows+32}px`,overflowY:"auto"}),hl=e.computed(()=>H.richText&&Vt.value.length>0),Nl=e.computed(()=>{if(!H.modelValue)return"";if(H.richText){let a=H.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return a=a.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),a=a.replace(/<[^>]+>/g,""),a=a.replace(/ /g," "),a=a.replace(/&/g,"&"),a=a.replace(/</g,"<"),a=a.replace(/>/g,">"),a=a.replace(/"/g,'"'),a=a.replace(/'/g,"'"),a=a.replace(/\s+/g," ").trim(),a}return H.modelValue}),cl=e.computed(()=>{const a=Nl.value.trim();return a?a.split(/\s+/).filter(n=>n.length>0).length:0}),nn=e.computed(()=>Nl.value.length),un=e.computed(()=>ht.value!==null&&X.value==="upload"&&It.value&&It.value.startsWith("data:")),Ul=e.computed(()=>H.titlePlaceholder||N("textEditor.placeholders.title")),Tl=e.computed(()=>H.descriptionPlaceholder||N("textEditor.placeholders.description")),dn=e.computed(()=>H.placeholder||N("textEditor.placeholders.startTyping")),Al=a=>ot&&ot[a]!==void 0,Wn=a=>{for(let n=a+1;n<H.customToolbarSlots.length;n++)if(Al(H.customToolbarSlots[n]))return!0;return!1},Ln=a=>{for(let n=a+1;n<H.customToolbarSlots.length;n++){const s=H.customToolbarSlots[n];if(Al(s)&&El(s))return!0}return!1},El=a=>H.customToolbarFloatingMap.hasOwnProperty(a)?H.customToolbarFloatingMap[a]===!0:!0,on=e.computed(()=>H.customToolbarSlots.some(a=>Al(a)&&El(a))),Dl=e.computed(()=>Al("title-slot")),Ol=e.computed(()=>Al("description-slot")),Hl=a=>{if(!a||a.trim()==="")return"<html></html>";const n=a.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?a:`<html>${a}</html>`},ul=a=>{if(!a||a.trim()==="")return"";const n=a.replace(/<!--[\s\S]*?-->/g,""),s=n.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():n},Tn=a=>{if(!a)return;const n=document.createTreeWalker(a,NodeFilter.SHOW_COMMENT,null,!1),s=[];let i=n.nextNode();for(;i;)s.push(i),i=n.nextNode();s.forEach(c=>c.remove())},R=a=>{try{const n=String(a.getDate()).padStart(2,"0"),i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][a.getMonth()],c=a.getFullYear();return`${n} ${i} ${c}`}catch{return""}},W=a=>{if(!a||typeof a!="string")return!1;const n=a.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=N("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const i=n.toLowerCase();return i.includes("started conversation")||i.includes("démarré la conversation")||i==="started conversation"||i==="a démarré la conversation"},D=a=>{const n=a.target.value;me("update:modelValue",n),me("change",n)},se=()=>{if(!Ve.value)return;const a=Ve.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},De=()=>{wt.value=!0,se()},mt=()=>{wt.value=!1,ut()},ut=()=>{if(!Ve.value)return;const a=Ve.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},Ze=a=>{const s=a.target.value;wt.value&&se(),me("update:title",s),me("title-change",s),Nt.value="title",H.richText&&(Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt()},500))},Je=()=>{if(!We.value)return;const a=We.value;if(a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important"),a.value.trim()===""){const i=a.value;a.value="M";const c=a.scrollHeight;a.value=i,a.style.setProperty("height",`${c}px`,"important"),a.style.setProperty("overflow-y","hidden","important");return}a.offsetHeight;const s=a.scrollHeight;a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important")},dl=()=>{B.value=!0,Je()},ml=()=>{B.value=!1,Tt()},Tt=()=>{if(!We.value)return;const a=We.value;a.style.setProperty("text-overflow","","important"),a.style.setProperty("white-space","","important"),a.style.setProperty("overflow-x","","important"),a.style.setProperty("height","auto","important");const n=a.value;a.value="M";const s=a.scrollHeight;a.value=n,a.offsetHeight,a.style.setProperty("height",`${s}px`,"important"),a.style.setProperty("overflow-y","hidden","important"),a.style.setProperty("overflow-x","hidden","important"),a.style.setProperty("text-overflow","ellipsis","important"),a.style.setProperty("white-space","nowrap","important")},ll=a=>{const s=a.target.value;B.value&&Je(),me("update:description",s),me("description-change",s),Nt.value="description",H.richText&&(Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt()},500))},Bt=()=>{const a=window.getSelection();if(a.rangeCount===0)return null;const n=a.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const s=n.cloneRange();return s.selectNodeContents(f.value),s.setEnd(n.startContainer,n.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+n.toString().length}},Bl=a=>{if(!(!a||!f.value))try{const n=window.getSelection(),s=document.createRange();if(a.type==="element"&&a.element)if(f.value.contains(a.element)){s.setStart(a.element,a.offset),s.collapse(!0),n.removeAllRanges(),n.addRange(s);return}else{f.value.focus();return}let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const g=i+d.length;!u&&a.start>=i&&a.start<=g&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=g&&(s.setEnd(d,a.end-i),p=!0),i=g}else{let g=d.childNodes.length;for(;g--;)c.push(d.childNodes[g])}n.removeAllRanges(),n.addRange(s)}catch{f.value.focus()}},mn=()=>{if(!f.value)return;f.value.focus();const a=window.getSelection(),n=document.createRange(),s=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],p=s(u);if(p)return p}return c},i=s(f.value);if(i.nodeType===3)n.setStart(i,i.length),n.setEnd(i,i.length);else if(i.childNodes.length>0){const c=s(i);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(i),n.collapse(!1))}else n.setStart(i,0),n.setEnd(i,0);a.removeAllRanges(),a.addRange(n)},Qt=(a=!1)=>{if(!f.value)return;const n=f.value.innerHTML,s=H.title||"",i=H.description||"";if(!a&&n===nt.value&&s===te.value&&i===K.value)return;const c={content:qt.value||nt.value,title:Q.value!==void 0?Q.value:te.value,description:ce.value!==void 0?ce.value:K.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),Vt.value=[]),nt.value=n,te.value=s,K.value=i,qt.value=n,Q.value=s,ce.value=i},Mt=a=>{if(!f.value)return;wn(),f.value&&Tn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Bt(),An()));const s=a&&a.inputType&&(a.inputType==="insertText"||a.inputType==="insertCompositionText"||a.inputType==="deleteContentBackward"||a.inputType==="deleteContentForward");s&&w.value&&(w.value=null),oe.value=!0;const i=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=Hl(i);me("update:modelValue",c),me("change",c),Nt.value="editor",Ke.value||(qt.value=nt.value,Q.value=te.value,ce.value=K.value),Pe.value&&clearTimeout(Pe.value),Ke.value=!0,Pe.value=setTimeout(()=>{Ke.value=!1,Qt(),Pl(),Cl()},500),e.nextTick(()=>{n&&Bl(n),wn();const d=["bold","italic","underline"],u=window.getSelection(),p=u.rangeCount>0?u.getRangeAt(0):null,g=p&&p.collapsed;if(d.forEach(k=>{try{if(g&&w.value?.command===k){ke.value[k]=w.value.state;return}if(k==="bold")if(p){const F=p.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F;let E=!1;if(P&&((P.tagName==="STRONG"||P.tagName==="B"||P.closest&&P.closest("strong, b"))&&(E=!0),!E&&P.style&&parseInt(P.style.fontWeight)>=600&&(E=!0),!E))try{const le=window.getComputedStyle(P);parseInt(le.fontWeight)>=600&&(E=!0)}catch{}ke.value[k]=E}else ke.value.hasOwnProperty(k)||(ke.value[k]=!1);else if(k==="italic")if(p){const F=p.commonAncestorContainer,P=F.nodeType===3?F.parentElement:F,E=P&&(P.tagName==="EM"||P.tagName==="I"||P.closest&&P.closest("em, i"));ke.value[k]=!!E}else{const F=document.queryCommandState(k);ke.value[k]=F}else{const F=document.queryCommandState(k);ke.value[k]=F}}catch{}}),Sl(),_l(),Ql(),ol(),hn(),xl("handleRichTextInput"),s&&(a.inputType==="insertText"||a.inputType==="insertCompositionText")){const k=a.data||"";k&&k.length===1&&setTimeout(()=>Cl(k),0),(k===" "||k===`
|
|
103
|
+
`||/[.,;:!?]/.test(k))&&setTimeout(()=>{Pl()},100)}oe.value=!1})},wn=()=>{if(!f.value)return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i)return;const c=i.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(i!==d&&!d?.contains(i)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,p=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(p)&&p!==d){const g=document.createRange();g.setStartAfter(c),g.collapse(!0),a.removeAllRanges(),a.addRange(g)}}}},An=()=>{if(!f.value)return;const a=f.value;if(a.querySelector&&a.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),s=Array.from(a.childNodes);let i=null;s.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===a&&a.removeChild(c);return}i||(i=document.createElement("p"),a.insertBefore(i,c)),i.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){i=null;return}if(n.has(u)){i=null;return}i||(i=document.createElement("p"),a.insertBefore(i,d)),i.appendChild(d)}})},_l=()=>{if(f.value&&!Ot.value){Ot.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(i=>{i.querySelector("img")||i.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(i=>{const c=i.parentElement;!c||!c.classList.contains("dss-image-wrapper")?i.remove():c.querySelector("img")||i.remove()}),f.value.querySelectorAll("img").forEach(i=>{let c=i.getAttribute("alt");c===null&&(c=i.alt||"");const d=i.getAttribute("src")||i.src||"";if(c){const k=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),F=c===d||c===k;(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 p=i.parentElement;const g=p&&p.classList.contains("dss-image-wrapper");if(g){const k=p.querySelector(".dss-image-no-alt-icon");k&&k.remove()}else{const k=i.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?i.nextElementSibling:null;k&&k.remove()}if(u){g?p.setAttribute("contenteditable","false"):(p=document.createElement("span"),p.className="dss-image-wrapper",p.setAttribute("contenteditable","false"),i.parentNode.insertBefore(p,i),p.appendChild(i));const k=document.createElement("div");k.className="dss-image-no-alt-icon",k.setAttribute("contenteditable","false"),k.innerHTML=ne,p.appendChild(k)}else if(g&&p.children.length===1){const k=p.parentNode;k.insertBefore(i,p),k.removeChild(p)}})}finally{Ot.value=!1}}},an=a=>{Pl(),me("blur",a),Yl()},pn=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Ke.value&&(Qt(),Ke.value=!1);const a=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(Ge.value.length===0){a&&Ve.value?Ve.value.focus():n&&We.value?We.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Mt()});return}const i={content:f.value.innerHTML,title:H.title||"",description:H.description||""};Vt.value.push(i);const c=Ge.value.pop();if(c!==void 0){oe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,nt.value=d,te.value=u,K.value=p,qt.value=d,Q.value=u,ce.value=p,e.nextTick(()=>{Sl(),wl(),Zl(),ol();const g=Hl(d);me("update:modelValue",g),me("update:title",u),me("update:description",p),me("change",g),me("title-change",u),me("description-change",p),oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}}else if(n){if(We.value){We.value.focus();const k=p.length;We.value.setSelectionRange(k,k)}}else if(s)mn();else if(Ve.value&&document.activeElement===Ve.value){const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}else if(We.value&&document.activeElement===We.value){const k=p.length;We.value.setSelectionRange(k,k)}else f.value&&mn()},10)})})}},qn=()=>{if(H.disabled||!H.richText||!f.value)return;nl();const a=Nt.value==="title",n=Nt.value==="description",s=Nt.value==="editor";if(Vt.value.length===0){a&&Ve.value?Ve.value.focus():n&&We.value?We.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Mt()});return}const i={content:f.value.innerHTML,title:H.title||"",description:H.description||""};Ge.value.push(i);const c=Vt.value.pop();if(c!==void 0){oe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",p=typeof c=="object"&&c.description||"";f.value.innerHTML=d,nt.value=d,te.value=u,K.value=p,qt.value=d,Q.value=u,ce.value=p,e.nextTick(()=>{Sl(),wl(),Zl(),ol();const g=Hl(d);me("update:modelValue",g),me("update:title",u),me("update:description",p),me("change",g),me("title-change",u),me("description-change",p),oe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(a){if(Ve.value){Ve.value.focus();const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}}else if(n){if(We.value){We.value.focus();const k=p.length;We.value.setSelectionRange(k,k)}}else if(s)mn();else if(Ve.value&&document.activeElement===Ve.value){const k=u.length;Ve.value.setSelectionRange&&Ve.value.setSelectionRange(k,k),se()}else if(We.value&&document.activeElement===We.value){const k=p.length;We.value.setSelectionRange(k,k)}else f.value&&mn()},10)})})}},Rl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{const c=i.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(i=>{if(parseInt(i.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";i.firstChild;)d.appendChild(i.firstChild);i.parentNode&&i.parentNode.replaceChild(d,i)}}),f.value.querySelectorAll("b, strong").forEach(i=>{i.style.fontWeight="600"})},Ql=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Jt=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{Ql()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Ql()});else try{const i=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Ql()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Ql()})}return!0},Dn=()=>{const a=window.getSelection();if(!a||a.rangeCount===0)return!1;const n=a.getRangeAt(0);let s=!1;if(n.collapsed){const i=n.startContainer;let c=i.nodeType===3?i.parentElement:i;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!0;break}c=c.parentElement}}else{const i=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(i){const c=document.createTreeWalker(i,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Rl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const p=u.style.fontWeight;if(p==="normal"||p==="400"){const g=document.createElement("b");g.style.fontWeight="600";const k=document.createDocumentFragment();for(;u.firstChild;)k.appendChild(u.firstChild);g.appendChild(k),u.parentNode&&u.parentNode.replaceChild(g,u),c.setStart(g,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const p=document.createElement("b");p.style.fontWeight="600",p.innerHTML="<br>",c.insertNode(p),c.setStart(p,0),c.collapse(!0),i.removeAllRanges(),i.addRange(c)}}Rl()});else try{const i=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(i),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),a.removeAllRanges(),a.addRange(n),e.nextTick(()=>{Rl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Rl()})}return!0},Fl=(a,n=null)=>{if(H.disabled||!H.richText||!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus();const s=window.getSelection();let i=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&gn(d)&&(i=Bt())}if(a==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const g=document.createTextNode(n);u.insertNode(g),u.selectNodeContents(g)}}}if(a==="bold"){const d=Dn();ke.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{i&&(Bl(i),e.nextTick(()=>{const p=Xt("bold");ke.value.bold=p})),Mt(),wl(),ol()});return}if(a==="italic"){const d=Jt();ke.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{i&&(Bl(i),e.nextTick(()=>{const p=Xt("italic");ke.value.italic=p})),Mt(),Ql(),wl(),ol()});return}let c=!1;try{c=document.execCommand(a,!1,n)}catch{}e.nextTick(()=>{if(i&&Bl(i),["bold","italic","underline"].includes(a))try{if(a==="bold")i&&e.nextTick(()=>{const u=Xt("bold");ke.value.bold=u});else if(a==="italic")if(i)e.nextTick(()=>{const u=Xt("italic");ke.value.italic=u});else{const u=document.queryCommandState(a);ke.value[a]=u}else{const u=document.queryCommandState(a);ke.value[a]=u}}catch{ke.value.hasOwnProperty(a)?ke.value[a]=!ke.value[a]:ke.value[a]=!0}if(a==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const g=u.getRangeAt(0),k=g.commonAncestorContainer.nodeType===1?g.commonAncestorContainer.closest("a"):g.commonAncestorContainer.parentElement?.closest("a");k&&(!k.getAttribute("href")||k.getAttribute("href")==="")&&k.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(g=>{const k=g.getAttribute("href");(!k||k===""||k==="#")&&g.setAttribute("href",n)})}Mt(),wl(),ol()})},Xt=(a,n=null)=>{if(H.disabled||!f.value)return!1;try{if(a==="formatBlock"&&n){const i=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=i.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const p=d.getRangeAt(0).commonAncestorContainer;return!!(p.nodeType===1?p.tagName==="BLOCKQUOTE"?p:p.closest("blockquote"):p.parentElement?.closest("blockquote"))}}return i===n||i.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(a))try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(a==="bold"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,g=p.nodeType===3?p.parentElement:p;if(g&&((g.tagName==="STRONG"||g.tagName==="B"||g.closest&&g.closest("strong, b"))&&(u=!0),!u&&g.style&&parseInt(g.style.fontWeight)>=600&&(u=!0),!u))try{const k=window.getComputedStyle(g);parseInt(k.fontWeight)>=600&&(u=!0)}catch{}return ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let g=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;g=!0;let E=F.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(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[a]=u&&g,u&&g}}if(a==="italic"){let u=!1;if(c.collapsed){const p=c.commonAncestorContainer,g=p.nodeType===3?p.parentElement:p;if(g&&((g.tagName==="EM"||g.tagName==="I"||g.closest&&g.closest("em, i"))&&(u=!0),!u&&g.style&&g.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(g).fontStyle==="italic"&&(u=!0)}catch{}return ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=u,u)}else{const p=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let g=!1;if(p){const k=document.createTreeWalker(p,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let F;for(;F=k.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(F))){if(F.nodeType===3){if(!(F.textContent||"").trim())continue;g=!0;let E=F.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(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[a]=u&&g,u&&g}}const d=document.queryCommandState(a);return c.collapsed&&ke.value.hasOwnProperty(a)?ke.value[a]:(ke.value[a]=d,d)}return ke.value.hasOwnProperty(a)?ke.value[a]:!1}catch{return ke.value.hasOwnProperty(a)?ke.value[a]:!1}try{return document.queryCommandState(a)}catch{return!1}}catch{return!1}},Zn=a=>{H.disabled||!H.richText||(be.value=be.value===a?null:a,a==="askAi"&&(Ft.value=null))},nl=()=>{be.value=null,Ce.value=null},Il=a=>{Fl("formatBlock",a),nl()},Un=a=>{if(!a||!f.value)return a;const n=Fe=>{let we=Fe.nodeType===Node.TEXT_NODE?Fe.parentElement:Fe;for(;we&&we!==f.value;){const ct=we.tagName;if(ct==="P"){const bl=we.parentElement;if(bl===f.value||bl.tagName==="BLOCKQUOTE")return we}if(ct==="BLOCKQUOTE")break;we=we.parentElement}return null},s=n(a.startContainer),i=n(a.endContainer);if(!s||!i)return a;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Fe=>{const we=Fe.tagName;if(we==="P"){const ct=Fe.parentElement;if(ct===f.value||ct.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return we==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const p=c.indexOf(s),g=c.indexOf(i);if(p===-1||g===-1)return a;const k=Math.min(p,g),F=Math.max(p,g),P=c.slice(k,F+1);if(P.length===0)return a;const E=P[0],le=P[P.length-1],J=document.createRange();return J.setStartBefore(E),J.setEndAfter(le),J},Hn=()=>{if(H.disabled||!H.richText||!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;let n=a.getRangeAt(0);!n.collapsed&&gn(n)&&(n=Un(n),a.removeAllRanges(),a.addRange(n));let s=null;!n.collapsed&&gn(n)&&(s=Bt());const i=n.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(g=>{if(g.nodeType===Node.ELEMENT_NODE)if(g.tagName==="P"||g.tagName==="DIV")u.insertBefore(g,c);else{const k=document.createElement("p");k.appendChild(g.cloneNode(!0)),u.insertBefore(k,c)}else if(g.nodeType===Node.TEXT_NODE&&g.textContent.trim()){const k=document.createElement("p");k.appendChild(g.cloneNode(!0)),u.insertBefore(k,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),p=n.extractContents();u.appendChild(p),n.insertNode(u);const g=[],k=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let F;for(;F=k.nextNode();)g.push(F);if(g.forEach(E=>{const le=document.createElement("p");E.parentNode.insertBefore(le,E),le.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Bl(s),Zl(),Mt(),ol()})},xn=()=>{if(!f.value)return;const a=window.getSelection();if(a.rangeCount===0)return;const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!i||!f.value.contains(i))return;const c=F=>{if(!F)return!1;const P=F.textContent||"",le=(F.innerHTML||"").trim();return P.trim()===""||le===""||le==="<br>"||le==="<br/>"||le==="<p></p>"||le==="<p><br></p>"||le==="<p><br/></p>"||le==="<p> </p>"||le==="<p><br> </p>"||le==="<div></div>"||le==="<div><br></div>"||le==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&i.contains(d)&&c(d)&&d.remove();i.lastChild;){const 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 p=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==p&&(i.innerHTML=u);const g=document.createElement("p");g.innerHTML="<br>",i.parentNode?i.nextSibling?i.parentNode.insertBefore(g,i.nextSibling):i.parentNode.appendChild(g):f.value&&f.value.appendChild(g);const k=document.createRange();k.selectNodeContents(g),k.collapse(!0),a.removeAllRanges(),a.addRange(k),e.nextTick(()=>{Zl(),Mt()})},wl=()=>{if(!f.value){he.value=!1;return}try{const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");he.value=!!i}else he.value=!1}catch{he.value=!1}},Xn=()=>{if(!f.value)return;const a=window.getSelection();a&&a.rangeCount>0&&a.getRangeAt(0),ze.value=Bt();const n=window.getSelection();let s="";n.rangeCount>0&&(s=n.getRangeAt(0).toString()),lt.value="",rt.value=s,ye.value="",qe.value=null,$e.value=!0,nl(),e.nextTick(()=>{Qe.value&&Qe.value.focus()})},sn=()=>{if(!f.value)return;Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt();const a=window.getSelection();let n=null;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer;n=i.nodeType===1?i.closest("a"):i.parentElement?.closest("a")}if(!n&&qe.value&&(n=qe.value),n&&n.parentNode){const s=document.createDocumentFragment();for(;n.firstChild;)s.appendChild(n.firstChild);if(n.parentNode.replaceChild(s,n),s.firstChild){const i=document.createRange();i.setStartBefore(s.firstChild),i.setEndAfter(s.lastChild||s.firstChild),a.removeAllRanges(),a.addRange(i),document.execCommand("removeFormat",!1),i.collapse(!1),a.removeAllRanges(),a.addRange(i)}qe.value=null}else Fl("unlink");he.value=!1,nl(),e.nextTick(()=>{Mt(),wl()})},Yn=()=>{H.disabled||!H.richText||f.value&&(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sl(),Mt(),ol()}))},rn=()=>{H.disabled||!H.richText||f.value&&(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),nl(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sl(),Mt(),ol()}))},Rn=a=>{const n=a.parentElement;if(!n||n.tagName!=="OL")return null;let s=0,i=a.previousElementSibling;for(;i;)i.tagName==="LI"&&s++,i=i.previousElementSibling;return s+1},Sl=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const s=n.parentElement;if(s&&s.tagName==="LI"){const i=Rn(s);i!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(i))})}})},Jl=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Sl(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=s.previousElementSibling;if(c&&c.tagName==="LI"){const d=i.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const p=Rn(c);u.appendChild(s),p!==null&&i.tagName==="OL"&&s.setAttribute("data-parent-num",String(p)),Sl();const g=document.createRange();g.selectNodeContents(s),g.collapse(!1),a.removeAllRanges(),a.addRange(g),e.nextTick(()=>{Mt(),ol()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sl(),Mt(),ol()})},Xl=()=>{if(H.disabled||!H.richText||!f.value)return;nl(),f.value.focus();const a=window.getSelection();if(a.rangeCount===0)return;const n=a.getRangeAt(0),s=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Sl(),Mt()});return}const i=s.parentElement;if(!i||i.tagName!=="OL"&&i.tagName!=="UL")return;const c=i.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){i.tagName==="OL"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),i.children.length===0&&i.remove(),Sl();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),a.removeAllRanges(),a.addRange(u),e.nextTick(()=>{Mt(),ol()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sl(),Mt(),ol()})},st=e.ref(null),Ne=e.ref(null),y=e.ref({}),h=e.ref(""),x=e.ref(null),$=e.ref("");e.ref("");const Y=e.ref(null);e.ref("");const U=e.ref([]),tt=e.ref(!1),Se=e.ref(!1),zl=a=>{if(!a)return"";const n=a.cloneRange(),s=document.createElement("div");return s.appendChild(n.cloneContents()),s.innerHTML},Wl=()=>{if(!H.commentUser||H.disabled||!H.richText||!f.value)return;if(st.value!==null){st.value=null,h.value="",$.value="",Y.value=null,U.value=[],tn(!0);return}nl(),f.value.focus();const a=window.getSelection();if(!a||a.rangeCount===0)return;const n=a.getRangeAt(0);if(n.collapsed||!gn(n))return;$.value=zl(n)||"",Y.value=Bt();const s=n.getBoundingClientRect(),i=f.value.parentElement;if(!i)return;const c=i.getBoundingClientRect(),d=s.bottom-c.top,p=Math.max(d+8,0);y.value={top:`${p}px`,bottom:"auto"},st.value=Date.now(),e.nextTick(()=>{if(h.value="",x.value){const k=x.value;k.style.height="auto",k.style.height=`${k.scrollHeight}px`,k.focus()}const g=i.querySelector(".dss-comment-overlay");if(g&&i){const k=i.querySelector(".dss-text-editor-footer");if(k){const F=i.getBoundingClientRect(),P=g.getBoundingClientRect(),E=k.getBoundingClientRect(),le=P.bottom-F.top,J=E.top-F.top,Fe=8;if(le>J-Fe){const we=E.height;y.value={bottom:`${we+Fe}px`,top:"auto"}}else y.value={top:`${p}px`,bottom:"auto"}}}})},ql=()=>{if(!h.value.trim())return;const a=h.value.trim(),n=new Date,s={text:a,selectionText:$.value,selectionRange:Y.value,commentId:st.value,user:H.commentUser||null,createdAt:n.toISOString()};U.value=[...U.value,s],me("comment-submitted",s),Xo(s),Y.value&&!uo(Y.value)&&Uo(st.value,Y.value),h.value="",e.nextTick(()=>{if(x.value){const i=x.value;i.style.height="auto",i.style.height=`${i.scrollHeight}px`,i.focus()}xl("sendComment")})},vn=(a,n)=>{if(!(!H.commentUser||!a.user||a.user.id!==H.commentUser.id)){if(U.value=U.value.filter((s,i)=>i!==n),st.value!==null&&f.value){const s=String(st.value),i=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(i&&U.value.length>0){const c=[],d=new Set;U.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?i.setAttribute("data-comment-user",JSON.stringify(c[0])):i.removeAttribute("data-comment-user"),c.length>1?i.setAttribute("data-comment-user-2",JSON.stringify(c[1])):i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count",String(U.value.length))}else i&&U.value.length===0&&(i.removeAttribute("data-comment-user"),i.removeAttribute("data-comment-user-2"),i.setAttribute("data-comment-count","0"))}if(me("comment-deleted",{comment:a,index:n,commentId:st.value}),H.comments&&Array.isArray(H.comments)){const s=H.comments.filter(i=>!(i.commentId===a.commentId&&i.text===a.text&&i.user?.id===a.user?.id));me("update:comments",s)}e.nextTick(()=>{xl("deleteComment")})}},uo=a=>{if(!a||!f.value)return!1;try{const n=Jn(a);if(!n)return!1;const s=n.commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(i)return!!i.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Jn=a=>{if(!a||!f.value)return null;try{const n=document.createRange();if(a.type==="element"&&a.element)return f.value.contains(a.element)?(n.setStart(a.element,a.offset),n.collapse(!0),n):null;let s=0;const i=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=i.pop());)if(c.nodeType===3){const p=s+c.length;!d&&a.start>=s&&a.start<=p&&(n.setStart(c,a.start-s),d=!0),d&&a.end>=s&&a.end<=p&&(n.setEnd(c,a.end-s),u=!0),s=p}else{let p=c.childNodes.length;for(;p--;)i.push(c.childNodes[p])}return d?n:null}catch{return null}},Uo=(a,n)=>{if(!(!a||!n||!f.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 p=c.closest("[data-comment], [data-fake-comment]");if(p){p.getAttribute("data-comment")!==String(a)&&p.getAttribute("data-fake-comment")!==String(a)&&p.setAttribute("data-comment",String(a));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(a));try{const p=s.startContainer,g=s.endContainer,k=s.startOffset,F=s.endOffset,P=p.nodeType===3?p.parentNode:p,E=g.nodeType===3?g.parentNode:g;if(P===E&&k===0&&F===(g.nodeType===3?g.length:E.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 J=s.extractContents();d.appendChild(J),s.insertNode(d)}else s.surroundContents(d)}catch{const g=s.extractContents();d.appendChild(g),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(a)}"]`);e.nextTick(()=>{xl("wrapSelectionWithCommentMarker"),Mt()})}catch{}},Xo=a=>{if(!a||!a.commentId)return;const n=Array.isArray(H.comments)?[...H.comments]:[],s=typeof a.commentId=="string"&&a.commentId.startsWith("comment-")?Date.now():Number(a.commentId)||a.commentId;let i=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(s)||d.conversation_id===s);const c={text:a.text,user:a.user,createdAt:a.createdAt,created_at:a.createdAt,updated_at:a.createdAt};if(i>=0){const d=n[i];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=a.createdAt,!d.article_id&&n.length>0){const u=n.find(p=>p.article_id);u&&(d.article_id=u.article_id)}}else{const d=a.selectionRange,u=n.length>0&&n.find(g=>g.article_id)?.article_id||null,p={conversation_id:s,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:a.selectionText||"",conversation:[c],created_by_user:a.user,created_at:a.createdAt,updated_at:a.createdAt,status:"active"};n.push(p)}tt.value=!0,me("update:comments",n)},Yo=(a,n=[])=>{if(!H.commentUser||H.disabled||!H.richText||!f.value)return;const s=f.value;let i=null;try{i=s.querySelector(a)}catch{return}if(!i)return;nl(),s.focus();const c=document.createRange();c.selectNodeContents(i);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),$.value=i.innerHTML||"",Y.value=Bt();const u=c.getBoundingClientRect(),p=s.parentElement;if(p){const F=p.getBoundingClientRect(),P=u.bottom-F.top,le=Math.max(P+8,0);y.value={top:`${le}px`,bottom:"auto"}}const g=i.getAttribute("data-comment")||i.getAttribute("data-fake-comment");let k=[];if(g&&H.comments&&Array.isArray(H.comments)){const F=H.comments.find(P=>String(P.conversation_id)===String(g));if(F&&F.conversation&&Array.isArray(F.conversation)){const P=F.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:F.id||F.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));k.push(...P)}}k.length===0&&Array.isArray(n)&&n.length>0&&(k=n.slice()),k.sort((F,P)=>{const E=Fe=>{if(!Fe)return 0;const we=new Date(Fe).getTime();return isNaN(we)?0:we},le=E(F.createdAt),J=E(P.createdAt);return le===J?0:le-J}),U.value=k,tn(!0),st.value=g||null,i&&(Ne.value=i,i.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(h.value="",x.value){const F=x.value;F.style.height="auto",F.style.height=`${F.scrollHeight}px`,F.focus()}if(p){const F=p.querySelector(".dss-comment-overlay");if(F){const P=p.querySelector(".dss-text-editor-footer");if(P){const E=p.getBoundingClientRect(),le=F.getBoundingClientRect(),J=P.getBoundingClientRect(),Fe=le.bottom-E.top,we=J.top-E.top,ct=8;if(Fe>we-ct){const bl=J.height;y.value={bottom:`${bl+ct}px`,top:"auto"}}}}}xl("openCommentOverlayForSelector")})},mo=e.ref(null),xo=e.ref(0),fn=a=>{if(!(H.disabled||!H.richText)){if(a.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){a.preventDefault();let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=document.createElement("p");p.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(p,u.nextSibling):c.appendChild(p),setTimeout(()=>{xn()},50);return}}}if(a.key.length===1||a.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const s=n.getRangeAt(0),i=s.commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const p=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,g=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(p)&&p!==u||d.contains(g)&&g!==u){a.preventDefault();const k=document.createRange();k.setStartAfter(d),k.collapse(!0),n.removeAllRanges(),n.addRange(k);return}}}}}}if(a.key==="Backspace"||a.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);let i=null,c=null;if(s.collapsed)if(a.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const p=u.previousSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.startContainer;let u=d;d.nodeType===3&&(s.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const p=u.nextSibling;p&&(p.classList&&p.classList.contains("dss-image-wrapper")?c=p:p.tagName==="IMG"&&(i=p,c=i.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(i=c.querySelector("img")))}else{const d=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,p=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(i=d,c=i.closest(".dss-image-wrapper")):(i=d.querySelector("img"),i&&(c=i.closest(".dss-image-wrapper"))),c){const g=c.contains(u)||u===c,k=c.contains(p)||p===c,P=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!g||!k||P.length>E.length)&&(c=null,i=null)}}if(c){a.preventDefault(),a.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const p=document.createRange();p.setStartAfter(u),p.collapse(!0),n.removeAllRanges(),n.addRange(p),e.nextTick(()=>{Mt()});return}}}}if(a.key==="Tab"){a.preventDefault(),a.shiftKey?Xl():Jl();return}if(a.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const s=n.getRangeAt(0);if(s.collapsed){const u=s.startContainer,p=g=>{if(!g)return!1;let k=g.previousSibling;for(;k;){if(k.classList&&k.classList.contains("dss-image-wrapper")||k.tagName==="IMG"||k.querySelector&&k.querySelector(".dss-image-wrapper")||k.querySelector&&k.querySelector("img"))return!0;k=k.previousSibling}const F=g.parentElement;return F&&F!==f.value?p(F):!1};if(u.nodeType===3){const g=u.parentElement;if(g&&(p(g)||p(u))){const k=g.closest("p, div");if(k&&k!==f.value){a.preventDefault(),a.stopPropagation();let F=null;const P=s.startOffset;P<u.length&&(F=u.splitText(P));const E=document.createElement("p");if(F?E.appendChild(F):E.innerHTML="<br>",u.length===0){const J=u.parentElement;J&&(J.removeChild(u),J.childNodes.length===0&&J.appendChild(document.createElement("br")))}k.nextSibling?k.parentNode.insertBefore(E,k.nextSibling):k.parentNode.appendChild(E);const le=document.createRange();F?le.setStart(F,0):le.setStart(E,0),le.collapse(!0),n.removeAllRanges(),n.addRange(le),e.nextTick(()=>{Mt()});return}}}}const i=s.commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;i.nodeType===3?u=i.parentElement:i.tagName==="P"||i.tagName==="DIV"?u=i:u=i.closest("p, div");const p=J=>{if(!J)return!1;const Fe=J.textContent||"",ct=(J.innerHTML||"").trim(),bl=ct.replace(/<br\s*\/?>/gi,"").trim();return Fe.trim()===""||ct===""||bl===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},g=c.lastChild,k=g&&g.nodeType===1&&g.tagName==="BR",F=s.startContainer,P=F.nodeType===3?F.parentElement:F,E=P===c||P&&P.parentElement===c;if(u&&p(u)||k&&E){a.preventDefault(),setTimeout(()=>{xn()},50);return}}}}if(a.key===" "){const n=Date.now(),s=n-xo.value;if(mo.value===" "&&s<300){const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){a.preventDefault(),Jl();return}}}}mo.value=" ",xo.value=n}else mo.value=a.key}},jo=a=>{if(H.disabled||!H.richText)return;a.preventDefault();let n=a.clipboardData.getData("text/html"),s=a.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),Qt();const i=window.getSelection();let c=null;if(i&&i.rangeCount>0){let p=i.getRangeAt(0).commonAncestorContainer;p.nodeType===3&&(p=p.parentNode),c=p.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const g=new DOMParser().parseFromString(u,"text/html");let k=f.value.querySelector("h1")?1:0;if(g.querySelectorAll("h1").forEach(P=>{if(k>0){const E=g.createElement("p");E.innerHTML=P.innerHTML,P.parentNode.replaceChild(E,P)}else k++}),c){const P=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(g.body.children).filter(le=>P.includes(le.tagName));if(E.length===1){const le=E[0].tagName,J=c.tagName,Fe=c.textContent.trim()===""&&!c.querySelector("img");let we=!1;if(["H1","H2","H3","H4","H5","H6"].includes(J)?we=!0:Fe||(le===J||le==="P")&&(we=!0),we)return E[0].innerHTML.trim()}}return g.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const p=d(s);document.execCommand("insertHTML",!1,p)}else document.execCommand("insertText",!1,s);Mt()},Eo=a=>{if(be.value){const s=a.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nl()}if(Te.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!i&&!c&&Yl()}if(Ft.value){const s=a.target,i=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!i&&!c&&Bo()}const n=a.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ce.value=null),!f.value||!n.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const i=s.getRangeAt(0);ie.value=!i.collapsed&&gn(i)}else ie.value=!1}if(st.value!==null){const s=document.querySelector(".dss-comment-overlay");let i=!1;if(s){const u=s.getBoundingClientRect(),p=a.clientX,g=a.clientY;i=p>=u.left&&p<=u.right&&g>=u.top&&g<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!i&&!d&&(st.value=null,h.value="",$.value="",Y.value=null,U.value=[],tn(!0))}},So=(a,n)=>{a&&a.stopPropagation&&a.stopPropagation(),je.value&&(clearTimeout(je.value),je.value=null),Ce.value=n},Vo=a=>{const n=a.relatedTarget;if(n){const s=n.closest(".dss-toolbar-dropdown-submenu"),i=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||i)return}je.value&&clearTimeout(je.value),je.value=setTimeout(()=>{Ce.value=null,je.value=null},150)},Ko=a=>{Ce.value=null};let Go=0;const Qo=a=>{if(!a)return;const n=Array.from(a.children);n.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),n.forEach((s,i)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(p=>p.tagName==="DIV"?p.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(p.children).filter(k=>k.tagName==="BUTTON"||k.tagName==="DIV").length>0:!1),d=s.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(p=>p.tagName==="BUTTON"||p.tagName==="DIV");if(c||u){const p=`submenu-auto-${++Go}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",p);let g=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),g=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),g=d),g&&(g.setAttribute("data-submenu-id",p),g.setAttribute("data-processed","true"),c&&s.tagName!=="BUTTON"?g.dataset.originalParentRef="inside":g.dataset.originalParentRef="sibling",Array.from(g.children).forEach(F=>{(F.tagName==="BUTTON"||F.tagName==="DIV")&&!F.classList.contains("dss-toolbar-dropdown-item")&&F.classList.add("dss-toolbar-dropdown-item")}))}})},po=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{Qo(n),n.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=g=>{const k=c.getAttribute("data-submenu-id");k&&So(g,k)},p=Vo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=k=>{const F=c.getAttribute("data-submenu-id");F&&So(k,F)},p=Vo;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",p),c._subMenuHandlers={enter:u,leave:p},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(k=>{k.addEventListener("click",Ko)})})})};let Fn=null;const en=()=>{if(Ce.value){const a=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ce.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ce.value}"]`);a&&n&&yn(a,n)}if(Te.value&&ol(),H.richText){if(Fn!==null)return;Fn=setTimeout(()=>{Fn=null,xl("handleWindowResize")},150)}},eo=()=>{if(!H.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")})})},Jo=()=>{const a=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const i=window.getSelection();i.removeAllRanges?i.removeAllRanges():i.empty&&i.empty()}return!1};a.forEach(s=>{s.addEventListener("selectstart",n),s.addEventListener("mousedown",n),s.addEventListener("dragstart",n),s.addEventListener("contextmenu",n),s.addEventListener("click",i=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{wt.value?se():ut(),B.value?Je():Tt()})}),e.nextTick(()=>{Jo()}),H.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Eo),window.addEventListener("resize",en);let a=null;const n=()=>{a===null&&(a=setTimeout(()=>{a=null,en()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=a,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const s=f.value.closest(".dss-text-editor-content");let i=null;const c=()=>{i===null&&(i=setTimeout(()=>{i=null,en()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{po(),eo()}),f.value.addEventListener("click",p=>{const g=p.target;g.closest("a")&&!H.disabled&&p.preventDefault();const F=g.closest(".dss-image-no-alt-icon"),P=g.closest(".dss-image-wrapper");if(F||P&&g===P){p.preventDefault(),p.stopPropagation();const E=window.getSelection(),le=document.createRange();le.setStartAfter(P),le.collapse(!0),E.removeAllRanges(),E.addRange(le)}else P&&g.tagName!=="IMG"&&(p.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const J=E.getRangeAt(0).commonAncestorContainer,Fe=J.nodeType===3?J.parentElement:J;if(P.contains(Fe)&&Fe!==P.querySelector("img")){const we=document.createRange();we.setStartAfter(P),we.collapse(!0),E.removeAllRanges(),E.addRange(we)}}else{const le=document.createRange();le.setStartAfter(P),le.collapse(!0),E.addRange(le)}}))},!0),f.value.addEventListener("mousedown",p=>{const g=p.target,k=g.closest(".dss-image-no-alt-icon"),F=g.closest(".dss-image-wrapper");if(k||F&&g.tagName!=="IMG"){p.preventDefault();const P=window.getSelection(),E=document.createRange();F&&(E.setStartAfter(F),E.collapse(!0),P.removeAllRanges(),P.addRange(E))}},!0),f.value.addEventListener("paste",p=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(k=>{if(!k.closest(".dss-image-wrapper"))k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="";else{const P=k.getAttribute("alt")||k.alt||"";if(P){const E=k.getAttribute("src")||k.src||"",le=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),J=P===E||P===le;(P.startsWith("http://")||P.startsWith("https://")||P.startsWith("data:")||J||J)&&(k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="")}}}),_l()})}),f.value.addEventListener("dragstart",p=>{const g=p.target,k=g.tagName==="IMG"?g:g.closest("img"),F=k?.closest(".dss-image-wrapper");k&&f.value.contains(k)&&(pt.value=F||k,p.dataTransfer.effectAllowed="move",p.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",p=>{pt.value&&(p.preventDefault(),p.stopPropagation(),p.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",p=>{pt.value&&(p.preventDefault(),p.stopPropagation())}),f.value.addEventListener("drop",p=>{if(!pt.value||!f.value)return;p.preventDefault(),p.stopPropagation();const g=pt.value,k=g.classList?.contains("dss-image-wrapper"),F=k?g.querySelector("img"):g,P=k?g:F?.closest(".dss-image-wrapper");if(!F||!f.value.contains(F)){pt.value=null;return}let E=null;const le=p.clientX,J=p.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(le,J);else{const Zt=window.getSelection();Zt.rangeCount>0?E=Zt.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){pt.value=null;return}const Fe=E.commonAncestorContainer,we=Fe.nodeType===3?Fe.parentElement:Fe;if(we?.closest(".dss-image-wrapper")===P||P&&P.contains(we)){pt.value=null;return}if(P&&(we===P||P.contains(we))){pt.value=null;return}const bl=F.getAttribute("src");let pl=null;P?pl=P.cloneNode(!0):pl=F.cloneNode(!0);try{let Zt=E.startContainer;if(Zt.nodeType===3&&(Zt=Zt.parentElement),P&&(Zt===P||P.contains(Zt))){const Ut=document.createRange();Ut.setStartAfter(P),Ut.collapse(!0),E=Ut}E.insertNode(pl);const vl=document.createRange();vl.setStartAfter(pl),vl.collapse(!0);const fl=window.getSelection();fl.removeAllRanges(),fl.addRange(vl)}catch{if(f.value.childNodes.length===0){const vl=document.createElement("p");vl.appendChild(pl),f.value.appendChild(vl)}else{const vl=f.value.lastChild;if(vl&&vl.nodeType===1)vl.appendChild(pl);else{const fl=document.createElement("p");fl.appendChild(pl),f.value.appendChild(fl)}}}P?P.remove():F.remove(),pt.value=null,e.nextTick(()=>{const Zt=f.value.querySelectorAll("img");let vl=!1;Zt.forEach(fl=>{if(fl.getAttribute("src")===bl)if(!vl)vl=!0;else{const Ut=fl.closest(".dss-image-wrapper");Ut?Ut.remove():fl.remove()}}),_l(),Mt()})}),f.value.addEventListener("dragend",p=>{pt.value=null});let d=null;const u=new MutationObserver(p=>{p.forEach(g=>{g.addedNodes.forEach(k=>{if(k.nodeType===1){k.tagName==="IMG"&&(k.removeAttribute("alt"),k.removeAttribute("data-alt"),k.setAttribute("alt",""),k.setAttribute("data-alt",""),k.alt="");const F=k.querySelectorAll&&k.querySelectorAll("img");F&&F.forEach(P=>{P.removeAttribute("alt"),P.removeAttribute("data-alt"),P.setAttribute("alt",""),P.setAttribute("data-alt",""),P.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{_l(),eo(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const p=document.querySelector(".dss-text-editor-toolbar");if(p){const g=new MutationObserver(()=>{e.nextTick(()=>{eo()})});g.observe(p,{childList:!0,subtree:!0}),p._toolbarMutationObserver=g}}),H.modelValue){const p=ul(H.modelValue);f.value.innerHTML=p,An()}e.nextTick(()=>{const p=f.value.innerHTML||"",g=H.title||"",k=H.description||"";nt.value=p,te.value=g,K.value=k,Q.value=g,ce.value=k,Sl(),_l(),Ql(),hn(),Ao(),vt()}),wl(),Zl(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Eo),window.removeEventListener("resize",en),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Fn!==null&&(clearTimeout(Fn),Fn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Pe.value&&clearTimeout(Pe.value),je.value&&clearTimeout(je.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),He.value&&He.value.disconnect(),gt.value!==null&&(cancelAnimationFrame(gt.value),gt.value=null),et.value!==null&&(clearTimeout(et.value),et.value=null),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),tn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:s,handler:i}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",i),s&&s.removeEventListener("scroll",i)}const a=document.querySelector(".dss-text-editor-toolbar");a&&a._toolbarMutationObserver&&a._toolbarMutationObserver.disconnect()});const ea=a=>{const n=a.target,s=n.closest("a");if(s&&!H.disabled){a.preventDefault();const c=document.createRange();c.selectNodeContents(s);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const i=n.closest(".dss-image-wrapper");i&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(i.contains(p)&&p!==i.querySelector("img")){const g=document.createRange();g.setStartAfter(i),g.collapse(!0),c.removeAllRanges(),c.addRange(g)}}_l(),wl(),Zl(),ol(),hn()}):e.nextTick(()=>{_l(),wl(),Zl(),ol(),hn()})},vo=()=>{wn();const a=window.getSelection();if(a&&a.rangeCount>0){const s=a.getRangeAt(0);ie.value=!s.collapsed&&gn(s),!s.collapsed&&w.value&&(w.value=null)}else ie.value=!1;if(_l(),wl(),Zl(),ol(),hn(),a&&a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===3?i.parentElement:i;if(c&&c.closest(".dss-text-editor-footer")){a.removeAllRanges(),ie.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const i=window.getSelection();if(i.rangeCount>0){const c=i.getRangeAt(0);if(!c.collapsed)if(s==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let p=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(p=!0),!p&&u.style&&parseInt(u.style.fontWeight)>=600&&(p=!0),!p))try{const g=window.getComputedStyle(u);parseInt(g.fontWeight)>=600&&(p=!0)}catch{}ke.value[s]=p}else{const d=document.queryCommandState(s);ke.value[s]=d}}}catch{}})},hn=()=>{if(!H.richText||H.disabled||!f.value){T.value="p";return}try{const a=window.getSelection();if(!a||a.rangeCount===0){T.value="p";return}const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===3?s.parentElement:s;if(!i||!f.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 d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?T.value=d:T.value="p"}catch{T.value="p"}},Zl=()=>{if(!f.value){Ue.value=!1;return}try{const a=window.getSelection();let n=!1;if(a.rangeCount>0){const i=a.getRangeAt(0).commonAncestorContainer,c=i.nodeType===1?i.tagName==="BLOCKQUOTE"?i:i.closest("blockquote"):i.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}Ue.value=n}catch{Ue.value=!1}},gn=a=>{if(!a||!f.value)return!1;const n=a.commonAncestorContainer;if(!n)return!1;const s=n.nodeType===3?n.parentElement:n;return s?f.value.contains(s):!1},Yl=()=>{Te.value=!1},ol=()=>{if(!H.floatingToolbar||!H.richText||H.disabled){Te.value=!1;return}const a=window.getSelection();if(!a||a.rangeCount===0){Te.value=!1;return}const n=a.getRangeAt(0);if(n.collapsed||!gn(n)){Te.value=!1;return}const s=n.getBoundingClientRect();if(!s||s.width===0&&s.height===0){Te.value=!1;return}const i=f.value;if(!i){Te.value=!1;return}const c=i.getBoundingClientRect();if(!c||c.width===0){Te.value=!1;return}const d=40,u=8,p=s.top-d/2+15;let g=s.left+s.width/2;const k=window.innerWidth||document.documentElement.clientWidth||0;let F=0;ge.value&&(F=ge.value.getBoundingClientRect().width);const P=(F||320)/2;let E=c.left+P,le=c.right-P;if(le<E){const J=c.left+c.width/2;E=J,le=J}if(k>0){const J=P+u,Fe=k-P-u;if(E=Math.max(E,J),le=Math.min(le,Fe),le<E){const we=k/2;E=we,le=we}}g<E?g=E:g>le&&(g=le),at.value={position:"fixed",top:`${Math.max(p,8)}px`,left:`${g}px`,transform:"translate(-50%, -100%)",zIndex:10003},Te.value=!0},No=a=>{H.disabled||!H.richText||(Ft.value=Ft.value===a?null:a,a==="askAi"&&(be.value=null))},Bo=()=>{Ft.value=null,Ce.value=null},En=a=>{Il(a),Bo()};let Sn=null,In=null,Vn=null,Nn=null;const fo=a=>{if(H.disabled||!H.richText){jn(),Bn();return}const n=a.target,s=n.closest("a"),i=n.closest("img");if(Sn&&(clearTimeout(Sn),Sn=null),Vn&&(clearTimeout(Vn),Vn=null),s&&s!==In){Bn(),In=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),qe.value=s,fe.value=c,j.value=!0,V.value=!0,_o(s)}else!s&&In?(In=null,Sn=setTimeout(()=>{V.value||jn()},150)):s&&s===In&&_o(s);if(i&&i!==Nn){jn(),Nn=i;let c=i.getAttribute("alt");c===null&&(c=i.alt||"");let d=i.getAttribute("data-alt");d===null&&(d=c),i.hasAttribute("alt")||i.setAttribute("alt",c),i.hasAttribute("data-alt")||i.setAttribute("data-alt",d),ht.value=i,Dt.value=c.trim()||N("textEditor.image.noAlt"),St.value=!0,A.value=!0,$o(i)}else!i&&Nn?(Nn=null,Vn=setTimeout(()=>{A.value||Bn()},150)):i&&i===Nn&&$o(i)},Mo=a=>{const n=a.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(In=null,Nn=null,Sn&&(clearTimeout(Sn),Sn=null),Vn&&(clearTimeout(Vn),Vn=null),jn(),Bn())},jn=()=>{V.value=!1,setTimeout(()=>{V.value||(j.value=!1,fe.value="",$e.value||(qe.value=null))},100)},_o=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;_e.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Bn=()=>{A.value=!1,setTimeout(()=>{A.value||(St.value=!1,Dt.value="",dt.value||(ht.value=null))},100)},$o=a=>{if(!a||!f.value)return;const n=a.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},ho=()=>{if(!fe.value||!qe.value)return;let n=qe.value.getAttribute("href")||fe.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},$l=()=>{if(qe.value){const a=qe.value.textContent||"",n=qe.value.getAttribute("href")||"",s=qe.value;lt.value=n,rt.value=a,ye.value=a,V.value=!1,j.value=!1,fe.value="",qe.value=s,$e.value=!0}else if(he.value){const a=window.getSelection();if(a.rangeCount>0){const s=a.getRangeAt(0).commonAncestorContainer,i=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(i){const c=i.textContent||"",d=i.getAttribute("href")||"";lt.value=d,rt.value=c,ye.value=c,qe.value=i,$e.value=!0}}}else{ze.value=Bt();const a=window.getSelection();let n="";a.rangeCount>0&&(n=a.getRangeAt(0).toString()),lt.value="",rt.value=n,ye.value="",qe.value=null,$e.value=!0}e.nextTick(()=>{Qe.value&&(Qe.value.focus(),Qe.value.select())})},z=()=>{$e.value=!1,lt.value="",rt.value="",ye.value="",qe.value=null,ze.value=null},kl=()=>{if(!lt.value.trim()){z();return}if(Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt(),rt.value.trim()||(rt.value=lt.value.trim()),qe.value&&f.value&&f.value.contains(qe.value)){const a=window.getSelection();a.rangeCount>0&&a.removeAllRanges();const n=qe.value;if(n.setAttribute("href",lt.value.trim()),rt.value.trim()!==ye.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=rt.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(n),s.collapse(!1),a.removeAllRanges(),a.addRange(s),Mt()}else if(f.value){f.value.focus();const a=window.getSelection();a.removeAllRanges(),ze.value&&Bl(ze.value);let n=null;if(a.rangeCount>0&&(n=a.getRangeAt(0)),n&&!n.collapsed){n.toString();const s=document.createElement("a");s.href=lt.value.trim(),s.textContent=rt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",n.deleteContents(),n.insertNode(s);const i=document.createTextNode(" ");n.setStartAfter(s),n.insertNode(i),n.setStartAfter(i),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const s=n.startContainer,i=s.nodeType===3,c=i&&n.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=lt.value.trim(),d.textContent=rt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let p=u.nextElementSibling;if(p&&(p.innerHTML==="<br>"||p.innerHTML==="<br/>"||p.textContent.trim()==="")){p.textContent="",p.appendChild(d);const g=document.createTextNode(" ");p.appendChild(g);const k=document.createRange();k.setStartAfter(d),k.collapse(!0),a.removeAllRanges(),a.addRange(k)}else{if(n.startOffset>0){const k=s.textContent.substring(0,n.startOffset),F=k[k.length-1];if(F&&F!==" "&&F!==" "&&F!==`
|
|
104
|
+
`){const P=document.createTextNode(" ");n.insertNode(P),n.setStartAfter(P)}}n.insertNode(d);const g=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(g),n.setStartAfter(g),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}}else{if(i&&n.startOffset>0){const p=s.textContent.substring(0,n.startOffset),g=p[p.length-1];if(g&&g!==" "&&g!==" "&&g!==`
|
|
105
|
+
`){const k=document.createTextNode(" ");n.insertNode(k),n.setStartAfter(k)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),a.removeAllRanges(),a.addRange(n)}}Mt()}e.nextTick(()=>{wl(),z()})},Pl=()=>{if(!f.value||oe.value)return;const a=window.getSelection();let n=null;a&&a.rangeCount>0&&(n=Bt());const s=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,i=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:p=>{const g=p.parentElement;return!g||g.closest("a")||g.closest(".dss-image-wrapper")||!p.textContent||p.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=i.nextNode();)c.push(d);let u=!1;for(let p=c.length-1;p>=0;p--){const g=c[p],k=g.textContent;s.lastIndex=0;const F=[...k.matchAll(s)];if(F.length===0)continue;const P=F.filter(J=>{const Fe=J[0],we=J.index;if(we>0&&k[we-1]==="@"||we+Fe.length<k.length&&k[we+Fe.length]==="@")return!1;const ct=g.parentElement;return!(ct&&ct.closest("a"))});if(P.length===0)continue;if(P.length===1&&P[0][0]===k.trim()){const J=P[0][0],Fe=J.startsWith("http://")||J.startsWith("https://")?J:`https://${J}`,we=document.createElement("a");we.href=Fe,we.textContent=J,we.style.color="#60afdf",we.style.textDecoration="underline",g.parentNode&&(g.parentNode.replaceChild(we,g),u=!0);continue}let E=0;const le=document.createDocumentFragment();if(P.forEach(J=>{const Fe=J.index,we=J[0];if(Fe>E){const pl=k.substring(E,Fe);pl&&le.appendChild(document.createTextNode(pl))}const ct=we.startsWith("http://")||we.startsWith("https://")?we:`https://${we}`,bl=document.createElement("a");bl.href=ct,bl.textContent=we,bl.style.color="#60afdf",bl.style.textDecoration="underline",le.appendChild(bl),E=Fe+we.length}),E<k.length){const J=k.substring(E);J&&le.appendChild(document.createTextNode(J))}g.parentNode&&le.childNodes.length>0&&(g.parentNode.replaceChild(le,g),u=!0)}u&&n&&e.nextTick(()=>{Bl(n),wl()})},Kn=()=>{if(!f.value)return;const a=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),s=[];let i;for(;i=n.nextNode();)s.push(i);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,p=[...u.matchAll(a)];if(p.length===0)continue;let g=0;const k=document.createDocumentFragment();p.forEach(F=>{const P=F.index,E=F[0].startsWith("<u>")?"u":"ins",le=F[1]||F[2]||"";P>g&&k.appendChild(document.createTextNode(u.substring(g,P)));const J=document.createElement(E);J.textContent=le,k.appendChild(J),g=P+F[0].length}),g<u.length&&k.appendChild(document.createTextNode(u.substring(g))),d.parentNode&&k.childNodes.length>0&&d.parentNode.replaceChild(k,d)}},Cl=a=>{if(!f.value||oe.value)return;if(!a){Kn();return}if(!["*","_",">"].includes(a))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const i=s.getRangeAt(0);if(!i.collapsed)return;const c=i.startContainer.nodeType===Node.TEXT_NODE?i.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):i.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let pl="",Zt=0,vl=!1;const fl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jl=>jl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Ut=0;for(;fl.nextNode();){const jl=fl.currentNode,kn=jl.textContent||"",Cn=Ut;if(Ut+=kn.length,jl===i.startContainer){pl+=kn.substring(0,i.startOffset),Zt=Cn+i.startOffset,vl=!0;break}pl+=kn}return vl||(Zt=pl.length),{textBeforeCursor:pl,cursorCharOffset:Zt}},{textBeforeCursor:u}=d();if(!u.length)return;let p=null,g=null;if(u.endsWith("**")&&(p=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(p=u.match(/__(.+?)__$/s))?g="strong":u.endsWith("*")&&!u.endsWith("**")&&(p=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(p=u.match(new RegExp("(?<!_)_([^_]+)_$")))?g="em":a===">"&&((p=u.match(/<u>(.+?)<\/u>$/s))||(p=u.match(/<ins>(.+?)<\/ins>$/s)))&&(g=p[0].startsWith("<u>")?"u":"ins",p[0].startsWith("<u>"),p[0].startsWith("<u>")),!p||!p[1])return;const k=p[0],F=p[1],P=u.length-k.length,le=(pl=>{let Zt=0;const vl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ut=>Ut.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let fl;for(;fl=vl.nextNode();){const Ut=(fl.textContent||"").length;if(Zt+Ut>=pl)return{node:fl,offset:pl-Zt};Zt+=Ut}return null})(P);if(!le)return;const J=document.createRange();J.setStart(le.node,le.offset),J.setEnd(i.endContainer,i.endOffset);const Fe=document.createElement(g);Fe.textContent=F,J.deleteContents(),J.insertNode(Fe);const we=window.getSelection(),ct=document.createRange();ct.setStartAfter(Fe),ct.collapse(!0),we.removeAllRanges(),we.addRange(ct);const bl=Bt();e.nextTick(()=>{Mt(),bl&&Bl(bl)})},gl=()=>{f.value&&(il.value=Bt(),Ye.value="",It.value="",ae.value="",bt.value="",ft.value="",Pt.value=null,ht.value=null,X.value="upload",dt.value=!0,nl(),e.nextTick(()=>{Yt.value&&Yt.value.focus(),it.value&&(it.value.value="")}))},el=a=>{const n=a.target?.files?.[0];if(!n){Pt.value=null,It.value="";return}Pt.value=n;const s=new FileReader;s.onload=i=>{It.value=i.target?.result||""},s.readAsDataURL(n)},jt=()=>{it.value&&it.value.click()},al=()=>{bt.value&&(ft.value="")},cn=()=>{ft.value&&(bt.value="")},Mn=()=>{let a=ht.value;if(!a){const n=window.getSelection();if(n&&n.rangeCount>0){const i=n.getRangeAt(0).commonAncestorContainer;a=i.nodeType===1?i.closest("img"):i.parentElement?.closest("img")}}if(a){const n=a.getAttribute("data-alt")||a.getAttribute("alt")||"";ht.value=a,Ye.value=n.trim()===""||n.trim()==="Image"?"":n;const s=a.getAttribute("src")||a.src||"";s.startsWith("http://")||s.startsWith("https://")?(ae.value=s,It.value="",X.value="url"):(It.value=s,ae.value="",X.value="upload");const c=a.style.width||a.getAttribute("width")||"",d=a.style.height||a.getAttribute("height")||"";bt.value=c.endsWith("px")?c.replace("px",""):c,ft.value=d.endsWith("px")?d.replace("px",""):d,il.value=null}else{gl();return}dt.value=!0,A.value=!1,St.value=!1,e.nextTick(()=>{X.value==="url"&&At.value?(At.value.focus(),At.value.select()):Yt.value&&(Yt.value.focus(),Yt.value.select()),it.value&&(it.value.value="")})},Lt=()=>{dt.value=!1,Ye.value="",It.value="",ae.value="",bt.value="",ft.value="",Pt.value=null,ht.value=null,il.value=null,X.value="upload"},Ct=()=>{const a=(Ye.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Ke.value?(Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Qt(),Ke.value=!1):Qt();const s=X.value==="url"?ae.value.trim():It.value;if(ht.value&&f.value&&f.value.contains(ht.value)){s&&(ht.value.src=s),ht.value.setAttribute("alt",a),ht.value.setAttribute("data-alt",a),bt.value?(ht.value.style.width=`${bt.value}px`,ht.value.setAttribute("width",bt.value)):(ht.value.style.removeProperty("width"),ht.value.removeAttribute("width")),ft.value?(ht.value.style.height=`${ft.value}px`,ht.value.setAttribute("height",ft.value)):(ht.value.style.removeProperty("height"),ht.value.removeAttribute("height"));const i=window.getSelection();if(i){i.removeAllRanges();const c=document.createRange();c.setStartAfter(ht.value),c.collapse(!0),i.addRange(c)}Mt()}else{if(!s){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Lt();return}if(f.value){f.value.focus();const i=window.getSelection();i&&i.rangeCount>0&&i.removeAllRanges();const c=window.getSelection();let d=null;if(il.value&&(Bl(il.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Lt();return}const u=d.commonAncestorContainer,p=u.nodeType===3?u.parentElement:u;if(!f.value.contains(p)){if(d=document.createRange(),f.value.childNodes.length===0){const k=document.createElement("p");k.innerHTML="<br>",f.value.appendChild(k),d.setStart(k,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const g=document.createElement("img");g.src=s,g.setAttribute("alt",a),g.setAttribute("data-alt",a),bt.value&&(g.style.width=`${bt.value}px`,g.setAttribute("width",bt.value)),ft.value&&(g.style.height=`${ft.value}px`,g.setAttribute("height",ft.value));try{d.insertNode(g),d.setStartAfter(g),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const P=document.createElement("p");f.value.appendChild(P),P.appendChild(g)}else{const P=f.value.lastChild;if(P&&P.nodeType===1)P.appendChild(g);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(g)}}const F=document.createRange();F.setStartAfter(g),F.collapse(!0),c&&(c.removeAllRanges(),c.addRange(F))}}ht.value=g,Mt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),wl(),ol(),Lt()})};e.watch(()=>H.modelValue,a=>{if(H.richText&&f.value&&!oe.value){const n=ul(a||""),i=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(i!==c){const d=Bt();f.value.innerHTML=n,e.nextTick(()=>{An();const u=f.value.innerHTML||"",p=H.title||"",g=H.description||"";nt.value=u,te.value=p,K.value=g,qt.value=u,Q.value=p,ce.value=g,Ge.value=[],Vt.value=[],Pe.value&&(clearTimeout(Pe.value),Pe.value=null),Ke.value=!1,d&&Bl(d),Sl(),_l(),Ql(),wl(),ol(),hn(),xl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>H.richText,a=>{a?(ol(),e.nextTick(()=>{Ao()})):(Yl(),re.value=[],He.value&&(He.value.disconnect(),He.value=null)),hn()}),e.watch(()=>H.floatingToolbar,a=>{a?ol():Yl()}),e.watch(()=>H.disabled,a=>{a&&Yl(),hn()}),e.watch(()=>H.description,()=>{e.nextTick(()=>{B.value?Je():Tt()})}),e.watch(()=>H.title,()=>{e.nextTick(()=>{wt.value?se():ut()})}),e.watch(()=>H.customToolbarSlots,()=>{e.nextTick(()=>{eo()})},{deep:!0}),e.watch(()=>H.comments,(a,n)=>{if(H.commentUser){if(tt.value){tt.value=!1;return}Se.value||H.richText&&f.value&&e.nextTick(()=>{vt()})}},{deep:!0,immediate:!1});const vt=()=>{if(H.commentUser&&!Se.value&&!(!H.comments||!Array.isArray(H.comments)||H.comments.length===0)&&!(!H.richText||!f.value)){Se.value=!0;try{const a=new Set,n=H.comments.filter(u=>{const p=String(u.conversation_id||u.id);return a.has(p)?!1:(a.add(p),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),i=s.length;s.forEach(u=>{const p=u.parentNode;if(p){for(;u.firstChild;)p.insertBefore(u.firstChild,u);p.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const p=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!p)return;const g=String(p);if(d.has(g))return;const k=f.value.querySelector(`[data-comment="${g}"]`);if(k){zn(k,u),d.add(g);return}try{const F=Gn(u.selection_range,u.selection_text);if(F&&!F.collapsed){const P=F.commonAncestorContainer,E=P.nodeType===3?P.parentElement:P;if(E){const Fe=E.closest("[data-comment], [data-fake-comment]");if(Fe){const we=Fe.getAttribute("data-comment")||Fe.getAttribute("data-fake-comment");if(String(we)===String(p)){Fe.setAttribute("data-comment",g),Fe.removeAttribute("data-fake-comment"),zn(Fe,u),d.add(g);return}else return}}const le=f.value.querySelector(`[data-comment="${g}"]`);if(le){zn(le,u),d.add(g);return}const J=document.createElement("span");J.setAttribute("data-comment",g),zn(J,u);try{F.surroundContents(J),c++,d.add(g)}catch{try{const we=document.createRange();we.setStart(F.startContainer,F.startOffset),we.setEnd(F.endContainer,F.endOffset),sl(we),we.surroundContents(J),c++,d.add(g)}catch{try{const ct=F.extractContents();J.appendChild(ct),F.insertNode(J),c++,d.add(g)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{xl("restoreCommentsFromModel"),Mt(),Se.value=!1})}catch{Se.value=!1}}},sl=a=>{if(!a||!f.value)return a;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=a.startContainer,i=a.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&n.includes(u.tagName)&&(i===0&&!ta(s)||a.setStartBefore(u))}else s.nodeType===1&&n.includes(s.tagName)&&i>0&&a.setStartBefore(s);let c=a.endContainer,d=a.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!Lo(c)||a.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&a.setEndAfter(c);return a}catch{return a}},ta=a=>{let n=a.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},Lo=a=>{let n=a.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},Gn=(a,n)=>{if(!a||!f.value)return null;try{const s=document.createRange();if(a.type==="text"&&typeof a.start=="number"&&typeof a.end=="number"){let i=0;const c=[f.value];let d=null,u=!1,p=!1;for(;!p&&(d=c.pop());)if(d.nodeType===3){const g=i+d.length;!u&&a.start>=i&&a.start<=g&&(s.setStart(d,a.start-i),u=!0),u&&a.end>=i&&a.end<=g&&(s.setEnd(d,a.end-i),p=!0),i=g}else{let g=d.childNodes.length;for(;g--;)c.push(d.childNodes[g])}return u?sl(s):null}}catch{return null}return null},zn=(a,n)=>{if(!a||!n)return;const s=n.conversation||[],i=new Set,c=[],d=p=>{p&&p.id&&!i.has(p.id)&&(i.add(p.id),c.push(p))};s.length>0&&s.forEach(p=>{p.user&&d(p.user)}),c.length>0?a.setAttribute("data-comment-user",JSON.stringify(c[0])):a.removeAttribute("data-comment-user"),c.length>1?a.setAttribute("data-comment-user-2",JSON.stringify(c[1])):a.removeAttribute("data-comment-user-2");const u=s.length;u>0?a.setAttribute("data-comment-count",String(u)):a.removeAttribute("data-comment-count")},xl=(a="unknown")=>{if(!H.commentUser||!H.richText||!f.value){re.value=[];return}Date.now()-yt.value<Et&>.value!==null||gt.value===null&&(gt.value=requestAnimationFrame(()=>{if(gt.value=null,yt.value=Date.now(),Ae.value)return;Ae.value=!0;const s={},i=f.value;if(!i){Ae.value=!1;return}const c=i.closest(".editor-with-comments");if(!c){Ae.value=!1;return}const d=i.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],p=new Set;d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");le&&E.tagName==="SPAN"&&(p.has(le)||(u.push(E),p.add(le)))}),d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!le||p.has(le)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${le}"], span[data-fake-comment="${le}"]`)||(u.push(E),p.add(le)):E.tagName!=="SPAN"&&(u.push(E),p.add(le)))});const g=c.getBoundingClientRect(),k=i.getBoundingClientRect();u.forEach((E,le)=>{let J=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!J)return;if(typeof J=="string"&&J.startsWith("comment-")){const Vl=E.textContent?.trim(),ln=H.comments?.find(rl=>(typeof rl.conversation_id=="string"&&rl.conversation_id.startsWith("comment-")?null:rl.conversation_id)&&rl.selection_text?.trim()===Vl);ln?(J=String(ln.conversation_id),E.setAttribute("data-comment",J),E.removeAttribute("data-fake-comment")):(J=String(Date.now()),E.setAttribute("data-comment",J),E.removeAttribute("data-fake-comment"))}const Fe=E.getBoundingClientRect(),we=window.getComputedStyle(E),ct=parseFloat(we.lineHeight)||parseFloat(we.fontSize)*1.2,Zt=Fe.top-k.top+ct/2-15,fl=k.top-g.top+Zt;let Ut=null,jl=null,kn=0;const Cn=[],Qn=new Set;if(J&&H.comments){const Vl=H.comments.find(ln=>String(ln.conversation_id||ln.id)===String(J));if(Vl){const ln=Vl.conversation||[];ln.length>0?(ln.forEach(rl=>{rl.user&&rl.user.id&&!Qn.has(rl.user.id)&&(Qn.add(rl.user.id),Cn.push(rl.user))}),kn=ln.length):(kn=0,Ut=null,jl=null),Cn.length>0?Ut=Cn[0]:Ut=null,Cn.length>1?jl=Cn[1]:jl=null}}const Ml=Fe.top+ct/2-15,Do=Ml+30,Wt=5,ko=Do>k.top+Wt&&Ml<k.bottom-Wt?1:0;re.value.find(Vl=>Vl.id===J);let to=E;if(!to&&J&&f.value){const Vl=String(J);to=f.value.querySelector(`[data-comment="${Vl}"], [data-fake-comment="${Vl}"]`)}const tl=Cn.length;s[J]?(s[J].top=fl,s[J].opacity=ko,s[J].element=to,s[J].firstUser=Ut,s[J].secondUser=jl,s[J].totalCount=kn,s[J].uniqueUserCount=tl):s[J]={id:J,top:fl,opacity:ko,element:to,firstUser:Ut,secondUser:jl,totalCount:kn,uniqueUserCount:tl}});const F=Object.values(s).map(E=>{const le=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Fe=String(E.id);E.element=f.value.querySelector(`[data-comment="${Fe}"], [data-fake-comment="${Fe}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:le}});(re.value.length!==F.length||F.some((E,le)=>{const J=re.value[le];if(!J)return!0;const Fe=(J.firstUser?.id||null)!==(E.firstUser?.id||null),we=(J.secondUser?.id||null)!==(E.secondUser?.id||null);return J.id!==E.id||Math.abs(J.top-E.top)>1||J.opacity!==E.opacity||J.totalCount!==E.totalCount||J.additionalCount!==E.additionalCount||Fe||we||J.element!==E.element}))&&(re.value=F),Ae.value=!1}))},go=a=>{if(!a)return;let n=a.element;if(!n&&a.id&&f.value){const s=String(a.id);n=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}n&&(tn(),Ne.value=n,n.classList.add("editor-comment-highlighted"))},tn=(a=!1)=>{!a&&st.value!==null&&Ne.value&&(Ne.value.getAttribute("data-comment")||Ne.value.getAttribute("data-fake-comment"))===st.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Ne.value&&(Ne.value.classList.remove("editor-comment-highlighted"),Ne.value=null))},yo=a=>{if(!a||!a.element)return;tn(!0);const n=a.element.getAttribute("data-comment")||a.element.getAttribute("data-fake-comment");if(!n)return;const s=`[data-comment="${n}"], [data-fake-comment="${n}"]`;me("comment-marker-clicked",{commentId:n,selector:s,element:a.element})},To=()=>{tn()},Ao=()=>{!H.richText||!f.value||(He.value&&He.value.disconnect(),xt.value!==null&&(clearTimeout(xt.value),xt.value=null),He.value=new MutationObserver(()=>{xt.value===null&&(xt.value=setTimeout(()=>{xt.value=null,e.nextTick(()=>{xl("MutationObserver")})},200))}),He.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),xl("setupCommentMarkersObserver-initial"))},yn=(a,n)=>{if(!a||!n)return;const s=n.getBoundingClientRect();let i=s.top,c=s.right+4;a.style.top=`${i}px`,a.style.left=`${c}px`,a.offsetHeight;const d=a.getBoundingClientRect(),u=window.innerWidth,p=window.innerHeight;if(d.right>u){const g=s.left-d.width-4;a.style.left=`${g}px`}if(d.bottom>p){const g=Math.max(8,p-d.height-8);a.style.top=`${g}px`}d.top<0&&(a.style.top="8px")};return e.watch(()=>Ce.value,a=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const i=s.getAttribute("data-submenu-id");if(i===a&&a){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${i}"]`);if(c){if(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{yn(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[be.value,Ft.value],()=>{be.value==="askAi"||Ft.value==="askAi"?e.nextTick(()=>{po()}):(Ce.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const s=n.getAttribute("data-submenu-id");if(s){const i=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);if(i)if(n.dataset.originalParentRef==="inside")i.appendChild(n);else{const d=i.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,i.nextSibling)}}}})}))}),e.watch(()=>H.locale,a=>{a&&a!==ue.value&&(ue.value=a)},{immediate:!0}),ee({openCommentOverlayForSelector:Yo,updateCommentMarkers:xl,restoreCommentsFromModel:vt}),(a,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container",[{"editor-with-comments":$t.value},Ht.value]]),style:e.normalizeStyle(kt.value)},[S.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Id,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:pn,title:e.unref(N)("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,zd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!hl.value}]),onClick:qn,title:e.unref(N)("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,Pd),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Od,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=s=>Zn("paragraph")),title:e.unref(N)("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,qd)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zd)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Ud)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xd)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yd)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,jd)):(e.openBlock(),e.createElementBlock("svg",Kd,[...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,Wd),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=s=>Il("<h1>"))},[e.createElementVNode("img",{src:O.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Gd),e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=s=>Il("<h2>"))},[e.createElementVNode("img",{src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Qd),e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=s=>Il("<h3>"))},[e.createElementVNode("img",{src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Jd),e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=s=>Il("<h4>"))},[e.createElementVNode("img",{src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,e1),e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=s=>Il("<h5>"))},[e.createElementVNode("img",{src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,t1),e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=s=>Il("<h6>"))},[e.createElementVNode("img",{src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,l1),e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=s=>Il("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("bold")}]),onClick:n[9]||(n[9]=s=>Fl("bold")),title:e.unref(N)("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,n1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[10]||(n[10]=s=>Fl("italic")),title:e.unref(N)("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,o1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[11]||(n[11]=s=>Fl("underline")),title:e.unref(N)("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":Ue.value}]),onClick:Hn,title:e.unref(N)("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,s1),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:sn,title:e.unref(N)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,i1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Xn,title:e.unref(N)("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":Xt("insertUnorderedList")}]),onClick:Yn,title:e.unref(N)("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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:rn,title:e.unref(N)("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,u1),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:gl,title:e.unref(N)("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,d1),$t.value&&ie.value?(e.openBlock(),e.createElementBlock("div",m1)):e.createCommentVNode("",!0),$t.value&&ie.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:Wl},[...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),S.askAi?(e.openBlock(),e.createElementBlock("div",v1)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",f1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=s=>Zn("askAi")),title:e.unref(N)("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",g1,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,h1),be.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)?(e.openBlock(),e.createElementBlock("div",k1,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&i<S.customToolbarSlots.length-1&&Wn(i)?(e.openBlock(),e.createElementBlock("div",C1)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&S.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nl})):e.createCommentVNode("",!0),e.createVNode(ma,{showModal:$e.value,width:"500px",height:"55vh",onCloseModal:z},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(N)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",b1,[e.createElementVNode("div",w1,[e.createElementVNode("label",x1,e.toDisplayString(e.unref(N)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Z,type:"text","onUpdate:modelValue":n[15]||(n[15]=s=>rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterAltText"),onKeyup:e.withKeys(kl,["enter"])},null,40,E1),[[e.vModelText,rt.value]])]),e.createElementVNode("div",S1,[e.createElementVNode("label",V1,e.toDisplayString(e.unref(N)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:Qe,type:"text","onUpdate:modelValue":n[16]||(n[16]=s=>lt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.link.enterUrl"),onKeyup:e.withKeys(kl,["enter"])},null,40,N1),[[e.vModelText,lt.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:z},e.toDisplayString(e.unref(N)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:kl},e.toDisplayString(e.unref(N)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(ma,{showModal:dt.value,width:"500px",height:"80vh",onCloseModal:Lt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ht.value?e.unref(N)("textEditor.image.editImage"):e.unref(N)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",B1,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":X.value==="upload"}]),onClick:n[17]||(n[17]=s=>X.value="upload")},e.toDisplayString(e.unref(N)("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":X.value==="url"}]),onClick:n[18]||(n[18]=s=>X.value="url")},e.toDisplayString(e.unref(N)("textEditor.image.imageLink")),3)]),X.value==="upload"?(e.openBlock(),e.createElementBlock("div",M1,[e.createElementVNode("div",_1,[e.createElementVNode("div",$1,[un.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",L1,e.toDisplayString(e.unref(N)("textEditor.image.uploadImage")),1)),un.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:jt},[e.createElementVNode("img",{src:It.value,alt:"Preview",class:"dss-image-preview-image"},null,8,T1),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:it,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:el},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:it,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:el},null,544))]),e.createElementVNode("div",A1,[e.createElementVNode("label",D1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Yt,type:"text","onUpdate:modelValue":n[19]||(n[19]=s=>Ye.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ct,["enter"])},null,40,H1),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",R1,[e.createElementVNode("label",F1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:al},null,40,I1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",z1,[e.createElementVNode("label",P1,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:cn},null,40,O1),[[e.vModelText,ft.value]])])])])):e.createCommentVNode("",!0),X.value==="url"?(e.openBlock(),e.createElementBlock("div",W1,[e.createElementVNode("div",q1,[e.createElementVNode("div",Z1,[e.createElementVNode("label",U1,e.toDisplayString(e.unref(N)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:At,type:"text","onUpdate:modelValue":n[22]||(n[22]=s=>ae.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(Ct,["enter"])},null,40,X1),[[e.vModelText,ae.value]])]),e.createElementVNode("div",Y1,[e.createElementVNode("label",j1,e.toDisplayString(e.unref(N)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=s=>Ye.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.enterAltText"),onKeyup:e.withKeys(Ct,["enter"])},null,40,K1),[[e.vModelText,Ye.value]])]),e.createElementVNode("div",G1,[e.createElementVNode("label",Q1,e.toDisplayString(e.unref(N)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=s=>bt.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:al},null,40,J1),[[e.vModelText,bt.value]])]),e.createElementVNode("div",em,[e.createElementVNode("label",tm,e.toDisplayString(e.unref(N)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=s=>ft.value=s),class:"dss-link-modal-input",placeholder:e.unref(N)("textEditor.image.auto"),onKeyup:e.withKeys(Ct,["enter"]),onInput:cn},null,40,lm),[[e.vModelText,ft.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Lt},e.toDisplayString(e.unref(N)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Ct},e.toDisplayString(e.unref(N)("textEditor.image.save")),1)]),_:1},8,["showModal"]),S.showTitle?(e.openBlock(),e.createElementBlock("div",{key:2,class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Dl.value&&wt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.title")),1),e.createElementVNode("div",nm,[wt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",om,[S.title?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(S.title),1)):(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(Ul.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ve,value:S.title,onInput:Ze,onFocus:De,onBlur:mt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!wt.value}]),placeholder:Ul.value,disabled:S.disabled,rows:"1"},null,42,rm)])],2)):e.createCommentVNode("",!0),S.showTitle&&Dl.value&&wt.value?(e.openBlock(),e.createElementBlock("div",im,[e.renderSlot(a.$slots,"title-slot")])):e.createCommentVNode("",!0),S.showDescription?(e.openBlock(),e.createElementBlock("div",{key:4,class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":Ol.value&&B.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("textEditor.labels.description")),1),e.createElementVNode("div",cm,[B.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",um,[S.description?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(S.description),1)):(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(Tl.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:We,value:S.description,onInput:ll,onFocus:dl,onBlur:ml,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!B.value}]),placeholder:Tl.value,disabled:S.disabled,rows:"1"},null,42,pm)])],2)):e.createCommentVNode("",!0),S.showDescription&&Ol.value&&B.value?(e.openBlock(),e.createElementBlock("div",vm,[e.renderSlot(a.$slots,"description-slot")])):e.createCommentVNode("",!0),$t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:6},e.renderList(re.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":st.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=>go(s),onMouseleave:To},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(i=>yo(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,gm)):(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,hm)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(i=>yo(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,Cm)):(e.openBlock(),e.createElementBlock("span",bm,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,km)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(i=>yo(s),["stop"])},[e.createElementVNode("span",xm,"+"+e.toDisplayString(s.additionalCount),1)],12,wm)):e.createCommentVNode("",!0)],46,fm))),128)):e.createCommentVNode("",!0),S.richText?(e.openBlock(),e.createElementBlock("div",_m,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":S.disabled,"dss-text-editor-fixed-height":S.fixedHeight}]),style:e.normalizeStyle(Ll.value),onInput:Mt,onBlur:an,onClick:ea,onMouseup:vo,onKeyup:vo,onKeydown:fn,onPaste:jo,onMousemove:fo,onMouseleave:Mo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[$t.value&&st.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(y.value)},[$.value||U.value.length>0?(e.openBlock(),e.createElementBlock("div",$m,[e.createElementVNode("div",Lm,[$.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:$.value},null,8,Tm)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.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",Dm,[e.createElementVNode("div",Hm,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,Rm)):(e.openBlock(),e.createElementBlock("span",Fm,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Im,[e.createElementVNode("div",zm,[e.createElementVNode("div",Pm,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",Om,e.toDisplayString(R(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":W(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),H.commentUser&&s.user&&s.user.id===H.commentUser.id&&!W(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>vn(s,i),["stop"]),title:e.unref(N)("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,Wm)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",qm,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:x,"onUpdate:modelValue":n[26]||(n[26]=s=>h.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(N)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(ql,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(x.value){const s=x.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,Zm),[[e.vModelText,h.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(ql,["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",Um,[e.createElementVNode("div",Xm,[e.createElementVNode("span",Ym,e.toDisplayString(cl.value)+" "+e.toDisplayString(cl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",jm,e.toDisplayString(nn.value)+" "+e.toDisplayString(nn.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Em,[e.createElementVNode("textarea",{value:S.modelValue,onInput:D,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":S.fixedHeight}]),placeholder:dn.value,rows:S.rows,disabled:S.disabled,style:e.normalizeStyle(Gt.value)},null,46,Sm),e.createElementVNode("div",Vm,[e.createElementVNode("div",Nm,[e.createElementVNode("span",Bm,e.toDisplayString(cl.value)+" "+e.toDisplayString(cl.value===1?e.unref(N)("textEditor.footer.word"):e.unref(N)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mm,e.toDisplayString(nn.value)+" "+e.toDisplayString(nn.value===1?e.unref(N)("textEditor.footer.character"):e.unref(N)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[j.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(_e.value),onMouseenter:n[28]||(n[28]=s=>V.value=!0),onMouseleave:jn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(ho,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,Km),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($l,["stop"]),title:e.unref(N)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Qm,[...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,Gm)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[St.value&&Dt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[29]||(n[29]=s=>A.value=!0),onMouseleave:Bn},[e.createElementVNode("div",Jm,[Dt.value===e.unref(N)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",e2,[...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:Dt.value},e.toDisplayString(Dt.value),9,t2)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Mn,["stop"]),title:e.unref(N)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n2,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,l2)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[S.floatingToolbar&&S.richText&&Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ge,class:"dss-floating-toolbar",style:e.normalizeStyle(at.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",o2,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(pn,["stop"]),title:e.unref(N)("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":!hl.value}]),onClick:e.withModifiers(qn,["stop"]),title:e.unref(N)("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,s2),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=>No("paragraph"),["stop"])),title:e.unref(N)("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,c2)):T.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:O.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,u2)):T.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:O.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,d2)):T.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:O.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,m2)):T.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:O.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,p2)):T.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:O.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,v2)):(e.openBlock(),e.createElementBlock("svg",f2,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,i2),Ft.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=>En("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=s=>En("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=s=>En("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=s=>En("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=s=>En("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=s=>En("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(N)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=s=>En("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(N)("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":Xt("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(s=>Fl("bold"),["stop"])),title:e.unref(N)("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,h2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(s=>Fl("italic"),["stop"])),title:e.unref(N)("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,g2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(s=>Fl("underline"),["stop"])),title:e.unref(N)("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,y2),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":Ue.value}]),onClick:e.withModifiers(Hn,["stop"]),title:e.unref(N)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,k2),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(sn,["stop"]),title:e.unref(N)("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,b2)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Xn,["stop"]),title:e.unref(N)("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,C2)),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":Xt("insertUnorderedList")}]),onClick:e.withModifiers(Yn,["stop"]),title:e.unref(N)("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,w2),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Xt("insertOrderedList")}]),onClick:e.withModifiers(rn,["stop"]),title:e.unref(N)("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,x2),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(gl,["stop"]),title:e.unref(N)("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,E2),$t.value?(e.openBlock(),e.createElementBlock("div",S2)):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(N)("textEditor.toolbar.comment"),onClick:e.withModifiers(Wl,["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,V2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",N2)):e.createCommentVNode("",!0),S.askAi?(e.openBlock(),e.createElementBlock("div",B2,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(s=>No("askAi"),["stop"])),title:e.unref(N)("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",_2,e.toDisplayString(e.unref(N)("textEditor.toolbar.askAi")),1)],8,M2),Ft.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(a.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),on.value?(e.openBlock(),e.createElementBlock("div",$2,[S.askAi&&on.value?(e.openBlock(),e.createElementBlock("div",L2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.customToolbarSlots,(s,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:i},[Al(s)&&El(s)?(e.openBlock(),e.createElementBlock("div",T2,[e.renderSlot(a.$slots,s)])):e.createCommentVNode("",!0),Al(s)&&El(s)&&i<S.customToolbarSlots.length-1&&Ln(i)?(e.openBlock(),e.createElementBlock("div",A2)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),R2={class:"dss-color-picker__section-title"},F2={class:"dss-color-picker__presets-row"},I2=["title","onClick"],z2={key:1,class:"dss-color-picker__section"},P2={class:"dss-color-picker__presets-row"},O2=["title","onClick"],W2={key:2,class:"dss-color-picker__section"},q2={class:"dss-color-picker__section-header"},Z2={class:"dss-color-picker__presets-row"},U2=["title","onClick"],X2=["onClick"],Y2={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},j2=["title","onClick"],K2={class:"dss-color-picker__input-row"},G2=["value"],Q2={__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(S,{emit:ee}){function L(te){const K=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(te);if(!K)return{h:0,s:0,l:50};const Q=parseInt(K[1],16)/255,ce=parseInt(K[2],16)/255,Ve=parseInt(K[3],16)/255,We=Math.max(Q,ce,Ve),Nt=Math.min(Q,ce,Ve);let Ot=0,pt=0;const wt=(We+Nt)/2;if(We!==Nt){const B=We-Nt;switch(pt=wt>.5?B/(2-We-Nt):B/(We+Nt),We){case Q:Ot=((ce-Ve)/B+(ce<Ve?6:0))/6;break;case ce:Ot=((Ve-Q)/B+2)/6;break;case Ve:Ot=((Q-ce)/B+4)/6;break}}return{h:Ot*360,s:pt*100,l:wt*100}}function N(te,K,Q){K/=100,Q/=100;const ce=K*Math.min(Q,1-Q),Ve=We=>{const Nt=(We+te/30)%12,Ot=Q-ce*Math.max(Math.min(Nt-3,9-Nt,1),-1);return Math.round(255*Ot).toString(16).padStart(2,"0")};return`#${Ve(0)}${Ve(8)}${Ve(4)}`}function ue(te){const K=te.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!K)return null;let Q=K[1];return Q.length===3&&(Q=Q.split("").map(ce=>ce+ce).join("")),"#"+Q}function O(te){const K=te.match(/^rgba?\(\s*(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})(?:[\s,\/]+[\d.]+)?\s*\)$/i);if(!K)return null;const Q=Math.max(0,Math.min(255,Number.parseInt(K[1],10))),ce=Math.max(0,Math.min(255,Number.parseInt(K[2],10))),Ve=Math.max(0,Math.min(255,Number.parseInt(K[3],10)));return`#${Q.toString(16).padStart(2,"0")}${ce.toString(16).padStart(2,"0")}${Ve.toString(16).padStart(2,"0")}`}function H(te){if(typeof te!="string")return null;const K=te.trim();return ue(K)||O(K)}function me(te,K,Q){K/=100,Q/=100;const ce=Q+K*Math.min(Q,1-Q),Ve=ce===0?0:2-2*Q/ce;return{h:te,s:Ve*100,v:ce*100}}function ot(te,K,Q){K/=100,Q/=100;const ce=Q*(1-K/2),Ve=ce===0||ce===1?0:(Q-ce)/Math.min(ce,1-ce);return{h:te,s:Ve*100,l:ce*100}}const ne=S,f=ee,be=e.ref(!1),he=e.ref(!1),oe=e.ref(!1),j=e.ref(-1),fe=e.ref(-1),_e=e.ref(null),V=e.ref(null),$e=e.ref(null),lt=e.ref(null),rt=e.ref({top:0,left:0}),Qe=e.ref(L(ne.modelValue||"#b8a5de")),Z=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),qe=e.computed(()=>!ne.disableCustomColors),ze=e.computed(()=>Z.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:fe.value<0?null:fe.value),ye=e.computed(()=>{const te=ze.value;return te==null?!0:Math.max(0,ne.presetColors.length-te)<ne.max}),Ue=e.computed(()=>!!(he.value||j.value>=0||!ke.value&&ne.presetColors.length===0));e.computed(()=>{const te=ze.value;return te!=null&&ne.presetColors.length>te});const ke=e.computed(()=>Z.value||ze.value!=null),Te=e.computed(()=>{const te=ze.value;return te==null?[]:ne.presetColors.slice(0,te)}),at=e.computed(()=>{const te=ze.value;return te==null?[]:ne.presetColors.slice(te)});function ge(te){const K=ze.value;return K!=null?K+te:-1}function Ft(te){const K=ze.value;return K!=null&&te>=K}function dt(te){Ft(te)&&(j.value=te,Qe.value=L(ne.presetColors[te]),he.value=!0,e.nextTick(()=>lt.value?.focus()))}function Ye(te){if(!Ft(te))return;const K=ne.presetColors.filter((Ve,We)=>We!==te);f("update:presetColors",K);const Q=ue(ne.modelValue),ce=ue(ne.presetColors[te]);if(Q&&ce&&Q.toLowerCase()===ce.toLowerCase()){const Ve=K[Math.max(0,te-1)]||K[0];Ve&&f("update:modelValue",Ve)}}function Pt(){oe.value=!oe.value,oe.value||(j.value=-1,he.value=!1)}function It(){if(!qe.value||j.value<0)return;const te=it.value,K=ue(te);if(K){const Q=[...ne.presetColors];Q[j.value]=K,f("update:presetColors",Q),f("update:modelValue",K),j.value=-1,he.value=!1}}function bt(){ne.disabled||!qe.value||(j.value=-1,he.value=!he.value,he.value&&(A(),e.nextTick(()=>lt.value?.focus())))}function ft(te){const K=H(te),Q=H(ne.modelValue);return K&&Q&&K.toLowerCase()===Q.toLowerCase()}function Yt(){if(ne.disabled||!qe.value||!ye.value)return;const te=it.value,K=ue(te);if(K){const Q=[...ne.presetColors,K];f("update:presetColors",Q),f("update:modelValue",K);const ce=ze.value??fe.value;ce>=0&&Q.length-ce>=ne.max&&(he.value=!1)}}const it=e.computed(()=>{const{h:te,s:K,l:Q}=Qe.value;return N(te,K,Q)}),At=e.computed(()=>it.value.toLowerCase()),ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Qe.value.h}, 100%, 50%))`})),il=e.computed(()=>{const te=me(Qe.value.h,Qe.value.s,Qe.value.l);return{left:`${te.s}%`,bottom:`${te.v}%`,transform:"translate(-50%, 50%)"}}),St=e.computed(()=>({left:`${Qe.value.h/360*100}%`,transform:"translateX(-50%)"})),Dt=e.computed(()=>({position:"fixed",left:`${rt.value.left}px`,top:`${rt.value.top}px`,zIndex:1002}));function pe(){if(!_e.value||!be.value)return;const te=_e.value.getBoundingClientRect(),K=window.innerHeight||document.documentElement.clientHeight;let Q=te.bottom+4;const ce=V.value;ce&&Q+ce.offsetHeight>K-8&&(Q=te.top-4-ce.offsetHeight),rt.value={top:Q,left:te.left}}function A(){const te=ne.modelValue||"#b8a5de",K=H(te);K&&(Qe.value=L(K))}function X(){f("update:modelValue",it.value)}function ae(){ne.disabled||(be.value=!be.value,be.value&&(A(),e.nextTick(()=>{pe(),lt.value?.focus()})))}function Ce(){const te=it.value,K=ue(te);if(K){if(j.value>=0){const Q=[...ne.presetColors];Q[j.value]=K,f("update:presetColors",Q),f("update:modelValue",K)}else if(qe.value&&(ne.presetColors.length>0||Z.value)&&he.value&&ye.value&&!ne.presetColors.some(ce=>ue(ce)?.toLowerCase()===K.toLowerCase())){const ce=[...ne.presetColors,K];f("update:presetColors",ce),f("update:modelValue",K)}}be.value=!1,he.value=!1,oe.value=!1,j.value=-1}function je(te){if(!$e.value)return;const K=$e.value.getBoundingClientRect(),Q=ce=>{const Ve=Math.max(0,Math.min(1,(ce.clientX-K.left)/K.width)),We=Math.max(0,Math.min(1,1-(ce.clientY-K.top)/K.height)),Nt={h:Qe.value.h,s:Ve*100,v:We*100};Qe.value=ot(Nt.h,Nt.s,Nt.v)};Q(te),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),X()},{once:!0})}function Ge(te){if(!te.currentTarget)return;const Q=te.currentTarget.getBoundingClientRect(),ce=Ve=>{const We=Math.max(0,Math.min(1,(Ve.clientX-Q.left)/Q.width));Qe.value={...Qe.value,h:We*360}};ce(te),document.addEventListener("mousemove",ce),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ce),X()},{once:!0})}function Vt(te){const K=te.target.value,Q=H(K);Q&&(Qe.value=L(Q),f("update:modelValue",Q))}function Pe(te){if(ne.disabled)return;const K=H(te);K&&(Qe.value=L(K),f("update:modelValue",K))}let Ke=null,nt=null;function qt(){Ke&&(document.removeEventListener("keydown",Ke),Ke=null),nt&&(window.removeEventListener("resize",nt),nt=null)}return e.watch(be,te=>{if(qt(),te){if(!Z.value&&ne.initialPresetCount==null){const K=ne.presetColors.length;K>0&&(fe.value<0||K<fe.value)&&(fe.value=K)}Ke=K=>{K.key==="Escape"&&Ce()},nt=pe,document.addEventListener("keydown",Ke),window.addEventListener("resize",nt)}}),e.watch(()=>ne.modelValue,()=>{be.value&&A()},{immediate:!1}),e.watch(at,te=>{te.length===0&&(oe.value=!1,j.value=-1,he.value=!1)}),e.onBeforeUnmount(qt),(te,K)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":S.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:_e,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":be.value}]),onClick:ae},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:it.value})},[...K[0]||(K[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ce,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:V,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Dt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Z.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(S.presetGroups,(Q,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ce,class:"dss-color-picker__section"},[e.createElementVNode("span",R2,e.toDisplayString(Q.title),1),e.createElementVNode("div",F2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Ve,We)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ce+"-"+We,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Ve)}]),style:e.normalizeStyle({backgroundColor:Ve,"--dss-preset-color":Ve}),title:Ve,onClick:e.withModifiers(Nt=>Pe(Ve),["stop"])},null,14,I2))),128))])]))),128)):Te.value.length?(e.openBlock(),e.createElementBlock("div",z2,[K[1]||(K[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",P2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(Q,ce)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ve=>Pe(Q),["stop"])},null,14,O2))),128))])])):e.createCommentVNode("",!0),qe.value?(e.openBlock(),e.createElementBlock("div",W2,[e.createElementVNode("div",q2,[K[3]||(K[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":oe.value}]),title:"Manage custom colors",onClick:e.withModifiers(Pt,["stop"])},[...K[2]||(K[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",Z2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,(Q,ce)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ce,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":oe.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!oe.value&&ft(Q),"dss-color-picker__preset-bubble--editing":oe.value&&j.value===ge(ce)}]),style:e.normalizeStyle({backgroundColor:j.value===ge(ce)?it.value:Q,"--dss-preset-color":j.value===ge(ce)?it.value:Q}),title:j.value===ge(ce)?it.value:Q,onClick:e.withModifiers(Ve=>oe.value?dt(ge(ce)):Pe(Q),["stop"])},null,14,U2),oe.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(Ve=>Ye(ge(ce)),["stop"])},[...K[4]||(K[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,X2)):e.createCommentVNode("",!0)],2))),128)),ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":he.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],64)):S.presetColors.length?(e.openBlock(),e.createElementBlock("div",Y2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.presetColors,(Q,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":ft(Q)}]),style:e.normalizeStyle({backgroundColor:Q,"--dss-preset-color":Q}),title:Q,onClick:e.withModifiers(Ve=>Pe(Q),["stop"])},null,14,j2))),128)),qe.value&&ye.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":he.value}]),onClick:e.withModifiers(bt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:$e,onMousedown:je},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ht.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(il.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ge},[K[5]||(K[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(St.value)},null,4)],32),e.createElementVNode("div",K2,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:lt,type:"text",class:"dss-color-picker__hex-input",value:At.value,onInput:Vt},null,40,G2)]),qe.value&&ke.value&&(S.presetColors.length||Z.value)&&ye.value&&j.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Yt}," Save color ")):e.createCommentVNode("",!0),qe.value&&ke.value&&j.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:It}," 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:Ce}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},J2={key:0,class:"dss-loader"},ep={key:0,class:"dss-loader-label"},tp={key:1,class:"dss-loader"},lp={key:0,class:"dss-loader-label"},np={key:2,class:"dss-loader"},op={key:0,class:"dss-loader-label"},ap={key:3,class:"dss-loader"},sp={key:0,class:"dss-loader-label"},rp={key:4,class:"dss-loader"},ip={key:0,class:"dss-loader-label"},cp={key:5,class:"dss-loader dss-loader--inline"},up={class:"dss-loader-inline-text"},dp={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(S){const ee=S,L=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),N=e.computed(()=>{const ue={};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);ue["--dss-loader-size"]=O}return ee.color&&(ue["--dss-loader-accent"]=ee.color,ue["--dss-loader-accent-soft"]=`color-mix(in srgb, ${ee.color} 30%, white)`),ue});return(ue,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",L.value]),style:e.normalizeStyle(N.value)},[S.type==="spinner"?(e.openBlock(),e.createElementBlock("div",J2,[O[0]||(O[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",ep,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="dots"?(e.openBlock(),e.createElementBlock("div",tp,[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)),S.label?(e.openBlock(),e.createElementBlock("span",lp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="battery"?(e.openBlock(),e.createElementBlock("div",np,[O[2]||(O[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),S.label?(e.openBlock(),e.createElementBlock("span",op,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.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)),S.label?(e.openBlock(),e.createElementBlock("span",sp,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.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)),S.label?(e.openBlock(),e.createElementBlock("span",ip,e.toDisplayString(S.label),1)):e.createCommentVNode("",!0)])):S.type==="inline"?(e.openBlock(),e.createElementBlock("div",cp,[O[5]||(O[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",up,[e.renderSlot(ue.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(S.label),1)])])])):e.createCommentVNode("",!0)],6))}},La="dss-skeleton-item",mp={__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:S=>["single","multiple"].includes(S)},targetClass:{type:String,default:La},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(S){const ee=S,L=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!==La&&(O[`dss-skeleton--target-${ee.targetClass}`]=!0),O}),N=e.computed(()=>{const O={};return ee.borderRadius&&(O.borderRadius=ee.borderRadius),O}),ue=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,H)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",L.value]),style:e.normalizeStyle(ue.value)},[S.loading&&S.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(N.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":S.loading&&S.mode==="single"}])},[e.renderSlot(O.$slots,"default")],2)],6))}},pp={key:0,class:"dss-dnd-column-header"},vp={class:"dss-dnd-column-title"},fp={class:"dss-dnd-column-count"},hp=["data-column"],gp={key:0,class:"dss-dnd-indicator"},yp=["onPointerdown"],kp=["onPointerdown"],Cp={class:"dss-dnd-item-content"},bp={class:"dss-dnd-item-default"},wp={key:0,class:"dss-dnd-empty"},xp={name:"DSSDnd"},Ep=Object.assign(xp,{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(S,{emit:ee}){const L=S,N=ee,ue=e.useSlots(),O=e.computed(()=>!!ue["delete-zone"]),H={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},me=e.computed(()=>({...H,...L.options})),ot=e.computed(()=>({"--dss-dnd-col-min-w":me.value.columnMinWidth,"--dss-dnd-col-max-w":me.value.columnMaxWidth,"--dss-dnd-col-gap":me.value.columnGap,"--dss-dnd-indicator-color":me.value.indicatorColor,"--dss-dnd-body-max-h":me.value.columnBodyMaxHeight}));function ne(pe){if(!me.value.ColColor||!pe)return{};const A=pe.background||pe.color;return A?{background:A}:{}}const f=e.ref(null),be=e.ref(null),he=e.ref(!1),oe=e.ref(-1),j=e.ref(null);let fe=null,_e=null,V=null,$e=null,lt=0,rt=0,Qe="",Z=null;const qe=5,ze=e.computed(()=>{const pe={};for(const A of L.columns)pe[A.value]=L.items.filter(X=>X[L.columnKey]===A.value).sort((X,ae)=>(X[L.positionKey]??0)-(ae[L.positionKey]??0));return pe}),ye=e.computed(()=>{const pe={},A=!!f.value,X=f.value?.[L.itemKey],ae=be.value,Ce=oe.value;for(const je of L.columns){const Ge=ze.value[je.value]||[],Vt=[],Pe=ae==je.value;let Ke=0;for(let nt=0;nt<Ge.length;nt++){const qt=Ge[nt],te=A&&qt[L.itemKey]===X;!te&&Pe&&Ce===Ke&&Vt.push({type:"indicator",key:`ind-${Ke}`}),te||Ke++,Vt.push({type:"item",item:qt,isDragged:te,key:`item-${qt[L.itemKey]}`})}Pe&&Ce>=Ke&&Vt.push({type:"indicator",key:"ind-end"}),pe[je.value]=Vt}return pe});function Ue(pe,A){const ae=(ze.value[pe]||[]).filter(Ge=>Ge[L.itemKey]!==f.value?.[L.itemKey]);if(ae.length===0)return 1;if(A<=0){const Ge=ae[0][L.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(A>=ae.length){const Ge=ae[ae.length-1][L.positionKey];return(Ge??0)+1}const Ce=ae[A-1][L.positionKey]??0,je=ae[A][L.positionKey]??0;return(Ce+je)/2}function ke(pe,A,X){V&&V.remove();const ae=pe.getBoundingClientRect(),Ce=pe.cloneNode(!0);Ce.classList.add("dss-dnd-ghost"),Ce.style.cssText=`
|
|
106
106
|
position: fixed;
|
|
107
|
-
left: ${
|
|
108
|
-
top: ${
|
|
109
|
-
width: ${
|
|
110
|
-
height: ${
|
|
107
|
+
left: ${A-lt}px;
|
|
108
|
+
top: ${X-rt}px;
|
|
109
|
+
width: ${ae.width}px;
|
|
110
|
+
height: ${ae.height}px;
|
|
111
111
|
z-index: 9999;
|
|
112
112
|
pointer-events: none;
|
|
113
|
-
opacity: ${
|
|
113
|
+
opacity: ${me.value.dragGhostOpacity};
|
|
114
114
|
box-sizing: border-box;
|
|
115
115
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
116
|
-
background-color: ${
|
|
116
|
+
background-color: ${me.value.dragSourceBackground};
|
|
117
117
|
font-family: 'Work Sans', sans-serif;
|
|
118
118
|
cursor: grabbing;
|
|
119
|
-
`,document.body.appendChild(Xe),ue=Xe}function Qe(W,G){ue&&(ue.style.left=`${W-tt}px`,ue.style.top=`${G-mt}px`)}function Ce(W){W.classList.add("dss-dnd-item--dragging"),W.style.background=fe.value.dragSourceBackground,W.style.borderColor=fe.value.dragSourceBorder,W.style.transform="scale(0.97)"}function Je(W){W.classList.remove("dss-dnd-item--dragging"),W.style.background="",W.style.borderColor="",W.style.transform=""}function ut(W,G){return document.elementFromPoint(W,G)?.closest(".dss-dnd-column-body")??null}function ht(W,G){return!!document.elementFromPoint(W,G)?.closest("[data-dss-dnd-delete-zone]")}function dt(W,G){if(O.value&&ht(W,G)){ke.value=!0,be.value=null,J.value=-1;return}ke.value=!1;const Ne=ut(W,G),Pe=Ne?.getAttribute("data-column")??null;if(!Pe){be.value=null,J.value=-1;return}be.value=Pe;const Xe=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=Xe.length;for(let Ge=0;Ge<Xe.length;Ge++){const Zt=Xe[Ge].getBoundingClientRect();if(G<Zt.top+Zt.height/2){Et=Ge;break}}J.value=Et}function Wt(W){W.preventDefault(),Qe(W.clientX,W.clientY),!me&&(me=requestAnimationFrame(()=>{me=null,dt(W.clientX,W.clientY)}))}function qt(W){window.removeEventListener("pointermove",Wt),window.removeEventListener("pointerup",qt),window.removeEventListener("pointercancel",qt),$e?.releasePointerCapture?.(W.pointerId),Je($e),$e=null;const G=O.value&&ht(W.clientX,W.clientY);if(v.value&&G)V("delete",{item:v.value});else{const Pe=ut(W.clientX,W.clientY)?.getAttribute("data-column")??null;if(v.value&&Pe){const Xe=v.value[$.columnKey],Et=Pe,Zt=(Ve.value[Et]||[]).filter(Lt=>Lt[$.itemKey]!==v.value[$.itemKey]),Ue=Math.max(0,Math.min(J.value,Zt.length)),We=je(Et,Ue),Dt=v.value[$.itemKey];V("move",{item:v.value,from:Xe,to:Et,position:We,index:Ue}),F&&clearTimeout(F),Y.value={id:Dt,from:Xe,to:Et},F=setTimeout(()=>{Y.value=null},3500)}}ue&&(ue.remove(),ue=null),U!==null&&(document.body.style.cursor=U,U=""),ge()}function Ct(W,G){W.preventDefault();const Ne=W.target.closest(".dss-dnd-item");if(!Ne)return;const Pe=Ne.getBoundingClientRect();tt=W.clientX-Pe.left,mt=W.clientY-Pe.top,U=document.body.style.cursor,document.body.style.cursor="grabbing",v.value=G,$e=Ne,re(Ne,W.clientX,W.clientY),requestAnimationFrame(()=>Ce(Ne)),Ne.setPointerCapture?.(W.pointerId),window.addEventListener("pointermove",Wt),window.addEventListener("pointerup",qt,{once:!0}),window.addEventListener("pointercancel",qt,{once:!0})}function wt(){ze&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it),ze=null)}function Yt(W){if(!ze||W.pointerId!==ze.pointerId)return;const G=W.clientX-ze.startX,Ne=W.clientY-ze.startY;if(Math.abs(G)>=qe||Math.abs(Ne)>=qe){const Pe=ze.item;wt(),Ct(W,Pe)}}function it(W){!ze||W.pointerId!==ze.pointerId||wt()}function Kt(W,G){wt(),ze={item:G,startX:W.clientX,startY:W.clientY,pointerId:W.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)}function yt(W,G){fe.value.useHandle||Kt(W,G)}function el(W,G){Kt(W,G)}function X(){me&&(cancelAnimationFrame(me),me=null)}function ge(){X(),v.value=null,be.value=null,ke.value=!1,J.value=-1}return e.onBeforeUnmount(()=>{X(),wt(),F&&clearTimeout(F),ue&&(ue.remove(),ue=null)}),(W,G)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":fe.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":ke.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(W.$slots,"delete-zone",{isDragging:!!v.value,isOver:ke.value})],2),[[e.vShow,!!v.value||fe.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(ee(Ne))},[fe.value.showHeader?(e.openBlock(),e.createElementBlock("div",e0,[e.renderSlot(W.$slots,"column-header",{column:Ne,items:Ve.value[Ne.value]||[]},()=>[e.createElementVNode("span",t0,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",l0,e.toDisplayString((Ve.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value[Ne.value],Pe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Pe.key},[Pe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",o0)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Pe.isDragged,"dss-dnd-item--no-handle":!fe.value.useHandle}]),onPointerdown:Xe=>yt(Xe,Pe.item)},[fe.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Xe=>el(Xe,Pe.item),["stop"])},[e.renderSlot(W.$slots,"handle",{},()=>[G[0]||(G[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,s0)):e.createCommentVNode("",!0),e.createElementVNode("div",r0,[e.renderSlot(W.$slots,"item",{item:Pe.item,column:Ne,justDropped:Y.value?.id===Pe.item[E.itemKey],droppedFrom:Y.value?.id===Pe.item[E.itemKey]?Y.value.from:null,droppedTo:Y.value?.id===Pe.item[E.itemKey]?Y.value.to:null},()=>[e.createElementVNode("div",i0,e.toDisplayString(Pe.item[E.itemKey]),1)])])],42,a0))],64))),128)),(Ve.value[Ne.value]||[]).length===0&&be.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",c0,[e.renderSlot(W.$slots,"empty",{column:Ne},()=>[G[1]||(G[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,n0)],6))),128))],6))}}),m0={name:"DSSConfetti"},p0=Object.assign(m0,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(E){const te=E,$=e.ref(null),V=e.ref(!1);let ce=[],O=null,L=null;function fe(J,Y){const me=[];for(let F=0;F<te.count;F++)me.push(rt(J));return me}function rt(J,Y){return{x:Math.random()*J,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:te.colors[Math.floor(Math.random()*te.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(J,Y,me,F){J.clearRect(0,0,Y,me);for(const ue of ce)J.save(),J.globalAlpha=ue.opacity*F,J.beginPath(),J.lineWidth=ue.r,J.strokeStyle=ue.color,J.moveTo(ue.x+ue.tilt+ue.r/2,ue.y),J.lineTo(ue.x+ue.tilt,ue.y+ue.tilt+ue.r/2),J.stroke(),J.restore()}function v(J,Y,me){const F=.3+me*.7;for(let ue=0;ue<ce.length;ue++){const $e=ce[ue];$e.tiltAngle+=$e.tiltInc,$e.y+=$e.speed*F,$e.x+=Math.sin($e.d)*.5*F,$e.tilt=Math.sin($e.tiltAngle)*15,me>=.99&&$e.y>Y+20&&(ce[ue]=rt(J))}}function be(){V.value=!0,e.nextTick(()=>{const J=$.value;if(!J)return;const Y=J.getContext("2d"),me=J.parentElement;if(!me)return;const F=me.getBoundingClientRect();J.width=F.width,J.height=F.height,ce=fe(J.width,J.height);const ue=Date.now(),$e=ue+te.duration,tt=()=>{const mt=Date.now(),U=mt-ue;if(mt<$e){let ze=1;U>te.fadeStart&&(ze=1-(U-te.fadeStart)/(te.duration-te.fadeStart)),ee(Y,J.width,J.height,ze),v(J.width,J.height,ze),O=requestAnimationFrame(tt)}else ke()};tt()})}function ke(){O&&(cancelAnimationFrame(O),O=null),ce=[],V.value=!1}return e.watch(()=>te.trigger,J=>{J&&(L&&clearTimeout(L),L=setTimeout(be,te.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ke(),L&&clearTimeout(L)}),(J,Y)=>V.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:$,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),f0={class:"dss-filter-global-inner"},v0=["placeholder","value"],h0=["title"],g0={key:0,class:"dss-filter-funnel-badge"},y0={key:1,class:"dss-filter-sortby"},k0=["value"],C0=["value"],b0=["disabled","title"],x0={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"},w0={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"},E0={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"},S0={class:"dss-filter-panel"},V0={key:0,class:"dss-filter-empty"},N0={class:"dss-filter-row-prefix"},B0={class:"dss-filter-cell"},M0=["onClick"],_0={class:"dss-filter-trigger-text"},$0=["placeholder"],L0={class:"dss-filter-popup-list"},A0=["onClick"],T0={key:0,class:"dss-filter-popup-empty"},D0={key:0,class:"dss-filter-cell"},H0=["onClick"],R0={class:"dss-filter-trigger-text"},F0={class:"dss-filter-popup-list"},I0=["onClick"],z0={key:1,class:"dss-filter-cell dss-filter-cell--value"},P0=["placeholder","onUpdate:modelValue"],O0={key:1,class:"dss-filter-date-wrap"},W0=["placeholder","onUpdate:modelValue"],q0=["placeholder","value","onInput","step"],Z0={key:4,class:"dss-filter-between"},U0=["placeholder","value","onInput","step"],X0={class:"dss-filter-between-sep"},Y0=["placeholder","value","onInput","step"],j0={key:5,class:"dss-filter-multiselect"},K0=["onClick"],G0={class:"dss-filter-trigger-text"},Q0=["placeholder"],J0={class:"dss-filter-popup-list dss-filter-popup-list--check"},ep=["onClick"],tp=["checked"],lp={key:0,class:"dss-filter-popup-empty"},np=["onClick"],op={class:"dss-filter-foot"},ap={class:"dss-filter-cell"},sp=["placeholder"],rp={class:"dss-filter-popup-list"},ip=["onClick"],cp={key:0,class:"dss-filter-popup-divider"},up=["onClick"],dp=["placeholder"],mp={class:"dss-filter-popup-list"},pp=["onClick"],fp={key:0,class:"dss-filter-popup-empty"},vp=["placeholder"],hp={class:"dss-filter-popup-list"},gp=["onClick"],yp={key:0,class:"dss-filter-popup-empty"},kp={name:"DSSFilter"},Cp=Object.assign(kp,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{expose:te,emit:$}){const{t:V}=ro.useI18n(),ce=E,O=$,L={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},fe=e.computed(()=>({...L,...ce.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"]),v=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),ke=e.ref([]),J=e.ref(null),Y=e.ref(!1),me=e.ref(null),F=e.ref(""),ue=e.ref(null),$e=e.ref(""),tt=e.ref("asc");let mt=1;function U(M){const x=M.find(A=>A&&typeof A=="object");if(!x)return null;for(const A of v)if(A in x&&typeof x[A]=="string")return A;return Object.keys(x).find(A=>typeof x[A]=="string")||null}function ze(M,x){const A=x.filter(ae=>ae!=null&&ae!=="NULL");if(A.length===0)return null;if(A.every(ae=>Array.isArray(ae))){const ae=A.flatMap(Fe=>Fe).filter(Fe=>Fe!=null);return ae.length===0?null:typeof ae.find(Fe=>Fe!=null)=="object"?"arraySelect":"arrayText"}return A.every(ae=>typeof ae=="boolean")?"boolean":A.every(ae=>typeof ae=="number")?new Set(A).size<=fe.value.maxUniqueForEnum?"select":"range":A.every(ae=>typeof ae=="string")?new Set(A).size<=fe.value.maxUniqueForSelect?"select":"text":A.some(ae=>typeof ae=="object"&&!Array.isArray(ae))?null:"text"}const qe=e.computed(()=>{if(!ce.data?.length)return[];const M=new Set;for(const oe of ce.data)if(oe&&typeof oe=="object")for(const Fe of Object.keys(oe))M.add(Fe);const x=new Set(ce.exclude),A=[];for(const oe of M){if(x.has(oe))continue;const Fe=ce.config[oe]||{},bt=ce.data.map(St=>St?.[oe]),ot=Fe.type||ze(oe,bt);if(!ot)continue;const Ie=Fe.filterMode||"contain",xt=Ie==="date"?"date":Ie==="string"?"text":ot,Mt={key:oe,label:Fe.label||et(oe),type:xt,filterMode:Ie};if(ot==="select"){const St=bt.filter(At=>At!=null&&At!=="NULL");Mt.uniqueValues=[...new Set(St)].sort((At,It)=>typeof At=="number"&&typeof It=="number"?At-It:String(At).localeCompare(String(It)))}else if(ot==="range"||ot==="int"){const St=bt.filter(At=>typeof At=="number");Mt.min=Math.min(...St),Mt.max=Math.max(...St)}else if(ot==="arraySelect"){const St=Fe.displayKey||U(bt.flatMap(At=>Array.isArray(At)?At:[]));if(Mt.displayKey=St,Array.isArray(Fe.uniqueValues)&&Fe.uniqueValues.length>0)Mt.uniqueValues=Fe.uniqueValues.map(At=>String(At));else{const At=bt.flatMap(It=>Array.isArray(It)?It:[]).filter(It=>It!=null).map(It=>St&&typeof It=="object"?It[St]:String(It)).filter(It=>It!=null&&It!=="");Mt.uniqueValues=[...new Set(At)].sort((It,Nt)=>String(It).localeCompare(String(Nt)))}}A.push(Mt)}const ae=ce.config._order;return ae&&A.sort((oe,Fe)=>{const bt=ae.indexOf(oe.key),ot=ae.indexOf(Fe.key);return bt===-1&&ot===-1?0:bt===-1?1:ot===-1?-1:bt-ot}),A}),Ve=e.computed(()=>{const M={};for(const x of qe.value)M[x.key]=x;return M}),Le=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),je=e.computed(()=>{if(!Le.value)return[];const M=new Set(qe.value.map(x=>x.key));return ce.config.groups.map(x=>({...x,keys:x.keys.filter(A=>M.has(A))})).filter(x=>x.keys.length>0)}),re=e.computed(()=>{if(!Le.value)return[];const M=new Set(ce.config.groups.flatMap(x=>x.keys));return qe.value.filter(x=>!M.has(x.key))}),Qe=e.computed(()=>{if(!ue.value)return[];const M=new Set(ue.value.keys),x=qe.value.filter(ae=>M.has(ae.key));if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>ae.label.toLowerCase().includes(A))}),Ce=e.computed(()=>{if(!F.value)return qe.value;const M=F.value.toLowerCase();return qe.value.filter(x=>x.label.toLowerCase().includes(M))}),Je=e.computed(()=>qe.value.filter(M=>!["arraySelect","arrayText"].includes(M.type))),ut=e.computed(()=>$e.value?tt.value==="asc"?"Ascending":"Descending":"No sort selected");function ht(M){J.value===M?dt():(J.value=M,F.value="",ue.value=null)}function dt(){J.value=null,F.value="",ue.value=null}function Wt(M){const x=M.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");J.value&&!x&&!M.target.closest(".dss-filter-popup")&&!M.target.closest(".dss-filter-trigger")&&!M.target.closest(".dss-filter-add-btn")&&dt(),Y.value&&me.value&&!me.value.contains(M.target)&&(x||(Y.value=!1))}e.onMounted(()=>document.addEventListener("click",Wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Wt));function qt(M){return Ve.value[M]?.label||et(M)}function Ct(M){return Ve.value[M.key]?.filterMode||"contain"}function wt(M){return V(`filter.operators.${M}`)}function Yt(M){const x=Ve.value[M.key];return(rt[x?.type]||rt.text).map(A=>({...A,label:V(`filter.operators.${A.value}`)}))}function it(M){return ee.has(M)}function Kt(M){const x=Ve.value[M.key];return x?x.type==="date"?"date":x.type==="boolean"?"boolean":x.type==="text"||x.type==="arrayText"?"text":x.type==="select"||x.type==="arraySelect"?"multiselect":x.type==="range"||x.type==="int"?M.operator==="between"?"between":"number":"text":"text"}function yt(M){return rt[M]?.[0]?.value||"contains"}function el(M,x){return ee.has(x)||M==="date"?null:M==="select"||M==="arraySelect"?[]:(M==="range"||M==="int")&&x==="between"?{min:null,max:null}:M==="range"||M==="int"?null:""}function X(M){return Ve.value[M.key]?.uniqueValues||[]}function ge(M){const x=X(M);if(!F.value)return x;const A=F.value.toLowerCase();return x.filter(ae=>String(ae).toLowerCase().includes(A))}function W(M){const x=M.value;return!x||x.length===0?V("filter.select"):x.length<=2?x.join(", "):V("filter.selectedCount",{count:x.length})}function G(M){const x=Ve.value[M],A=x?.filterMode||"contain",ae=x?.type||"text",oe=A==="string"?"contains":yt(ae);ke.value.push(e.reactive({id:mt++,key:M,operator:oe,value:el(ae,oe)})),dt()}function Ne(M){ke.value=ke.value.filter(x=>x.id!==M)}function Pe(M,x){const ae=Ve.value[x]?.type||"text";M.key=x,M.operator=yt(ae),M.value=el(ae,M.operator),dt()}function Xe(M,x){const A=Kt(M);M.operator=x;const ae=Kt(M);if(A!==ae||ee.has(x)){const oe=Ve.value[M.key];M.value=el(oe?.type||"text",x)}dt()}function Et(M,x){const A=x.target.value;M.value=A===""?null:Number(A)}function Ge(M,x,A){const ae=A.target.value,oe=ae===""?null:Number(ae);(!M.value||typeof M.value!="object")&&(M.value={min:null,max:null}),M.value={...M.value,[x]:isNaN(oe)?null:oe}}function Zt(M,x){const A=M.value||[],ae=A.indexOf(x);M.value=ae>=0?A.filter(oe=>oe!==x):[...A,x]}function Ue(){ke.value=[],be.value="",dt()}function We(M){be.value=M.target.value}function Dt(M){$e.value=M.target.value}function Lt(){tt.value=tt.value==="asc"?"desc":"asc"}const ne=e.computed(()=>{if(!ce.data)return[];let M=ce.data;if(be.value){const x=be.value.toLowerCase();M=M.filter(A=>{for(const ae of Object.keys(A)){const oe=A[ae];if(typeof oe=="string"&&oe.toLowerCase().includes(x)||typeof oe=="number"&&String(oe).includes(x)||Array.isArray(oe)&&oe.some(Fe=>Fe!=null&&(typeof Fe=="string"?Fe.toLowerCase().includes(x):typeof Fe=="object"?Object.values(Fe).some(bt=>typeof bt=="string"&&bt.toLowerCase().includes(x)):!1)))return!0}return!1})}for(const x of ke.value){if(!de(x))continue;const A=Ve.value[x.key];A&&(M=M.filter(ae=>xe(ae,x,A)))}if(ce.showSortBy&&$e.value){const x=$e.value,A=tt.value==="asc"?1:-1;M=[...M].sort((ae,oe)=>j(ae?.[x],oe?.[x])*A)}return M});function j(M,x){const A=K(M),ae=K(x);return A==null&&ae==null?0:A==null?1:ae==null?-1:typeof A=="number"&&typeof ae=="number"?A-ae:String(A).localeCompare(String(ae),void 0,{numeric:!0,sensitivity:"base"})}function K(M){return M==null||M==="NULL"?null:typeof M=="string"||typeof M=="number"||typeof M=="boolean"?M:M instanceof Date?M.getTime():null}function de(M){return ee.has(M.operator)?!0:M.value==null||typeof M.value=="string"&&M.value===""||Array.isArray(M.value)&&M.value.length===0?!1:M.value instanceof Date?!isNaN(M.value.getTime()):!(typeof M.value=="object"&&!Array.isArray(M.value)&&M.value.min==null&&M.value.max==null)}function xe(M,x,A){const ae=M?.[x.key],oe=x.value,Fe=x.operator;if(Fe==="is_empty")return jt(ae);if(Fe==="is_not_empty")return!jt(ae);const bt=A.type;if(bt==="text"||bt==="arrayText"){const ot=bt==="arrayText"&&Array.isArray(ae)?ae.filter(Mt=>Mt!=null).map(String).join(" "):ae!=null?String(ae):"",Ie=String(oe).toLowerCase(),xt=ot.toLowerCase();switch(Fe){case"contains":return xt.includes(Ie);case"not_contains":return!xt.includes(Ie);case"equals":return xt===Ie;case"not_equals":return xt!==Ie;case"starts_with":return xt.startsWith(Ie);case"ends_with":return xt.endsWith(Ie);default:return!0}}if(bt==="select")switch(Fe){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(Fe==="between"){const xt=oe?.min!=null?Number(oe.min):null,Mt=oe?.max!=null?Number(oe.max):null,St=xt!=null&&!isNaN(xt)?xt:null,At=Mt!=null&&!isNaN(Mt)?Mt:null;return(St==null||ot>=St)&&(At==null||ot<=At)}const Ie=typeof oe=="number"&&!isNaN(oe)?oe:Number(oe);if(Fe==="contains"||Fe==="not_contains"){const xt=String(ot),Mt=String(oe??"").toLowerCase(),St=xt.toLowerCase().includes(Mt);return Fe==="contains"?St:!St}if(typeof Ie!="number"||isNaN(Ie))return!1;switch(Fe){case"eq":return ot===Ie;case"neq":return ot!==Ie;case"gt":return ot>Ie;case"gte":return ot>=Ie;case"lt":return ot<Ie;case"lte":return ot<=Ie;default:return!0}}if(bt==="arraySelect"){if(!Array.isArray(ae))return!1;const ot=ae.filter(Ie=>Ie!=null).map(Ie=>A.displayKey&&typeof Ie=="object"?Ie[A.displayKey]:String(Ie));switch(Fe){case"contains_any":return ot.some(Ie=>oe.includes(Ie));case"contains_all":return oe.every(Ie=>ot.includes(Ie));case"not_contains_any":return!ot.some(Ie=>oe.includes(Ie));default:return!0}}if(bt==="date"){const ot=Ke(oe);if(!ot||isNaN(ot.getTime()))return!1;const Ie=Ke(ae);if(!Ie||isNaN(Ie.getTime()))return!1;const xt=Ht(Ie),Mt=Ht(ot);switch(Fe){case"eq":return xt===Mt;case"before":return xt<Mt;case"after":return xt>Mt;default:return!0}}if(bt==="boolean"){const ot=ae===!0||ae==="true"||ae===1,Ie=ae===!1||ae==="false"||ae===0;switch(Fe){case"is_true":return ot;case"is_false":return Ie;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 x=new Date(M);return isNaN(x.getTime())?null:x}return null}function Ht(M){const x=M.getFullYear(),A=String(M.getMonth()+1).padStart(2,"0"),ae=String(M.getDate()).padStart(2,"0");return`${x}-${A}-${ae}`}function jt(M){return!!(M==null||M===""||M==="NULL"||Array.isArray(M)&&M.length===0||Array.isArray(M)&&M.every(x=>x==null))}e.watch(ne,M=>O("update:modelValue",M),{immediate:!0}),e.watch(()=>ce.data,()=>{ke.value=[],be.value="",Y.value=!1,$e.value="",tt.value="asc",dt()});function et(M){return M.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,x=>x.toUpperCase())}function vl(){const M=x=>{if(x==null)return x;if(x instanceof Date)return{_type:"Date",value:x.toISOString(),local:x.toLocaleDateString()};if(Array.isArray(x))return x.map(M);if(typeof x=="object"&&!Array.isArray(x)){const A={};for(const ae of Object.keys(x))A[ae]=M(x[ae]);return A}return x};return{globalSearch:be.value,rows:ke.value.map(x=>({key:x.key,operator:x.operator,value:M(x.value),defType:Ve.value[x.key]?.type,defFilterMode:Ve.value[x.key]?.filterMode})),filteredCount:ne.value?.length??0}}return te({getDebugState:vl}),(M,x)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":fe.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:me},[e.createElementVNode("div",f0,[x[20]||(x[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(V)("filter.searchAcrossFields"),value:be.value,onInput:We},null,40,v0),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:x[0]||(x[0]=A=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:Y.value||ke.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:x[1]||(x[1]=A=>Y.value=!Y.value),type:"button",title:Y.value?e.unref(V)("filter.closeAdvancedFilter"):e.unref(V)("filter.openAdvancedFilter")},[x[14]||(x[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",g0,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,h0),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",y0,[x[19]||(x[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:$e.value,onChange:Dt},[x[15]||(x[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,A=>(e.openBlock(),e.createElementBlock("option",{key:A.key,value:A.key},e.toDisplayString(A.label),9,C0))),128))],40,k0),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Lt,disabled:!$e.value,title:ut.value},[$e.value?tt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",w0,[...x[17]||(x[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",E0,[...x[18]||(x[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",x0,[...x[16]||(x[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,b0)])):e.createCommentVNode("",!0)]),Y.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:x[13]||(x[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",S0,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",V0,e.toDisplayString(e.unref(V)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(A,ae)=>(e.openBlock(),e.createElementBlock("div",{key:A.id,class:"dss-filter-row"},[e.createElementVNode("span",N0,e.toDisplayString(ae===0?e.unref(V)("filter.where"):e.unref(V)("filter.and")),1),e.createElementVNode("div",B0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:field`),["stop"])},[e.createElementVNode("span",_0,e.toDisplayString(qt(A.key)),1),x[21]||(x[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,M0),J.value===`${A.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[3]||(x[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[2]||(x[2]=oe=>F.value=oe),placeholder:e.unref(V)("filter.searchAttributes")},null,8,$0),[[e.vModelText,F.value]]),e.createElementVNode("ul",L0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.key,class:"dss-filter-popup-item",onClick:Fe=>Pe(A,oe.key)},e.toDisplayString(oe.label),9,A0))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",T0,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Ct(A)==="contain"||Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",D0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:op`),["stop"])},[e.createElementVNode("span",R0,e.toDisplayString(wt(A.operator)),1),x[22]||(x[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,H0),J.value===`${A.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[4]||(x[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",F0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:A.operator===oe.value}]),onClick:Fe=>Xe(A,oe.value)},e.toDisplayString(oe.label),11,I0))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),it(A.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",z0,[Ct(A)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,P0)),[[e.vModelText,A.value]]):Ct(A)==="date"?(e.openBlock(),e.createElementBlock("div",O0,[e.createVNode(pa,{mode:"single",modelValue:A.value,"onUpdate:modelValue":oe=>A.value=oe},null,8,["modelValue","onUpdate:modelValue"])])):Kt(A)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),"onUpdate:modelValue":oe=>A.value=oe},null,8,W0)),[[e.vModelText,A.value]]):Kt(A)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.enterValue"),value:A.value,onInput:oe=>Et(A,oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,q0)):Kt(A)==="between"?(e.openBlock(),e.createElementBlock("div",Z0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.min"),value:A.value?.min,onInput:oe=>Ge(A,"min",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,U0),e.createElementVNode("span",X0,e.toDisplayString(e.unref(V)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(V)("filter.max"),value:A.value?.max,onInput:oe=>Ge(A,"max",oe),step:Ve.value[A.key]?.type==="int"?1:void 0},null,40,Y0)])):Kt(A)==="multiselect"?(e.openBlock(),e.createElementBlock("div",j0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(oe=>ht(`${A.id}:val`),["stop"])},[e.createElementVNode("span",G0,e.toDisplayString(W(A)),1),x[23]||(x[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,K0),J.value===`${A.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:x[6]||(x[6]=e.withModifiers(()=>{},["stop"]))},[X(A).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[5]||(x[5]=oe=>F.value=oe),placeholder:e.unref(V)("filter.search")},null,8,Q0)),[[e.vModelText,F.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",J0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge(A),oe=>(e.openBlock(),e.createElementBlock("li",{key:oe,class:"dss-filter-popup-item",onClick:Fe=>Zt(A,oe)},[e.createElementVNode("input",{type:"checkbox",checked:(A.value||[]).includes(oe),tabindex:"-1"},null,8,tp),e.createElementVNode("span",null,e.toDisplayString(oe),1)],8,ep))),128)),ge(A).length===0?(e.openBlock(),e.createElementBlock("li",lp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:oe=>Ne(A.id)},[...x[24]||(x[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,np)]))),128)),e.createElementVNode("div",op,[e.createElementVNode("div",ap,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:x[7]||(x[7]=e.withModifiers(A=>ht("add"),["stop"]))},e.toDisplayString(e.unref(V)("filter.addFilter")),1),J.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:x[12]||(x[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!ue.value&&!F.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[8]||(x[8]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,sp),[[e.vModelText,F.value]]),e.createElementVNode("ul",rp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ae=>ue.value=A},[e.createElementVNode("span",null,e.toDisplayString(A.label),1),x[25]||(x[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,ip))),128)),re.value.length>0?(e.openBlock(),e.createElementBlock("li",cp)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(re.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,up))),128))])],64)):ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:x[9]||(x[9]=A=>ue.value=null)},[x[26]||(x[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ue.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[10]||(x[10]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,dp),[[e.vModelText,F.value]]),e.createElementVNode("ul",mp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,pp))),128)),Qe.value.length===0?(e.openBlock(),e.createElementBlock("li",fp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":x[11]||(x[11]=A=>F.value=A),placeholder:e.unref(V)("filter.searchAttributes")},null,8,vp),[[e.vModelText,F.value]]),e.createElementVNode("ul",hp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,A=>(e.openBlock(),e.createElementBlock("li",{key:A.key,class:"dss-filter-popup-item",onClick:ae=>G(A.key)},e.toDisplayString(A.label),9,gp))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",yp,e.toDisplayString(e.unref(V)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ue},e.toDisplayString(e.unref(V)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),bp={class:"dss-pill-field__pills"},xp=["data-value"],wp=["disabled"],Ep={class:"dss-pill-field__pill-text"},Sp={key:0,class:"dss-pill-field__pill-actions"},Vp=["onClick"],Np=["onClick"],Bp=["placeholder","disabled"],Mp=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(E,{emit:te}){const $=E,V=te,ce=e.ref(""),O=e.ref([...$.modelValue]),L=e.ref(null);let fe=null;const rt=e.ref(null),ee=e.ref(""),v=e.ref(null),be=e.ref(null),ke=e.computed(()=>{if(!be.value)return;const{width:Le,height:je}=be.value;return{minWidth:`${Le}px`,height:`${je}px`}});function J(Le,je){rt.value===je&&(v.value=Le)}function Y(){rt.value=null,ee.value="",be.value=null,v.value=null}const me=e.computed(()=>new Set(O.value.map(Le=>Le.trim()).filter(Boolean)));function F(Le){L.value=Le,fe&&clearTimeout(fe),fe=setTimeout(()=>{L.value=null,fe=null},900)}function ue(Le){const je=Le.trim();return je?me.value.has(je)?(F(je),!1):(O.value=[...O.value,je],V("update:modelValue",[...O.value]),!0):!1}function $e(Le){const je=Le.split(/\r?\n/g).map(Je=>Je.trim()).filter(Boolean);if(!je.length)return;const re=new Set(O.value.map(Je=>Je.trim()).filter(Boolean)),Qe=[...O.value];let Ce=null;for(const Je of je){if(re.has(Je)){Ce??=Je;continue}re.add(Je),Qe.push(Je)}Qe.length!==O.value.length&&(O.value=Qe,V("update:modelValue",[...O.value])),Ce&&F(Ce)}function tt(Le){$.disabled||(rt.value===Le&&Y(),O.value=O.value.filter((je,re)=>re!==Le),V("update:modelValue",[...O.value]))}async function mt(Le,je){if($.disabled)return;const re=je.currentTarget.closest(".dss-pill-field__pill");re&&(be.value={width:re.offsetWidth,height:re.offsetHeight}),rt.value=Le,ee.value=O.value[Le]??"",await e.nextTick();const Qe=v.value;if(!Qe)return;Qe.focus();const Ce=Qe.value.length;Qe.setSelectionRange(Ce,Ce)}function U(){Y()}function ze(){if($.disabled||rt.value===null)return;const Le=rt.value,je=O.value[Le]??"",re=ee.value.trim();if(Y(),re!==je&&me.value.has(re)){F(re);return}if(!re){O.value=O.value.filter((Ce,Je)=>Je!==Le),V("update:modelValue",[...O.value]);return}const Qe=O.value.map((Ce,Je)=>Je===Le?re:Ce);O.value=Qe,V("update:modelValue",[...O.value])}function qe(Le){Le.preventDefault(),!$.disabled&&(ue(ce.value),ce.value="")}function Ve(Le){if($.disabled)return;const je=Le.clipboardData?.getData("text")??"";!je.includes(`
|
|
120
|
-
`)&&!je.includes("\r")||(Le.preventDefault(),$e(je),ce.value="")}return e.watch(()=>$.modelValue,Le=>{O.value=Array.isArray(Le)?[...Le]:[]},{deep:!0}),e.onBeforeUnmount(()=>{fe&&clearTimeout(fe)}),(Le,je)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":Le.disabled}])},[e.createElementVNode("div",bp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(re,Qe)=>(e.openBlock(),e.createElementBlock("span",{key:re,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":L.value===re,"dss-pill-field__pill--editing":rt.value===Qe}]),style:e.normalizeStyle(rt.value===Qe&&be.value?ke.value:void 0)},[rt.value===Qe?(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:Ce=>J(Ce,Qe),"onUpdate:modelValue":je[0]||(je[0]=Ce=>ee.value=Ce),class:"dss-pill-field__pill-edit",type:"text",disabled:Le.disabled,onKeydown:[e.withKeys(ze,["enter"]),e.withKeys(U,["esc"])],onBlur:ze},null,40,wp),[[e.vModelText,ee.value]])],8,xp)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Ep,e.toDisplayString(re),1),Le.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",Sp,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:Ce=>mt(Qe,Ce)},[...je[2]||(je[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,Vp),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:Ce=>tt(Qe)}," × ",8,Np)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":je[1]||(je[1]=re=>ce.value=re),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":Le.placeholder,disabled:Le.disabled,onPaste:Ve,onKeydown:e.withKeys(qe,["enter"])},null,40,Bp),[[e.vModelText,ce.value]])])],2))}}),_p={class:"dss-step-bar__layout"},$p={class:"dss-step-bar__header"},Lp={class:"dss-step-bar__label"},Ap={key:0,class:"dss-step-bar__counter"},Tp={class:"dss-step-bar__track-wrapper"},Dp=["aria-valuemax","aria-valuenow","aria-label"],Hp=["onMouseenter"],Rp={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:E=>["input","desc","asc"].includes(E)},orientation:{type:String,default:"horizontal",validator:E=>["horizontal","vertical"].includes(E)},barHeight:{type:[Number,String],default:200},labelPosition:{type:String,default:"up",validator:E=>["up","down","left","right"].includes(E)},sideLabelMaxWidth:{type:[Number,String],default:null},sideLabelWrapWidth:{type:[Number,String],default:"18ch"},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(E){const te=E,$={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},V=X=>X&&typeof X=="object"&&!Array.isArray(X),ce=(X,ge)=>{const W=Object.assign({},X);return!V(X)||!V(ge)||Object.keys(ge).forEach(G=>{if(V(ge[G])){G in X?W[G]=ce(X[G],ge[G]):Object.assign(W,{[G]:ge[G]});return}Object.assign(W,{[G]:ge[G]})}),W},O=e.computed(()=>ce($,te.options)),L=e.computed(()=>Math.max(1,Number(te.steps)||1)),fe=e.computed(()=>Math.min(L.value,Math.max(0,Number(te.currentStep)||0))),rt=e.computed(()=>Array.isArray(te.segments)&&te.segments.length>0),ee=e.computed(()=>{if(!rt.value)return[];const X=te.segments.map((ge,W)=>{const G=Number(ge?.value);return{label:ge?.label||`Step ${W+1}`,value:Number.isFinite(G)&&G>0?G:0,color:ge?.color||te.activeColor,marker:ge?.marker}});return te.segmentOrder==="desc"?[...X].sort((ge,W)=>W.value-ge.value):te.segmentOrder==="asc"?[...X].sort((ge,W)=>ge.value-W.value):X}),v=e.computed(()=>rt.value?ee.value.reduce((X,ge)=>X+ge.value,0):fe.value),be=e.computed(()=>rt.value?Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0?Number(te.totalValue):Math.max(1,v.value):L.value),ke=e.computed(()=>rt.value&&Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0),J=e.computed(()=>ke.value?Math.max(0,Number(te.totalValue)-v.value):0),Y=e.computed(()=>typeof te.remainderLabel=="string"&&te.remainderLabel.trim().length>0),me=e.computed(()=>J.value>0),F=e.computed(()=>ee.value.reduce((X,ge)=>Math.max(X,Number(ge.value)||0),0)),ue=e.computed(()=>ee.value.filter(X=>X.value>0).map(X=>`${X.label}: ${Ct(X.value)}`).join(" | ")),$e=e.computed(()=>rt.value?ke.value?ee.value.filter(X=>X.value>0):ee.value:[]),tt=e.computed(()=>{if(!te.counterAsPercentage)return`${v.value} / ${be.value}`;const X=Number(be.value);if(!Number.isFinite(X)||X<=0)return"0%";const ge=Math.round(Number(v.value)/X*100);return`${Math.min(Math.max(ge,0),100)}%`}),mt=e.computed(()=>v.value),U=e.computed(()=>be.value),ze=e.reactive({visible:!1,x:0,y:0,content:""}),qe=e.computed(()=>te.orientation==="vertical"),Ve=e.computed(()=>{const X=te.barHeight;return X==null||X===""?"200px":typeof X=="number"?`${X}px`:String(X)}),Le=e.computed(()=>{const X=te.sideLabelMaxWidth;if(!(X==null||X===""))return typeof X=="number"?`${X}px`:String(X)}),je=e.computed(()=>{const X=te.sideLabelWrapWidth;return X==null||X===""?"18ch":typeof X=="number"?`${X}ch`:String(X)}),re=e.computed(()=>({left:`${ze.x}px`,top:`${ze.y}px`,transform:"translate(-50%, calc(-100% - 8px))"})),Qe=X=>qe.value?{flex:`${X} 0 0`,minHeight:X>0?"6px":"0",minWidth:"0"}:{flex:`${X} 0 0`,minWidth:X>0?"6px":"0"},Ce=X=>{const ge=X?.parentElement;if(!ge)return{x:0,y:0};const W=ge.getBoundingClientRect();return{x:W.left+W.width/2,y:W.top}},Je=X=>{const ge=X.getBoundingClientRect();return{x:ge.left+ge.width/2,y:ge.top}},ut=X=>{if(ke.value){const G=Math.max(0,Number(X.value)||0);return{...Qe(G),backgroundColor:X.color}}const ge=v.value,W=X.value>0?X.value:ge>0?1e-4:1;return{...Qe(W),backgroundColor:X.color}},ht=X=>Number(X?.value||0)>0&&Number(X?.value||0)===F.value,dt=X=>{const ge=V(X?.marker)?X.marker:{},W=X?.marker===!0||ge.enabled===!0,G=ht(X)&&O.value.maxSegment?.marker?.enabled===!0;if(!(W||G))return{enabled:!1};const Pe=ge.backgroundColor??(G?O.value.maxSegment?.marker?.backgroundColor:O.value.segmentMarker?.backgroundColor),Xe=ge.borderColor??(G?O.value.maxSegment?.marker?.borderColor:O.value.segmentMarker?.borderColor),Et=ge.color??(G?O.value.maxSegment?.marker?.color:O.value.segmentMarker?.color),Ge=ge.width??(G?O.value.maxSegment?.marker?.width:O.value.segmentMarker?.width),Zt=ge.height??(G?O.value.maxSegment?.marker?.height:O.value.segmentMarker?.height);return{enabled:!0,backgroundColor:Pe,borderColor:Xe,color:Et,width:Ge,height:Zt,icon:ge.icon??null,...ge}},Wt=X=>{const ge=dt(X);return{backgroundColor:ge.backgroundColor??void 0,borderColor:ge.borderColor??void 0,color:ge.color??void 0}},qt=X=>{const ge=dt(X);return{width:ge.width??void 0,height:ge.height??void 0}},Ct=X=>`${X}${te.valueLabel}`,wt=e.computed(()=>({...Qe(J.value),backgroundColor:te.inactiveColor})),Yt=(X,ge)=>{if(!X||!ge?.currentTarget)return;const W=ge.currentTarget;if(te.remainderTooltipSummary){const Ne=Ce(W);ze.x=Ne.x,ze.y=Ne.y,ze.content=ue.value,ze.visible=!!ze.content;return}const G=Je(W);ze.x=G.x,ze.y=G.y,ze.content=`${X.label}: ${Ct(X.value)}`,ze.visible=!0},it=X=>{if(!J.value||!X?.currentTarget)return;const ge=X.currentTarget;if(te.remainderTooltipSummary){const G=Ce(ge);ze.x=G.x,ze.y=G.y,ze.content=ue.value,ze.visible=!!ze.content;return}const W=Je(ge);ze.x=W.x,ze.y=W.y,Y.value&&(ze.content=`${te.remainderLabel}: ${Ct(J.value)}`,ze.visible=!0)},Kt=()=>{ze.visible=!1},yt=()=>{ze.visible&&Kt()};e.onMounted(()=>{window.addEventListener("scroll",yt,!0)}),e.onBeforeUnmount(()=>{window.removeEventListener("scroll",yt,!0)});const el=e.computed(()=>({"--dss-step-bar-label-color":te.labelColor??void 0,"--dss-step-bar-counter-color":te.counterColor??void 0,"--dss-step-bar-active-color":te.activeColor,"--dss-step-bar-inactive-color":te.inactiveColor,"--dss-step-bar-bar-height":qe.value?Ve.value:void 0,"--dss-step-bar-side-label-max-width":Le.value,"--dss-step-bar-side-label-wrap-width":je.value}));return(X,ge)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-step-bar",[`dss-step-bar--${E.orientation}`,`dss-step-bar--label-${E.labelPosition}`]]),style:e.normalizeStyle(el.value)},[e.createElementVNode("div",_p,[e.createElementVNode("div",$p,[e.createElementVNode("span",Lp,[e.renderSlot(X.$slots,"label",{label:E.label},()=>[e.createTextVNode(e.toDisplayString(E.label),1)])]),E.showCounter?(e.openBlock(),e.createElementBlock("span",Ap,[e.renderSlot(X.$slots,"counter",{counterDisplay:tt.value},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Tp,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":U.value,"aria-valuenow":mt.value,"aria-label":E.label},[rt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(W,G)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${G}-${W.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":ht(W),"dss-step-bar__segment--marker-enabled":dt(W).enabled}]),style:e.normalizeStyle(ut(W)),onMouseenter:Ne=>Yt(W,Ne),onMouseleave:Kt},[dt(W).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(Wt(W)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(qt(W))},[e.renderSlot(X.$slots,"segment-marker-icon",{segment:W,index:G,marker:dt(W)},()=>[e.renderSlot(X.$slots,"max-segment-icon",{segment:W,index:G,marker:dt(W)},()=>[e.createTextVNode(e.toDisplayString(dt(W).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,Hp))),128)),me.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(wt.value),onMouseenter:ge[0]||(ge[0]=W=>it(W)),onMouseleave:Kt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(L.value,W=>(e.openBlock(),e.createElementBlock("div",{key:W,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":W<=fe.value}])},null,2))),128))],8,Dp)])]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ze.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip dss-step-bar__tooltip--teleported",style:e.normalizeStyle(re.value)},e.toDisplayString(ze.content),5)):e.createCommentVNode("",!0)]))],6))}},Fp={key:0,class:"dss-title dss-title--separator"},Ip={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:E=>["main","separator","subtitle"].includes(E)},h:{type:Number,default:null,validator:E=>E===null||Number.isInteger(E)&&E>=1&&E<=6},size:{type:[String,Number],default:null},weight:{type:[String,Number],default:null},color:{type:String,default:null},editable:{type:Boolean,default:!1},modelValue:{type:String,default:""}},emits:["update:modelValue","change"],setup(E,{expose:te,emit:$}){const V=E,ce=$,O=e.ref(null),L=e.computed(()=>`dss-title--${V.type}`),fe=e.computed(()=>V.h!=null?`dss-title--h${V.h}`:null),rt={main:"div",subtitle:"p",separator:"span"},ee=e.computed(()=>V.h!=null?`h${V.h}`:rt[V.type]??"div"),v=e.computed(()=>V.editable?"plaintext-only":void 0),be=e.computed(()=>{const ue={};return V.size!=null&&(ue.fontSize=typeof V.size=="number"?`${V.size}px`:V.size),V.weight!=null&&(ue.fontWeight=V.weight),V.color!=null&&(ue.color=V.color),Object.keys(ue).length?ue:void 0}),ke=e.computed(()=>V.editable?{input:Y,keydown:me,paste:F}:{}),J=()=>{const ue=O.value;!V.editable||!ue||document.activeElement!==ue&&(ue.innerText=V.modelValue??"")},Y=ue=>{const $e=ue.target.innerText;ce("update:modelValue",$e),ce("change",$e)},me=ue=>{ue.key==="Enter"&&ue.preventDefault()},F=ue=>{ue.preventDefault();const $e=(ue.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,$e)};return e.watch(()=>V.modelValue,()=>{J()}),e.watch(()=>V.editable,()=>{e.nextTick(J)}),e.onMounted(()=>{e.nextTick(J)}),te({focus:()=>O.value?.focus()}),(ue,$e)=>E.type==="separator"?(e.openBlock(),e.createElementBlock("div",Fp,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",fe.value,{"dss-title--editable":E.editable}],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ee.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[L.value,fe.value,{"dss-title--editable":E.editable}]],style:be.value,contenteditable:v.value,spellcheck:E.editable?!1:void 0},e.toHandlers(ke.value)),{default:e.withCtx(()=>[E.editable?e.createCommentVNode("",!0):e.renderSlot(ue.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(E.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},zp={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"}},Pp={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"},Op={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"}},Wp={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},qp={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"}},io={chart:zp,table:Pp,filter:Op,datepicker:Wp,textEditor:qp},Zp={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"}},Up={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"},Xp={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"}},Yp={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},jp={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"}},co={chart:Zp,table:Up,filter:Xp,datepicker:Yp,textEditor:jp},Kp={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"}},Gp={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"},Qp={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"}},Jp={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},e9={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"}},uo={chart:Kp,table:Gp,filter:Qp,datepicker:Jp,textEditor:e9},Oo={en:io,fr:co,nl:uo};function Ma(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Oo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Oo[$])})}const Wo={en:{textEditor:io.textEditor},fr:{textEditor:co.textEditor},nl:{textEditor:uo.textEditor}};function _a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Wo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Wo[$])})}const qo={en:{table:io.table},fr:{table:co.table},nl:{table:uo.table}};function $a(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(qo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,qo[$])})}const Zo={en:{datepicker:io.datepicker},fr:{datepicker:co.datepicker},nl:{datepicker:uo.datepicker}};function La(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Zo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Zo[$])})}const Uo={en:{filter:io.filter},fr:{filter:co.filter},nl:{filter:uo.filter}};function Aa(E){if(!E||!E.global)return;const te=E.global.availableLocales||[];Object.keys(Uo).forEach($=>{te.includes($)&&E.global.mergeLocaleMessage($,Uo[$])})}const t9={chart:Oo,textEditor:Wo,table:qo,datepicker:Zo,filter:Uo};function l9(E){!E||!E.global||(Ma(E),_a(E),$a(E),La(E),Aa(E))}const n9={en:{...io},fr:{...co},nl:{...uo}};ro.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:n9});exports.DSSChart=Gc;exports.DSSChartMessages=Oo;exports.DSSColorPicker=I2;exports.DSSConfetti=p0;exports.DSSDatepicker=pa;exports.DSSDatepickerMessages=Zo;exports.DSSDnd=d0;exports.DSSFilter=Cp;exports.DSSFilterMessages=Uo;exports.DSSLoader=Q2;exports.DSSMessages=t9;exports.DSSModal=ma;exports.DSSPillField=Mp;exports.DSSSkeleton=J2;exports.DSSStepBar=Rp;exports.DSSTable=kd;exports.DSSTableMessages=qo;exports.DSSTextEditor=w2;exports.DSSTextEditorMessages=Wo;exports.DSSTitle=Ip;exports.addDSSChartTranslations=Ma;exports.addDSSDatepickerTranslations=La;exports.addDSSFilterTranslations=Aa;exports.addDSSTableTranslations=$a;exports.addDSSTextEditorTranslations=_a;exports.addDSSTranslations=l9;
|
|
119
|
+
`,document.body.appendChild(Ce),V=Ce}function Te(pe,A){V&&(V.style.left=`${pe-lt}px`,V.style.top=`${A-rt}px`)}function at(pe){pe.classList.add("dss-dnd-item--dragging"),pe.style.background=me.value.dragSourceBackground,pe.style.borderColor=me.value.dragSourceBorder,pe.style.transform="scale(0.97)"}function ge(pe){pe.classList.remove("dss-dnd-item--dragging"),pe.style.background="",pe.style.borderColor="",pe.style.transform=""}function Ft(pe,A){return document.elementFromPoint(pe,A)?.closest(".dss-dnd-column-body")??null}function dt(pe,A){return!!document.elementFromPoint(pe,A)?.closest("[data-dss-dnd-delete-zone]")}function Ye(pe,A){if(O.value&&dt(pe,A)){he.value=!0,be.value=null,oe.value=-1;return}he.value=!1;const X=Ft(pe,A),ae=X?.getAttribute("data-column")??null;if(!ae){be.value=null,oe.value=-1;return}be.value=ae;const Ce=X.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let je=Ce.length;for(let Ge=0;Ge<Ce.length;Ge++){const Vt=Ce[Ge].getBoundingClientRect();if(A<Vt.top+Vt.height/2){je=Ge;break}}oe.value=je}function Pt(pe){pe.preventDefault(),Te(pe.clientX,pe.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,Ye(pe.clientX,pe.clientY)}))}function It(pe){window.removeEventListener("pointermove",Pt),window.removeEventListener("pointerup",It),window.removeEventListener("pointercancel",It),$e?.releasePointerCapture?.(pe.pointerId),ge($e),$e=null;const A=O.value&&dt(pe.clientX,pe.clientY);if(f.value&&A)N("delete",{item:f.value});else{const ae=Ft(pe.clientX,pe.clientY)?.getAttribute("data-column")??null;if(f.value&&ae){const Ce=f.value[L.columnKey],je=ae,Vt=(ze.value[je]||[]).filter(qt=>qt[L.itemKey]!==f.value[L.itemKey]),Pe=Math.max(0,Math.min(oe.value,Vt.length)),Ke=Ue(je,Pe),nt=f.value[L.itemKey];N("move",{item:f.value,from:Ce,to:je,position:Ke,index:Pe}),_e&&clearTimeout(_e),j.value={id:nt,from:Ce,to:je},_e=setTimeout(()=>{j.value=null},3500)}}V&&(V.remove(),V=null),Qe!==null&&(document.body.style.cursor=Qe,Qe=""),Dt()}function bt(pe,A){pe.preventDefault();const X=pe.target.closest(".dss-dnd-item");if(!X)return;const ae=X.getBoundingClientRect();lt=pe.clientX-ae.left,rt=pe.clientY-ae.top,Qe=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=A,$e=X,ke(X,pe.clientX,pe.clientY),requestAnimationFrame(()=>at(X)),X.setPointerCapture?.(pe.pointerId),window.addEventListener("pointermove",Pt),window.addEventListener("pointerup",It,{once:!0}),window.addEventListener("pointercancel",It,{once:!0})}function ft(){Z&&(window.removeEventListener("pointermove",Yt),window.removeEventListener("pointerup",it),window.removeEventListener("pointercancel",it),Z=null)}function Yt(pe){if(!Z||pe.pointerId!==Z.pointerId)return;const A=pe.clientX-Z.startX,X=pe.clientY-Z.startY;if(Math.abs(A)>=qe||Math.abs(X)>=qe){const ae=Z.item;ft(),bt(pe,ae)}}function it(pe){!Z||pe.pointerId!==Z.pointerId||ft()}function At(pe,A){ft(),Z={item:A,startX:pe.clientX,startY:pe.clientY,pointerId:pe.pointerId},window.addEventListener("pointermove",Yt),window.addEventListener("pointerup",it),window.addEventListener("pointercancel",it)}function ht(pe,A){me.value.useHandle||At(pe,A)}function il(pe,A){At(pe,A)}function St(){fe&&(cancelAnimationFrame(fe),fe=null)}function Dt(){St(),f.value=null,be.value=null,he.value=!1,oe.value=-1}return e.onBeforeUnmount(()=>{St(),ft(),_e&&clearTimeout(_e),V&&(V.remove(),V=null)}),(pe,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":me.value.unstyled}]),style:e.normalizeStyle(ot.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":he.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(pe.$slots,"delete-zone",{isDragging:!!f.value,isOver:he.value})],2),[[e.vShow,!!f.value||me.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.columns,X=>(e.openBlock(),e.createElementBlock("div",{key:X.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==X.value},X.class||""]]),style:e.normalizeStyle(ne(X))},[me.value.showHeader?(e.openBlock(),e.createElementBlock("div",pp,[e.renderSlot(pe.$slots,"column-header",{column:X,items:ze.value[X.value]||[]},()=>[e.createElementVNode("span",vp,e.toDisplayString(X.title||X.value),1),e.createElementVNode("span",fp,e.toDisplayString((ze.value[X.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":X.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value[X.value],ae=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ae.key},[ae.type==="indicator"?(e.openBlock(),e.createElementBlock("div",gp)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ae.isDragged,"dss-dnd-item--no-handle":!me.value.useHandle}]),onPointerdown:Ce=>ht(Ce,ae.item)},[me.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ce=>il(Ce,ae.item),["stop"])},[e.renderSlot(pe.$slots,"handle",{},()=>[A[0]||(A[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,kp)):e.createCommentVNode("",!0),e.createElementVNode("div",Cp,[e.renderSlot(pe.$slots,"item",{item:ae.item,column:X,justDropped:j.value?.id===ae.item[S.itemKey],droppedFrom:j.value?.id===ae.item[S.itemKey]?j.value.from:null,droppedTo:j.value?.id===ae.item[S.itemKey]?j.value.to:null},()=>[e.createElementVNode("div",bp,e.toDisplayString(ae.item[S.itemKey]),1)])])],42,yp))],64))),128)),(ze.value[X.value]||[]).length===0&&be.value!=X.value?(e.openBlock(),e.createElementBlock("div",wp,[e.renderSlot(pe.$slots,"empty",{column:X},()=>[A[1]||(A[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,hp)],6))),128))],6))}}),Sp={name:"DSSConfetti"},Vp=Object.assign(Sp,{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(S){const ee=S,L=e.ref(null),N=e.ref(!1);let ue=[],O=null,H=null;function me(oe,j){const fe=[];for(let _e=0;_e<ee.count;_e++)fe.push(ot(oe));return fe}function ot(oe,j){return{x:Math.random()*oe,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 ne(oe,j,fe,_e){oe.clearRect(0,0,j,fe);for(const V of ue)oe.save(),oe.globalAlpha=V.opacity*_e,oe.beginPath(),oe.lineWidth=V.r,oe.strokeStyle=V.color,oe.moveTo(V.x+V.tilt+V.r/2,V.y),oe.lineTo(V.x+V.tilt,V.y+V.tilt+V.r/2),oe.stroke(),oe.restore()}function f(oe,j,fe){const _e=.3+fe*.7;for(let V=0;V<ue.length;V++){const $e=ue[V];$e.tiltAngle+=$e.tiltInc,$e.y+=$e.speed*_e,$e.x+=Math.sin($e.d)*.5*_e,$e.tilt=Math.sin($e.tiltAngle)*15,fe>=.99&&$e.y>j+20&&(ue[V]=ot(oe))}}function be(){N.value=!0,e.nextTick(()=>{const oe=L.value;if(!oe)return;const j=oe.getContext("2d"),fe=oe.parentElement;if(!fe)return;const _e=fe.getBoundingClientRect();oe.width=_e.width,oe.height=_e.height,ue=me(oe.width,oe.height);const V=Date.now(),$e=V+ee.duration,lt=()=>{const rt=Date.now(),Qe=rt-V;if(rt<$e){let Z=1;Qe>ee.fadeStart&&(Z=1-(Qe-ee.fadeStart)/(ee.duration-ee.fadeStart)),ne(j,oe.width,oe.height,Z),f(oe.width,oe.height,Z),O=requestAnimationFrame(lt)}else he()};lt()})}function he(){O&&(cancelAnimationFrame(O),O=null),ue=[],N.value=!1}return e.watch(()=>ee.trigger,oe=>{oe&&(H&&clearTimeout(H),H=setTimeout(be,ee.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{he(),H&&clearTimeout(H)}),(oe,j)=>N.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:L,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Np={class:"dss-filter-global-inner"},Bp=["placeholder","value"],Mp=["title"],_p={key:0,class:"dss-filter-funnel-badge"},$p={key:1,class:"dss-filter-sortby"},Lp=["value"],Tp=["value"],Ap=["disabled","title"],Dp={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"},Hp={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"},Rp={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"},Fp={class:"dss-filter-panel"},Ip={key:0,class:"dss-filter-empty"},zp={class:"dss-filter-row-prefix"},Pp={class:"dss-filter-cell"},Op=["onClick"],Wp={class:"dss-filter-trigger-text"},qp=["placeholder"],Zp={class:"dss-filter-popup-list"},Up=["onClick"],Xp={key:0,class:"dss-filter-popup-empty"},Yp={key:0,class:"dss-filter-cell"},jp=["onClick"],Kp={class:"dss-filter-trigger-text"},Gp={class:"dss-filter-popup-list"},Qp=["onClick"],Jp={key:1,class:"dss-filter-cell dss-filter-cell--value"},e0=["placeholder","onUpdate:modelValue"],t0={key:1,class:"dss-filter-date-wrap"},l0=["placeholder","onUpdate:modelValue"],n0=["placeholder","value","onInput","step"],o0={key:4,class:"dss-filter-between"},a0=["placeholder","value","onInput","step"],s0={class:"dss-filter-between-sep"},r0=["placeholder","value","onInput","step"],i0={key:5,class:"dss-filter-multiselect"},c0=["onClick"],u0={class:"dss-filter-trigger-text"},d0=["placeholder"],m0={class:"dss-filter-popup-list dss-filter-popup-list--check"},p0=["onClick"],v0=["checked"],f0={key:0,class:"dss-filter-popup-empty"},h0=["onClick"],g0={class:"dss-filter-foot"},y0={class:"dss-filter-cell"},k0=["placeholder"],C0={class:"dss-filter-popup-list"},b0=["onClick"],w0={key:0,class:"dss-filter-popup-divider"},x0=["onClick"],E0=["placeholder"],S0={class:"dss-filter-popup-list"},V0=["onClick"],N0={key:0,class:"dss-filter-popup-empty"},B0=["placeholder"],M0={class:"dss-filter-popup-list"},_0=["onClick"],$0={key:0,class:"dss-filter-popup-empty"},L0={name:"DSSFilter"},T0=Object.assign(L0,{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(S,{expose:ee,emit:L}){const{t:N}=so.useI18n(),ue=S,O=L,H={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},me=e.computed(()=>({...H,...ue.options})),ot={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"}]},ne=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),he=e.ref([]),oe=e.ref(null),j=e.ref(!1),fe=e.ref(null),_e=e.ref(""),V=e.ref(null),$e=e.ref(""),lt=e.ref("asc");let rt=1;function Qe(B){const w=B.find(T=>T&&typeof T=="object");if(!w)return null;for(const T of f)if(T in w&&typeof w[T]=="string")return T;return Object.keys(w).find(T=>typeof w[T]=="string")||null}function Z(B,w){const T=w.filter(ie=>ie!=null&&ie!=="NULL");if(T.length===0)return null;if(T.every(ie=>Array.isArray(ie))){const ie=T.flatMap(He=>He).filter(He=>He!=null);return ie.length===0?null:typeof ie.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return T.every(ie=>typeof ie=="boolean")?"boolean":T.every(ie=>typeof ie=="number")?new Set(T).size<=me.value.maxUniqueForEnum?"select":"range":T.every(ie=>typeof ie=="string")?new Set(T).size<=me.value.maxUniqueForSelect?"select":"text":T.some(ie=>typeof ie=="object"&&!Array.isArray(ie))?null:"text"}const qe=e.computed(()=>{if(!ue.data?.length)return[];const B=new Set;for(const re of ue.data)if(re&&typeof re=="object")for(const He of Object.keys(re))B.add(He);const w=new Set(ue.exclude),T=[];for(const re of B){if(w.has(re))continue;const He=ue.config[re]||{},gt=ue.data.map(xt=>xt?.[re]),et=He.type||Z(re,gt);if(!et)continue;const Ae=He.filterMode||"contain",yt=Ae==="date"?"date":Ae==="string"?"text":et,Et={key:re,label:He.label||pt(re),type:yt,filterMode:Ae};if(et==="select"){const xt=gt.filter($t=>$t!=null&&$t!=="NULL");Et.uniqueValues=[...new Set(xt)].sort(($t,Ht)=>typeof $t=="number"&&typeof Ht=="number"?$t-Ht:String($t).localeCompare(String(Ht)))}else if(et==="range"||et==="int"){const xt=gt.filter($t=>typeof $t=="number");Et.min=Math.min(...xt),Et.max=Math.max(...xt)}else if(et==="arraySelect"){const xt=He.displayKey||Qe(gt.flatMap($t=>Array.isArray($t)?$t:[]));if(Et.displayKey=xt,Array.isArray(He.uniqueValues)&&He.uniqueValues.length>0)Et.uniqueValues=He.uniqueValues.map($t=>String($t));else{const $t=gt.flatMap(Ht=>Array.isArray(Ht)?Ht:[]).filter(Ht=>Ht!=null).map(Ht=>xt&&typeof Ht=="object"?Ht[xt]:String(Ht)).filter(Ht=>Ht!=null&&Ht!=="");Et.uniqueValues=[...new Set($t)].sort((Ht,kt)=>String(Ht).localeCompare(String(kt)))}}T.push(Et)}const ie=ue.config._order;return ie&&T.sort((re,He)=>{const gt=ie.indexOf(re.key),et=ie.indexOf(He.key);return gt===-1&&et===-1?0:gt===-1?1:et===-1?-1:gt-et}),T}),ze=e.computed(()=>{const B={};for(const w of qe.value)B[w.key]=w;return B}),ye=e.computed(()=>Array.isArray(ue.config.groups)&&ue.config.groups.length>0),Ue=e.computed(()=>{if(!ye.value)return[];const B=new Set(qe.value.map(w=>w.key));return ue.config.groups.map(w=>({...w,keys:w.keys.filter(T=>B.has(T))})).filter(w=>w.keys.length>0)}),ke=e.computed(()=>{if(!ye.value)return[];const B=new Set(ue.config.groups.flatMap(w=>w.keys));return qe.value.filter(w=>!B.has(w.key))}),Te=e.computed(()=>{if(!V.value)return[];const B=new Set(V.value.keys),w=qe.value.filter(ie=>B.has(ie.key));if(!_e.value)return w;const T=_e.value.toLowerCase();return w.filter(ie=>ie.label.toLowerCase().includes(T))}),at=e.computed(()=>{if(!_e.value)return qe.value;const B=_e.value.toLowerCase();return qe.value.filter(w=>w.label.toLowerCase().includes(B))}),ge=e.computed(()=>qe.value.filter(B=>!["arraySelect","arrayText"].includes(B.type))),Ft=e.computed(()=>$e.value?lt.value==="asc"?"Ascending":"Descending":"No sort selected");function dt(B){oe.value===B?Ye():(oe.value=B,_e.value="",V.value=null)}function Ye(){oe.value=null,_e.value="",V.value=null}function Pt(B){const w=B.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");oe.value&&!w&&!B.target.closest(".dss-filter-popup")&&!B.target.closest(".dss-filter-trigger")&&!B.target.closest(".dss-filter-add-btn")&&Ye(),j.value&&fe.value&&!fe.value.contains(B.target)&&(w||(j.value=!1))}e.onMounted(()=>document.addEventListener("click",Pt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Pt));function It(B){return ze.value[B]?.label||pt(B)}function bt(B){return ze.value[B.key]?.filterMode||"contain"}function ft(B){return N(`filter.operators.${B}`)}function Yt(B){const w=ze.value[B.key];return(ot[w?.type]||ot.text).map(T=>({...T,label:N(`filter.operators.${T.value}`)}))}function it(B){return ne.has(B)}function At(B){const w=ze.value[B.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?B.operator==="between"?"between":"number":"text":"text"}function ht(B){return ot[B]?.[0]?.value||"contains"}function il(B,w){return ne.has(w)||B==="date"?null:B==="select"||B==="arraySelect"?[]:(B==="range"||B==="int")&&w==="between"?{min:null,max:null}:B==="range"||B==="int"?null:""}function St(B){return ze.value[B.key]?.uniqueValues||[]}function Dt(B){const w=St(B);if(!_e.value)return w;const T=_e.value.toLowerCase();return w.filter(ie=>String(ie).toLowerCase().includes(T))}function pe(B){const w=B.value;return!w||w.length===0?N("filter.select"):w.length<=2?w.join(", "):N("filter.selectedCount",{count:w.length})}function A(B){const w=ze.value[B],T=w?.filterMode||"contain",ie=w?.type||"text",re=T==="string"?"contains":ht(ie);he.value.push(e.reactive({id:rt++,key:B,operator:re,value:il(ie,re)})),Ye()}function X(B){he.value=he.value.filter(w=>w.id!==B)}function ae(B,w){const ie=ze.value[w]?.type||"text";B.key=w,B.operator=ht(ie),B.value=il(ie,B.operator),Ye()}function Ce(B,w){const T=At(B);B.operator=w;const ie=At(B);if(T!==ie||ne.has(w)){const re=ze.value[B.key];B.value=il(re?.type||"text",w)}Ye()}function je(B,w){const T=w.target.value;B.value=T===""?null:Number(T)}function Ge(B,w,T){const ie=T.target.value,re=ie===""?null:Number(ie);(!B.value||typeof B.value!="object")&&(B.value={min:null,max:null}),B.value={...B.value,[w]:isNaN(re)?null:re}}function Vt(B,w){const T=B.value||[],ie=T.indexOf(w);B.value=ie>=0?T.filter(re=>re!==w):[...T,w]}function Pe(){he.value=[],be.value="",Ye()}function Ke(B){be.value=B.target.value}function nt(B){$e.value=B.target.value}function qt(){lt.value=lt.value==="asc"?"desc":"asc"}const te=e.computed(()=>{if(!ue.data)return[];let B=ue.data;if(be.value){const w=be.value.toLowerCase();B=B.filter(T=>{for(const ie of Object.keys(T)){const re=T[ie];if(typeof re=="string"&&re.toLowerCase().includes(w)||typeof re=="number"&&String(re).includes(w)||Array.isArray(re)&&re.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(w):typeof He=="object"?Object.values(He).some(gt=>typeof gt=="string"&>.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of he.value){if(!ce(w))continue;const T=ze.value[w.key];T&&(B=B.filter(ie=>Ve(ie,w,T)))}if(ue.showSortBy&&$e.value){const w=$e.value,T=lt.value==="asc"?1:-1;B=[...B].sort((ie,re)=>K(ie?.[w],re?.[w])*T)}return B});function K(B,w){const T=Q(B),ie=Q(w);return T==null&&ie==null?0:T==null?1:ie==null?-1:typeof T=="number"&&typeof ie=="number"?T-ie:String(T).localeCompare(String(ie),void 0,{numeric:!0,sensitivity:"base"})}function Q(B){return B==null||B==="NULL"?null:typeof B=="string"||typeof B=="number"||typeof B=="boolean"?B:B instanceof Date?B.getTime():null}function ce(B){return ne.has(B.operator)?!0:B.value==null||typeof B.value=="string"&&B.value===""||Array.isArray(B.value)&&B.value.length===0?!1:B.value instanceof Date?!isNaN(B.value.getTime()):!(typeof B.value=="object"&&!Array.isArray(B.value)&&B.value.min==null&&B.value.max==null)}function Ve(B,w,T){const ie=B?.[w.key],re=w.value,He=w.operator;if(He==="is_empty")return Ot(ie);if(He==="is_not_empty")return!Ot(ie);const gt=T.type;if(gt==="text"||gt==="arrayText"){const et=gt==="arrayText"&&Array.isArray(ie)?ie.filter(Et=>Et!=null).map(String).join(" "):ie!=null?String(ie):"",Ae=String(re).toLowerCase(),yt=et.toLowerCase();switch(He){case"contains":return yt.includes(Ae);case"not_contains":return!yt.includes(Ae);case"equals":return yt===Ae;case"not_equals":return yt!==Ae;case"starts_with":return yt.startsWith(Ae);case"ends_with":return yt.endsWith(Ae);default:return!0}}if(gt==="select")switch(He){case"is_any_of":return re.includes(ie);case"is_none_of":return!re.includes(ie);default:return!0}if(gt==="range"||gt==="int"){const et=typeof ie=="number"?ie:Number(ie);if(typeof et!="number"||isNaN(et))return!1;if(He==="between"){const yt=re?.min!=null?Number(re.min):null,Et=re?.max!=null?Number(re.max):null,xt=yt!=null&&!isNaN(yt)?yt:null,$t=Et!=null&&!isNaN(Et)?Et:null;return(xt==null||et>=xt)&&($t==null||et<=$t)}const Ae=typeof re=="number"&&!isNaN(re)?re:Number(re);if(He==="contains"||He==="not_contains"){const yt=String(et),Et=String(re??"").toLowerCase(),xt=yt.toLowerCase().includes(Et);return He==="contains"?xt:!xt}if(typeof Ae!="number"||isNaN(Ae))return!1;switch(He){case"eq":return et===Ae;case"neq":return et!==Ae;case"gt":return et>Ae;case"gte":return et>=Ae;case"lt":return et<Ae;case"lte":return et<=Ae;default:return!0}}if(gt==="arraySelect"){if(!Array.isArray(ie))return!1;const et=ie.filter(Ae=>Ae!=null).map(Ae=>T.displayKey&&typeof Ae=="object"?Ae[T.displayKey]:String(Ae));switch(He){case"contains_any":return et.some(Ae=>re.includes(Ae));case"contains_all":return re.every(Ae=>et.includes(Ae));case"not_contains_any":return!et.some(Ae=>re.includes(Ae));default:return!0}}if(gt==="date"){const et=We(re);if(!et||isNaN(et.getTime()))return!1;const Ae=We(ie);if(!Ae||isNaN(Ae.getTime()))return!1;const yt=Nt(Ae),Et=Nt(et);switch(He){case"eq":return yt===Et;case"before":return yt<Et;case"after":return yt>Et;default:return!0}}if(gt==="boolean"){const et=ie===!0||ie==="true"||ie===1,Ae=ie===!1||ie==="false"||ie===0;switch(He){case"is_true":return et;case"is_false":return Ae;default:return!0}}return!0}function We(B){if(B==null)return null;if(B instanceof Date)return isNaN(B.getTime())?null:B;if(typeof B=="number")return new Date(B>1e10?B:B*1e3);if(typeof B=="string"){const w=new Date(B);return isNaN(w.getTime())?null:w}return null}function Nt(B){const w=B.getFullYear(),T=String(B.getMonth()+1).padStart(2,"0"),ie=String(B.getDate()).padStart(2,"0");return`${w}-${T}-${ie}`}function Ot(B){return!!(B==null||B===""||B==="NULL"||Array.isArray(B)&&B.length===0||Array.isArray(B)&&B.every(w=>w==null))}e.watch(te,B=>O("update:modelValue",B),{immediate:!0}),e.watch(()=>ue.data,()=>{he.value=[],be.value="",j.value=!1,$e.value="",lt.value="asc",Ye()});function pt(B){return B.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function wt(){const B=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(B);if(typeof w=="object"&&!Array.isArray(w)){const T={};for(const ie of Object.keys(w))T[ie]=B(w[ie]);return T}return w};return{globalSearch:be.value,rows:he.value.map(w=>({key:w.key,operator:w.operator,value:B(w.value),defType:ze.value[w.key]?.type,defFilterMode:ze.value[w.key]?.filterMode})),filteredCount:te.value?.length??0}}return ee({getDebugState:wt}),(B,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":me.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",Np,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(N)("filter.searchAcrossFields"),value:be.value,onInput:Ke},null,40,Bp),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=T=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:j.value||he.value.length>0,"dss-filter-funnel-btn--with-sort":ue.showSortBy}]),onClick:w[1]||(w[1]=T=>j.value=!j.value),type:"button",title:j.value?e.unref(N)("filter.closeAdvancedFilter"):e.unref(N)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),he.value.length>0?(e.openBlock(),e.createElementBlock("span",_p,e.toDisplayString(he.value.length),1)):e.createCommentVNode("",!0)],10,Mp),ue.showSortBy?(e.openBlock(),e.createElementBlock("div",$p,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:$e.value,onChange:nt},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,T=>(e.openBlock(),e.createElementBlock("option",{key:T.key,value:T.key},e.toDisplayString(T.label),9,Tp))),128))],40,Lp),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:qt,disabled:!$e.value,title:Ft.value},[$e.value?lt.value==="asc"?(e.openBlock(),e.createElementBlock("svg",Hp,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Rp,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",Dp,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,Ap)])):e.createCommentVNode("",!0)]),j.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Fp,[he.value.length===0?(e.openBlock(),e.createElementBlock("div",Ip,e.toDisplayString(e.unref(N)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(T,ie)=>(e.openBlock(),e.createElementBlock("div",{key:T.id,class:"dss-filter-row"},[e.createElementVNode("span",zp,e.toDisplayString(ie===0?e.unref(N)("filter.where"):e.unref(N)("filter.and")),1),e.createElementVNode("div",Pp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:field`),["stop"])},[e.createElementVNode("span",Wp,e.toDisplayString(It(T.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Op),oe.value===`${T.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=re=>_e.value=re),placeholder:e.unref(N)("filter.searchAttributes")},null,8,qp),[[e.vModelText,_e.value]]),e.createElementVNode("ul",Zp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,re=>(e.openBlock(),e.createElementBlock("li",{key:re.key,class:"dss-filter-popup-item",onClick:He=>ae(T,re.key)},e.toDisplayString(re.label),9,Up))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",Xp,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),bt(T)==="contain"||bt(T)==="date"?(e.openBlock(),e.createElementBlock("div",Yp,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:op`),["stop"])},[e.createElementVNode("span",Kp,e.toDisplayString(ft(T.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,jp),oe.value===`${T.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Gp,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(T),re=>(e.openBlock(),e.createElementBlock("li",{key:re.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:T.operator===re.value}]),onClick:He=>Ce(T,re.value)},e.toDisplayString(re.label),11,Qp))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),it(T.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Jp,[bt(T)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>T.value=re},null,8,e0)),[[e.vModelText,T.value]]):bt(T)==="date"?(e.openBlock(),e.createElementBlock("div",t0,[e.createVNode(pa,{mode:"single",modelValue:T.value,"onUpdate:modelValue":re=>T.value=re},null,8,["modelValue","onUpdate:modelValue"])])):At(T)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),"onUpdate:modelValue":re=>T.value=re},null,8,l0)),[[e.vModelText,T.value]]):At(T)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.enterValue"),value:T.value,onInput:re=>je(T,re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,n0)):At(T)==="between"?(e.openBlock(),e.createElementBlock("div",o0,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.min"),value:T.value?.min,onInput:re=>Ge(T,"min",re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,a0),e.createElementVNode("span",s0,e.toDisplayString(e.unref(N)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(N)("filter.max"),value:T.value?.max,onInput:re=>Ge(T,"max",re),step:ze.value[T.key]?.type==="int"?1:void 0},null,40,r0)])):At(T)==="multiselect"?(e.openBlock(),e.createElementBlock("div",i0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(re=>dt(`${T.id}:val`),["stop"])},[e.createElementVNode("span",u0,e.toDisplayString(pe(T)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,c0),oe.value===`${T.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[St(T).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=re=>_e.value=re),placeholder:e.unref(N)("filter.search")},null,8,d0)),[[e.vModelText,_e.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(T),re=>(e.openBlock(),e.createElementBlock("li",{key:re,class:"dss-filter-popup-item",onClick:He=>Vt(T,re)},[e.createElementVNode("input",{type:"checkbox",checked:(T.value||[]).includes(re),tabindex:"-1"},null,8,v0),e.createElementVNode("span",null,e.toDisplayString(re),1)],8,p0))),128)),Dt(T).length===0?(e.openBlock(),e.createElementBlock("li",f0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:re=>X(T.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,h0)]))),128)),e.createElementVNode("div",g0,[e.createElementVNode("div",y0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(T=>dt("add"),["stop"]))},e.toDisplayString(e.unref(N)("filter.addFilter")),1),oe.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[ye.value&&!V.value&&!_e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,k0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",C0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ie=>V.value=T},[e.createElementVNode("span",null,e.toDisplayString(T.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,b0))),128)),ke.value.length>0?(e.openBlock(),e.createElementBlock("li",w0)):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:ie=>A(T.key)},e.toDisplayString(T.label),9,x0))),128))])],64)):V.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=T=>V.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(V.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,E0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",S0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,T=>(e.openBlock(),e.createElementBlock("li",{key:T.key,class:"dss-filter-popup-item",onClick:ie=>A(T.key)},e.toDisplayString(T.label),9,V0))),128)),Te.value.length===0?(e.openBlock(),e.createElementBlock("li",N0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=T=>_e.value=T),placeholder:e.unref(N)("filter.searchAttributes")},null,8,B0),[[e.vModelText,_e.value]]),e.createElementVNode("ul",M0,[(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:ie=>A(T.key)},e.toDisplayString(T.label),9,_0))),128)),at.value.length===0?(e.openBlock(),e.createElementBlock("li",$0,e.toDisplayString(e.unref(N)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),he.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Pe},e.toDisplayString(e.unref(N)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),A0={class:"dss-pill-field__pills"},D0=["data-value"],H0=["disabled"],R0={class:"dss-pill-field__pill-text"},F0={key:0,class:"dss-pill-field__pill-actions"},I0=["onClick"],z0=["onClick"],P0=["placeholder","disabled"],O0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(S,{emit:ee}){const L=S,N=ee,ue=e.ref(""),O=e.ref([...L.modelValue]),H=e.ref(null);let me=null;const ot=e.ref(null),ne=e.ref(""),f=e.ref(null),be=e.ref(null),he=e.computed(()=>{if(!be.value)return;const{width:ye,height:Ue}=be.value;return{minWidth:`${ye}px`,height:`${Ue}px`}});function oe(ye,Ue){ot.value===Ue&&(f.value=ye)}function j(){ot.value=null,ne.value="",be.value=null,f.value=null}const fe=e.computed(()=>new Set(O.value.map(ye=>ye.trim()).filter(Boolean)));function _e(ye){H.value=ye,me&&clearTimeout(me),me=setTimeout(()=>{H.value=null,me=null},900)}function V(ye){const Ue=ye.trim();return Ue?fe.value.has(Ue)?(_e(Ue),!1):(O.value=[...O.value,Ue],N("update:modelValue",[...O.value]),!0):!1}function $e(ye){const Ue=ye.split(/\r?\n/g).map(ge=>ge.trim()).filter(Boolean);if(!Ue.length)return;const ke=new Set(O.value.map(ge=>ge.trim()).filter(Boolean)),Te=[...O.value];let at=null;for(const ge of Ue){if(ke.has(ge)){at??=ge;continue}ke.add(ge),Te.push(ge)}Te.length!==O.value.length&&(O.value=Te,N("update:modelValue",[...O.value])),at&&_e(at)}function lt(ye){L.disabled||(ot.value===ye&&j(),O.value=O.value.filter((Ue,ke)=>ke!==ye),N("update:modelValue",[...O.value]))}async function rt(ye,Ue){if(L.disabled)return;const ke=Ue.currentTarget.closest(".dss-pill-field__pill");ke&&(be.value={width:ke.offsetWidth,height:ke.offsetHeight}),ot.value=ye,ne.value=O.value[ye]??"",await e.nextTick();const Te=f.value;if(!Te)return;Te.focus();const at=Te.value.length;Te.setSelectionRange(at,at)}function Qe(){j()}function Z(){if(L.disabled||ot.value===null)return;const ye=ot.value,Ue=O.value[ye]??"",ke=ne.value.trim();if(j(),ke!==Ue&&fe.value.has(ke)){_e(ke);return}if(!ke){O.value=O.value.filter((at,ge)=>ge!==ye),N("update:modelValue",[...O.value]);return}const Te=O.value.map((at,ge)=>ge===ye?ke:at);O.value=Te,N("update:modelValue",[...O.value])}function qe(ye){ye.preventDefault(),!L.disabled&&(V(ue.value),ue.value="")}function ze(ye){if(L.disabled)return;const Ue=ye.clipboardData?.getData("text")??"";!Ue.includes(`
|
|
120
|
+
`)&&!Ue.includes("\r")||(ye.preventDefault(),$e(Ue),ue.value="")}return e.watch(()=>L.modelValue,ye=>{O.value=Array.isArray(ye)?[...ye]:[]},{deep:!0}),e.onBeforeUnmount(()=>{me&&clearTimeout(me)}),(ye,Ue)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":ye.disabled}])},[e.createElementVNode("div",A0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,(ke,Te)=>(e.openBlock(),e.createElementBlock("span",{key:ke,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":H.value===ke,"dss-pill-field__pill--editing":ot.value===Te}]),style:e.normalizeStyle(ot.value===Te&&be.value?he.value:void 0)},[ot.value===Te?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-pill-field__pill-edit-wrap","data-value":ne.value||" "},[e.withDirectives(e.createElementVNode("input",{ref_for:!0,ref:at=>oe(at,Te),"onUpdate:modelValue":Ue[0]||(Ue[0]=at=>ne.value=at),class:"dss-pill-field__pill-edit",type:"text",disabled:ye.disabled,onKeydown:[e.withKeys(Z,["enter"]),e.withKeys(Qe,["esc"])],onBlur:Z},null,40,H0),[[e.vModelText,ne.value]])],8,D0)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",R0,e.toDisplayString(ke),1),ye.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",F0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:at=>rt(Te,at)},[...Ue[2]||(Ue[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,I0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:at=>lt(Te)}," × ",8,z0)]))],64))],6))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ue[1]||(Ue[1]=ke=>ue.value=ke),class:"dss-pill-field__input",type:"text",placeholder:O.value.length?"":ye.placeholder,disabled:ye.disabled,onPaste:ze,onKeydown:e.withKeys(qe,["enter"])},null,40,P0),[[e.vModelText,ue.value]])])],2))}}),W0={key:0,class:"dss-title dss-title--separator"},q0={__name:"DSSTitle",props:{type:{type:String,default:"main",validator:S=>["main","separator","subtitle"].includes(S)},h:{type:Number,default:null,validator:S=>S===null||Number.isInteger(S)&&S>=1&&S<=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(S,{expose:ee,emit:L}){const N=S,ue=L,O=e.ref(null),H=e.computed(()=>`dss-title--${N.type}`),me=e.computed(()=>N.h!=null?`dss-title--h${N.h}`:null),ot={main:"div",subtitle:"p",separator:"span"},ne=e.computed(()=>N.h!=null?`h${N.h}`:ot[N.type]??"div"),f=e.computed(()=>N.editable?"plaintext-only":void 0),be=e.computed(()=>{const V={};return N.size!=null&&(V.fontSize=typeof N.size=="number"?`${N.size}px`:N.size),N.weight!=null&&(V.fontWeight=N.weight),N.color!=null&&(V.color=N.color),Object.keys(V).length?V:void 0}),he=e.computed(()=>N.editable?{input:j,keydown:fe,paste:_e}:{}),oe=()=>{const V=O.value;!N.editable||!V||document.activeElement!==V&&(V.innerText=N.modelValue??"")},j=V=>{const $e=V.target.innerText;ue("update:modelValue",$e),ue("change",$e)},fe=V=>{V.key==="Enter"&&V.preventDefault()},_e=V=>{V.preventDefault();const $e=(V.clipboardData||window.clipboardData).getData("text/plain");document.execCommand("insertText",!1,$e)};return e.watch(()=>N.modelValue,()=>{oe()}),e.watch(()=>N.editable,()=>{e.nextTick(oe)}),e.onMounted(()=>{e.nextTick(oe)}),ee({focus:()=>O.value?.focus()}),(V,$e)=>S.type==="separator"?(e.openBlock(),e.createElementBlock("div",W0,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ne.value),e.mergeProps({ref_key:"titleRef",ref:O,class:["dss-title__separator-label",me.value,{"dss-title--editable":S.editable}],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(he.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(V.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))])):(e.openBlock(),e.createBlock(e.resolveDynamicComponent(ne.value),e.mergeProps({key:1,ref_key:"titleRef",ref:O,class:["dss-title",[H.value,me.value,{"dss-title--editable":S.editable}]],style:be.value,contenteditable:f.value,spellcheck:S.editable?!1:void 0},e.toHandlers(he.value)),{default:e.withCtx(()=>[S.editable?e.createCommentVNode("",!0):e.renderSlot(V.$slots,"default",{key:0},()=>[e.createTextVNode(e.toDisplayString(S.modelValue),1)])]),_:3},16,["class","style","contenteditable","spellcheck"]))}},Z0={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"}},U0={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"},X0={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"}},Y0={selectDate:"Select Date",selectRange:"Select range",selectFromList:"Select a date",noAvailableDates:"No dates available",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},j0={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},ro={chart:Z0,table:U0,filter:X0,datepicker:Y0,textEditor:j0},K0={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"}},G0={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"},Q0={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"}},J0={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",selectFromList:"Sélectionner une date",noAvailableDates:"Aucune date disponible",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},e9={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},io={chart:K0,table:G0,filter:Q0,datepicker:J0,textEditor:e9},t9={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},l9={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},n9={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"}},o9={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",selectFromList:"Selecteer een datum",noAvailableDates:"Geen datums beschikbaar",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},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"}},co={chart:t9,table:l9,filter:n9,datepicker:o9,textEditor:a9},Po={en:ro,fr:io,nl:co};function Aa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Po).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Po[L])})}const Oo={en:{textEditor:ro.textEditor},fr:{textEditor:io.textEditor},nl:{textEditor:co.textEditor}};function Da(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Oo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Oo[L])})}const Wo={en:{table:ro.table},fr:{table:io.table},nl:{table:co.table}};function Ha(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Wo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Wo[L])})}const qo={en:{datepicker:ro.datepicker},fr:{datepicker:io.datepicker},nl:{datepicker:co.datepicker}};function Ra(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(qo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,qo[L])})}const Zo={en:{filter:ro.filter},fr:{filter:io.filter},nl:{filter:co.filter}};function Fa(S){if(!S||!S.global)return;const ee=S.global.availableLocales||[];Object.keys(Zo).forEach(L=>{ee.includes(L)&&S.global.mergeLocaleMessage(L,Zo[L])})}const s9={chart:Po,textEditor:Oo,table:Wo,datepicker:qo,filter:Zo};function r9(S){!S||!S.global||(Aa(S),Da(S),Ha(S),Ra(S),Fa(S))}const i9={en:{...ro},fr:{...io},nl:{...co}};so.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:i9});exports.DSSChart=uu;exports.DSSChartMessages=Po;exports.DSSColorPicker=Q2;exports.DSSConfetti=Vp;exports.DSSDatepicker=pa;exports.DSSDatepickerMessages=qo;exports.DSSDnd=Ep;exports.DSSFilter=T0;exports.DSSFilterMessages=Zo;exports.DSSLoader=dp;exports.DSSMessages=s9;exports.DSSModal=ma;exports.DSSPillField=O0;exports.DSSSkeleton=mp;exports.DSSStepBar=Ta;exports.DSSTable=Ld;exports.DSSTableMessages=Wo;exports.DSSTextEditor=H2;exports.DSSTextEditorMessages=Oo;exports.DSSTitle=q0;exports.addDSSChartTranslations=Aa;exports.addDSSDatepickerTranslations=Ra;exports.addDSSFilterTranslations=Fa;exports.addDSSTableTranslations=Ha;exports.addDSSTextEditorTranslations=Da;exports.addDSSTranslations=r9;
|