dsp-semactic 0.6.27 → 0.6.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),to=require("vue-i18n"),na={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},la=["value"],oa=["placeholder","value","disabled"],aa=["placeholder","value"],sa={key:0,class:"dss-datepicker__double-wrap"},ra={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ia=["onClick"],ca={class:"dss-datepicker__double-calendars"},ua={class:"dss-datepicker__double-calendar"},da={class:"dss-datepicker__calendar-header"},ma=["aria-label"],pa={class:"dss-datepicker__month-year-row"},va=["aria-label"],fa={class:"dss-datepicker__weekdays"},ga={class:"dss-datepicker__grid"},ha=["disabled","onClick","onMouseenter"],ya={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ca={class:"dss-datepicker__double-calendar"},ka={class:"dss-datepicker__calendar-header"},ba=["aria-label"],wa={class:"dss-datepicker__month-year-row"},xa=["aria-label"],Ea={class:"dss-datepicker__weekdays"},Va={class:"dss-datepicker__grid"},Na=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ba={class:"dss-datepicker__calendar-header"},Ma=["aria-label"],_a={class:"dss-datepicker__month-year-row"},$a=["aria-label"],Ta={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ha=["disabled","onClick","onMouseenter"],Aa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Da={class:"dss-datepicker__calendar-header"},Ra={class:"dss-datepicker__month-year-row"},Fa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ia={class:"dss-datepicker__months-grid"},za=["onClick"],Pa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Oa={class:"dss-datepicker__month-year"},Za={class:"dss-datepicker__years-grid"},Wa=["data-year","onClick"],Uo=27,Oo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:R=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(R)},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}},emits:["update:modelValue"],setup(R,{emit:be}){const I=R,D=be,{t:Ve,locale:b}=to.useI18n(),Ne=e.ref(!1),ce=e.ref("days"),gt=new Date,v=e.computed(()=>I.minDate instanceof Date?I.minDate:gt),de=e.ref(v.value.getMonth()),ke=e.ref(v.value.getFullYear()),Ce=e.ref(v.value.getMonth()),se=e.ref(v.value.getFullYear()),te=e.ref(v.value.getMonth()),ae=e.ref(v.value.getFullYear()),A=e.ref("start"),xe=e.ref(null),De=e.ref(null);function qe(){const H=v.value,W=H.getMonth(),F=H.getFullYear(),re=W===11?0:W+1,Be=W===11?F+1:F;return{left:{month:W,year:F},right:{month:re,year:Be}}}const mt=e.ref(null),O=e.ref(null),Le=e.ref(null),_t=e.ref(null),Xe=e.ref(null),Rt=e.ref(null),He=new Date().getFullYear(),Ue=e.computed(()=>["single","singleFromAvailable"].includes(I.mode)),wt=e.computed(()=>["range","rangeFromAvailable"].includes(I.mode)),Ze=e.computed(()=>{if(I.mode!=="single"&&I.mode!=="singleFromAvailable")return null;const H=I.modelValue;return H instanceof Date?H:null}),$t=e.computed(()=>{if(!wt.value)return{start:null,end:null};const H=I.modelValue;return!H||typeof H!="object"?{start:null,end:null}:{start:H.start instanceof Date?H.start:null,end:H.end instanceof Date?H.end:null}});function st(H){if(!H||!(H instanceof Date))return"";const W=H.getDate(),F=H.getMonth()+1,re=H.getFullYear(),Be=ot=>String(ot).padStart(2,"0");return`${Be(W)}/${Be(F)}/${re}`}const kt=e.computed(()=>st(Ze.value)),un=e.computed(()=>{const{start:H,end:W}=$t.value;if(!H&&!W)return"";const F=!W||H&&H<=W?H:W,re=!H||W&&W>=H?W:H;return q(F,re)?st(F):`${st(F)} - ${st(re)}`}),Tt=e.computed(()=>{if(I.mode!=="readonly")return"—";const H=I.modelValue;if(H instanceof Date)return st(H)||"—";if(H&&typeof H=="object"&&("start"in H||"end"in H)){const W=H.start instanceof Date?H.start:null,F=H.end instanceof Date?H.end:null;if(!W&&!F)return"—";const re=!F||W&&W<=F?W:F,Be=!W||F&&F>=W?F:W;return q(re,Be)?st(re):`${st(re)} - ${st(Be)}`}return"—"});e.computed(()=>{const H=new Date(ke.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(H)});const Ge=e.computed(()=>De.value==="left"?Ce.value:De.value==="right"?te.value:de.value),Ke=e.computed(()=>De.value==="left"?se.value:De.value==="right"?ae.value:ke.value),Lt=e.computed(()=>{const H=new Date(ke.value,de.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(H)}),Ht=e.computed(()=>{const H=new Date(Ke.value,Ge.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(H)}),qt=e.computed(()=>{const H=new Intl.DateTimeFormat(b.value,{month:"short"});return Array.from({length:12},(W,F)=>H.format(new Date(2024,F,1)))}),pt=e.computed(()=>{const W=(De.value?Ke.value:ke.value)-Math.floor(Uo/2);return Array.from({length:Uo},(F,re)=>W+re)}),St=e.computed(()=>{const H=pt.value;return H.length?`${H[0]} – ${H[H.length-1]}`:""}),xt=e.computed(()=>{const H=new Intl.DateTimeFormat(b.value,{weekday:"short"}),W=new Date(2024,0,1),F=[];for(let re=0;re<7;re++){const Be=new Date(W);Be.setDate(W.getDate()+re),F.push(H.format(Be).slice(0,2))}return F});function Bt(H,W){const F=new Date(H,W,1),re=new Date(H,W+1,0),Be=F.getDay(),ot=re.getDate(),lt=[];for(let Pe=0;Pe<Be;Pe++)lt.push(null);for(let Pe=1;Pe<=ot;Pe++)lt.push(new Date(H,W,Pe));return lt}const jt=e.computed(()=>Bt(ke.value,de.value)),Q=e.computed(()=>Bt(se.value,Ce.value)),pe=e.computed(()=>Bt(ae.value,te.value));e.computed(()=>{const H=new Date(se.value,Ce.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(H)}),e.computed(()=>{const H=new Date(ae.value,te.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(H)});const ge=e.computed(()=>{const H=new Date(se.value,Ce.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(H)}),_e=e.computed(()=>{const H=new Date(ae.value,te.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(H)}),it=e.computed(()=>I.availableDates&&I.availableDates.length>0),ze=e.computed(()=>it.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"}]),Qe=e.ref({top:0,left:0});function me(){if(!_t.value||!Ne.value)return;const H=_t.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,F=window.innerHeight||document.documentElement.clientHeight;let re=H.left,Be=H.bottom+4;const ot=Xe.value;if(ot){const lt=ot.offsetWidth,Pe=ot.offsetHeight;if(re+lt>W-8&&(re=H.right-lt,re<8&&(re=8)),Be+Pe>F-8){const rt=H.top-4-Pe;rt>=8?Be=rt:Be=Math.max(8,F-Pe-8)}}Qe.value={top:Be,left:re}}const Je=e.computed(()=>!_t.value||!Ne.value?{}:{position:"fixed",left:`${Qe.value.left}px`,top:`${Qe.value.top}px`,zIndex:1002});function q(H,W){return!H||!W?!1:H.getFullYear()===W.getFullYear()&&H.getMonth()===W.getMonth()&&H.getDate()===W.getDate()}function Z(H){return new Date(H.getFullYear(),H.getMonth(),H.getDate()).getTime()}function K(H){return!I.availableDates||!I.availableDates.length?!0:I.availableDates.some(W=>W instanceof Date&&q(W,H))}function ne(H){const W=Z(H);return!(I.minDate instanceof Date&&W<Z(I.minDate)||I.maxDate instanceof Date&&W>Z(I.maxDate))}function x(H){return!I.exceptDates||!I.exceptDates.length?!1:I.exceptDates.some(W=>W instanceof Date&&q(W,H))}function k(H){return x(H)?!1:["singleFromAvailable","rangeFromAvailable"].includes(I.mode)?K(H):ne(H)}function V(H){const W=Ze.value,F=$t.value,re=Z(H),Be=wt.value&&F.start&&F.end&&re>Z(F.start)&&re<Z(F.end),ot=wt.value&&F.start&&q(H,F.start),lt=wt.value&&F.end&&q(H,F.end),Pe=ot&&lt,rt=Ue.value&&W&&q(H,W)||ot||lt;let pn=!1;if(wt.value&&F.start&&!F.end&&xe.value){const on=Z(F.start),bn=Z(xe.value),Vn=Math.min(on,bn),Nn=Math.max(on,bn);pn=re>Vn&&re<Nn}return{"dss-datepicker__day--selected":rt&&!Pe,"dss-datepicker__day--range-start":ot&&!Pe,"dss-datepicker__day--range-end":lt&&!Pe,"dss-datepicker__day--range-single":Pe,"dss-datepicker__day--in-range":Be&&!ot&&!lt,"dss-datepicker__day--in-range-preview":pn&&!ot&&!lt&&!Be,"dss-datepicker__day--disabled":!k(H)}}function P(H){if(!wt.value)return;const W=$t.value;if(!W.start||W.end){xe.value=null;return}if(!k(H)){xe.value=null;return}xe.value=new Date(H.getFullYear(),H.getMonth(),H.getDate())}function U(){xe.value=null}function Re(){if(!I.doubleCalendar||!wt.value)return;const H=$t.value,{start:W,end:F}=H;if(W&&F){const ot=W<=F?W:F,lt=W<=F?F:W,Pe=ot.getMonth(),rt=ot.getFullYear(),pn=lt.getMonth(),on=lt.getFullYear();if(Pe!==pn||rt!==on){const bn=Ce.value===Pe&&se.value===rt,Vn=te.value===pn&&ae.value===on;if(bn&&Vn)return;Ce.value=Pe,se.value=rt,te.value=pn,ae.value=on}else{const bn=Pe===0?11:Pe-1,Vn=Pe===0?rt-1:rt;Ce.value===bn&&se.value===Vn&&te.value===Pe&&ae.value===rt||(Ce.value=Pe,se.value=rt,Pe===11?(te.value=0,ae.value=rt+1):(te.value=Pe+1,ae.value=rt))}return}const re=W||F;if(re){const ot=re.getMonth(),lt=re.getFullYear(),Pe=Ce.value===ot&&se.value===lt,rt=te.value===ot&&ae.value===lt;if(Pe||rt)return;Ce.value=ot,se.value=lt,ot===11?(te.value=0,ae.value=lt+1):(te.value=ot+1,ae.value=lt);return}const Be=qe();Ce.value=Be.left.month,se.value=Be.left.year,te.value=Be.right.month,ae.value=Be.right.year}function Ye(H="start"){if(I.mode==="readonly")return;A.value=H;const W=Ze.value,F=$t.value;if(Ue.value&&W)de.value=W.getMonth(),ke.value=W.getFullYear();else if(wt.value)if(I.doubleCalendar)Re();else{const re=H==="start"&&F.start?F.start:F.end||F.start;re&&(de.value=re.getMonth(),ke.value=re.getFullYear())}_t.value=Ue.value?mt.value?.closest(".dss-datepicker__input-wrap"):O.value,ce.value="days",De.value=null,Ne.value=!0,e.nextTick(()=>{me()})}function Se(){ce.value="days",De.value=null,xe.value=null,Ne.value=!1}function le(H,W){De.value=H,ce.value=W}function nt(){ce.value="days",De.value=null}function tt(H){const W=new Date,F=W.getFullYear(),re=W.getMonth(),Be=W.getDate();let ot,lt;if(it.value){const Pe=[...I.availableDates].filter(rt=>rt instanceof Date).map(rt=>new Date(rt.getFullYear(),rt.getMonth(),rt.getDate()));if(Pe.sort((rt,pn)=>rt.getTime()-pn.getTime()),Pe.length===0)return;if(H==="all")ot=Pe[0],lt=Pe[Pe.length-1];else{const rt=parseInt(H.replace("last",""),10);if(rt<2||rt>5)return;const pn=Pe.slice(-rt);ot=pn[0],lt=pn[pn.length-1]}}else{const Pe=new Date(F,re,Be);switch(H){case"today":ot=Pe,lt=Pe;break;case"lastWeek":ot=new Date(F,re,Be-6),lt=Pe;break;case"last15Days":ot=new Date(F,re,Be-14),lt=Pe;break;case"last30Days":ot=new Date(F,re,Be-29),lt=Pe;break;case"thisMonth":ot=new Date(F,re,1),lt=Pe;break;case"last3Months":ot=new Date(F,re-3,1),lt=new Date(F,re,0);break;case"last6Months":ot=new Date(F,re-6,1),lt=new Date(F,re,0);break;case"last12Months":ot=new Date(F,re-12,1),lt=new Date(F,re,0);break;case"lastYear":ot=new Date(F-1,0,1),lt=new Date(F-1,11,31);break;default:return}}D("update:modelValue",{start:ot,end:lt}),Re()}function Ct(H){De.value==="left"?Ce.value=H:De.value==="right"?te.value=H:de.value=H,nt()}function yt(H){De.value==="left"?se.value=H:De.value==="right"?ae.value=H:ke.value=H,nt()}function je(){de.value===0?(de.value=11,ke.value--):de.value--}function fn(){de.value===11?(de.value=0,ke.value++):de.value++}function jn(){Ce.value===0?(Ce.value=11,se.value--):Ce.value--}function Dn(){Ce.value===11?(Ce.value=0,se.value++):Ce.value++}function Ft(){te.value===0?(te.value=11,ae.value--):te.value--}function Wn(){te.value===11?(te.value=0,ae.value++):te.value++}function dn(H){if(!k(H))return;const W=new Date(H.getFullYear(),H.getMonth(),H.getDate());if(Ue.value){D("update:modelValue",W),Se();return}const F=$t.value;if(!F.start&&!F.end){D("update:modelValue",{start:W,end:null}),A.value="end";return}if(F.start&&F.end){D("update:modelValue",{start:W,end:null}),A.value="end";return}if(A.value==="start"){let re=W,Be=F.end;re&&Be&&re>Be&&([re,Be]=[Be,re]),D("update:modelValue",{start:re||Be,end:Be||re}),A.value="end"}else{let re=F.start,Be=W;re&&Be&&Be<re&&([re,Be]=[Be,re]),D("update:modelValue",{start:re||Be,end:Be||re}),A.value="start"}}e.watch($t,()=>{I.doubleCalendar&&wt.value&&Ne.value&&Re()},{deep:!0});let En=null,mn=null,Rn=null;function gn(){En&&(document.removeEventListener("keydown",En),En=null),mn&&(window.removeEventListener("resize",mn),mn=null),Rn&&(window.removeEventListener("scroll",Rn,!0),Rn=null)}return e.watch(ce,H=>{H==="years"&&e.nextTick(()=>{Rt.value?.querySelector(`[data-year="${Ke.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Ne,H=>{gn(),H&&(En=W=>{W.key==="Escape"&&(ce.value==="years"||ce.value==="months"?nt():Se())},mn=()=>{me()},Rn=()=>{me()},document.addEventListener("keydown",En),window.addEventListener("resize",mn),window.addEventListener("scroll",Rn,!0))}),e.onBeforeUnmount(()=>{gn()}),(H,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":R.mode==="readonly"}])},[R.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",na,[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:Tt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,la)])):Ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=F=>Ye("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:mt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ve)("datepicker.selectDate"),value:kt.value,readonly:"",disabled:R.mode==="readonly"},null,8,oa)])):wt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:O,onClick:W[1]||(W[1]=F=>Ye("start"))},[W[12]||(W[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:Le,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Ve)("datepicker.selectRange"),value:un.value,readonly:""},null,8,aa)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ne.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Se,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Xe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":R.doubleCalendar&&wt.value&&ce.value==="days","dss-datepicker__dropdown--quick-select":R.doubleCalendar&&wt.value&&ce.value==="days"&&R.quickSelect}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Je.value)},[ce.value==="days"&&R.doubleCalendar&&wt.value?(e.openBlock(),e.createElementBlock("div",sa,[R.quickSelect?(e.openBlock(),e.createElementBlock("nav",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ze.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:re=>tt(F.id)},e.toDisplayString(e.unref(Ve)(F.labelKey)),9,ia))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ca,[e.createElementVNode("div",ua,[e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.prevMonth"),onClick:jn}," ‹ ",8,ma),e.createElementVNode("div",pa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=F=>le("left","months"))},e.toDisplayString(ge.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=F=>le("left","years"))},e.toDisplayString(se.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.nextMonth"),onClick:Dn}," › ",8,va)]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(F,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+re},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Be=>dn(F),onMouseenter:Be=>P(F),onMouseleave:U},e.toDisplayString(F.getDate()),43,ha)):(e.openBlock(),e.createElementBlock("span",ya))],64))),128))])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.prevMonth"),onClick:Ft}," ‹ ",8,ba),e.createElementVNode("div",wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=F=>le("right","months"))},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=F=>le("right","years"))},e.toDisplayString(ae.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.nextMonth"),onClick:Wn}," › ",8,xa)]),e.createElementVNode("div",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(F,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+re},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Be=>dn(F),onMouseenter:Be=>P(F),onMouseleave:U},e.toDisplayString(F.getDate()),43,Na)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])])])])):ce.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.prevMonth"),onClick:je}," ‹ ",8,Ma),e.createElementVNode("div",_a,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=F=>ce.value="months")},e.toDisplayString(Lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=F=>ce.value="years")},e.toDisplayString(ke.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Ve)("datepicker.nextMonth"),onClick:fn}," › ",8,$a)]),e.createElementVNode("div",Ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,(F,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:re},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Be=>dn(F),onMouseenter:Be=>P(F),onMouseleave:U},e.toDisplayString(F.getDate()),43,Ha)):(e.openBlock(),e.createElementBlock("span",Aa))],64))),128))])],64)):ce.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Da,[e.createElementVNode("div",Ra,[e.createElementVNode("span",Fa,e.toDisplayString(Ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=F=>ce.value="years")},e.toDisplayString(Ke.value),1)])]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,(F,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":re===Ge.value}]),onClick:Be=>Ct(re)},e.toDisplayString(F),11,za))),128))])],64)):ce.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Pa,[e.createElementVNode("span",Oa,e.toDisplayString(St.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Rt},[e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":F===Ke.value,"dss-datepicker__year-cell--current":F===e.unref(He)}]),"data-year":F,onClick:re=>yt(F)},e.toDisplayString(F),11,Wa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},qa=["data-chart-type"],Ua={class:"dss-chart-header-titles"},Xa={key:0,class:"dss-chart-title"},Ya={key:1,class:"dss-chart-subtitle"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["onClick","onMouseenter"],Qa={class:"dss-legend-text"},Ja=["title"],es=["src"],ts={class:"dss-chart-area-wrapper"},ns={key:0,class:"dss-chart-z-axis-label"},ls=["width","height","data-smooth","data-animated"],os=["id"],as=["y","width","height"],ss=["id"],rs=["d"],is=["id"],cs=["d"],us={key:0},ds=["clip-path"],ms=["x1","x2","y1","y2"],ps={class:"dss-axes"},vs=["x1","x2","y1","y2"],fs=["x1","x2","y1","y2"],gs={class:"dss-axis-labels"},hs=["x","y"],ys=["x","y"],Cs=["x","y"],ks=["y","transform"],bs={key:1,class:"dss-flag-markers"},ws=["clip-path"],xs=["x1","x2","y1","y2","onMouseover"],Es=["x1","x2","y1","y2","onMouseover"],Vs=["x1","x2","y1","y2","onMouseover"],Ns=["cx","cy","onMouseover"],Ss=["cx","cy","fill","onMouseover"],Bs=["x","y"],Ms=["clip-path"],_s={key:0},$s=["d","onMouseover"],Ts=["x","y","width","height","fill","onMouseover"],Ls={class:"dss-line-chart"},Hs=["d","stroke","stroke-width"],As=["d","stroke","stroke-width","opacity"],Ds=["cx","cy","r","fill","onMouseover"],Rs={key:1},Fs=["d","stroke","stroke-width"],Is=["d","stroke","stroke-width"],zs=["d","stroke","stroke-width","opacity"],Ps=["cx","cy","r","fill","onMouseover"],Os={key:2},Zs=["id"],Ws=["x","y","width","height"],qs=["d","fill","fill-opacity","mask"],Us=["d","stroke","stroke-width"],Xs=["d","fill","onMouseover"],Ys=["x","y","width","height","onMouseover"],js=["clip-path"],Ks=["x1","x2","y1","y2","stroke"],Gs=["cx","cy","r","fill"],Qs={key:1,class:"dss-bubble-chart"},Js={key:0,class:"dss-bubble-group"},er=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],tr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],nr=["transform"],lr=["cx","cy","r"],or=["data-chart-type","clip-path"],ar=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],sr={key:1,class:"dss-radial-segment-data-labels"},rr=["x","y"],ir=["x","y","font-size","fill"],cr=["x1","y1","x2","y2","stroke"],ur=["x1","y1","x2","y2","stroke"],dr=["x","y","text-anchor","font-size"],mr=["transform"],pr={key:0,class:"dss-spider-grid"},vr=["cx","cy","r"],fr={class:"dss-spider-grid-labels"},gr=["x","y"],hr=["x","y"],yr=["x1","x2","y1","y2"],Cr={class:"dss-spider-labels"},kr=["x","y","text-anchor","dominant-baseline"],br=["points","fill","fill-opacity","stroke","stroke-width"],wr=["cx","cy","r","fill","onMouseover"],xr={class:"dss-chart-logos"},Er=["cx","cy","r","fill"],Vr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Nr=["onClick","onMouseenter"],Sr=["src"],Br={class:"dss-marker-tooltip-category"},Mr={key:0,class:"dss-marker-tooltip-description"},_r={key:0,class:"dss-tooltip-section"},$r={key:0,class:"dss-tooltip-title"},Tr={class:"dss-tooltip-series-name"},Lr={class:"dss-tooltip-series-value"},Hr={key:1,class:"dss-tooltip-section"},Ar={key:0,class:"dss-tooltip-title"},Dr={class:"dss-bubble-tooltip-data"},Rr={key:2,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-title"},Ir={class:"dss-tooltip-value"},zr={key:0,class:"dss-tooltip-section"},Pr={class:"dss-tooltip-section-title"},Or={class:"dss-tooltip-group-header"},Zr={class:"dss-tooltip-item-content"},Wr={class:"dss-tooltip-item-text"},qr={key:1,class:"dss-tooltip-section"},Ur={class:"dss-tooltip-section-title"},Xr={class:"dss-tooltip-item-content"},Yr={class:"dss-tooltip-item-title"},jr={key:0,class:"dss-tooltip-item-description"},Kr={class:"dss-tooltip-section"},Gr={class:"dss-tooltip-title"},Qr={key:0,class:"dss-bubble-tooltip-data"},Jr={class:"dss-tooltip-series-name"},ei={class:"dss-tooltip-series-value"},ti={key:0,class:"dss-tooltip-section"},ni={class:"dss-tooltip-section-title"},li={class:"dss-tooltip-group-header"},oi={class:"dss-tooltip-item-content"},ai={class:"dss-tooltip-item-text"},si={key:1,class:"dss-tooltip-section"},ri={class:"dss-tooltip-section-title"},ii={class:"dss-tooltip-item-content"},ci={class:"dss-tooltip-item-title"},ui={key:0,class:"dss-tooltip-item-description"},di=["onClick","onMouseenter"],mi={class:"dss-legend-text"},pi={key:1,class:"dss-context-menu-separator"},vi={key:0,class:"dss-context-menu-separator"},fi={key:0,class:"dss-context-menu-separator"},gi=["onClick"],hi=["innerHTML"],yi={key:0,class:"dss-context-menu-icon"},Ci={class:"dss-marker-modal-header"},ki={class:"dss-marker-modal-body"},bi={class:"dss-form-group"},wi={class:"dss-form-group"},xi={for:"dss-marker-description"},Ei={key:0,class:"dss-form-text-display"},Vi=["placeholder"],Ni={class:"dss-marker-modal-footer"},Si={class:"modal-footer-left"},Bi={class:"dss-modal-footer-right"},Mi=["disabled"],_i={name:"DSSChart"},$i=Object.assign(_i,{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:R=>typeof R=="object"&&R!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(R,{emit:be}){const{t:I,locale:D}=to.useI18n(),Ve=be,b=e.ref(null),Ne=e.ref(null),ce=e.ref(null),gt=e.ref(0),v=e.ref(0);let de=null,ke=null;const Ce=20,se=e.computed(()=>{if(v.value,gt.value,!b.value||!Ne.value)return 0;try{const t=b.value.getBoundingClientRect();return Ne.value.getBoundingClientRect().top-t.top}catch{return 0}}),te=e.computed(()=>`chart-clip-${A.chartId}`),ae=e.computed(()=>`url(#${te.value})`),A=R,xe={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}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function De(t,s){const n=Object.assign({},t);return mt(t)&&mt(s)&&Object.keys(s).forEach(i=>{mt(s[i])?i in t?n[i]=De(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const qe=()=>{let t=20,s=0,n=0;if(st.value&&(t+=30),kt.value&&(t+=25),St.value&&A.series.length>0){const i=A.series.filter((p,g)=>!ut.value.has(g)).length;if(xt.value==="top"||xt.value==="bottom"){if(Bt.value==="horizontal"){const g=Math.floor(Xe.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>De(xe,A.options)),Le=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),_t=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Xe=e.computed(()=>{const t=O.value;return Le.value?gt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Rt=e.ref(Ce),He=e.computed(()=>{if(_t.value){const t=He.value;return t??Math.max(0,(v.value||400)-Rt.value*5)}}),Ue=e.computed(()=>{const t=O.value;if(_t.value){const s=He.value;return s??Math.max(0,(v.value||400)-Rt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),wt=e.computed(()=>{if(_t.value&&Ze.value==="semi-radial"&&He.value!=null)return Rt.value+Ue.value+"px";if(_t.value)return"100%";if(cn.value)return Rt.value+Ue.value+"px";if(St.value&&xt.value==="bottom"){const t=qe();return Ue.value+(t.legendHeight||35)+"px"}return Ue.value+(St.value?20:0)+"px"}),Ze=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),$t=e.computed(()=>{const t=A.series.map(s=>s.type||Ze.value);return new Set(t).size>1}),st=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),kt=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),un=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Tt=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ge=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),Ke=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.min;return typeof s=="number"||s===nl?s:nl}),Lt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.max;return typeof s=="number"||s===nl?s:nl}),Ht=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),qt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),pt=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),St=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),xt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Bt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),jt=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Q=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),pe=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),ge=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),_e=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),it=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),ze=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Qe=e.computed(()=>{if(!cn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),me=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Je=e.computed(()=>{const{maxX:t}=Pt.value;return t===0}),q=(t,s)=>Je.value&&s===0?5:s,Z=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},K=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ne=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),x=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),k=e.computed(()=>{const t=O.value;return ne.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),U=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Re=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Ye=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Se=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),le=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),nt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),tt=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ct=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),yt=e.computed(()=>O.value?.spider?.gridSteps||5),je=e.computed(()=>{const t=[],s=yt.value;for(let n=1;n<=s;n++)t.push(ht.value/s*n);return t}),fn=t=>{const s=jn.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=je.value[t];return Math.round(n/ht.value*100)+"%"},jn=e.computed(()=>O.value?.spider?.gridLabels||null),Dn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ft=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Wn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),dn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:bn.value}),En=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),mn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Rn=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),gn=t=>{const s=Rn.value;if(t==null)return"";const n=String(t);return s?n+s:n},H=e.computed(()=>!j.value.isZooming);e.computed(()=>At.value.map(t=>{if(t.categoryIndex!==void 0&&(rn.value||Ut.value)){const s=Xt(t.categoryIndex),n=se.value+z.value.bottom-mn.value/2;return{...t,x:s,y:n}}return t}));function W(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,w]=t.split("-"),T=Number(w?.length===2?`20${w}`:w);n=new Date(T,Number(E)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,E)=>{const[w,T,$]=g.split("-"),L=Number($?.length===2?`20${$}`:$),B=new Date(L,Number(T)-1,Number(w)),G=Math.abs(B-n);G<p&&(p=G,i=E)}),i}const F=e.computed(()=>{const t=A.markers.map(n=>{const i=W(n.marker_date,A.categories),p=Xt(i),g=se.value+z.value.bottom-mn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),s=At.value.map(n=>{if(n.categoryIndex!==void 0&&(rn.value||Ut.value)){const i=Xt(n.categoryIndex),p=se.value+z.value.bottom-mn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),re=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),Be=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ot=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),lt=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Pe=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let s,n;const i=String(ot.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,n=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),n=s*(96/499)}return{width:s,height:n,area:t}}),rt=e.computed(()=>{const{width:t,height:s}=Pe.value,n=lt.value;let i,p;const g=z.value.left,E=z.value.right,w=z.value.top,T=z.value.bottom,$=z.value.width,L=z.value.height;switch(n){case"center":i=g+($-t)/2,p=w+(L-s)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=E-t-15,p=w+5;break;case"bottom-left":i=g+15,p=T-s-5;break;case"bottom-right":default:i=E-t-15,p=T-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),pn=t=>!A.flags||!A.flags.length?[]:A.flags.filter(s=>s.categoryIndex===t),on=t=>{const s=pn(t),n=so(t),i=s.filter(E=>E.manual),p=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:I("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(E=>({text:E.text,color:"#698dbe"}))}),p.length>0&&g.push({type:I("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(E=>({text:E.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(E=>({title:E.title,description:E.description,type:I("chart.tooltip.markers"),color:E.color||"#9784ba"}))}},bn=e.computed(()=>{const t=A.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"),no=require("vue-i18n"),la={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},na=["value"],oa=["placeholder","value","disabled"],aa=["placeholder","value"],sa={key:0,class:"dss-datepicker__double-wrap"},ra={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ia=["onClick"],ca={class:"dss-datepicker__double-calendars"},ua={class:"dss-datepicker__double-calendar"},da={class:"dss-datepicker__calendar-header"},ma=["aria-label"],pa={class:"dss-datepicker__month-year-row"},fa=["aria-label"],va={class:"dss-datepicker__weekdays"},ga={class:"dss-datepicker__grid"},ha=["disabled","onClick","onMouseenter"],ya={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ca={class:"dss-datepicker__double-calendar"},ka={class:"dss-datepicker__calendar-header"},ba=["aria-label"],wa={class:"dss-datepicker__month-year-row"},xa=["aria-label"],Ea={class:"dss-datepicker__weekdays"},Va={class:"dss-datepicker__grid"},Na=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ba={class:"dss-datepicker__calendar-header"},Ma=["aria-label"],_a={class:"dss-datepicker__month-year-row"},$a=["aria-label"],Ta={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ha=["disabled","onClick","onMouseenter"],Da={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Aa={class:"dss-datepicker__calendar-header"},Ra={class:"dss-datepicker__month-year-row"},Fa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ia={class:"dss-datepicker__months-grid"},za=["onClick"],Pa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Oa={class:"dss-datepicker__month-year"},Za={class:"dss-datepicker__years-grid"},Wa=["data-year","onClick"],Uo=27,Oo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:F=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(F)},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}},emits:["update:modelValue"],setup(F,{emit:we}){const A=F,D=we,{t:xe,locale:C}=no.useI18n(),Ve=e.ref(!1),ne=e.ref("days"),et=new Date,f=e.computed(()=>A.minDate instanceof Date?A.minDate:et),ce=e.ref(f.value.getMonth()),ve=e.ref(f.value.getFullYear()),fe=e.ref(f.value.getMonth()),se=e.ref(f.value.getFullYear()),te=e.ref(f.value.getMonth()),le=e.ref(f.value.getFullYear()),R=e.ref("start"),Ee=e.ref(null),He=e.ref(null);function qe(){const I=f.value,W=I.getMonth(),z=I.getFullYear(),re=W===11?0:W+1,Le=W===11?z+1:z;return{left:{month:W,year:z},right:{month:re,year:Le}}}const ut=e.ref(null),$=e.ref(null),me=e.ref(null),tt=e.ref(null),$e=e.ref(null),ft=e.ref(null),ge=new Date().getFullYear(),Ze=e.computed(()=>["single","singleFromAvailable"].includes(A.mode)),xt=e.computed(()=>["range","rangeFromAvailable"].includes(A.mode)),Ue=e.computed(()=>{if(A.mode!=="single"&&A.mode!=="singleFromAvailable")return null;const I=A.modelValue;return I instanceof Date?I:null}),Lt=e.computed(()=>{if(!xt.value)return{start:null,end:null};const I=A.modelValue;return!I||typeof I!="object"?{start:null,end:null}:{start:I.start instanceof Date?I.start:null,end:I.end instanceof Date?I.end:null}});function it(I){if(!I||!(I instanceof Date))return"";const W=I.getDate(),z=I.getMonth()+1,re=I.getFullYear(),Le=rt=>String(rt).padStart(2,"0");return`${Le(W)}/${Le(z)}/${re}`}const Et=e.computed(()=>it(Ue.value)),rl=e.computed(()=>{const{start:I,end:W}=Lt.value;if(!I&&!W)return"";const z=!W||I&&I<=W?I:W,re=!I||W&&W>=I?W:I;return Y(z,re)?it(z):`${it(z)} - ${it(re)}`}),Tt=e.computed(()=>{if(A.mode!=="readonly")return"—";const I=A.modelValue;if(I instanceof Date)return it(I)||"—";if(I&&typeof I=="object"&&("start"in I||"end"in I)){const W=I.start instanceof Date?I.start:null,z=I.end instanceof Date?I.end:null;if(!W&&!z)return"—";const re=!z||W&&W<=z?W:z,Le=!W||z&&z>=W?z:W;return Y(re,Le)?it(re):`${it(re)} - ${it(Le)}`}return"—"});e.computed(()=>{const I=new Date(ve.value,ce.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const gt=e.computed(()=>He.value==="left"?fe.value:He.value==="right"?te.value:ce.value),lt=e.computed(()=>He.value==="left"?se.value:He.value==="right"?le.value:ve.value),kt=e.computed(()=>{const I=new Date(ve.value,ce.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),$t=e.computed(()=>{const I=new Date(lt.value,gt.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Dt=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{month:"short"});return Array.from({length:12},(W,z)=>I.format(new Date(2024,z,1)))}),at=e.computed(()=>{const W=(He.value?lt.value:ve.value)-Math.floor(Uo/2);return Array.from({length:Uo},(z,re)=>W+re)}),_t=e.computed(()=>{const I=at.value;return I.length?`${I[0]} – ${I[I.length-1]}`:""}),Nt=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{weekday:"short"}),W=new Date(2024,0,1),z=[];for(let re=0;re<7;re++){const Le=new Date(W);Le.setDate(W.getDate()+re),z.push(I.format(Le).slice(0,2))}return z});function Ht(I,W){const z=new Date(I,W,1),re=new Date(I,W+1,0),Le=z.getDay(),rt=re.getDate(),nt=[];for(let Qe=0;Qe<Le;Qe++)nt.push(null);for(let Qe=1;Qe<=rt;Qe++)nt.push(new Date(I,W,Qe));return nt}const gl=e.computed(()=>Ht(ve.value,ce.value)),G=e.computed(()=>Ht(se.value,fe.value)),he=e.computed(()=>Ht(le.value,te.value));e.computed(()=>{const I=new Date(se.value,fe.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)}),e.computed(()=>{const I=new Date(le.value,te.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const Be=e.computed(()=>{const I=new Date(se.value,fe.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ne=e.computed(()=>{const I=new Date(le.value,te.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ke=e.computed(()=>A.availableDates&&A.availableDates.length>0),Xe=e.computed(()=>Ke.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"}]),st=e.ref({top:0,left:0});function de(){if(!tt.value||!Ve.value)return;const I=tt.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,z=window.innerHeight||document.documentElement.clientHeight;let re=I.left,Le=I.bottom+4;const rt=$e.value;if(rt){const nt=rt.offsetWidth,Qe=rt.offsetHeight;if(re+nt>W-8&&(re=I.right-nt,re<8&&(re=8)),Le+Qe>z-8){const ot=I.top-4-Qe;ot>=8?Le=ot:Le=Math.max(8,z-Qe-8)}}st.value={top:Le,left:re}}const Ye=e.computed(()=>!tt.value||!Ve.value?{}:{position:"fixed",left:`${st.value.left}px`,top:`${st.value.top}px`,zIndex:1002});function Y(I,W){return!I||!W?!1:I.getFullYear()===W.getFullYear()&&I.getMonth()===W.getMonth()&&I.getDate()===W.getDate()}function Z(I){return new Date(I.getFullYear(),I.getMonth(),I.getDate()).getTime()}function X(I){return!A.availableDates||!A.availableDates.length?!0:A.availableDates.some(W=>W instanceof Date&&Y(W,I))}function ae(I){const W=Z(I);return!(A.minDate instanceof Date&&W<Z(A.minDate)||A.maxDate instanceof Date&&W>Z(A.maxDate))}function x(I){return!A.exceptDates||!A.exceptDates.length?!1:A.exceptDates.some(W=>W instanceof Date&&Y(W,I))}function b(I){return x(I)?!1:["singleFromAvailable","rangeFromAvailable"].includes(A.mode)?X(I):ae(I)}function S(I){const W=Ue.value,z=Lt.value,re=Z(I),Le=xt.value&&z.start&&z.end&&re>Z(z.start)&&re<Z(z.end),rt=xt.value&&z.start&&Y(I,z.start),nt=xt.value&&z.end&&Y(I,z.end),Qe=rt&&nt,ot=Ze.value&&W&&Y(I,W)||rt||nt;let cl=!1;if(xt.value&&z.start&&!z.end&&Ee.value){const jt=Z(z.start),Nl=Z(Ee.value),Rl=Math.min(jt,Nl),jl=Math.max(jt,Nl);cl=re>Rl&&re<jl}return{"dss-datepicker__day--selected":ot&&!Qe,"dss-datepicker__day--range-start":rt&&!Qe,"dss-datepicker__day--range-end":nt&&!Qe,"dss-datepicker__day--range-single":Qe,"dss-datepicker__day--in-range":Le&&!rt&&!nt,"dss-datepicker__day--in-range-preview":cl&&!rt&&!nt&&!Le,"dss-datepicker__day--disabled":!b(I)}}function O(I){if(!xt.value)return;const W=Lt.value;if(!W.start||W.end){Ee.value=null;return}if(!b(I)){Ee.value=null;return}Ee.value=new Date(I.getFullYear(),I.getMonth(),I.getDate())}function K(){Ee.value=null}function Te(){if(!A.doubleCalendar||!xt.value)return;const I=Lt.value,{start:W,end:z}=I;if(W&&z){const rt=W<=z?W:z,nt=W<=z?z:W,Qe=rt.getMonth(),ot=rt.getFullYear(),cl=nt.getMonth(),jt=nt.getFullYear();if(Qe!==cl||ot!==jt){const Nl=fe.value===Qe&&se.value===ot,Rl=te.value===cl&&le.value===jt;if(Nl&&Rl)return;fe.value=Qe,se.value=ot,te.value=cl,le.value=jt}else{const Nl=Qe===0?11:Qe-1,Rl=Qe===0?ot-1:ot;fe.value===Nl&&se.value===Rl&&te.value===Qe&&le.value===ot||(fe.value=Qe,se.value=ot,Qe===11?(te.value=0,le.value=ot+1):(te.value=Qe+1,le.value=ot))}return}const re=W||z;if(re){const rt=re.getMonth(),nt=re.getFullYear(),Qe=fe.value===rt&&se.value===nt,ot=te.value===rt&&le.value===nt;if(Qe||ot)return;fe.value=rt,se.value=nt,rt===11?(te.value=0,le.value=nt+1):(te.value=rt+1,le.value=nt);return}const Le=qe();fe.value=Le.left.month,se.value=Le.left.year,te.value=Le.right.month,le.value=Le.right.year}function ze(I="start"){if(A.mode==="readonly")return;R.value=I;const W=Ue.value,z=Lt.value;if(Ze.value&&W)ce.value=W.getMonth(),ve.value=W.getFullYear();else if(xt.value)if(A.doubleCalendar)Te();else{const re=I==="start"&&z.start?z.start:z.end||z.start;re&&(ce.value=re.getMonth(),ve.value=re.getFullYear())}tt.value=Ze.value?ut.value?.closest(".dss-datepicker__input-wrap"):$.value,ne.value="days",He.value=null,Ve.value=!0,e.nextTick(()=>{de()})}function Me(){ne.value="days",He.value=null,Ee.value=null,Ve.value=!1}function be(I,W){He.value=I,ne.value=W}function wt(){ne.value="days",He.value=null}function Ge(I){const W=new Date,z=W.getFullYear(),re=W.getMonth(),Le=W.getDate();let rt,nt;if(Ke.value){const Qe=[...A.availableDates].filter(ot=>ot instanceof Date).map(ot=>new Date(ot.getFullYear(),ot.getMonth(),ot.getDate()));if(Qe.sort((ot,cl)=>ot.getTime()-cl.getTime()),Qe.length===0)return;if(I==="all")rt=Qe[0],nt=Qe[Qe.length-1];else{const ot=parseInt(I.replace("last",""),10);if(ot<2||ot>5)return;const cl=Qe.slice(-ot);rt=cl[0],nt=cl[cl.length-1]}}else{const Qe=new Date(z,re,Le);switch(I){case"today":rt=Qe,nt=Qe;break;case"lastWeek":rt=new Date(z,re,Le-6),nt=Qe;break;case"last15Days":rt=new Date(z,re,Le-14),nt=Qe;break;case"last30Days":rt=new Date(z,re,Le-29),nt=Qe;break;case"thisMonth":rt=new Date(z,re,1),nt=Qe;break;case"last3Months":rt=new Date(z,re-3,1),nt=new Date(z,re,0);break;case"last6Months":rt=new Date(z,re-6,1),nt=new Date(z,re,0);break;case"last12Months":rt=new Date(z,re-12,1),nt=new Date(z,re,0);break;case"lastYear":rt=new Date(z-1,0,1),nt=new Date(z-1,11,31);break;default:return}}D("update:modelValue",{start:rt,end:nt}),Te()}function De(I){He.value==="left"?fe.value=I:He.value==="right"?te.value=I:ce.value=I,wt()}function bt(I){He.value==="left"?se.value=I:He.value==="right"?le.value=I:ve.value=I,wt()}function dt(){ce.value===0?(ce.value=11,ve.value--):ce.value--}function yl(){ce.value===11?(ce.value=0,ve.value++):ce.value++}function ml(){fe.value===0?(fe.value=11,se.value--):fe.value--}function Zt(){fe.value===11?(fe.value=0,se.value++):fe.value++}function ll(){te.value===0?(te.value=11,le.value--):te.value--}function Yl(){te.value===11?(te.value=0,le.value++):te.value++}function il(I){if(!b(I))return;const W=new Date(I.getFullYear(),I.getMonth(),I.getDate());if(Ze.value){D("update:modelValue",W),Me();return}const z=Lt.value;if(!z.start&&!z.end){D("update:modelValue",{start:W,end:null}),R.value="end";return}if(z.start&&z.end){D("update:modelValue",{start:W,end:null}),R.value="end";return}if(R.value==="start"){let re=W,Le=z.end;re&&Le&&re>Le&&([re,Le]=[Le,re]),D("update:modelValue",{start:re||Le,end:Le||re}),R.value="end"}else{let re=z.start,Le=W;re&&Le&&Le<re&&([re,Le]=[Le,re]),D("update:modelValue",{start:re||Le,end:Le||re}),R.value="start"}}e.watch(Lt,()=>{A.doubleCalendar&&xt.value&&Ve.value&&Te()},{deep:!0});let Yt=null,nl=null,Al=null;function Vl(){Yt&&(document.removeEventListener("keydown",Yt),Yt=null),nl&&(window.removeEventListener("resize",nl),nl=null),Al&&(window.removeEventListener("scroll",Al,!0),Al=null)}return e.watch(ne,I=>{I==="years"&&e.nextTick(()=>{ft.value?.querySelector(`[data-year="${lt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Ve,I=>{Vl(),I&&(Yt=W=>{W.key==="Escape"&&(ne.value==="years"||ne.value==="months"?wt():Me())},nl=()=>{de()},Al=()=>{de()},document.addEventListener("keydown",Yt),window.addEventListener("resize",nl),window.addEventListener("scroll",Al,!0))}),e.onBeforeUnmount(()=>{Vl()}),(I,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":F.mode==="readonly"}])},[F.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",la,[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:Tt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,na)])):Ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=z=>ze("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:ut,type:"text",class:"dss-datepicker__input",placeholder:e.unref(xe)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:F.mode==="readonly"},null,8,oa)])):xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:$,onClick:W[1]||(W[1]=z=>ze("start"))},[W[12]||(W[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:me,type:"text",class:"dss-datepicker__input",placeholder:e.unref(xe)("datepicker.selectRange"),value:rl.value,readonly:""},null,8,aa)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ve.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Me,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:$e,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":F.doubleCalendar&&xt.value&&ne.value==="days","dss-datepicker__dropdown--quick-select":F.doubleCalendar&&xt.value&&ne.value==="days"&&F.quickSelect}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ye.value)},[ne.value==="days"&&F.doubleCalendar&&xt.value?(e.openBlock(),e.createElementBlock("div",sa,[F.quickSelect?(e.openBlock(),e.createElementBlock("nav",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:re=>Ge(z.id)},e.toDisplayString(e.unref(xe)(z.labelKey)),9,ia))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ca,[e.createElementVNode("div",ua,[e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.prevMonth"),onClick:ml}," ‹ ",8,ma),e.createElementVNode("div",pa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=z=>be("left","months"))},e.toDisplayString(Be.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=z=>be("left","years"))},e.toDisplayString(se.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.nextMonth"),onClick:Zt}," › ",8,fa)]),e.createElementVNode("div",va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",S(z)]),disabled:!b(z),onClick:Le=>il(z),onMouseenter:Le=>O(z),onMouseleave:K},e.toDisplayString(z.getDate()),43,ha)):(e.openBlock(),e.createElementBlock("span",ya))],64))),128))])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.prevMonth"),onClick:ll}," ‹ ",8,ba),e.createElementVNode("div",wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=z=>be("right","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=z=>be("right","years"))},e.toDisplayString(le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.nextMonth"),onClick:Yl}," › ",8,xa)]),e.createElementVNode("div",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",S(z)]),disabled:!b(z),onClick:Le=>il(z),onMouseenter:Le=>O(z),onMouseleave:K},e.toDisplayString(z.getDate()),43,Na)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])])])])):ne.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.prevMonth"),onClick:dt}," ‹ ",8,Ma),e.createElementVNode("div",_a,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=z=>ne.value="months")},e.toDisplayString(kt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=z=>ne.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(xe)("datepicker.nextMonth"),onClick:yl}," › ",8,$a)]),e.createElementVNode("div",Ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gl.value,(z,re)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:re},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",S(z)]),disabled:!b(z),onClick:Le=>il(z),onMouseenter:Le=>O(z),onMouseleave:K},e.toDisplayString(z.getDate()),43,Ha)):(e.openBlock(),e.createElementBlock("span",Da))],64))),128))])],64)):ne.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Aa,[e.createElementVNode("div",Ra,[e.createElementVNode("span",Fa,e.toDisplayString($t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=z=>ne.value="years")},e.toDisplayString(lt.value),1)])]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt.value,(z,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":re===gt.value}]),onClick:Le=>De(re)},e.toDisplayString(z),11,za))),128))])],64)):ne.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Pa,[e.createElementVNode("span",Oa,e.toDisplayString(_t.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:ft},[e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":z===lt.value,"dss-datepicker__year-cell--current":z===e.unref(ge)}]),"data-year":z,onClick:re=>bt(z)},e.toDisplayString(z),11,Wa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},qa=["data-chart-type"],Ua={class:"dss-chart-header-titles"},Xa={key:0,class:"dss-chart-title"},Ya={key:1,class:"dss-chart-subtitle"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["onClick","onMouseenter"],Qa={class:"dss-legend-text"},Ja=["title"],es=["src"],ts={class:"dss-chart-area-wrapper"},ls={key:0,class:"dss-chart-z-axis-label"},ns=["width","height","data-smooth","data-animated"],os=["id"],as=["y","width","height"],ss=["id"],rs=["d"],is=["id"],cs=["d"],us={key:0},ds=["clip-path"],ms=["x1","x2","y1","y2"],ps={class:"dss-axes"},fs=["x1","x2","y1","y2"],vs=["x1","x2","y1","y2"],gs={class:"dss-axis-labels"},hs=["x","y"],ys=["x","y"],Cs=["x","y"],ks=["y","transform"],bs={key:1,class:"dss-flag-markers"},ws=["clip-path"],xs=["x1","x2","y1","y2","onMouseover"],Es=["x1","x2","y1","y2","onMouseover"],Vs=["x1","x2","y1","y2","onMouseover"],Ns=["cx","cy","onMouseover"],Ss=["cx","cy","fill","onMouseover"],Bs=["x","y"],Ms=["clip-path"],_s={key:0},$s=["d","onMouseover"],Ts=["x","y","width","height","fill","onMouseover"],Ls={class:"dss-line-chart"},Hs=["d","stroke","stroke-width"],Ds=["d","stroke","stroke-width","opacity"],As=["cx","cy","r","fill","onMouseover"],Rs={key:1},Fs=["d","stroke","stroke-width"],Is=["d","stroke","stroke-width"],zs=["d","stroke","stroke-width","opacity"],Ps=["cx","cy","r","fill","onMouseover"],Os={key:2},Zs=["id"],Ws=["x","y","width","height"],qs=["d","fill","fill-opacity","mask"],Us=["d","stroke","stroke-width"],Xs=["d","fill","onMouseover"],Ys=["x","y","width","height","onMouseover"],js=["clip-path"],Ks=["x1","x2","y1","y2","stroke"],Gs=["cx","cy","r","fill"],Qs={key:1,class:"dss-bubble-chart"},Js={key:0,class:"dss-bubble-group"},er=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],tr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],lr=["transform"],nr=["cx","cy","r"],or=["data-chart-type","clip-path"],ar=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],sr={key:1,class:"dss-radial-segment-data-labels"},rr=["x","y"],ir=["x","y","font-size","fill"],cr=["x1","y1","x2","y2","stroke"],ur=["x1","y1","x2","y2","stroke"],dr=["x","y","text-anchor","font-size"],mr=["transform"],pr={key:0,class:"dss-spider-grid"},fr=["cx","cy","r"],vr={class:"dss-spider-grid-labels"},gr=["x","y"],hr=["x","y"],yr=["x1","x2","y1","y2"],Cr={class:"dss-spider-labels"},kr=["x","y","text-anchor","dominant-baseline"],br=["points","fill","fill-opacity","stroke","stroke-width"],wr=["cx","cy","r","fill","onMouseover"],xr={class:"dss-chart-logos"},Er=["cx","cy","r","fill"],Vr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Nr=["onClick","onMouseenter"],Sr=["src"],Br={class:"dss-marker-tooltip-category"},Mr={key:0,class:"dss-marker-tooltip-description"},_r={key:0,class:"dss-tooltip-section"},$r={key:0,class:"dss-tooltip-title"},Tr={class:"dss-tooltip-series-name"},Lr={class:"dss-tooltip-series-value"},Hr={key:1,class:"dss-tooltip-section"},Dr={key:0,class:"dss-tooltip-title"},Ar={class:"dss-bubble-tooltip-data"},Rr={key:2,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-title"},Ir={class:"dss-tooltip-value"},zr={key:0,class:"dss-tooltip-section"},Pr={class:"dss-tooltip-section-title"},Or={class:"dss-tooltip-group-header"},Zr={class:"dss-tooltip-item-content"},Wr={class:"dss-tooltip-item-text"},qr={key:1,class:"dss-tooltip-section"},Ur={class:"dss-tooltip-section-title"},Xr={class:"dss-tooltip-item-content"},Yr={class:"dss-tooltip-item-title"},jr={key:0,class:"dss-tooltip-item-description"},Kr={class:"dss-tooltip-section"},Gr={class:"dss-tooltip-title"},Qr={key:0,class:"dss-bubble-tooltip-data"},Jr={class:"dss-tooltip-series-name"},ei={class:"dss-tooltip-series-value"},ti={key:0,class:"dss-tooltip-section"},li={class:"dss-tooltip-section-title"},ni={class:"dss-tooltip-group-header"},oi={class:"dss-tooltip-item-content"},ai={class:"dss-tooltip-item-text"},si={key:1,class:"dss-tooltip-section"},ri={class:"dss-tooltip-section-title"},ii={class:"dss-tooltip-item-content"},ci={class:"dss-tooltip-item-title"},ui={key:0,class:"dss-tooltip-item-description"},di=["onClick","onMouseenter"],mi={class:"dss-legend-text"},pi={key:1,class:"dss-context-menu-separator"},fi={key:0,class:"dss-context-menu-separator"},vi={key:0,class:"dss-context-menu-separator"},gi=["onClick"],hi=["innerHTML"],yi={key:0,class:"dss-context-menu-icon"},Ci={class:"dss-marker-modal-header"},ki={class:"dss-marker-modal-body"},bi={class:"dss-form-group"},wi={class:"dss-form-group"},xi={for:"dss-marker-description"},Ei={key:0,class:"dss-form-text-display"},Vi=["placeholder"],Ni={class:"dss-marker-modal-footer"},Si={class:"modal-footer-left"},Bi={class:"dss-modal-footer-right"},Mi=["disabled"],_i={name:"DSSChart"},$i=Object.assign(_i,{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:F=>typeof F=="object"&&F!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(F,{emit:we}){const{t:A,locale:D}=no.useI18n(),xe=we,C=e.ref(null),Ve=e.ref(null),ne=e.ref(null),et=e.ref(0),f=e.ref(0);let ce=null,ve=null;const fe=20,se=e.computed(()=>{if(f.value,et.value,!C.value||!Ve.value)return 0;try{const t=C.value.getBoundingClientRect();return Ve.value.getBoundingClientRect().top-t.top}catch{return 0}}),te=e.computed(()=>`chart-clip-${R.chartId}`),le=e.computed(()=>`url(#${te.value})`),R=F,Ee={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function He(t,s){const l=Object.assign({},t);return ut(t)&&ut(s)&&Object.keys(s).forEach(i=>{ut(s[i])?i in t?l[i]=He(t[i],s[i]):Object.assign(l,{[i]:s[i]}):Object.assign(l,{[i]:s[i]})}),l}const qe=()=>{let t=20,s=0,l=0;if(it.value&&(t+=30),Et.value&&(t+=25),_t.value&&R.series.length>0){const i=R.series.filter((p,g)=>!ht.value.has(g)).length;if(Nt.value==="top"||Nt.value==="bottom"){if(Ht.value==="horizontal"){const g=Math.floor($e.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else l=150}return{height:t,legendHeight:s,legendWidth:l}};function ut(t){return t&&typeof t=="object"&&!Array.isArray(t)}const $=e.computed(()=>He(Ee,R.options)),me=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.width==="auto"}),tt=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.height==="auto"}),$e=e.computed(()=>{const t=$.value;return me.value?et.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),ft=e.ref(fe),ge=e.computed(()=>{if(tt.value){const t=ge.value;return t??Math.max(0,(f.value||400)-ft.value*5)}}),Ze=e.computed(()=>{const t=$.value;if(tt.value){const s=ge.value;return s??Math.max(0,(f.value||400)-ft.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),xt=e.computed(()=>{if(tt.value&&Ue.value==="semi-radial"&&ge.value!=null)return ft.value+Ze.value+"px";if(tt.value)return"100%";if(dl.value)return ft.value+Ze.value+"px";if(_t.value&&Nt.value==="bottom"){const t=qe();return Ze.value+(t.legendHeight||35)+"px"}return Ze.value+(_t.value?20:0)+"px"}),Ue=e.computed(()=>{const t=$.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Lt=e.computed(()=>{const t=R.series.map(s=>s.type||Ue.value);return new Set(t).size>1}),it=e.computed(()=>{const t=$.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=$.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),rl=e.computed(()=>{const t=$.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Tt=e.computed(()=>{const t=$.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),gt=e.computed(()=>{const t=$.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),lt=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return an;const s=t.yAxis.min;return typeof s=="number"||s===an?s:an}),kt=e.computed(()=>{const t=$.value;if(!t||!t.yAxis)return an;const s=t.yAxis.max;return typeof s=="number"||s===an?s:an}),$t=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Dt=e.computed(()=>{const t=$.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),at=e.computed(()=>{const t=$.value;return t&&t.grid&&t.grid.show!==!1}),_t=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.show!==!1}),Nt=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ht=e.computed(()=>{const t=$.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),gl=e.computed(()=>{const t=$.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),G=e.computed(()=>{const t=$.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),he=e.computed(()=>{const t=$.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Be=e.computed(()=>{const t=$.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ne=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ke=e.computed(()=>{const t=$.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Xe=e.computed(()=>{const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),st=e.computed(()=>{if(!dl.value)return 0;const t=$.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),de=e.computed(()=>{const t=$.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ye=e.computed(()=>{const{maxX:t}=It.value;return t===0}),Y=(t,s)=>Ye.value&&s===0?5:s,Z=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},X=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ae=e.computed(()=>{const t=$.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),x=e.computed(()=>{const t=$.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),b=e.computed(()=>{const t=$.value;return ae.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),S=e.computed(()=>{const t=$.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),O=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.enabled!==!1}),K=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Te=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),ze=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Me=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),be=e.computed(()=>{const t=$.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),wt=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ge=e.computed(()=>{const t=$.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),De=e.computed(()=>{const t=$.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),bt=e.computed(()=>$.value?.spider?.gridSteps||5),dt=e.computed(()=>{const t=[],s=bt.value;for(let l=1;l<=s;l++)t.push(Ct.value/s*l);return t}),yl=t=>{const s=ml.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=dt.value[t];return Math.round(l/Ct.value*100)+"%"},ml=e.computed(()=>$.value?.spider?.gridLabels||null),Zt=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),ll=e.computed(()=>{const t=$.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Yl=e.computed(()=>{const t=$.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),il=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Nl.value}),Yt=e.computed(()=>{const t=$.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),nl=e.computed(()=>{const t=$.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Al=e.computed(()=>{const s=$.value?.valueFormat?.extension;return typeof s=="string"?s:""}),Vl=t=>{const s=Al.value;if(t==null)return"";const l=String(t);return s?l+s:l},I=e.computed(()=>!j.value.isZooming);e.computed(()=>Ut.value.map(t=>{if(t.categoryIndex!==void 0&&(ul.value||Wt.value)){const s=qt(t.categoryIndex),l=se.value+P.value.bottom-nl.value/2;return{...t,x:s,y:l}}return t}));function W(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,V,w]=t.split("-"),L=Number(w?.length===2?`20${w}`:w);l=new Date(L,Number(V)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,V)=>{const[w,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),B=new Date(H,Number(L)-1,Number(w)),Q=Math.abs(B-l);Q<p&&(p=Q,i=V)}),i}const z=e.computed(()=>{const t=R.markers.map(l=>{const i=W(l.marker_date,R.categories),p=qt(i),g=se.value+P.value.bottom-nl.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),s=Ut.value.map(l=>{if(l.categoryIndex!==void 0&&(ul.value||Wt.value)){const i=qt(l.categoryIndex),p=se.value+P.value.bottom-nl.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),re=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.enabled===!0}),Le=e.computed(()=>{const t=$.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),rt=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),nt=e.computed(()=>{const t=$.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Qe=e.computed(()=>{const t={left:P.value.left,top:P.value.top,width:P.value.width,height:P.value.height};let s,l;const i=String(rt.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,l=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),l=s*(96/499)}return{width:s,height:l,area:t}}),ot=e.computed(()=>{const{width:t,height:s}=Qe.value,l=nt.value;let i,p;const g=P.value.left,V=P.value.right,w=P.value.top,L=P.value.bottom,T=P.value.width,H=P.value.height;switch(l){case"center":i=g+(T-t)/2,p=w+(H-s)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=V-t-15,p=w+5;break;case"bottom-left":i=g+15,p=L-s-5;break;case"bottom-right":default:i=V-t-15,p=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),cl=t=>!R.flags||!R.flags.length?[]:R.flags.filter(s=>s.categoryIndex===t),jt=t=>{const s=cl(t),l=Fn(t),i=s.filter(V=>V.manual),p=s.filter(V=>!V.manual),g=[];return i.length>0&&g.push({type:A("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(V=>({text:V.text,color:"#698dbe"}))}),p.length>0&&g.push({type:A("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(V=>({text:V.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(V=>({title:V.title,description:V.description,type:A("chart.tooltip.markers"),color:V.color||"#9784ba"}))}},Nl=e.computed(()=>{const t=R.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
2
2
  <path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
3
3
  <path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
4
4
  <path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
@@ -15,7 +15,7 @@
15
15
  <rect width="57" height="57" fill="white"/>
16
16
  </clipPath>
17
17
  </defs>
18
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Vn=e.computed(()=>{const t=A.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
18
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Rl=e.computed(()=>{const t=R.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
19
19
  <path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
20
20
  <path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
21
21
  <path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
@@ -41,23 +41,23 @@
41
41
  <rect width="45" height="45" fill="white" transform="translate(0 1)"/>
42
42
  </clipPath>
43
43
  </defs>
44
- </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),kl=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Sn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),an=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Bn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),qn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),bl=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Ll=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return zn.value&&s&&(s.show===!0||s.enabled===!0)}),Fn=e.computed(()=>{if(!Ll.value||!l.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?l.value[0]?.value??0:l.value.reduce((i,p)=>i+(p.value??0),0);return gn(n)}),wl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),al=e.computed(()=>({x:Et.value,y:Vt.value-wl.value/2})),sn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Zl=e.computed(()=>{if(!qn.value||!cn.value||!l.value.length)return[];const t=bl.value*Math.PI/180,s=(Yt.value+ht.value)/2;return l.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Et.value+Math.cos(n.midAngle)*s,E=Vt.value+Math.sin(n.midAngle)*s;return{value:gn(n.value),x:g,y:E,show:p,color:n.color,contrastColor:Lo(n.color)}})}),sl=e.computed(()=>{if(!A.flags||!A.flags.length)return[];const t=new Map;return A.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const i=Xt(s),p=n.filter(E=>E.manual),g=n.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(E=>E.text).join(`
45
- `)}})}),Mn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Hl=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),rl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Al=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),ut=e.ref(new Set),ve=e.ref(null),il=e.ref(!1),Fe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),at=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),et=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),vt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),j=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),At=e.ref([]),Me=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 En.value&&t.push(...Object.keys(En.value)),t}),e.computed(()=>{if(!A.categories||A.categories.length===0){const{maxX:t}=Pt.value;return Array.from({length:t+1},(s,n)=>I("chart.fallback.item",{number:n+1}))}return A.categories});const Bl=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[0],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),C=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[A.categories.length-1],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),y=e.computed(()=>Me.value.editingMarkerId!==null),S=e.computed(()=>Me.value.readonly),X=t=>{ut.value.has(t)||(eo.value=!0,ve.value=t)},ee=()=>{eo.value=!1,ve.value=null},Oe=t=>{if(Nl.value||Tl.value){et.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=Ut.value?i>=z.value.left-50&&i<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:i>=z.value.left&&i<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(il.value=g,Ut.value){if(!Q.value||!g||j.value.isDragging||j.value.isZooming){et.value.show=!1;return}if($l.value.find(oe=>!oe||oe.isHidden?!1:Math.sqrt(Math.pow(oe.x-i,2)+Math.pow(oe.y-p,2))<=oe.radius+3))et.value.show=!1;else{const oe=$l.value.filter(ue=>!ue||ue.isHidden?!1:Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2))<=250);if(oe.length>0){let ue=oe[0],ye=Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2));oe.forEach(Ae=>{const Ee=Math.sqrt(Math.pow(Ae.x-i,2)+Math.pow(Ae.y-p,2));Ee<ye&&(ye=Ee,ue=Ae)});const ie=30,We=$l.value.filter(Ae=>!Ae||Ae.isHidden?!1:Math.abs(Ae.x-ue.x)<=ie).sort((Ae,Ee)=>Ae.y-Ee.y);et.value={show:!0,x:ue.x,categoryIndex:Math.round(ue.originalX),data:(()=>{const Ae=Hl.value,Ee=rl.value,we=[];return We.forEach(Te=>{Ae.forEach(bt=>{const Nt=Ee[bt]||bt,xn=h(bt,Te);xn&&we.push({seriesName:Te.seriesName,label:Te.label,value:`${Nt}: ${xn}`,color:Te.color,y:Te.y})})}),we})()}}else et.value.show=!1}return}if(j.value.isDragging&&j.value.scale>1&&rn.value&&ge.value){et.value.show=!1;const Ie=t.clientX-j.value.lastMouseX,{minX:oe,maxX:ue}=Pt.value,ye=ue-oe||1,We=Ie*.8;j.value.offsetX+=We;const Ae=ye/j.value.scale,Ee=ye-Ae,we=0,Te=-Ee/ye*z.value.width,bt=we;j.value.offsetX=Math.max(Te,Math.min(bt,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY;return}if(!Q.value||!rn.value||j.value.isDragging||j.value.isZooming||!g){et.value.show=!1;return}const{minX:E,maxX:w}=Pt.value,T=w-E||1,$=T/j.value.scale,L=E-j.value.offsetX/z.value.width*T,B=(i-z.value.left)/z.value.width,G=L+B*$,fe=Math.round(G);if(fe>=0&&fe<=w){const Ie=Xt(fe),oe=hl.value.map((ue,ye)=>{const ie=A.series.findIndex(Ae=>Ae===ue),We=ue.data[fe];return{seriesName:ue.name,value:We!==void 0?We:null,color:It(ie),y:We!==void 0?nn(We):null}}).filter(ue=>ue.value!==null);et.value={show:!0,x:Ie,categoryIndex:fe,data:oe}}},ft=()=>{et.value.show=!1,il.value=!1,Tl.value=!1,Nl.value||(Mn.value.show=!1),j.value.isDragging&&(j.value.isDragging=!1),j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1,setTimeout(()=>{ve.value=null,Fe.value.show=!1},150)},Mt=t=>{if(t.preventDefault(),t.stopPropagation(),!Dn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(cn.value){vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null});return}const p=Math.max(0,z.value.left-20),g=z.value.right,E=z.value.top,w=z.value.bottom+80;n>=p&&n<=g&&i>=E&&i<=w&&(vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null;const T=Math.max(z.value.left,Math.min(n,z.value.right))-z.value.left,L=z.value.width/yl.value.length,B=Math.floor(T/L);B>=0&&B<yl.value.length&&(vt.value.categoryIndex=B)}))},Dt=t=>{if(!(t&&t.button===2)){if(vt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}vt.value.show=!1}},In=t=>{if(typeof t.template=="function"){const s={series:A.series,categories:A.categories,markers:At.value},n={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:vt.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},cl=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Dl=t=>t.style||{},hn=t=>t.type&&En.value[t.type]?En.value[t.type]:t.customIcon?t.customIcon:dn.value,ao=t=>t==null?"":A.categories&&A.categories[t]?A.categories[t]:"",so=t=>At.value.length?At.value.filter(s=>s.categoryIndex===t):[],ro=t=>{if(!rn.value&&!Ut.value)return{x:0,y:0};const s=Xt(t),n=se.value+z.value.bottom-mn.value/2;return{x:s,y:n}},Wl=()=>{At.value.forEach(t=>{if(t.categoryIndex!==void 0&&(rn.value||Ut.value)){const s=ro(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(Me.value.description&&Me.value.description.length&&Me.value.date){if(y.value){const t=At.value.findIndex(s=>s.id===Me.value.editingMarkerId);t!==-1?(At.value[t].description=Me.value.description||"",At.value[t].color=Me.value.color||"",At.value[t].type=Me.value.type||"default",Ve("update-marker",At.value[t])):Ve("update-marker",{id:Me.value.editingMarkerId,description:Me.value.description||"",color:Me.value.color||"",type:Me.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=W(Me.value.date,A.categories||[]);if(Ut.value){const{maxX:E}=Pt.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else rn.value&&(s=Math.max(0,Math.min(s,Pt.value.maxX)));const n=Xt(s),i=se.value+z.value.bottom-mn.value/2,p=Array.isArray(A.categories)?A.categories[s]:null,g={id:t,title:"",description:Me.value.description||"",color:Me.value.color||"",type:Me.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:p||null};Me.value.categoryIndex=s,At.value.push(g),Ve("add-marker",g)}Kt(),Kn()}},Kt=()=>{Me.value.show=!1,Me.value.title="",Me.value.description="",Me.value.color="#FF6B6B",Me.value.type="default",Me.value.editingMarkerId=null,Me.value.readonly=!1,Me.value.categoryIndex=null,Me.value.fromButton=!1,Me.value.date=null},co=()=>{y.value&&(No(Me.value.editingMarkerId),Kt())},No=t=>{const s=At.value.findIndex(n=>n.id===t);s!==-1&&(At.value.splice(s,1),Kn()),Ve("delete-marker",t)},vn=t=>{if(Me.value.show=!0,Me.value.title=t?.title??t?.comment??"",Me.value.description=t?.description??t?.comment??"",Me.value.color=t?.color??"",Me.value.type=t?.type??"default",Me.value.editingMarkerId=t?.id??t?.marker_id??null,Me.value.readonly=t?.readonly??!1,Me.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;g&&n&&p?Me.value.date=new Date(p,E,g):Me.value.date=null}else Me.value.date=null},Kn=()=>{try{const t=`dss-chart-markers-${A.chartId}`;localStorage.setItem(t,JSON.stringify(At.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},xl=()=>{try{const t=`dss-chart-markers-${A.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(At.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),At.value=[]}},_n=t=>{const s=st.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},Un=()=>{const t=et.value.show,s=Fe.value.show;return et.value.show=!1,Fe.value.show=!1,{originalCrosshair:t,originalTooltip:s}},yn=t=>{et.value.show=t.originalCrosshair,Fe.value.show=t.originalTooltip},ul=async(t,s=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(E);try{const w=document.createElement("canvas"),T=w.getContext("2d");w.width=s,w.height=n,T.fillStyle="#fafafa",T.fillRect(0,0,s,n),T.drawImage(g,0,0,s,n);const $=w.toDataURL("image/png");i($)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(E),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),wn=async()=>{try{const t=Un();setTimeout(async()=>{try{const s=Ne.value;if(!s){console.error("Chart SVG element not found"),yn(t);return}const n=qe(),i=Xe.value,p=Ue.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ie=>ie.remove());const w=g.querySelectorAll("image"),T=Array.from(w).map(async ie=>{const We=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(We&&!We.startsWith("data:"))try{const Ae=await ul(We,32,32);ie.setAttribute("xlink:href",Ae),ie.setAttribute("href",Ae)}catch(Ae){console.warn("Failed to convert logo to base64:",Ae)}});await Promise.all(T);const L=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",G=30;if(st.value&&(B+=`
46
- <text x="24" y="${G}"
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),jl=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),xn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=$.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const hn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),cn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),qn=e.computed(()=>{const t=$.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Zl=e.computed(()=>{const s=$.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),pl=e.computed(()=>{const s=$.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Sl=e.computed(()=>{const s=$.value?.radialBar?.dataCenter;return Il.value&&s&&(s.show===!0||s.enabled===!0)}),fl=e.computed(()=>{if(!Sl.value||!n.value.length)return"";const l=$.value?.radialBar?.dataCenter?.showValueOnly===!0?n.value[0]?.value??0:n.value.reduce((i,p)=>i+(p.value??0),0);return Vl(l)}),En=e.computed(()=>{const s=$.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),An=e.computed(()=>({x:St.value,y:Bt.value-En.value/2})),Vn=e.computed(()=>{const s=$.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),$n=e.computed(()=>{if(!Zl.value||!dl.value||!n.value.length)return[];const t=pl.value*Math.PI/180,s=(Xt.value+Ct.value)/2;return n.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=St.value+Math.cos(l.midAngle)*s,V=Bt.value+Math.sin(l.midAngle)*s;return{value:Vl(l.value),x:g,y:V,show:p,color:l.color,contrastColor:Lo(l.color)}})}),Fl=e.computed(()=>{if(!R.flags||!R.flags.length)return[];const t=new Map;return R.flags.forEach(s=>{const l=s.categoryIndex;t.has(l)||t.set(l,[]),t.get(l).push(s)}),Array.from(t.entries()).map(([s,l])=>{const i=qt(s),p=l.filter(V=>V.manual),g=l.filter(V=>!V.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(V=>V.text).join(`
45
+ `)}})}),Kt=e.ref({show:!1,x:0,y:0,content:"",count:0}),Rn=e.computed(()=>$.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),yn=e.computed(()=>{const t=$.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Wl=e.computed(()=>$.value?.bubbles?.tooltip?.formatters||{}),ht=e.ref(new Set),pe=e.ref(null),Kl=e.ref(!1),Ae=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),pt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Je=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),vt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),j=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ut=e.ref([]),Re=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return Yt.value&&t.push(...Object.keys(Yt.value)),t}),e.computed(()=>{if(!R.categories||R.categories.length===0){const{maxX:t}=It.value;return Array.from({length:t+1},(s,l)=>A("chart.fallback.item",{number:l+1}))}return R.categories});const Gl=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[0],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),V=Number(l)-1;return!g||!l||!p?null:new Date(p,V,g)}),Cl=e.computed(()=>{if(!R.categories||R.categories.length===0)return null;const t=R.categories[R.categories.length-1],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),V=Number(l)-1;return!g||!l||!p?null:new Date(p,V,g)}),hl=e.computed(()=>Re.value.editingMarkerId!==null),Ql=e.computed(()=>Re.value.readonly),k=t=>{ht.value.has(t)||(lo.value=!0,pe.value=t)},y=()=>{lo.value=!1,pe.value=null},E=t=>{if(Mn.value||Dn.value){Je.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=Wt.value?i>=P.value.left-50&&i<=P.value.right+50&&p>=P.value.top-50&&p<=P.value.bottom+100:i>=P.value.left&&i<=P.value.right&&p>=P.value.top&&p<=P.value.bottom;if(Kl.value=g,Wt.value){if(!G.value||!g||j.value.isDragging||j.value.isZooming){Je.value.show=!1;return}if(Hn.value.find(oe=>!oe||oe.isHidden?!1:Math.sqrt(Math.pow(oe.x-i,2)+Math.pow(oe.y-p,2))<=oe.radius+3))Je.value.show=!1;else{const oe=Hn.value.filter(ue=>!ue||ue.isHidden?!1:Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2))<=250);if(oe.length>0){let ue=oe[0],ke=Math.sqrt(Math.pow(ue.x-i,2)+Math.pow(ue.y-p,2));oe.forEach(Pe=>{const _e=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));_e<ke&&(ke=_e,ue=Pe)});const ie=30,je=Hn.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ue.x)<=ie).sort((Pe,_e)=>Pe.y-_e.y);Je.value={show:!0,x:ue.x,categoryIndex:Math.round(ue.originalX),data:(()=>{const Pe=Rn.value,_e=yn.value,Se=[];return je.forEach(Ie=>{Pe.forEach(Vt=>{const Mt=_e[Vt]||Vt,Ml=h(Vt,Ie);Ml&&Se.push({seriesName:Ie.seriesName,label:Ie.label,value:`${Mt}: ${Ml}`,color:Ie.color,y:Ie.y})})}),Se})()}}else Je.value.show=!1}return}if(j.value.isDragging&&j.value.scale>1&&ul.value&&Be.value){Je.value.show=!1;const Oe=t.clientX-j.value.lastMouseX,{minX:oe,maxX:ue}=It.value,ke=ue-oe||1,je=Oe*.8;j.value.offsetX+=je;const Pe=ke/j.value.scale,_e=ke-Pe,Se=0,Ie=-_e/ke*P.value.width,Vt=Se;j.value.offsetX=Math.max(Ie,Math.min(Vt,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY;return}if(!G.value||!ul.value||j.value.isDragging||j.value.isZooming||!g){Je.value.show=!1;return}const{minX:V,maxX:w}=It.value,L=w-V||1,T=L/j.value.scale,H=V-j.value.offsetX/P.value.width*L,B=(i-P.value.left)/P.value.width,Q=H+B*T,ye=Math.round(Q);if(ye>=0&&ye<=w){const Oe=qt(ye),oe=kn.value.map((ue,ke)=>{const ie=R.series.findIndex(Pe=>Pe===ue),je=ue.data[ye];return{seriesName:ue.name,value:je!==void 0?je:null,color:Rt(ie),y:je!==void 0?al(je):null}}).filter(ue=>ue.value!==null);Je.value={show:!0,x:Oe,categoryIndex:ye,data:oe}}},q=()=>{Je.value.show=!1,Kl.value=!1,Dn.value=!1,Mn.value||(Kt.value.show=!1),j.value.isDragging&&(j.value.isDragging=!1),j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1,setTimeout(()=>{pe.value=null,Ae.value.show=!1},150)},J=t=>{if(t.preventDefault(),t.stopPropagation(),!Zt.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(dl.value){vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null});return}const p=Math.max(0,P.value.left-20),g=P.value.right,V=P.value.top,w=P.value.bottom+80;l>=p&&l<=g&&i>=V&&i<=w&&(vt.value.show=!1,e.nextTick(()=>{vt.value.show=!0,vt.value.x=t.clientX,vt.value.y=t.clientY,vt.value.categoryIndex=null;const L=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,H=P.value.width/bn.value.length,B=Math.floor(L/H);B>=0&&B<bn.value.length&&(vt.value.categoryIndex=B)}))},We=t=>{if(!(t&&t.button===2)){if(vt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}vt.value.show=!1}},yt=t=>{if(typeof t.template=="function"){const s={series:R.series,categories:R.categories,markers:Ut.value},l={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:vt.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},kl=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},bl=t=>t.style||{},At=t=>t.type&&Yt.value[t.type]?Yt.value[t.type]:t.customIcon?t.customIcon:il.value,un=t=>t==null?"":R.categories&&R.categories[t]?R.categories[t]:"",Fn=t=>Ut.value.length?Ut.value.filter(s=>s.categoryIndex===t):[],ro=t=>{if(!ul.value&&!Wt.value)return{x:0,y:0};const s=qt(t),l=se.value+P.value.bottom-nl.value/2;return{x:s,y:l}},Un=()=>{Ut.value.forEach(t=>{if(t.categoryIndex!==void 0&&(ul.value||Wt.value)){const s=ro(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(Re.value.description&&Re.value.description.length&&Re.value.date){if(hl.value){const t=Ut.value.findIndex(s=>s.id===Re.value.editingMarkerId);t!==-1?(Ut.value[t].description=Re.value.description||"",Ut.value[t].color=Re.value.color||"",Ut.value[t].type=Re.value.type||"default",xe("update-marker",Ut.value[t])):xe("update-marker",{id:Re.value.editingMarkerId,description:Re.value.description||"",color:Re.value.color||"",type:Re.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=W(Re.value.date,R.categories||[]);if(Wt.value){const{maxX:V}=It.value;s=Math.max(0,Math.min(s,Math.floor(V)))}else ul.value&&(s=Math.max(0,Math.min(s,It.value.maxX)));const l=qt(s),i=se.value+P.value.bottom-nl.value/2,p=Array.isArray(R.categories)?R.categories[s]:null,g={id:t,title:"",description:Re.value.description||"",color:Re.value.color||"",type:Re.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:p||null};Re.value.categoryIndex=s,Ut.value.push(g),xe("add-marker",g)}Gt(),Jl()}},Gt=()=>{Re.value.show=!1,Re.value.title="",Re.value.description="",Re.value.color="#FF6B6B",Re.value.type="default",Re.value.editingMarkerId=null,Re.value.readonly=!1,Re.value.categoryIndex=null,Re.value.fromButton=!1,Re.value.date=null},co=()=>{hl.value&&(No(Re.value.editingMarkerId),Gt())},No=t=>{const s=Ut.value.findIndex(l=>l.id===t);s!==-1&&(Ut.value.splice(s,1),Jl()),xe("delete-marker",t)},vl=t=>{if(Re.value.show=!0,Re.value.title=t?.title??t?.comment??"",Re.value.description=t?.description??t?.comment??"",Re.value.color=t?.color??"",Re.value.type=t?.type??"default",Re.value.editingMarkerId=t?.id??t?.marker_id??null,Re.value.readonly=t?.readonly??!1,Re.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),V=Number(l)-1;g&&l&&p?Re.value.date=new Date(p,V,g):Re.value.date=null}else Re.value.date=null},Jl=()=>{try{const t=`dss-chart-markers-${R.chartId}`;localStorage.setItem(t,JSON.stringify(Ut.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Nn=()=>{try{const t=`dss-chart-markers-${R.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(Ut.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Ut.value=[]}},_l=t=>{const s=it.value||"Chart",l=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${l}.${t}`},ql=()=>{const t=Je.value.show,s=Ae.value.show;return Je.value.show=!1,Ae.value.show=!1,{originalCrosshair:t,originalTooltip:s}},wl=t=>{Je.value.show=t.originalCrosshair,Ae.value.show=t.originalTooltip},dn=async(t,s=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const V=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(V);try{const w=document.createElement("canvas"),L=w.getContext("2d");w.width=s,w.height=l,L.fillStyle="#fafafa",L.fillRect(0,0,s,l),L.drawImage(g,0,0,s,l);const T=w.toDataURL("image/png");i(T)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(V),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),Bl=async()=>{try{const t=ql();setTimeout(async()=>{try{const s=Ve.value;if(!s){console.error("Chart SVG element not found"),wl(t);return}const l=qe(),i=$e.value,p=Ze.value+l.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ie=>ie.remove());const w=g.querySelectorAll("image"),L=Array.from(w).map(async ie=>{const je=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(je&&!je.startsWith("data:"))try{const Pe=await dn(je,32,32);ie.setAttribute("xlink:href",Pe),ie.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",Q=30;if(it.value&&(B+=`
46
+ <text x="24" y="${Q}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
49
49
  font-weight="bold"
50
50
  fill="#333">
51
- ${st.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
- </text>`,G+=30),kt.value&&(B+=`
53
- <text x="24" y="${G}"
51
+ ${it.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
52
+ </text>`,Q+=30),Et.value&&(B+=`
53
+ <text x="24" y="${Q}"
54
54
  font-family="Arial, sans-serif"
55
55
  font-size="14"
56
56
  fill="#666">
57
- ${kt.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
- </text>`,G+=25),St.value&&A.series.length>0){let ie=i-200,We=st.value||kt.value?35:25;const Ae=Math.floor((i-250)/120);let Ee=0;A.series.forEach((we,Te)=>{if(!ut.value.has(Te)){const bt=It(Te),Nt=we.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${ie+6}" cy="${We-4}" r="6" fill="${bt}"/>`,B+=`<text x="${ie+18}" y="${We}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Nt}</text>`,Ee++,Ee%Ae===0?(ie=i-200,We+=20):ie+=Math.min(120,Nt.length*8+35)}})}let fe="";if(re.value)try{const{width:ie,height:We}=Pe.value,Ae=lt.value,Ee=z.value.left,we=z.value.right,Te=z.value.top,bt=z.value.bottom,Nt=z.value.width,xn=z.value.height;let Wt,Zn;switch(Ae){case"center":Wt=Ee+(Nt-ie)/2,Zn=Te+(xn-We)/2;break;case"top-left":Wt=Ee+15,Zn=Te+5;break;case"top-right":Wt=we-ie-5,Zn=Te+5;break;case"bottom-left":Wt=Ee+15,Zn=bt-We-5;break;case"bottom-right":default:Wt=we-ie-5,Zn=bt-We-5;break}fe=`
59
- <g opacity="${Be.value}">
60
- <g transform="translate(${Wt}, ${Zn}) scale(${ie/499})">
57
+ ${Et.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}
58
+ </text>`,Q+=25),_t.value&&R.series.length>0){let ie=i-200,je=it.value||Et.value?35:25;const Pe=Math.floor((i-250)/120);let _e=0;R.series.forEach((Se,Ie)=>{if(!ht.value.has(Ie)){const Vt=Rt(Ie),Mt=Se.name.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");B+=`<circle cx="${ie+6}" cy="${je-4}" r="6" fill="${Vt}"/>`,B+=`<text x="${ie+18}" y="${je}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Mt}</text>`,_e++,_e%Pe===0?(ie=i-200,je+=20):ie+=Math.min(120,Mt.length*8+35)}})}let ye="";if(re.value)try{const{width:ie,height:je}=Qe.value,Pe=nt.value,_e=P.value.left,Se=P.value.right,Ie=P.value.top,Vt=P.value.bottom,Mt=P.value.width,Ml=P.value.height;let Ot,Ol;switch(Pe){case"center":Ot=_e+(Mt-ie)/2,Ol=Ie+(Ml-je)/2;break;case"top-left":Ot=_e+15,Ol=Ie+5;break;case"top-right":Ot=Se-ie-5,Ol=Ie+5;break;case"bottom-left":Ot=_e+15,Ol=Vt-je-5;break;case"bottom-right":default:Ot=Se-ie-5,Ol=Vt-je-5;break}ye=`
59
+ <g opacity="${Le.value}">
60
+ <g transform="translate(${Ot}, ${Ol}) scale(${ie/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(ie){console.warn("Watermark processing failed, skipping watermark in SVG:",ie),fe=""}const Ie=`<?xml version="1.0" encoding="UTF-8"?>
75
+ </g>`}catch(ie){console.warn("Watermark processing failed, skipping watermark in SVG:",ie),ye=""}const Oe=`<?xml version="1.0" encoding="UTF-8"?>
76
76
  <svg width="${i}" height="${p}"
77
77
  xmlns="http://www.w3.org/2000/svg"
78
78
  xmlns:xlink="http://www.w3.org/1999/xlink">
@@ -85,33 +85,34 @@
85
85
  </defs>
86
86
  <rect width="100%" height="100%" fill="#fafafa"/>
87
87
  ${B}
88
- <g transform="translate(0, ${n.height})">
89
- ${L}
90
- ${fe}
88
+ <g transform="translate(0, ${l.height})">
89
+ ${H}
90
+ ${ye}
91
91
  </g>
92
- </svg>`,oe=new Blob([Ie],{type:"image/svg+xml;charset=utf-8"}),ue=URL.createObjectURL(oe),ye=document.createElement("a");ye.href=ue,ye.download=_n("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(ue),yn(t),Dt()}catch(s){console.error("Error downloading SVG:",s),yn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},ql=async()=>{try{const t=Un();b.value&&b.value.offsetHeight,await new Promise(ie=>setTimeout(ie,300));const s=qe(),n=Xe.value,i=Ue.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),E=2;p.width=n*E,p.height=i*E,p.style.width=n+"px",p.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let w=30;if(st.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(st.value,24,w),w+=30),kt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(kt.value,24,w),w+=25),St.value&&A.series.length>0){let ie=n-200,We=st.value||kt.value?35:25;const Ae=Math.floor((n-250)/120);let Ee=0;g.font="12px Arial, sans-serif",A.series.forEach((we,Te)=>{if(!ut.value.has(Te)){const bt=It(Te);g.beginPath(),g.arc(ie+6,We-4,6,0,2*Math.PI),g.fillStyle=bt,g.fill(),g.fillStyle="#333",g.fillText(we.name,ie+18,We),Ee++,Ee%Ae===0?(ie=n-200,We+=20):ie+=Math.min(120,we.name.length*8+35)}})}const $=Ne.value.cloneNode(!0),L=$.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=$.querySelectorAll(".dss-crosshair"),G=$.querySelectorAll('[class*="tooltip"]');L.forEach(ie=>ie.remove()),B.forEach(ie=>ie.remove()),G.forEach(ie=>ie.remove()),$.querySelectorAll("image").forEach((ie,We)=>{const Ae=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(Ae&&!Ae.startsWith("data:")){const Ee=Ot.value[We],we=Ee?It(Ee.seriesIndex):"#3B82F6",Te=ie.getAttribute("x")||0,bt=ie.getAttribute("y")||0,Nt=ie.getAttribute("width")||32,xn=ie.getAttribute("height")||32,Wt=document.createElementNS("http://www.w3.org/2000/svg","circle");Wt.setAttribute("cx",parseFloat(Te)+parseFloat(Nt)/2),Wt.setAttribute("cy",parseFloat(bt)+parseFloat(xn)/2),Wt.setAttribute("r",Math.min(parseFloat(Nt),parseFloat(xn))/2-1),Wt.setAttribute("fill",we),Wt.setAttribute("stroke","#fafafa"),Wt.setAttribute("stroke-width","2"),ie.parentNode.replaceChild(Wt,ie)}});const Ie=new XMLSerializer().serializeToString($),oe=new Blob([Ie],{type:"image/svg+xml;charset=utf-8"}),ue=URL.createObjectURL(oe),ye=new Image;return new Promise((ie,We)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),Ot.value.forEach(Ae=>{const Ee=Ae.x,we=Ae.y+s.height,Te=(Ae.width||32)/2,bt=It(Ae.seriesIndex);g.save(),g.beginPath(),g.arc(Ee,we,Te-1,0,2*Math.PI),g.fillStyle=bt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),re.value){const Ae=new Image,Ee=()=>{const{width:Te,height:bt}=Pe.value,Nt=lt.value,xn=z.value.left,Wt=z.value.right,Zn=z.value.top,Vo=z.value.bottom,ea=z.value.width,ta=z.value.height;let Pl,Ol;switch(Nt){case"center":Pl=xn+(ea-Te)/2,Ol=Zn+s.height+(ta-bt)/2;break;case"top-left":Pl=xn+15,Ol=Zn+s.height+10;break;case"top-right":Pl=Wt-Te-5,Ol=Zn+s.height+10;break;case"bottom-left":Pl=xn+15,Ol=Vo+s.height-bt-5;break;case"bottom-right":default:Pl=Wt-Te-5,Ol=Vo+s.height-bt-5;break}g.globalAlpha=Be.value,g.drawImage(Ae,Pl,Ol,Te,bt),g.globalAlpha=1,we()},we=()=>{p.toBlob(Te=>{const bt=URL.createObjectURL(Te),Nt=document.createElement("a");Nt.href=bt,Nt.download=_n("png"),document.body.appendChild(Nt),Nt.click(),document.body.removeChild(Nt),URL.revokeObjectURL(bt),URL.revokeObjectURL(ue),yn(t),Dt(),ie()},"image/png")};Ae.onload=Ee,Ae.onerror=we,Ae.src=Vn.value}else p.toBlob(Ae=>{const Ee=URL.createObjectURL(Ae),we=document.createElement("a");we.href=Ee,we.download=_n("png"),document.body.appendChild(we),we.click(),document.body.removeChild(we),URL.revokeObjectURL(Ee),URL.revokeObjectURL(ue),yn(t),Dt(),ie()},"image/png")}catch(Ae){URL.revokeObjectURL(ue),yn(t),We(Ae)}},ye.onerror=()=>{URL.revokeObjectURL(ue),yn(t),We(new Error("Failed to load SVG image"))},ye.src=ue})}catch(t){console.error("Error downloading PNG:",t)}},Ml=()=>{try{let t="";st.value&&(t+=`# ${I("chart.csv.chartTitle")}: ${st.value}
93
- `),kt.value&&(t+=`# ${I("chart.csv.chartSubtitle")}: ${kt.value}
94
- `),t+=`# ${I("chart.csv.generated")}: ${new Date().toLocaleString()}
92
+ </svg>`,oe=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),ue=URL.createObjectURL(oe),ke=document.createElement("a");ke.href=ue,ke.download=_l("svg"),document.body.appendChild(ke),ke.click(),document.body.removeChild(ke),URL.revokeObjectURL(ue),wl(t),We()}catch(s){console.error("Error downloading SVG:",s),wl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Xn=async()=>{try{const t=ql();C.value&&C.value.offsetHeight,await new Promise(ie=>setTimeout(ie,300));const s=qe(),l=$e.value,i=Ze.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),V=2;p.width=l*V,p.height=i*V,p.style.width=l+"px",p.style.height=i+"px",g.scale(V,V),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let w=30;if(it.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(it.value,24,w),w+=30),Et.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Et.value,24,w),w+=25),_t.value&&R.series.length>0){let ie=l-200,je=it.value||Et.value?35:25;const Pe=Math.floor((l-250)/120);let _e=0;g.font="12px Arial, sans-serif",R.series.forEach((Se,Ie)=>{if(!ht.value.has(Ie)){const Vt=Rt(Ie);g.beginPath(),g.arc(ie+6,je-4,6,0,2*Math.PI),g.fillStyle=Vt,g.fill(),g.fillStyle="#333",g.fillText(Se.name,ie+18,je),_e++,_e%Pe===0?(ie=l-200,je+=20):ie+=Math.min(120,Se.name.length*8+35)}})}const T=Ve.value.cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=T.querySelectorAll(".dss-crosshair"),Q=T.querySelectorAll('[class*="tooltip"]');H.forEach(ie=>ie.remove()),B.forEach(ie=>ie.remove()),Q.forEach(ie=>ie.remove()),T.querySelectorAll("image").forEach((ie,je)=>{const Pe=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const _e=zt.value[je],Se=_e?Rt(_e.seriesIndex):"#3B82F6",Ie=ie.getAttribute("x")||0,Vt=ie.getAttribute("y")||0,Mt=ie.getAttribute("width")||32,Ml=ie.getAttribute("height")||32,Ot=document.createElementNS("http://www.w3.org/2000/svg","circle");Ot.setAttribute("cx",parseFloat(Ie)+parseFloat(Mt)/2),Ot.setAttribute("cy",parseFloat(Vt)+parseFloat(Ml)/2),Ot.setAttribute("r",Math.min(parseFloat(Mt),parseFloat(Ml))/2-1),Ot.setAttribute("fill",Se),Ot.setAttribute("stroke","#fafafa"),Ot.setAttribute("stroke-width","2"),ie.parentNode.replaceChild(Ot,ie)}});const Oe=new XMLSerializer().serializeToString(T),oe=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),ue=URL.createObjectURL(oe),ke=new Image;return new Promise((ie,je)=>{ke.onload=async()=>{try{if(g.drawImage(ke,0,s.height),zt.value.forEach(Pe=>{const _e=Pe.x,Se=Pe.y+s.height,Ie=(Pe.width||32)/2,Vt=Rt(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(_e,Se,Ie-1,0,2*Math.PI),g.fillStyle=Vt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),re.value){const Pe=new Image,_e=()=>{const{width:Ie,height:Vt}=Qe.value,Mt=nt.value,Ml=P.value.left,Ot=P.value.right,Ol=P.value.top,Vo=P.value.bottom,ea=P.value.width,ta=P.value.height;let Zn,Wn;switch(Mt){case"center":Zn=Ml+(ea-Ie)/2,Wn=Ol+s.height+(ta-Vt)/2;break;case"top-left":Zn=Ml+15,Wn=Ol+s.height+10;break;case"top-right":Zn=Ot-Ie-5,Wn=Ol+s.height+10;break;case"bottom-left":Zn=Ml+15,Wn=Vo+s.height-Vt-5;break;case"bottom-right":default:Zn=Ot-Ie-5,Wn=Vo+s.height-Vt-5;break}g.globalAlpha=Le.value,g.drawImage(Pe,Zn,Wn,Ie,Vt),g.globalAlpha=1,Se()},Se=()=>{p.toBlob(Ie=>{const Vt=URL.createObjectURL(Ie),Mt=document.createElement("a");Mt.href=Vt,Mt.download=_l("png"),document.body.appendChild(Mt),Mt.click(),document.body.removeChild(Mt),URL.revokeObjectURL(Vt),URL.revokeObjectURL(ue),wl(t),We(),ie()},"image/png")};Pe.onload=_e,Pe.onerror=Se,Pe.src=Rl.value}else p.toBlob(Pe=>{const _e=URL.createObjectURL(Pe),Se=document.createElement("a");Se.href=_e,Se.download=_l("png"),document.body.appendChild(Se),Se.click(),document.body.removeChild(Se),URL.revokeObjectURL(_e),URL.revokeObjectURL(ue),wl(t),We(),ie()},"image/png")}catch(Pe){URL.revokeObjectURL(ue),wl(t),je(Pe)}},ke.onerror=()=>{URL.revokeObjectURL(ue),wl(t),je(new Error("Failed to load SVG image"))},ke.src=ue})}catch(t){console.error("Error downloading PNG:",t)}},Tn=()=>{try{let t="";it.value&&(t+=`# ${A("chart.csv.chartTitle")}: ${it.value}
93
+ `),Et.value&&(t+=`# ${A("chart.csv.chartSubtitle")}: ${Et.value}
94
+ `),t+=`# ${A("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
- `,t+="Category",A.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
97
- `;const s=Math.max(...A.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let T='"'+(A.categories[g]||I("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';A.series.forEach($=>{const L=$.data&&$.data[g]!==void 0?$.data[g]:"";T+=","+L}),t+=T+`
98
- `}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=_n("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Dt()}catch(t){console.error("Error downloading CSV:",t)}},So=t=>{if(typeof t.action=="function"){const s={series:A.series,categories:A.categories,markers:At.value},n={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:clampedCategoryIndex||vt.value.categoryIndex};t.action(s,n)}Dt()},uo=()=>{Kt(),Me.value.show=!0,Me.value.categoryIndex=vt.value.categoryIndex,Me.value.fromButton=!1,Dt()},mo=()=>{Kt(),Me.value.show=!0,Me.value.categoryIndex=0,Me.value.fromButton=!0},po=t=>{if(vt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(vt.value.show=!1)}},Ul=t=>{vt.value.show&&!t.target.closest(".context-menu")&&(vt.value.show=!1)},Xl=t=>{if(!rn.value||!ge.value)return;t.preventDefault(),t.stopPropagation(),j.value.isZooming=!0,et.value.show=!1,j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<z.value.left-50||i>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){j.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(j.value.minScale,Math.min(j.value.maxScale,j.value.scale*g));if(E!==j.value.scale){const{minX:w,maxX:T}=Pt.value,$=T-w||1,L=$/j.value.scale,B=w-j.value.offsetX/z.value.width*$,G=(i-z.value.left)/z.value.width,fe=B+G*L;j.value.scale=E;const Ie=$/j.value.scale,oe=fe-G*Ie;j.value.offsetX=-(oe-w)/$*z.value.width,j.value.scale<=1.01&&(j.value.scale=1,j.value.offsetX=0)}j.value.zoomTimeout=setTimeout(()=>{j.value.isZooming=!1,j.value.zoomTimeout=null},300)},Bo=t=>{if(!rn.value||!ge.value||j.value.scale<=1)return;et.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,j.value.isDragging=!0,j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY,t.preventDefault()},Mo=()=>{j.value.isDragging=!1},Yl=()=>{!rn.value||!ge.value||(j.value.scale=1,j.value.offsetX=0,j.value.isDragging=!1,j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1)},jl=()=>!rn.value||!il.value||!ge.value?"default":j.value.isDragging?"grabbing":j.value.scale>1?"grab":"dss-crosshair",Rl=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 s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],E=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-i.x)/6*x.value,T=p.y+(g.y-i.y)/6*x.value,$=g.x-(E.x-p.x)/6*x.value,L=g.y-(E.y-p.y)/6*x.value;s+=` C ${w} ${T} ${$} ${L} ${g.x} ${g.y}`}return s},Cn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(Tt.value?30:0)+60;if(Gn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(cn.value){const B=!St.value,G=Nn.value,fe=G?Sn.value+an.value+Math.max(24,kl.value+16):0,Ie=B?12:p;let oe=0;st.value&&(oe+=B?8:15),kt.value&&(oe+=B?6:10);const ue=qe();let ye=Ie+(B?4:16)+(G?fe:0),ie=Ie+(G?fe:0);St.value&&xt.value==="left"?ye+=ue.legendWidth||150:St.value&&xt.value==="right"&&(ie+=ue.legendWidth||150);const Ae=Ze.value==="semi-radial"?G?fe:8:G?fe:B?8:p+80,Ee=G?14:0,we=Ie+oe+Ee,Te={left:ye,top:we,right:ie,bottom:Ae};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Te.left,top:i.top??Te.top,right:i.right??Te.right,bottom:i.bottom??Te.bottom}:Te}let E=0;st.value&&(E+=15),kt.value&&(E+=10);const w=qe();let T=p+16,$=p;St.value&&xt.value==="left"?T+=w.legendWidth||150:St.value&&xt.value==="right"&&($+=w.legendWidth||150);const L={left:T,top:p+E,right:$,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??L.left,top:i.top??L.top,right:i.right??L.right,bottom:i.bottom??L.bottom}:L}),z=e.computed(()=>({left:Cn.value.left,top:Cn.value.top,right:Xe.value-Cn.value.right,bottom:Ue.value-Cn.value.bottom,width:Xe.value-(Cn.value.left+Cn.value.right),height:Ue.value-(Cn.value.top+Cn.value.bottom)})),rn=e.computed(()=>["line","area","bar"].includes(Ze.value)||$t.value),$n=e.computed(()=>$t.value),cn=e.computed(()=>["radial","semi-radial"].includes(Ze.value)),Gn=e.computed(()=>Ze.value==="spider"),Ut=e.computed(()=>Ze.value==="bubble"),tn=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(Ze.value==="bar"||$n.value)),Qn=t=>{const{minY:s,maxY:n}=Pt.value,i=n-s||1;return z.value.left+(t-s)/i*z.value.width},Tn=t=>{const{maxX:s}=Pt.value,n=s+1,p=z.value.height/n;return z.value.top+(t+.5)*p},Et=e.computed(()=>cn.value?Cn.value.left+(Xe.value-Cn.value.left-Cn.value.right)/2:Xe.value/2),Vt=e.computed(()=>Gn.value?Ue.value/2-40:cn.value?Cn.value.top+(Ue.value-Cn.value.top-Cn.value.bottom)/2:Ue.value/2),ht=e.computed(()=>{if(Gn.value){const t=z.value.width-80,s=z.value.height-80;return Math.min(t,s)/2}return Math.min(z.value.width,z.value.height)/2}),Yt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return ht.value*n}),vo=e.computed(()=>{const t=O.value,s=typeof A.innerSize=="number"?A.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cn.value||Gn.value)?1:1+s/100}),Jn=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const s=Et.value,n=Vt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Ln=e.ref(0),el=e.computed(()=>`semi-radial-fill-clip-${A.chartId}`),zn=e.computed(()=>Ze.value==="semi-radial"),zt=e.computed(()=>zn.value&&P.value&&!en.value),_l=e.computed(()=>zn.value&&P.value&&!en.value&&U.value==="fill"),fo=e.computed(()=>{const t=zt.value?Ln.value:1,s=Et.value,n=Vt.value,i=Yt.value,p=ht.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const w=s+p*Math.cos(g),T=n+p*Math.sin(g),$=s+p*Math.cos(E),L=n+p*Math.sin(E),B=s+i*Math.cos(E),G=n+i*Math.sin(E),fe=s+i*Math.cos(g),Ie=n+i*Math.sin(g),oe=t>.5?1:0;return`M ${s} ${n} L ${w} ${T} A ${p} ${p} 0 ${oe} 1 ${$} ${L} L ${B} ${G} A ${i} ${i} 0 ${oe} 1 ${fe} ${Ie} Z`}),dl=e.computed(()=>{if(!(!zn.value||!zt.value)&&!_l.value)return`url(#${el.value})`}),gl=t=>{if(!(!_l.value||t!==0))return`url(#${el.value})`},Hn=e.ref(0),ml=e.computed(()=>`radial-reveal-clip-${A.chartId}`),kn=e.computed(()=>Ze.value==="radial"),_o=e.computed(()=>{const t=kn.value?Hn.value:1,s=Et.value,n=Vt.value,i=Math.max(ht.value*1.5,Xe.value,Ue.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const B=s-i,G=s+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,E=s+i*Math.cos(p),w=n+i*Math.sin(p),T=s+i*Math.cos(g),$=n+i*Math.sin(g),L=t>=.5?1:0;return`M ${s} ${n} L ${E} ${w} A ${i} ${i} 0 ${L} 1 ${T} ${$} Z`}),$o=e.computed(()=>{if(dl.value)return dl.value;if(kn.value)return`url(#${ml.value})`});let tl=null;const go=()=>{if(!zt.value)return;Ln.value=0;const t=Re.value,s=performance.now(),n=i=>{const p=i-s,g=Math.min(1,p/t);Ln.value=On(Se.value,g),g<1&&(tl=requestAnimationFrame(n))};tl=requestAnimationFrame(n)},El=e.computed(()=>O.value?.bubbles?.minSize||8),ho=e.computed(()=>O.value?.bubbles?.maxSize||50),yo=e.computed(()=>O.value?.bubbles?.opacity||.7),Co=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Fl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Kl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Pn=e.computed(()=>A.series),hl=e.computed(()=>A.series.filter((t,s)=>!ut.value.has(s))),nl="auto",Pt=e.computed(()=>{if(Ut.value)return ko();if(!hl.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;hl.value.forEach(w=>{w.data&&w.data.length&&(n=Math.max(n,w.data.length-1),w.data.forEach(T=>{typeof T=="number"&&(t=Math.min(t,T),s=Math.max(s,T))}))}),A.categories.length>0&&(n=Math.max(n,A.categories.length-1)),t===1/0&&(t=0,s=100);const i=Ke.value,p=Lt.value;let g,E;if(i===nl){const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}else if(typeof i=="number")g=i;else{const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}if(p===nl){const w=s-t,T=w>0?w*.1:2;E=s+T}else if(typeof p=="number")E=p;else{const w=s-t,T=w>0?w*.1:2;E=s+T}return{minX:0,maxX:n,minY:g,maxY:E}}),ko=()=>{if(!hl.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,E=!1;if(hl.value.forEach((fe,Ie)=>{fe?.data?.length&&fe.data.forEach((oe,ue)=>{let ye,ie,We;if(typeof oe=="object"&&oe!==null&&!Array.isArray(oe))ye=typeof oe.x=="number"?oe.x:ue,ie=typeof oe.y=="number"?oe.y:0,We=typeof oe.size=="number"?oe.size:20;else if(Array.isArray(oe)&&oe.length>=3)ye=typeof oe[0]=="number"?oe[0]:ue,ie=typeof oe[1]=="number"?oe[1]:0,We=typeof oe[2]=="number"?oe[2]:20;else if(typeof oe=="number")ye=ue,ie=oe,We=Co(Ie,ue);else return;isFinite(ye)&&isFinite(ie)&&isFinite(We)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,ie),i=Math.max(i,ie),p=Math.min(p,We),g=Math.max(g,We),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,A.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const w=s-t,T=i-n;let $,L,B,G;return Ht.value!==null?$=Ht.value:$=t-w*.1,qt.value!==null?L=qt.value:L=s+w*.1,Ke.value!==null&&typeof Ke.value=="number"?B=Ke.value:B=Math.max(0,n-T*.1),Lt.value!==null&&typeof Lt.value=="number"?G=Lt.value:G=i+T*.1,{minX:$,maxX:L,minY:B,maxY:G,minSize:p,maxSize:g}},Xt=t=>{if(Ut.value){const{minX:w,maxX:T}=Pt.value,$=T-w||1;return z.value.left+(t-w)/$*z.value.width}const{minX:s,maxX:n}=Pt.value,i=n-s;if(n===0||i===0)return z.value.left+z.value.width/2;const p=i/j.value.scale,g=s-j.value.offsetX/z.value.width*i,E=(t-g)/p;return z.value.left+E*z.value.width},nn=t=>{const{minY:s,maxY:n}=Pt.value,i=n-s||1;return z.value.bottom-(t-s)/i*z.value.height},bo=t=>{if(!Ut.value)return me.value||4;const{maxSize:s}=Pt.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return El.value+i*(ho.value-El.value)},To=e.computed(()=>Il.value.map(t=>({y:t.y}))),yl=e.computed(()=>{if(Ut.value)return pl();if(Ze.value==="bar"){if(tn.value){const we=[],{minY:Te,maxY:bt}=Pt.value,Nt=5,xn=bt-Te||1;for(let Wt=0;Wt<=Nt;Wt++){const Zn=Te+xn*(Wt/Nt),Vo=Qn(Zn);we.push({x:Vo,y:z.value.bottom+20,text:gn(Math.round(Zn))})}return we}const ue=[],{maxX:ye}=Pt.value,ie=ye+1,We=5,Ee=(z.value.width-We*2)/ie;for(let we=0;we<=ye;we++){const Te=z.value.left+We+(we+.5)*Ee;ue.push({x:Te,y:z.value.bottom+20,text:A.categories[we]||I("chart.fallback.item",{number:we+1})})}return ue}const t=[],{minX:s,maxX:n}=Pt.value,i=Ht.value!==null?Ht.value:s,p=qt.value!==null?qt.value:n,g=p-i||1,E=g/j.value.scale,w=i-j.value.offsetX/z.value.width*g,T=w+E,$=Math.max(0,Math.floor(w-2)),L=Math.min(p,Math.ceil(T+2)),B=L-$,G=z.value.width,Ie=Math.floor(G/60);let oe=1;B>Ie&&(oe=Math.ceil(B/Ie));for(let ue=$;ue<=L;ue+=oe)if(ue>=0&&ue<=p){const ye=Xt(ue);ye>=z.value.left-100&&ye<=z.value.right+100&&t.push({x:ye,y:z.value.bottom+20,text:A.categories[ue]||`Item ${ue+1}`})}return t}),pl=()=>{const t=[],{minX:s,maxX:n}=Pt.value,i=n-s||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let g=0;g<=p;g++){const E=s+i*g/p,w=Xt(E);if(w>=z.value.left-10&&w<=z.value.right+10){const T=Math.round(E),$=A.categories?.[T];t.push({x:w,y:z.value.bottom+20,text:$||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Il=e.computed(()=>{if(tn.value){const p=[],{maxX:g}=Pt.value;for(let E=0;E<=g;E++)p.push({x:z.value.left-10,y:Tn(E),text:A.categories[E]||`Item ${E+1}`});return p}const t=[],{minY:s,maxY:n}=Pt.value,i=5;for(let p=0;p<=i;p++){const g=s+(n-s)*(p/i),E=Math.round(g);t.push({x:z.value.left-10,y:nn(g),text:gn(E)})}return t}),It=t=>{const s=V.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},Lo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const T=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(T){let $=T[1];$.length===3&&($=$[0]+$[0]+$[1]+$[1]+$[2]+$[2]),n=parseInt($.slice(0,2),16)/255,i=parseInt($.slice(2,4),16)/255,p=parseInt($.slice(4,6),16)/255}else if(typeof document<"u"){const $=document.createElement("span");$.style.color=s,$.style.display="none",document.body.appendChild($);const L=getComputedStyle($).color;document.body.removeChild($);const B=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},Gl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),E=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${w})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),E=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${w}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),T=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,w,T].map($=>$.toString(16).padStart(2,"0")).join("")}`}return s},Ql=(t,s)=>{const i=O.value?.stroke?.color;return i==null?Gl(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??Gl(s):Gl(s)},Vl=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+p*p)}return s},An=e.computed(()=>Ze.value==="line"||$n.value?($n.value?A.series.filter(s=>(s.type||Ze.value)==="line"):Pn.value).map((s,n)=>{const i=A.series.findIndex(B=>B===s),p=[];let g=[];s.data.forEach((B,G)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:tn.value?Qn(B):Xt(G),y:tn.value?Tn(G):nn(B),index:G})}),g.length>0&&p.push(g);let E="";p.forEach(B=>{if(B.length>0){let G="";ne.value?G=Rl(B):G=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(fe=>` L ${fe.x} ${fe.y}`).join(""),E+=(E?" ":"")+G}});const w=p.reduce((B,G)=>B+Vl(G),0),T=ut.value.has(i),$=ve.value===i,L=ve.value!==null&&ve.value!==i;return{path:E,color:It(i),pathLength:w,seriesIndex:i,animationDelay:n*le.value,isHighlighted:$,isDimmed:L,isHidden:T}}):[]),wo=e.computed(()=>{if(!(Ze.value==="line"||$n.value))return[];const t=$n.value?A.series.filter(n=>(n.type||Ze.value)==="line"):Pn.value,s=[];return t.forEach((n,i)=>{const p=A.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let w=-1,T=0;for(let $=g+1;$<n.data.length;$++){const L=n.data[$];if(L==null)T++;else{w=$;break}}if(T>0&&w!==-1){const $=n.data[w],L=tn.value?Qn(E):Xt(g),B=tn.value?Tn(g):nn(E),G=tn.value?Qn($):Xt(w),fe=tn.value?Tn(w):nn($),Ie=ut.value.has(p),oe=ve.value===p,ue=ve.value!==null&&ve.value!==p;s.push({path:`M ${L} ${B} L ${G} ${fe}`,color:It(p),seriesIndex:p,animationDelay:i*le.value,isHighlighted:oe,isDimmed:ue,isHidden:Ie,gapSize:T}),g=w-1}}}}),s}),Cl=e.computed(()=>Ze.value==="line"||$n.value?!P.value||en.value||ct.value.hasAnimated?[]:($n.value?A.series.filter(s=>(s.type||Ze.value)==="line"):Pn.value).map((s,n)=>{const i=A.series.findIndex(T=>T===s);let p="",g=null;s.data.forEach((T,$)=>{if(T!=null){const L={x:tn.value?Qn(T):Xt($),y:tn.value?Tn($):nn(T)};g===null?p+=`M ${L.x} ${L.y}`:p+=` L ${L.x} ${L.y}`,g=L}else if(g!==null){const L=s.data.findIndex((B,G)=>G>$&&B!==null&&B!==void 0);if(L!==-1){const B={x:tn.value?Qn(s.data[L]):Xt(L),y:tn.value?Tn(L):nn(s.data[L])};p+=` L ${B.x} ${B.y}`,g=B}}});const E=s.data.map((T,$)=>T==null?null:{x:tn.value?Qn(T):Xt($),y:tn.value?Tn($):nn(T)}).filter(T=>T!==null),w=Vl(E);return{path:p,pathLength:w,color:It(i),animationDelay:n*le.value,seriesIndex:i}}):[]),Jl=e.computed(()=>{if(Ze.value!=="line")return[];const t=[];return Pn.value.forEach((s,n)=>{const i=ve.value===n,p=ve.value!==null&&ve.value!==n,g=ut.value.has(n);s.data.forEach((E,w)=>{E!=null&&t.push({x:Xt(w),y:nn(E),color:It(n),value:E,label:A.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(n*s.data.length+w)*(le.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Ho=e.computed(()=>{if(!$n.value)return[];const t=[];return A.series.filter(n=>(n.type||Ze.value)==="line").forEach((n,i)=>{const p=A.series.findIndex(T=>T===n),g=ve.value===p,E=ve.value!==null&&ve.value!==p,w=ut.value.has(p);n.data.forEach((T,$)=>{T!=null&&t.push({x:Xt($),y:nn(T),color:It(p),value:T,label:A.categories[$]||$.toString(),seriesName:n.name,categoryIndex:$,dataIndex:$,animationDelay:(i*n.data.length+$)*(le.value/8),isHighlighted:g,isDimmed:E,isHidden:w})})}),t}),$l=e.computed(()=>{if(!Ut.value)return[];const t=[];return Pn.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=ve.value,p=i!==null&&i===n,g=i!==null&&i!==n,E=ut.value.has(n);s.data.forEach((w,T)=>{let $,L,B,G,fe;if(typeof w=="object"&&w!==null&&!Array.isArray(w))$=typeof w.x=="number"?w.x:T,L=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,G=w.label||A.categories?.[T]||`Point ${T+1}`,fe=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)$=typeof w[0]=="number"?w[0]:T,L=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,G=w[3]||A.categories?.[T]||`Point ${T+1}`,fe=w[4];else if(typeof w=="number")$=T,L=w,B=Co(n,T),G=A.categories?.[T]||`Point ${T+1}`;else return;!isFinite($)||!isFinite(L)||!isFinite(B)||t.push({x:Xt($),y:nn(L),radius:bo(B),originalX:$,originalY:L,originalSize:B,color:It(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:fe,seriesIndex:n,dataIndex:T,categoryIndex:Math.round($),isHighlighted:p,isDimmed:g,isHidden:E,opacity:yo.value})})}),t}),zl=e.computed(()=>Ze.value!=="area"?[]:Pn.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((B,G)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Xt(G),y:nn(B),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:It(s),isHidden:ut.value.has(s)};const p=z.value.bottom+1;let g="",E="";n.forEach((B,G)=>{if(B.length===0)return;let fe=`M ${B[0].x} ${B[0].y}`;ne.value&&B.length>1?fe=Rl(B):B.slice(1).forEach(oe=>{fe+=` L ${oe.x} ${oe.y}`}),g+=(g?" ":"")+fe;let Ie=`M ${B[0].x} ${p}`;if(Ie+=` L ${B[0].x} ${B[0].y}`,ne.value&&B.length>1){const oe=Rl(B),ue=oe.substring(oe.indexOf("C")||oe.indexOf("Q")||oe.indexOf("L"));ue?Ie+=" "+ue:B.slice(1).forEach(ye=>{Ie+=` L ${ye.x} ${ye.y}`})}else B.slice(1).forEach(oe=>{Ie+=` L ${oe.x} ${oe.y}`});Ie+=` L ${B[B.length-1].x} ${p} Z`,E+=(E?" ":"")+Ie});const w=ve.value===s,T=ve.value!==null&&ve.value!==s,$=ut.value.has(s),L=n.reduce((B,G)=>B+Vl(G),0);return{linePath:g,areaPath:E,color:It(s),pathLength:L,isHighlighted:w,isDimmed:T,isHidden:$}})),o=e.computed(()=>{if(!(["bar"].includes(Ze.value)||$n.value))return[];const t=[],{maxX:s}=Pt.value,n=$n.value?A.series.filter(p=>(p.type||Ze.value)==="bar"):Pn.value,i=n.length;if(tn.value){const p=s+1,E=z.value.height/p,w=E*(2/3),T=Math.min(4,w/i*.15),$=w-(i-1)*T,L=Math.max(4,$/i);n.forEach((B,G)=>{const fe=A.series.findIndex(ye=>ye===B),Ie=ve.value===fe,oe=ve.value!==null&&ve.value!==fe,ue=ut.value.has(fe);B.data.forEach((ye,ie)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const Ee=z.value.top+(ie+.5)*E-w/2+G*(L+T),we=z.value.left,Te=Math.abs(Qn(ye)-z.value.left);let bt="";if(ne.value&&Te>0){const Nt=Math.min(k.value,L/2,Te/2);bt=[`M ${we} ${Ee}`,`L ${we+Te-Nt} ${Ee}`,`Q ${we+Te} ${Ee} ${we+Te} ${Ee+Nt}`,`L ${we+Te} ${Ee+L-Nt}`,`Q ${we+Te} ${Ee+L} ${we+Te-Nt} ${Ee+L}`,`L ${we} ${Ee+L}`,"Z"].join(" ")}t.push({x:we,y:Ee,width:Te,height:L,color:It(i===1?ie:fe),value:ye,label:A.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(le.value/4),isHighlighted:Ie,isDimmed:oe,isHidden:ue,barPath:bt,isSmooth:ne.value&&Te>0})})})}else{const p=s+1,E=z.value.width/p,w=E*.8,T=w/i,$=T*.05,L=T-$;n.forEach((B,G)=>{const fe=A.series.findIndex(ye=>ye===B),Ie=ve.value===fe,oe=ve.value!==null&&ve.value!==fe,ue=ut.value.has(fe);B.data.forEach((ye,ie)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const Ee=z.value.left+(ie+.5)*E-w/2+G*T+$/2,we=nn(Math.max(0,ye)),Te=Math.abs(nn(0)-nn(ye));let bt="";if(ne.value&&Te>0){const Nt=Math.min(k.value,L/2,Te/2);bt=[`M ${Ee} ${we+Te}`,`L ${Ee} ${we+Nt}`,`Q ${Ee} ${we} ${Ee+Nt} ${we}`,`L ${Ee+L-Nt} ${we}`,`Q ${Ee+L} ${we} ${Ee+L} ${we+Nt}`,`L ${Ee+L} ${we+Te}`,"Z"].join(" ")}t.push({x:Ee,y:we,width:L,height:Te,color:It(i===1?ie:fe),value:ye,label:A.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(le.value/4),isHighlighted:Ie,isDimmed:oe,isHidden:ue,barPath:bt,isSmooth:ne.value&&Te>0})})})}return t}),l=e.computed(()=>{if(!cn.value)return[];const t=Pn.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!ut.value.has(g));if(t.length===0)return[];let s=Ze.value==="semi-radial"?Math.PI:-Math.PI/2;const n=Ze.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],w=g.data[0]||0,T=s,$=s+n-.001,L=T+n/2,B=Et.value+Math.cos(T)*Yt.value,G=Vt.value+Math.sin(T)*Yt.value,fe=Et.value+Math.cos($)*Yt.value,Ie=Vt.value+Math.sin($)*Yt.value,oe=Et.value+Math.cos($)*ht.value,ue=Vt.value+Math.sin($)*ht.value,ye=Et.value+Math.cos(T)*ht.value,ie=Vt.value+Math.sin(T)*ht.value,We=1,Ae=[`M ${B} ${G}`,`A ${Yt.value} ${Yt.value} 0 ${We} 1 ${fe} ${Ie}`,`L ${oe} ${ue}`,`A ${ht.value} ${ht.value} 0 ${We} 0 ${ye} ${ie}`,"Z"].join(" "),Ee=It(E);return i.push({path:Ae,color:Ee,strokeWidth:Qe.value,strokeColor:Ql(0,Ee),value:w,seriesName:g.name,opacity:.8,isHighlighted:ve.value===E,isDimmed:!1,isHidden:!1,startAngle:T,endAngle:$,midAngle:L}),i}if(_l.value&&t.length===2){const g=t[0],E=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),T=w/100*n,$=(L,B,G,fe,Ie)=>{const oe=L+(B-L)/2,ue=B-L,ye=Et.value+Math.cos(L)*Yt.value,ie=Vt.value+Math.sin(L)*Yt.value,We=Et.value+Math.cos(B)*Yt.value,Ae=Vt.value+Math.sin(B)*Yt.value,Ee=Et.value+Math.cos(B)*ht.value,we=Vt.value+Math.sin(B)*ht.value,Te=Et.value+Math.cos(L)*ht.value,bt=Vt.value+Math.sin(L)*ht.value,Nt=ue>Math.PI?1:0,xn=[`M ${ye} ${ie}`,`A ${Yt.value} ${Yt.value} 0 ${Nt} 1 ${We} ${Ae}`,`L ${Ee} ${we}`,`A ${ht.value} ${ht.value} 0 ${Nt} 0 ${Te} ${bt}`,"Z"].join(" "),Wt=It(fe);return{path:xn,color:Wt,strokeWidth:Qe.value,strokeColor:Ql(i.length,Wt),value:Ie,seriesName:G.name,opacity:.8,isHighlighted:ve.value===fe,isDimmed:ve.value!==null&&ve.value!==fe,isHidden:!1,startAngle:L,endAngle:B,midAngle:oe}};return i.push($(s,s+T,g.series,g.originalIndex,w)),i.push($(s,s+n,E.series,E.originalIndex,100)),i}const p=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const w=g.data[0]||0,T=w/p*n,$=s,L=s+T,B=$+T/2,G=Et.value+Math.cos($)*Yt.value,fe=Vt.value+Math.sin($)*Yt.value,Ie=Et.value+Math.cos(L)*Yt.value,oe=Vt.value+Math.sin(L)*Yt.value,ue=Et.value+Math.cos(L)*ht.value,ye=Vt.value+Math.sin(L)*ht.value,ie=Et.value+Math.cos($)*ht.value,We=Vt.value+Math.sin($)*ht.value,Ae=T>Math.PI?1:0,Ee=[`M ${G} ${fe}`,`A ${Yt.value} ${Yt.value} 0 ${Ae} 1 ${Ie} ${oe}`,`L ${ue} ${ye}`,`A ${ht.value} ${ht.value} 0 ${Ae} 0 ${ie} ${We}`,"Z"].join(" "),we=It(E);i.push({path:Ee,color:we,strokeWidth:Qe.value,strokeColor:Ql(i.length,we),value:w,seriesName:g.name,opacity:.8,isHighlighted:ve.value===E,isDimmed:ve.value!==null&&ve.value!==E,isHidden:!1,startAngle:$,endAngle:L,midAngle:B}),s=L}),i)}),a=e.computed(()=>{const t=l.value;return _l.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),r=e.computed(()=>{if(!Nn.value||!cn.value)return[];const t=kl.value,s=Sn.value,n=an.value,i=Bn.value,p=15,g=t*1.3,E=.55,w=(B,G)=>{const fe=Et.value+Math.cos(B.midAngle)*ht.value,Ie=Vt.value+Math.sin(B.midAngle)*ht.value,oe=Et.value+Math.cos(B.midAngle)*(ht.value+s),ue=Vt.value+Math.sin(B.midAngle)*(ht.value+s),ie=oe+n*(G?1:-1),We=G?oe+p:oe-p,Ae=ue-i,Ee=`${B.seriesName}: ${gn(B.value)}`,we=Ee.length*t*E;return{pointerStartX:fe,pointerStartY:Ie,pointerEndX:oe,pointerEndY:ue,horizontalEndX:ie,horizontalEndY:ue,textX:We,textY:Ae,text:Ee,textWidth:we,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(oe-fe,ue-Ie),horizontalLineLength:Math.hypot(ie-oe,0)}},T=(B,G)=>{const fe=Math.abs(B.textY-G.textY)<g,Ie=B.isRightSide?B.textX:B.textX-B.textWidth,oe=B.isRightSide?B.textX+B.textWidth:B.textX,ue=G.isRightSide?G.textX:G.textX-G.textWidth,ye=G.isRightSide?G.textX+G.textWidth:G.textX,ie=Ie<ye&&ue<oe;return fe&&ie},$=l.value.filter(B=>!B.isHidden),L=[];for(let B=0;B<$.length;B++){const G=$[B];let fe=Math.cos(G.midAngle)>=0;if(B>0){const oe=L[B-1],ue=w(G,fe);T(oe,ue)&&(fe=!fe)}const Ie=w(G,fe);L.push({...Ie,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return L}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||yo.value||.7;return ve.value===null||ve.value===void 0?s:ve.value!==null?t.seriesIndex===ve.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},d=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return ve.value!==null?t.seriesIndex===ve.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(ve.value===t.seriesIndex?ve.value=null:ve.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:A.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},m=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},f=(t,s)=>{if(!t||(s.stopPropagation(),Tl.value=!0,ve.value=t.seriesIndex,et.value.show=!1,!jt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120;p+E>Xe.value&&(p=s.clientX-i.left-E-10),g+w>i.height&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const T=Hl.value,$=rl.value,L=T.map(B=>{const G=$[B]||B,fe=h(B,t);return fe?{seriesName:t.seriesName,label:t.label,value:`${G}: ${fe}`,color:t.color}:null}).filter(Boolean);Fe.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderSeries:[]}},h=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=Al.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const p=n.toFixed(1);return Rn.value?p+Rn.value:p}return n?.toString()||""},M=()=>{if(!Ut.value||!et.value.data||et.value.data.length===0)return"Bubbles";const t=[],s=new Set;return et.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_=(t,s)=>{t&&(Tl.value=!1,ve.value=null,Fe.value.show=!1,Fe.value.bubbleData=[])},N=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=ao(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,w=s.clientY-i.top-10;const T=200,$=g?80:50;E+T>Xe.value&&(E=s.clientX-i.left-T-15),w+$>Ue.value&&(w=s.clientY-i.top-$-10),E<0&&(E=10),w<0&&(w=10),at.value={show:!0,x:E,y:w,categoryValue:p,description:g}},J=()=>{at.value.show=!1},Y=e.computed(()=>A.categories.length||Math.max(...hl.value.map(t=>t.data.length))),$e=e.computed(()=>{let t=0;return hl.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),he=e.computed(()=>{const t=[],s=Y.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,p=Et.value+Math.cos(i)*ht.value,g=Vt.value+Math.sin(i)*ht.value;t.push({x:p,y:g,angle:i,index:n})}return t}),dt=e.computed(()=>{const t=[],s=Y.value;return he.value.forEach((n,i)=>{const p=ht.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Et.value+Math.cos(g)*p,w=Vt.value+Math.sin(g)*p+5;let T="middle",$="middle";Math.abs(Math.cos(g))>.5&&(T=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&($=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:w,text:A.categories[i]||`Axis ${i+1}`,anchor:T,baseline:$})}),t}),ln=e.ref(new Set),Gt=(t,s,n)=>{const i=`current-${n}`,p=ln.value.has(i);return!p&&ve.value===null?s.fillOpacity||Ct.value:s.isHighlighted||p?(s.fillOpacity||Ct.value)+.15:s.isDimmed?(s.fillOpacity||Ct.value)*.3:s.fillOpacity||Ct.value},Zt=e.computed(()=>{if(!Gn.value)return[];const t=[],s=Y.value;return Pn.value.forEach((n,i)=>{const p=[],g=[],E=[],w=ve.value===i,T=ve.value!==null&&ve.value!==i,$=ut.value.has(i);for(let L=0;L<s;L++){const B=n.data[L]||0,fe=B/$e.value*ht.value,Ie=L*2*Math.PI/s-Math.PI/2,oe=Et.value+Math.cos(Ie)*fe,ue=Vt.value+Math.sin(Ie)*fe;p.push(`${oe},${ue}`),g.push({x:oe,y:ue}),E.push({x:oe,y:ue,value:B,label:A.categories[L]||`Axis ${L+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:E,color:It(i),fillOpacity:Ct.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:w,isDimmed:T,isHidden:$,seriesIndex:i})}),t}),Qt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,E=s[i].y,w=s[p].x,T=s[p].y;E>t.y!=T>t.y&&t.x<(w-g)*(t.y-E)/(T-E)+g&&(n=!n)}return n},Jt=t=>{if(!Gn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Ne.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,E=Zt.value.filter(w=>w.isHidden?!1:Qt({x:p,y:g},w.polygonPoints));if(E.length>0){E.length,ve.value=E[0].seriesIndex;const w=t.clientX-n.left+10,T=t.clientY-n.top-10,$=200,L=50+E.length*25;let B=w,G=T;B+$>Xe.value&&(B=t.clientX-n.left-$-10),G+L>Ue.value&&(G=t.clientY-n.top-L-10),B<0&&(B=10),G<0&&(G=10);const fe=E.map(Ie=>{let oe=Ie.dataPoints[0],ue=1/0;return Ie.dataPoints.forEach(ye=>{const ie=Math.sqrt(Math.pow(ye.x-p,2)+Math.pow(ye.y-g,2));ie<ue&&(ue=ie,oe=ye)}),{seriesName:Ie.seriesName,color:Ie.color,value:gn(oe.value!==void 0?oe.value:Ie.value)}});Fe.value={show:!0,x:B,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:fe}}else ol()},Ot=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=A.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||ut.value.has(s.seriesIndex))return null;let p,g;if(rn.value){let w=-1,T=null;for(let L=i.data.length-1;L>=0;L--)if(i.data[L]!==null&&i.data[L]!==void 0){w=L,T=i.data[L];break}if(w===-1||T===null)return null;const $=i.data.map((L,B)=>L==null?null:{x:Xt(B),y:nn(L),index:B}).filter(L=>L!==null);if(t.animations.enabled&&!en.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(ct.value.isAnimating||!ct.value.hasAnimated))if(ct.value.isAnimating){const L=ct.value.currentFrame/ct.value.totalFrames,B=On(t.animations.easing,Math.min(L,1)),G=Jo($,B);p=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else p=$[0].x+(s.offsetX||0),g=$[0].y+(s.offsetY||0);else p=Xt(w)+(s.offsetX||0),g=nn(T)+(s.offsetY||0)}else if(cn.value||Gn.value){const w=Math.PI*2/t.logos.length*n;p=Et.value+Math.cos(w)*(ht.value+30)+(s.offsetX||0),g=Vt.value+Math.sin(w)*(ht.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Xn=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},vl=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Yn=t=>{ut.value.has(t)?ut.value.delete(t):ut.value.add(t)},xo=e.computed(()=>{if(!Fe.value.show&&!(Q.value&&et.value.show&&!j.value.isZooming))return{display:"none"};let t,s;if(Q.value&&et.value.show&&!j.value.isZooming){t=et.value.x+15,s=z.value.top;const n=Ut.value?200:150;t+n>Xe.value&&(t=et.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Fe.value.x,s=Fe.value.y;return{left:t+"px",top:s+"px"}}),ll=(t,s)=>{if(!jt.value||Nl.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120,T=Xe.value,$=Ue.value;p+E>T&&(p=s.clientX-i.left-E-10),g+w>$&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&A.categories.includes(t.label)&&(L=A.categories.indexOf(t.label));const B=(tn.value||Ze.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Fe.value={show:!0,x:p,y:g,title:B,value:gn(t.value)||"",categoryIndex:L,spiderSeries:[]}},eo=e.ref(!1),Tl=e.ref(!1),ol=()=>{Fe.value.show=!1,Fe.value.spiderSeries=[],Fe.value.bubbleData=[],et.value.show=!1,eo.value||(ve.value=null)},Nl=e.ref(!1),fl=(t,s)=>{Nl.value=!0,Fe.value.show=!1,et.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;p+E>Xe.value&&(p=s.clientX-i.left-E-15),p<0&&(p=10),g<0&&(g=10),Mn.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},Sl=()=>{Nl.value=!1,Mn.value.show=!1},ct=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),On=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},en=e.computed(()=>tt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ao=()=>{if(!P.value||en.value){ct.value.hasAnimated=!0,kn.value&&(Hn.value=1);return}kn.value&&(Hn.value=0),ct.value.isAnimating=!0,ct.value.currentFrame=0,ct.value.totalFrames=Math.ceil(Re.value/16.67);const t=()=>{const s=ct.value.currentFrame/ct.value.totalFrames,n=On(Se.value,Math.min(s,1));Yo(n),kn.value&&(Hn.value=n),s<1?(ct.value.currentFrame++,ct.value.animationId=requestAnimationFrame(t)):jo()};ct.value.animationId=requestAnimationFrame(t)},Yo=t=>{const s=b.value;s&&s.style.setProperty("--dss-animation-progress",t)},jo=()=>{ct.value.isAnimating=!1,ct.value.hasAnimated=!0,kn.value&&(Hn.value=1),ct.value.animationId&&(cancelAnimationFrame(ct.value.animationId),ct.value.animationId=null)},Do=e.computed(()=>!cn.value||ct.value.hasAnimated?!0:kn.value?Hn.value>=1:zn.value?Ln.value>=1:!0),Zo=e.computed(()=>Nn.value&&Do.value),Eo=e.ref(!1);e.watch(Zo,t=>{t?(Eo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Eo.value=!0})})):Eo.value=!1},{immediate:!0});const Ko=e.computed(()=>{if(!P.value||en.value||ct.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Re.value}ms`,t["--dss-animation-easing"]=Go(Se.value),t["--dss-stagger-delay"]=`${le.value}ms`,t}),Go=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Qo=()=>{if(!P.value||en.value)return"";const t=["dss-chart-animated"];return ct.value.hasAnimated||t.push(`dss-animate-${U.value}`),ct.value.hasAnimated||(cn.value&&Ze.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${U.value}`)),ct.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>A.series,(t,s)=>{nt.value&&s&&ct.value.hasAnimated&&(ct.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ao(),Ye.value)}))},{deep:!0}),e.watch(()=>j.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Wl()},50)}),e.watch(()=>[j.value.scale,j.value.offsetX],()=>{!j.value.isZooming&&!j.value.isDragging&&Wl()},{flush:"post"}),e.watch([_e,it],([t,s])=>{j.value.minScale=t,j.value.maxScale=s,(j.value.scale<t||j.value.scale>s)&&Yl()},{immediate:!0}),e.watch(()=>A.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>vt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Ul)}):document.removeEventListener("click",Ul)}),e.onMounted(()=>{ve.value=null,kn.value&&(!P.value||en.value)&&(Hn.value=1),xl(),b.value&&typeof ResizeObserver<"u"&&(de=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ke&&cancelAnimationFrame(ke),ke=requestAnimationFrame(()=>{ke=null;const{width:n,height:i}=s.contentRect;gt.value=Math.round(n),v.value=Math.round(i),ce.value&&(Rt.value=ce.value.offsetHeight||Ce)}))}),de.observe(b.value)),P.value&&!en.value?Ze.value==="semi-radial"?setTimeout(()=>go(),Ye.value):setTimeout(()=>Ao(),Ye.value):(ct.value.hasAnimated=!0,Ze.value==="semi-radial"&&(Ln.value=1)),document.addEventListener("mousemove",Wo),document.addEventListener("mouseup",qo),document.addEventListener("click",po)}),e.onUnmounted(()=>{ke&&cancelAnimationFrame(ke),de&&b.value&&(de.unobserve(b.value),de.disconnect(),de=null),ct.value.animationId&&cancelAnimationFrame(ct.value.animationId),tl&&(cancelAnimationFrame(tl),tl=null),j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout),document.removeEventListener("mousemove",Wo),document.removeEventListener("mouseup",qo),document.removeEventListener("click",po),document.removeEventListener("click",Ul)});const Wo=t=>{if(j.value.isDragging&&j.value.scale>1&&rn.value){et.value.show=!1;const s=t.clientX-j.value.lastMouseX,{minX:n,maxX:i}=Pt.value,p=i-n||1,E=s*.8;j.value.offsetX+=E;const w=p/j.value.scale,T=p-w,$=0,L=-T/p*z.value.width,B=$;j.value.offsetX=Math.max(L,Math.min(B,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY}},qo=()=>{j.value.isDragging&&(j.value.isDragging=!1,setTimeout(()=>{!j.value.isDragging&&j.value.isZooming},100))},Jo=(t,s)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const p=[];for(let w=1;w<n.length;w++){const T=n[w].x-n[w-1].x,$=n[w].y-n[w-1].y,L=Math.sqrt(T*T+$*$);p.push(L),i+=L}const g=i*s;let E=0;for(let w=0;w<p.length;w++){const T=E+p[w];if(g<=T){const $=(g-E)/p[w],L=n[w],B=n[w+1];return{x:L.x+(B.x-L.x)*$,y:L.y+(B.y-L.y)*$}}E=T}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Qo(),{"dss-chart-fill-width":Le.value,"dss-chart-fill-height":_t.value,"dss-chart-compact":cn.value&&!St.value}]]),style:e.normalizeStyle({width:Le.value?"100%":Xe.value+"px",height:wt.value,...Le.value||_t.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ko.value,cursor:jl()}),"data-chart-type":Ze.value,ref_key:"containerEl",ref:b,onWheel:Xl,onMousedown:Bo,onMousemove:Oe,onMouseup:Mo,onMouseleave:ft,onDblclick:Yl,onContextmenu:e.withModifiers(Mt,["prevent"]),onClick:e.withModifiers(Dt,["left"]),onWheelCapture:Xl},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ce},[e.createElementVNode("div",Ua,[st.value?(e.openBlock(),e.createElementBlock("div",Xa,e.toDisplayString(st.value),1)):e.createCommentVNode("",!0),kt.value?(e.openBlock(),e.createElementBlock("div",Ya,e.toDisplayString(kt.value),1)):e.createCommentVNode("",!0)]),St.value&&xt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Bt.value==="horizontal","dss-legend-vertical":Bt.value==="vertical","dss-legend-top":xt.value==="top","dss-legend-bottom":xt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ut.value.has(i),"dss-legend-hovered":ve.value===i,"dss-legend-dimmed":ve.value!==null&&ve.value!==i}]),onClick:p=>Yn(i),onMouseenter:p=>X(i),onMouseleave:ee,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:It(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0),St.value&&(xt.value==="left"||xt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":xt.value==="left","dss-legend-right":xt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ut.value.has(i),"dss-legend-hovered":ve.value===i,"dss-legend-dimmed":ve.value!==null&&ve.value!==i}]),onClick:p=>Yn(i),onMouseenter:p=>X(i),onMouseleave:ee,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:It(i)})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(n.name),1)],46,Ga))),128))],2)):e.createCommentVNode("",!0)],512),R.showAddMarkerButton&&Dn.value&&Ft.value.addMarker&&(rn.value||Ut.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:mo,title:e.unref(I)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:dn.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,es),s[4]||(s[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,Ja)):e.createCommentVNode("",!0),e.createElementVNode("div",ts,[Ut.value&&un.value?(e.openBlock(),e.createElementBlock("div",ns,"Bubble size: "+e.toDisplayString(un.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Xe.value,height:Ue.value,class:"dss-chart-svg","data-smooth":ne.value,"data-animated":P.value,ref_key:"svgEl",ref:Ne},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:te.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:Xe.value,height:z.value.height*4},null,8,as)],8,os),zn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:el.value},[e.createElementVNode("path",{d:fo.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0),kn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:ml.value},[e.createElementVNode("path",{d:_o.value},null,8,cs)],8,is)):e.createCommentVNode("",!0)]),rn.value||Ut.value?(e.openBlock(),e.createElementBlock("g",us,[pt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ae.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:z.value.left,x2:z.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ms))),128))],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",ps,[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,vs),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,fs)]),e.createElementVNode("g",gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,ys))),128)),Tt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Tt.value),9,Cs)):e.createCommentVNode("",!0),Ge.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(Ge.value),9,ks)):e.createCommentVNode("",!0)]),sl.value.length>0?(e.openBlock(),e.createElementBlock("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sl.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ae.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.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:i=>fl(n,i),onMouseleave:Sl},null,40,xs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.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:i=>fl(n,i),onMouseleave:Sl},null,40,Es)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.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:i=>fl(n,i),onMouseleave:Sl},null,40,Vs)):e.createCommentVNode("",!0)],8,ws),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>fl(n,i),onMouseleave:Sl},null,40,Ns)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,z.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>fl(n,i),onMouseleave:Sl},null,40,Ss),e.createElementVNode("text",{x:n.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(n.totalCount),9,Bs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ae.value},[$n.value?(e.openBlock(),e.createElementBlock("g",_s,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":tn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,$s)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ts))],64))),128))],2),e.createElementVNode("g",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,As))),128)),me.value>0||Je.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Z(n.isHighlighted?q(n,me.value)+2:q(n,me.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ds))),128)):e.createCommentVNode("",!0)])])):Ze.value==="line"?(e.openBlock(),e.createElementBlock("g",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":ct.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(An.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Is))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+2:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,zs))),128)),me.value>0||Je.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Jl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Z(n.isHighlighted?q(n,me.value)+2:q(n,me.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ps))),128)):e.createCommentVNode("",!0)])):Ze.value==="area"?(e.openBlock(),e.createElementBlock("g",Os,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${R.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,Ws)],8,Zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?K.value+.2:K.value,mask:`url(#area-mask-${i}-${R.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*le.value}ms`})},null,14,Us))),128))])):Ze.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":tn.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Xs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ys))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ms),Q.value&&et.value.show&&!j.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ae.value},[e.createElementVNode("line",{x1:et.value.x,x2:et.value.x,y1:z.value.top,y2:z.value.bottom,stroke:pe.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:et.value.x,cy:n.y,r:Z(me.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Gs))),128))],8,js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ut.value?(e.openBlock(),e.createElementBlock("g",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Js,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Z(n.radius),fill:n.color,"fill-opacity":c(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>f(n,p),onMouseleave:p=>_(n),onClick:p=>u(n,p)},null,42,er),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:d(n)}),onLoad:p=>Fl(i),onError:p=>Kl(i),onMouseenter:p=>f(n,p),onMouseleave:p=>_(n),onClick:p=>u(n,p)},null,46,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Jn.value},[Ze.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Et.value,cy:Vt.value,r:ht.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,lr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ze.value,"clip-path":$o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":gl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>ll(n.segment,p),onMouseleave:ol},null,42,ar))),128))],8,or),qn.value&&Do.value?(e.openBlock(),e.createElementBlock("g",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,rr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),Ll.value&&(Do.value||zn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:al.value.x,y:al.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":wl.value,fill:sn.value,class:"dss-radial-data-center"},e.toDisplayString(Fn.value),9,ir)):e.createCommentVNode("",!0),Zo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Eo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,cr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,ur),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":kl.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,dr)],6))),128))],2)):e.createCommentVNode("",!0)],8,nr)):e.createCommentVNode("",!0),Gn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Jn.value},[pt.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Et.value,cy:Vt.value,r:Z(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,vr))),128)),e.createElementVNode("g",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Et.value-16,y:Vt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,gr),e.createElementVNode("text",{x:Et.value,y:Vt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(fn(i)),9,hr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Et.value,x2:n.x,y1:Vt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,yr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/Y.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/Y.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,kr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jt,onMouseleave:ol},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":Gt("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?ze.value+1:ze.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*le.value}ms`,transition:"all 0.2s ease"})},null,14,br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:Z(n.isHighlighted?me.value+1:me.value>0?me.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*le.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>ll(p,E),onMouseleave:ol},null,46,wr))),128))]))),128))],32)],8,mr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Z(n.width/2),fill:It(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Er))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Xn(i),onError:p=>vl(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Vr))),128))])],8,ls))]),re.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Xe.value+"px",height:Ue.value+"px",backgroundImage:`url('${Vn.value}')`,backgroundRepeat:"no-repeat",...rt.value,opacity:Be.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:mn.value+"px",height:mn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>vn(n),["stop"]),onMouseenter:p=>N(n,p),onMouseleave:J},[e.createElementVNode("img",{src:hn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Sr)],44,Nr)),[[e.vShow,H.value]])),128)),at.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:at.value.x+"px",top:at.value.y+"px"})},[e.createElementVNode("div",Br,e.toDisplayString(at.value.categoryValue),1),at.value.description?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(at.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),jt.value&&(Fe.value.show||Q.value&&et.value.show&&!j.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Q.value&&et.value.show&&!j.value.isZooming}]),style:e.normalizeStyle(xo.value)},[!Q.value||!et.value.show||j.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Gn.value&&Fe.value.spiderSeries&&Fe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_r,[Fe.value.title?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(Fe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Tr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Lr,e.toDisplayString(n.value),1)]))),128))])):Ut.value&&Fe.value.bubbleData&&Fe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Fe.value.title?(e.openBlock(),e.createElementBlock("div",Ar,e.toDisplayString(Fe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Fr,e.toDisplayString(Fe.value.title),1),e.createElementVNode("div",Ir,e.toDisplayString(Fe.value.value),1)])),Fe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[on(Fe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pr,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(Fe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Or,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),on(Fe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ur,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(Fe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",jr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(Ut.value?M():R.categories[et.value.categoryIndex]||`Category ${et.value.categoryIndex+1}`),1),Ut.value?(e.openBlock(),e.createElementBlock("div",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(et.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Jr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ei,e.toDisplayString(gn(n.value)),1)]))),128))]),on(et.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ti,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ni,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(et.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",li,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",oi,[e.createElementVNode("div",ai,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),on(et.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",si,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ri,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(et.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ii,[e.createElementVNode("div",ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ui,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),rn.value&&ge.value&&j.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Yl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(j.value.scale*100))+"% "+e.toDisplayString(e.unref(I)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,qa),St.value&&xt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Bt.value==="horizontal","dss-legend-vertical":Bt.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(A.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ut.value.has(i),"dss-legend-hovered":ve.value===i,"dss-legend-dimmed":ve.value!==null&&ve.value!==i}]),onClick:p=>Yn(i),onMouseenter:p=>X(i),onMouseleave:ee,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:It(i)})},null,4),e.createElementVNode("span",mi,e.toDisplayString(n.name),1)],46,di))),128))],2)):e.createCommentVNode("",!0),vt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:vt.value.x+"px",top:vt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ft.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:uo},e.toDisplayString(e.unref(I)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ft.value.addMarker&&(Ft.value.downloadSvg||Ft.value.downloadPng||Ft.value.downloadCsv||Wn.value.length>0)?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),Ft.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:wn},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ft.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ql},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ft.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Ml},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Wn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ft.value.downloadSvg||Ft.value.downloadPng||Ft.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",vi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",fi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(cl(n)),style:e.normalizeStyle(Dl(n)),onClick:p=>So(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:In(n),class:"dss-custom-menu-content"},null,8,hi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",yi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,gi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Me.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Kt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ci,[e.createElementVNode("h3",null,e.toDisplayString(S.value?e.unref(I)("chart.modalMarker.viewMarker"):y.value?e.unref(I)("chart.modalMarker.editMarker"):e.unref(I)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Kt},"×")]),e.createElementVNode("div",ki,[e.createElementVNode("div",bi,[e.createVNode(Oo,{id:"dss-marker-date",mode:"single",modelValue:Me.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>Me.value.date=n),"min-date":Bl.value,"max-date":C.value,disabled:S.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",wi,[e.createElementVNode("label",xi,e.toDisplayString(e.unref(I)("chart.modalMarker.description")),1),S.value?(e.openBlock(),e.createElementBlock("div",Ei,e.toDisplayString(Me.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>Me.value.description=n),placeholder:e.unref(I)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Vi)),[[e.vModelText,Me.value.description]])])]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Si,[y.value&&!S.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(I)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Kt},e.toDisplayString(S.value?e.unref(I)("chart.modalMarker.close"):e.unref(I)("chart.modalMarker.cancel")),1),S.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(Me.value.description&&Me.value.description.length)},e.toDisplayString(y.value?e.unref(I)("chart.modalMarker.save"):e.unref(I)("chart.contextMenu.addMarker")),9,Mi))])])])])):e.createCommentVNode("",!0)],64))}}),Ti={class:"dss-modal-title"},Li={class:"dss-modal-actions"},Ro={__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(R,{emit:be}){const I=R,D=be,Ve=e.ref(null),b=e.ref(null),Ne=e.computed(()=>{const te={"max-width":I.width};return I.height!=="auto"&&(te.height=I.height,te["min-height"]="0"),te}),ce=e.computed(()=>({}));function gt(){D("close-modal")}function v(){I.backDrop&&!Ve.value&&D("close-modal")}function de(te){te.target.tagName==="INPUT"&&(Ve.value=te.target.tagName)}function ke(){setTimeout(()=>{Ve.value=null},300)}function Ce(){const te=document.body,ae=document.documentElement;b.value={bodyOverflow:te.style.overflow,bodyPosition:te.style.position,bodyTop:te.style.top,bodyWidth:te.style.width,htmlOverflow:ae.style.overflow,scrollY:window.scrollY},te.style.overflow="hidden",te.style.position="fixed",te.style.top=`-${b.value.scrollY}px`,te.style.width="100%",te.style.left="0",ae.style.overflow="hidden"}function se(){if(!b.value)return;const te=document.body,ae=document.documentElement,{bodyOverflow:A,bodyPosition:xe,bodyTop:De,bodyWidth:qe,htmlOverflow:mt,scrollY:O}=b.value;te.style.overflow=A||"",te.style.position=xe||"",te.style.top=De||"",te.style.width=qe||"",te.style.left="",ae.style.overflow=mt||"",window.scrollTo(0,O||0)}return e.watch(()=>I.showModal,te=>{if(te)Ce(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.addEventListener("focusin",de),ae.addEventListener("focusout",ke))},100);else{se(),document.body.classList.remove("dss-modal-open");const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.removeEventListener("focusin",de),ae.removeEventListener("focusout",ke))}},{immediate:!0}),e.onUnmounted(()=>{I.showModal&&se()}),(te,ae)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ne.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ae[0]||(ae[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":R.headerType,"font-size":R.titleSize})},[e.createElementVNode("h1",Ti,[e.renderSlot(te.$slots,"title",{},()=>[ae[1]||(ae[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(te.$slots,"title-data"),R.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:gt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ce.value)},[e.renderSlot(te.$slots,"content",{},()=>[ae[2]||(ae[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Li,[e.renderSlot(te.$slots,"actions")])])],4),[[e.vShow,R.showModal]])])):e.createCommentVNode("",!0)]))}},Hi={key:0,class:"dss-table-toolbar"},Ai={class:"dss-table-toolbar-left"},Di=["aria-expanded"],Ri={class:"dss-pagination-select-dropdown",role:"listbox"},Fi={class:"dss-table-column-visibility-label"},Ii={class:"dss-table-checkbox-wrapper"},zi=["checked","onChange"],Pi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Oi={class:"dss-table-column-visibility-text"},Zi={class:"dss-table-toolbar-right"},Wi=["placeholder"],qi=["aria-expanded"],Ui={key:1,class:"dss-table-toolbar-extra"},Xi={class:"dss-table-thead"},Yi={key:0,class:"dss-table-th dss-table-selection-column"},ji={key:0,class:"dss-table-checkbox-wrapper"},Ki=["checked","indeterminate"],Gi={key:0,class:"dss-table-checkbox__indeterminate"},Qi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ji={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ec=["onClick"],tc={class:"dss-table-th-content"},nc={class:"dss-table-th-text"},lc={key:0},oc={key:1},ac={key:2},sc=["data-filter-column-key","aria-expanded","onClick"],rc={class:"dss-table-tbody"},ic=["onClick"],cc={class:"dss-table-checkbox-wrapper"},uc=["type","name","checked","onChange"],dc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},mc={key:1,class:"dss-table-checkbox__dot"},pc=["onClick"],vc=["aria-expanded","aria-label"],fc={key:0,class:"dss-table-expansion-row"},gc=["colspan"],hc=["colspan"],yc={key:1,class:"dss-table-pagination"},Cc={class:"dss-pagination-center"},kc={class:"dss-pagination-controls"},bc=["disabled","title"],wc=["disabled","title"],xc={class:"dss-pagination-pages"},Ec=["onClick"],Vc={key:1,class:"dss-pagination-ellipsis"},Nc=["disabled","title"],Sc=["disabled","title"],Bc=["aria-expanded"],Mc={class:"dss-pagination-select-dropdown",role:"listbox"},_c=["aria-selected","onClick"],$c={key:0,class:"dss-table-filter-row"},Tc=["value","placeholder"],Lc=["min","max","value"],Hc=["min","max","value"],Ac={class:"dss-table-filter-double-range-values"},Dc={key:2,class:"dss-table-filter-daterange"},Rc={class:"dss-table-filter-daterange-row"},Fc={class:"dss-table-filter-daterange-label"},Ic=["value"],zc={class:"dss-table-filter-daterange-row"},Pc={class:"dss-table-filter-daterange-label"},Oc=["value"],Zc=["value","placeholder"],Wc={class:"dss-table-filter-list"},qc=["checked","onChange"],Uc={class:"dss-table-filter-actions"},Xc={name:"DSSTable"},Yc=Object.assign(Xc,{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:R=>typeof R=="object"&&R!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(R,{emit:be}){const{t:I,locale:D}=to.useI18n(),Ve=R,b=be,Ne={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ce(C,y){const S=Object.assign({},C);return gt(C)&&gt(y)&&Object.keys(y).forEach(X=>{gt(y[X])?X in C?S[X]=ce(C[X],y[X]):Object.assign(S,{[X]:y[X]}):Object.assign(S,{[X]:y[X]})}),S}function gt(C){return C&&typeof C=="object"&&!Array.isArray(C)}const v=e.computed(()=>ce(Ne,Ve.options)),de=e.computed(()=>{const C=v.value.table.width;return C==="auto"?null:typeof C=="number"?C:null}),ke=e.computed(()=>v.value.table.height),Ce=e.computed(()=>v.value.table.rowHeight??"auto"),se=e.computed(()=>({height:Ce.value})),te=e.computed(()=>v.value.table.expandable===!0),ae=e.computed(()=>v.value.table.truncated===!0),A=e.computed(()=>v.value.table.striped),xe=e.computed(()=>v.value.table.bordered),De=e.computed(()=>v.value.table.hoverable),qe=e.computed(()=>v.value.table.size),mt=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const O=e.computed(()=>v.value.selection.enabled),Le=e.computed(()=>v.value.selection.mode),_t=e.computed(()=>v.value.sorting.enabled),Xe=e.computed(()=>v.value.sorting.mode),Rt=e.computed(()=>v.value.pagination.enabled),He=e.computed(()=>v.value.pagination.rows),Ue=e.computed(()=>v.value.pagination.rowsPerPageOptions),wt=e.computed(()=>v.value.scrollable),Ze=e.computed(()=>v.value.emptyMessage),$t=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),st=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),kt=e.computed(()=>v.value.toolbar?.search!==!1),un=e.computed(()=>$t.value||st.value||kt.value||Tt.value),Tt=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),Ge=e.ref(""),Ke=e.ref(!1),Lt=e.ref(null);let Ht=null;function qt(){Ke.value?(Ht&&(clearTimeout(Ht),Ht=null),Ke.value=!1,Ge.value="",b("search",""),Lt.value?.blur()):(Ke.value=!0,Ht=setTimeout(()=>{Ht=null,Lt.value?.focus()},80))}function pt(){Ge.value||(Ke.value=!1)}function St(){Ge.value="",b("search",""),Lt.value?.focus()}const xt=e.computed(()=>({"dss-table-striped":A.value,"dss-table-bordered":xe.value,"dss-table-hoverable":De.value,[`dss-table-${qe.value}`]:qe.value!=="default","dss-table-truncated":ae.value})),Bt=(C,y)=>C?.field??C?.key??y,jt=e.ref(new Set);function Q(){const C=new Set;Ve.columns.forEach((y,S)=>{y?.hidden!==!0&&C.add(Bt(y,S))}),jt.value=C}const pe=e.computed(()=>Ve.columns.filter((C,y)=>jt.value.has(Bt(C,y)))),ge=C=>{const y=Ve.columns.findIndex(S=>S===C);return Bt(C,y>=0?y:0)},_e=(C,y)=>jt.value.has(Bt(C,y));function it(C,y){const S=Bt(C,y),X=new Set(jt.value);X.has(S)?X.delete(S):X.add(S),jt.value=X}const ze=e.ref(null),Qe=e.ref(!1);function me(C){ze.value&&!ze.value.contains(C.target)&&(Qe.value=!1)}const Je=e.computed(()=>pe.value.length+(O.value?1:0)+(te.value?1:0)),q=(C,y)=>C?.id??C?.key??y,Z=e.ref(new Set),K=e.ref(null),ne=(C,y)=>Z.value.has(q(C,y)),x=(C,y,S)=>{S&&S.stopPropagation();const X=q(C,y),ee=new Set(Z.value);ee.has(X)?(ee.delete(X),b("row-collapse",{data:C,index:y})):(ee.add(X),b("row-expand",{data:C,index:y})),Z.value=ee},k=(C,y)=>{if(!ae.value)return;const S=q(C,y);K.value!==S&&(K.value=S)},V=e.ref(null),P=e.ref(0),U=e.ref([]),Re=C=>{if(Xe.value==="single")return V.value===C.field?P.value:0;{const y=U.value.find(S=>S.field===C.field);return y?y.order:0}},Ye=C=>{const y=Re(C);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Se=e.ref({}),le=e.ref(null),nt=e.ref(null),tt=220,Ct=e.ref(null),yt=e.computed(()=>pe.value.find(C=>ge(C)===le.value)??null),je=e.computed(()=>{if(!yt.value||yt.value.filter!=="range")return null;const C=yt.value,y=le.value,{min:S,max:X}=Be(C),ee=C.filterMin??S,Oe=C.filterMax??X,ft=Ft(y),Mt=ft.min??ee,Dt=ft.max??Oe,In=Oe-ee,cl=In===0?0:(Mt-ee)/In*100,Dl=In===0?100:(Dt-ee)/In*100;return{rangeMin:ee,rangeMax:Oe,currentMin:Mt,currentMax:Dt,minPct:cl,maxPct:Dl}}),fn=e.ref(null),jn=e.ref("max");function Dn(C){const y=fn.value,S=je.value;if(!y||!S)return;const X=y.getBoundingClientRect(),Oe=(C.clientX-X.left)/X.width*100,ft=(S.minPct+S.maxPct)/2;jn.value=Oe<ft?"min":"max"}function Ft(C){return Se.value[C]??{}}function Wn(C,y){Se.value={...Se.value,[C]:y}}function dn(C){const y=Se.value[C];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function En(C){const y={...Se.value};delete y[C],Se.value=y,le.value=null,nt.value=null}function mn(){if(!le.value){nt.value=null;return}const C=Ct.value;if(!C)return;const y=C.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${le.value}"]`);if(!y)return;const S=y.getBoundingClientRect();nt.value={top:S.bottom+6,left:Math.max(8,S.right-tt)}}const Rn=e.computed(()=>{const C=String(Ge.value??"").trim().toLowerCase();return C?Ve.data.filter(y=>pe.value.some(S=>H(j(y,S)).some(ee=>String(ee).toLowerCase().includes(C)))):Ve.data}),gn=e.computed(()=>{let C=[...Rn.value];const y=(Ge.value??"").trim().toLowerCase();return y&&(C=C.filter(S=>Ve.columns.some(X=>{if(!X||!X.field)return!1;const ee=j(S,X);return String(ee??"").toLowerCase().includes(y)}))),pe.value.forEach(S=>{const X=ge(S),ee=Se.value[X];if(!ee)return;const Oe=S.field;if(Oe){if(ee.type==="string"&&ee.value?.trim()){const ft=ee.value.trim().toLowerCase();C=C.filter(Mt=>{const Dt=j(Mt,S);return String(Dt??"").toLowerCase().includes(ft)})}else if(ee.type==="range")C=C.filter(ft=>{const Mt=At(ft,Oe),Dt=Number(Mt);return!(Number.isNaN(Dt)||ee.min!=null&&Dt<ee.min||ee.max!=null&&Dt>ee.max)});else if(ee.type==="dateRange"){const ft=ee.from?new Date(ee.from).getTime():null,Mt=ee.to?new Date(ee.to).getTime():null;C=C.filter(Dt=>{const In=At(Dt,Oe),cl=In?new Date(In).getTime():NaN;return!(Number.isNaN(cl)||ft!=null&&cl<ft||Mt!=null&&cl>Mt)})}else if(ee.type==="list"&&ee.selected?.length){const ft=new Set(ee.selected);C=C.filter(Mt=>H(j(Mt,S)).some(In=>ft.has(In)))}}}),C});function H(C){if(C==null)return[""];if(Array.isArray(C))return C.flatMap(H);if(typeof C=="object"){const y=C?.label??C?.name??C?.value??C?.title;return[y!=null?String(y):String(C)]}return[String(C)]}function W(C){const y=new Set;return Ve.data.forEach(S=>{H(j(S,C)).forEach(ee=>y.add(ee))}),Array.from(y).sort((S,X)=>String(S).localeCompare(String(X)))}function F(C,y){if(le.value===C){le.value=null,nt.value=null;return}if(le.value=C,y?.currentTarget){const S=y.currentTarget.getBoundingClientRect();nt.value={top:S.bottom+6,left:Math.max(8,S.right-tt)}}else mn()}function re(C,y){Wn(C,{type:"string",value:y})}function Be(C){const y=C.field;if(!y)return{min:0,max:100};let S=1/0,X=-1/0;return Ve.data.forEach(ee=>{const Oe=At(ee,y),ft=Number(Oe);Number.isNaN(ft)||(S=Math.min(S,ft),X=Math.max(X,ft))}),{min:S===1/0?0:S,max:X===-1/0?100:X}}function ot(C,y,S){const X={...Ft(C),type:"range"},ee=S===""?null:Number(S),Oe=ee===null||Number.isNaN(ee)?null:ee;X[y]=Oe,Oe!=null&&(y==="min"&&X.max!=null&&Oe>X.max&&(X.max=Oe),y==="max"&&X.min!=null&&Oe<X.min&&(X.min=Oe)),Wn(C,X)}function lt(C,y,S){const X={...Ft(C),type:"dateRange"};X[y]=S||"",Wn(C,X)}const Pe=e.reactive({});function rt(C,y){Pe[C]=y}function pn(C){const y=ge(C),S=(Pe[y]??"").trim().toLowerCase(),X=W(C);return S?X.filter(ee=>String(ee).toLowerCase().includes(S)):X}function on(C,y){return(Ft(C).selected??[]).includes(y!=null?String(y):"")}function bn(C,y){const X=[...Ft(C).selected??[]],ee=y!=null?String(y):"",Oe=X.indexOf(ee);Oe>=0?X.splice(Oe,1):X.push(ee),Wn(C,{type:"list",selected:X})}function Vn(C){le.value&&!C.target.closest(".dss-table-filter-wrap")&&!C.target.closest(".dss-table-filter-dropdown")&&(le.value=null,nt.value=null)}function Nn(){mn()}const kl=C=>{if(!(C.sortable===!1||!_t.value))if(Xe.value==="single")V.value===C.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=C.field,P.value=1),P.value===0&&(V.value=null),b("sort",{field:V.value,order:P.value});else{const y=U.value.findIndex(S=>S.field===C.field);y>=0?U.value[y].order===1?U.value[y].order=-1:U.value.splice(y,1):U.value.push({field:C.field,order:1}),b("sort",{multiSortMeta:U.value})}},Sn=e.computed(()=>{if(!_t.value)return gn.value;let C=[...gn.value];return Xe.value==="single"&&V.value&&P.value!==0?C.sort((y,S)=>{const X=At(y,V.value),ee=At(S,V.value);return X===ee?0:X==null?1:ee==null?-1:(X<ee?-1:X>ee?1:0)*P.value}):Xe.value==="multiple"&&U.value.length>0&&C.sort((y,S)=>{for(const X of U.value){const ee=At(y,X.field),Oe=At(S,X.field);if(ee===Oe)continue;if(ee==null)return 1;if(Oe==null)return-1;const ft=ee<Oe?-1:ee>Oe?1:0;if(ft!==0)return ft*X.order}return 0}),C}),an=e.ref(0),Bn=e.ref(He.value),qn=e.ref(!1),bl=e.ref(null),Ll=C=>{Bn.value=C,qn.value=!1,an.value=0,b("page",{page:0,rows:Bn.value})};function Fn(C){bl.value&&!bl.value.contains(C.target)&&(qn.value=!1)}const wl=e.computed(()=>Sn.value.length),al=e.computed(()=>Math.ceil(wl.value/Bn.value)),sn=e.computed(()=>Rt.value?an.value*Bn.value:0),Zl=e.computed(()=>Rt.value?Math.min((an.value+1)*Bn.value,wl.value):wl.value),sl=e.computed(()=>{if(!Rt.value)return Sn.value;const C=sn.value,y=Zl.value;return Sn.value.slice(C,y)}),Mn=e.ref(new Set),Hl=e.computed(()=>Sn.value.filter((C,y)=>Mn.value.has(q(C,y)))),rl=e.computed(()=>{const C=Sn.value.length;return C>0&&Mn.value.size===C}),Al=e.computed(()=>{const C=Sn.value.length,y=Mn.value.size;return y>0&&y<C}),ut=(C,y)=>Mn.value.has(q(C,y)),ve=()=>{if(rl.value)Mn.value=new Set,b("unselect-all");else{const C=new Set;Sn.value.forEach((y,S)=>C.add(q(y,S))),Mn.value=C,b("select-all",Hl.value)}},il=(C,y)=>{const S=q(C,y),X=new Set(Mn.value),ee=X.has(S);Le.value==="single"?ee?(X.delete(S),b("row-unselect",C)):(X.clear(),X.add(S),b("row-select",C)):ee?(X.delete(S),b("row-unselect",C)):(X.add(S),b("row-select",C)),Mn.value=X},Fe=e.computed(()=>{const C=al.value,y=an.value+1,S=2,X=[],ee=[];let Oe;for(let ft=1;ft<=C;ft++)(ft===1||ft===C||ft>=y-S&&ft<=y+S)&&X.push(ft);for(const ft of X)Oe&&(ft-Oe===2?ee.push(Oe+1):ft-Oe!==1&&ee.push("...")),ee.push(ft),Oe=ft;return ee}),at=C=>{C<0||C>=al.value||(an.value=C,b("page",{page:C,rows:Bn.value}))},et=(C,y,S)=>{b("row-click",{data:C,index:y,originalEvent:S}),k(C,sn.value+y)},vt=(C,y)=>{const S=sn.value+y;return{"dss-table-row-selected":ut(C,S),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ae.value,"dss-table-row-truncated-expanded":K.value===q(C,S)}},j=(C,y)=>y.field?At(C,y.field):"",At=(C,y)=>y.split(".").reduce((S,X)=>S&&S[X],C),Me=C=>{const y=C.align??mt.value;return{"dss-table-sortable":C.sortable!==!1&&_t.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[C.className]:C.className}},Bl=C=>{const y={};return C.width&&(y.width=typeof C.width=="number"?`${C.width}px`:C.width),C.minWidth&&(y.minWidth=typeof C.minWidth=="number"?`${C.minWidth}px`:C.minWidth),C.maxWidth&&(y.maxWidth=typeof C.maxWidth=="number"?`${C.maxWidth}px`:C.maxWidth),y};return e.watch(()=>Ve.locale,C=>{C&&C!==D.value&&(D.value=C)},{immediate:!0}),e.watch(He,C=>{Bn.value=C,an.value=0}),e.watch(Ge,C=>{b("search",C??"")}),e.watch(()=>Ve.columns,()=>{Q()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Fn),document.addEventListener("click",me),document.addEventListener("click",Vn),window.addEventListener("resize",Nn),window.addEventListener("scroll",Nn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Fn),document.removeEventListener("click",me),document.removeEventListener("click",Vn),window.removeEventListener("resize",Nn),window.removeEventListener("scroll",Nn,!0)}),(C,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Ct,style:e.normalizeStyle({width:de.value+"px",height:ke.value?ke.value+"px":"auto"})},[un.value?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("div",Ai,[$t.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=S=>b("download-pdf"))},[y[21]||(y[21]=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(I)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),st.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=S=>b("download-excel"))},[y[22]||(y[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_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(I)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Tt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:ze},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Qe.value}]),onClick:y[2]||(y[2]=S=>Qe.value=!Qe.value),"aria-expanded":Qe.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(I)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Di),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,(S,X)=>(e.openBlock(),e.createElementBlock("li",{key:Bt(S,X),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Fi,[e.createElementVNode("span",Ii,[e.createElementVNode("input",{type:"checkbox",checked:_e(S,X),onChange:ee=>it(S,X),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,zi),_e(S,X)?(e.openBlock(),e.createElementBlock("span",Pi,[...y[24]||(y[24]=[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",Oi,e.toDisplayString(S.header),1)])]))),128))],512),[[e.vShow,Qe.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zi,[kt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ke.value||Ge.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Lt,"onUpdate:modelValue":y[4]||(y[4]=S=>Ge.value=S),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(I)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=S=>Ke.value=!0),onBlur:pt},null,40,Wi),[[e.vModelText,Ge.value]]),Ge.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:St},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":Ke.value||!!Ge.value,onMousedown:e.withModifiers(qt,["prevent"])},[...y[26]||(y[26]=[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,qi)],2)):e.createCommentVNode("",!0),C.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ui,[e.renderSlot(C.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":wt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",xt.value])},[e.createElementVNode("thead",Xi,[e.createElementVNode("tr",null,[O.value?(e.openBlock(),e.createElementBlock("th",Yi,[Le.value==="multiple"?(e.openBlock(),e.createElementBlock("span",ji,[e.createElementVNode("input",{type:"checkbox",checked:rl.value,indeterminate:Al.value,onChange:ve,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ki),Al.value?(e.openBlock(),e.createElementBlock("span",Gi)):rl.value?(e.openBlock(),e.createElementBlock("span",Qi,[...y[27]||(y[27]=[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),te.value?(e.openBlock(),e.createElementBlock("th",Ji)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(S,X)=>(e.openBlock(),e.createElementBlock("th",{key:ge(S),class:e.normalizeClass(["dss-table-th",Me(S)]),style:e.normalizeStyle(Bl(S)),onClick:ee=>kl(S)},[e.createElementVNode("div",tc,[e.createElementVNode("span",nc,e.toDisplayString(S.header),1),S.sortable!==!1&&_t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ye(S)])},[Re(S)===0?(e.openBlock(),e.createElementBlock("span",lc,[...y[28]||(y[28]=[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)])])):Re(S)===1?(e.openBlock(),e.createElementBlock("span",oc,[...y[29]||(y[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:"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)])])):Re(S)===-1?(e.openBlock(),e.createElementBlock("span",ac,[...y[30]||(y[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 -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),S.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":le.value===ge(S)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":dn(ge(S))}]),"data-filter-column-key":ge(S),"aria-expanded":le.value===ge(S),"aria-label":"Filter column",onClick:ee=>F(ge(S),ee)},[...y[31]||(y[31]=[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,sc)],2)):e.createCommentVNode("",!0)])],14,ec))),128))])]),e.createElementVNode("tbody",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sl.value,(S,X)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:q(S,sn.value+X)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",vt(S,X)]),style:e.normalizeStyle(se.value),onClick:ee=>et(S,X,ee)},[O.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",cc,[e.createElementVNode("input",{type:Le.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${R.tableId}`,checked:ut(S,sn.value+X),onChange:ee=>il(S,sn.value+X),class:e.normalizeClass(["dss-table-checkbox",Le.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,uc),Le.value==="multiple"&&ut(S,sn.value+X)?(e.openBlock(),e.createElementBlock("span",dc,[...y[32]||(y[32]=[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)])])):Le.value==="single"&&ut(S,sn.value+X)?(e.openBlock(),e.createElementBlock("span",mc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ee=>x(S,sn.value+X,ee),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ne(S,sn.value+X),"aria-label":ne(S,sn.value+X)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ne(S,sn.value+X)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,vc)],8,pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,(ee,Oe)=>(e.openBlock(),e.createElementBlock("td",{key:ge(ee),class:e.normalizeClass(["dss-table-td",Me(ee)]),style:e.normalizeStyle(Bl(ee))},[e.renderSlot(C.$slots,`cell-${ee.field}`,{data:S,column:ee,rowIndex:X},()=>[e.createTextVNode(e.toDisplayString(j(S,ee)),1)])],6))),128))],14,ic),te.value&&ne(S,sn.value+X)?(e.openBlock(),e.createElementBlock("tr",fc,[e.createElementVNode("td",{colspan:Je.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(C.$slots,"expansion",{data:S,rowIndex:X})],8,gc)])):e.createCommentVNode("",!0)],64))),128)),sl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(se.value)},[e.createElementVNode("td",{colspan:Je.value,class:"dss-table-empty-cell"},[e.renderSlot(C.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Ze.value),1)])],8,hc)],4))])],2)],2),Rt.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:an.value===0,onClick:y[8]||(y[8]=S=>at(0)),title:e.unref(I)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:an.value===0,onClick:y[9]||(y[9]=S=>at(an.value-1)),title:e.unref(I)("table.previousPage")}," ‹ ",8,wc),e.createElementVNode("span",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,S=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S},[S!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":S===an.value+1}]),onClick:X=>at(S-1)},e.toDisplayString(S),11,Ec)):(e.openBlock(),e.createElementBlock("span",Vc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:an.value>=al.value-1,onClick:y[10]||(y[10]=S=>at(an.value+1)),title:e.unref(I)("table.nextPage")}," › ",8,Nc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:an.value>=al.value-1,onClick:y[11]||(y[11]=S=>at(al.value-1)),title:e.unref(I)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Sc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:bl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":qn.value}]),onClick:y[12]||(y[12]=S=>qn.value=!qn.value),"aria-expanded":qn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(Bn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Bc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":S===Bn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":S===Bn.value}]),onClick:X=>Ll(S)},e.toDisplayString(S),11,_c))),128))],512),[[e.vShow,qn.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(nt.value?{top:nt.value.top+"px",left:nt.value.left+"px",width:tt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[yt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[yt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("input",{type:"text",value:Ft(le.value).value??"",onInput:y[13]||(y[13]=S=>re(le.value,S.target.value)),class:"dss-table-filter-input",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Tc)])):yt.value.filter==="range"&&je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":je.value.minPct+"%","--range-max-pct":je.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:fn,class:"dss-table-filter-double-range-track",onMousemove:Dn,onMouseenter:Dn},[e.createElementVNode("input",{type:"range",min:je.value.rangeMin,max:je.value.rangeMax,value:je.value.currentMin,onInput:y[14]||(y[14]=S=>ot(le.value,"min",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:jn.value==="min"?2:1})},null,44,Lc),e.createElementVNode("input",{type:"range",min:je.value.rangeMin,max:je.value.rangeMax,value:je.value.currentMax,onInput:y[15]||(y[15]=S=>ot(le.value,"max",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:jn.value==="max"?2:1})},null,44,Hc)],544),e.createElementVNode("div",Ac,e.toDisplayString(je.value.currentMin)+" – "+e.toDisplayString(je.value.currentMax),1)],4)):yt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Fc,e.toDisplayString(e.unref(I)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Ft(le.value).from??"",onInput:y[16]||(y[16]=S=>lt(le.value,"from",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ic)]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(I)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Ft(le.value).to??"",onInput:y[17]||(y[17]=S=>lt(le.value,"to",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Oc)])])):yt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Pe[le.value]??"",onInput:y[18]||(y[18]=S=>rt(le.value,S.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Zc),e.createElementVNode("div",Wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pn(yt.value),S=>(e.openBlock(),e.createElementBlock("label",{key:S,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:on(le.value,S),onChange:X=>bn(le.value,S)},null,40,qc),e.createElementVNode("span",null,e.toDisplayString(S),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Uc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=S=>En(le.value))},e.toDisplayString(e.unref(I)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,le.value&&yt.value&&nt.value]])]),_:1})]))],64))}}),jc={class:"dss-toolbar-left"},Kc=["title"],Gc=["title"],Qc={class:"dss-toolbar-dropdown-wrapper"},Jc=["title"],eu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},au={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},su={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],vu=["title"],fu=["title"],gu={key:2,class:"dss-toolbar-separator"},hu=["title"],yu={key:4,class:"dss-toolbar-separator"},Cu={key:5,class:"dss-toolbar-dropdown-wrapper"},ku=["title"],bu={class:"dss-toolbar-dropdown-ai"},wu={class:"dss-toolbar-right"},xu={key:0,class:"dss-toolbar-custom-group"},Eu={key:1,class:"dss-toolbar-separator"},Vu={class:"dss-link-modal-content"},Nu={class:"dss-link-modal-field"},Su={class:"dss-link-modal-label"},Bu=["placeholder"],Mu={class:"dss-link-modal-field"},_u={class:"dss-link-modal-label"},$u=["placeholder"],Tu={class:"dss-image-modal-tabs"},Lu={key:0,class:"dss-image-tab-content"},Hu={class:"dss-link-modal-content"},Au={class:"dss-link-modal-field"},Du={key:0,class:"dss-link-modal-label"},Ru=["src"],Fu={class:"dss-link-modal-field"},Iu={class:"dss-link-modal-label"},zu=["placeholder"],Pu={class:"dss-link-modal-field"},Ou={class:"dss-link-modal-label"},Zu=["placeholder"],Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={key:1,class:"dss-image-tab-content"},Yu={class:"dss-link-modal-content"},ju={class:"dss-link-modal-field"},Ku={class:"dss-link-modal-label"},Gu=["placeholder"],Qu={class:"dss-link-modal-field"},Ju={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},ld=["placeholder"],od={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-text-editor-title-input-container"},id={key:0,class:"dss-text-editor-title-preview"},cd={key:0},ud={key:1,class:"dss-text-editor-preview-placeholder"},dd=["value","placeholder","disabled"],md={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},pd={class:"dss-text-editor-description-input-container"},vd={key:0,class:"dss-text-editor-description-preview"},fd={key:0},gd={key:1,class:"dss-text-editor-preview-placeholder"},hd=["value","placeholder","disabled"],yd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Cd=["data-comment-id","onMouseenter"],kd=["onClick"],bd=["src","alt"],wd={key:1},xd=["onClick"],Ed=["src","alt"],Vd={key:1},Nd=["data-has-second-user","onClick"],Sd={class:"editor-comment-marker-count"},Bd={key:4,class:"dss-text-editor-textarea-wrapper"},Md=["value","placeholder","rows","disabled"],_d={class:"dss-text-editor-footer"},$d={class:"dss-text-editor-footer-content"},Td={class:"dss-text-editor-footer-stat"},Ld={class:"dss-text-editor-footer-stat"},Hd={key:5,class:"dss-text-editor-content-wrapper"},Ad={key:0,class:"dss-comment-overlay-body"},Dd={class:"dss-comment-selection-wrapper"},Rd=["innerHTML"],Fd={class:"dss-comment-messages-wrapper"},Id={key:0,class:"dss-comment-avatar-wrapper"},zd={class:"dss-comment-avatar"},Pd=["src","alt"],Od={key:1},Zd={class:"dss-comment-header"},Wd={class:"dss-comment-header-text"},qd={class:"dss-comment-author"},Ud={key:0,class:"dss-comment-date"},Xd=["onClick","title"],Yd={class:"dss-comment-overlay-inner"},jd=["placeholder","onKeydown"],Kd={class:"dss-text-editor-footer"},Gd={class:"dss-text-editor-footer-content"},Qd={class:"dss-text-editor-footer-stat"},Jd={class:"dss-text-editor-footer-stat"},e1=["title"],t1=["title"],n1={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:""},l1={class:"dss-image-popup-content"},o1={key:0,class:"dss-image-popup-no-alt-icon"},a1=["title"],s1=["title"],r1={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:""},i1={class:"dss-toolbar-left"},c1=["title"],u1=["title"],d1={class:"dss-toolbar-dropdown-wrapper"},m1=["title"],p1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1=["title"],M1=["title"],_1={key:2,class:"dss-toolbar-separator"},$1={key:3,class:"dss-toolbar-dropdown-wrapper"},T1=["title"],L1={class:"dss-toolbar-dropdown-ai"},H1={key:0,class:"dss-toolbar-right"},A1={key:0,class:"dss-toolbar-separator"},D1={key:0,class:"dss-toolbar-custom-group"},R1={key:1,class:"dss-toolbar-separator"},F1={name:"DSSTextEditor"},I1=Object.assign(F1,{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:R=>typeof R=="object"&&R!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==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(R,{expose:be,emit:I}){const{t:D,locale:Ve}=to.useI18n(),b=R,Ne=I,ce=e.useSlots(),gt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
96
+ `,t+="Category",R.series.forEach(g=>{const V=g.name.replace(/"/g,'""');t+=',"'+V+'"'}),t+=`
97
+ `;const s=Math.max(...R.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let L='"'+(R.categories[g]||A("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';R.series.forEach(T=>{const H=T.data&&T.data[g]!==void 0?T.data[g]:"";L+=","+H}),t+=L+`
98
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=_l("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),We()}catch(t){console.error("Error downloading CSV:",t)}},So=t=>{if(typeof t.action=="function"){const s={series:R.series,categories:R.categories,markers:Ut.value},l={chartX:vt.value.chartX,chartY:vt.value.chartY,dataX:vt.value.mouseDataX,dataY:vt.value.mouseDataY,categoryIndex:clampedCategoryIndex||vt.value.categoryIndex};t.action(s,l)}We()},uo=()=>{Gt(),Re.value.show=!0,Re.value.categoryIndex=vt.value.categoryIndex,Re.value.fromButton=!1,We()},mo=()=>{Gt(),Re.value.show=!0,Re.value.categoryIndex=0,Re.value.fromButton=!0},po=t=>{if(vt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(vt.value.show=!1)}},Yn=t=>{vt.value.show&&!t.target.closest(".context-menu")&&(vt.value.show=!1)},jn=t=>{if(!ul.value||!Be.value)return;t.preventDefault(),t.stopPropagation(),j.value.isZooming=!0,Je.value.show=!1,j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<P.value.left-50||i>P.value.right+50||p<P.value.top-50||p>P.value.bottom+100){j.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,V=Math.max(j.value.minScale,Math.min(j.value.maxScale,j.value.scale*g));if(V!==j.value.scale){const{minX:w,maxX:L}=It.value,T=L-w||1,H=T/j.value.scale,B=w-j.value.offsetX/P.value.width*T,Q=(i-P.value.left)/P.value.width,ye=B+Q*H;j.value.scale=V;const Oe=T/j.value.scale,oe=ye-Q*Oe;j.value.offsetX=-(oe-w)/T*P.value.width,j.value.scale<=1.01&&(j.value.scale=1,j.value.offsetX=0)}j.value.zoomTimeout=setTimeout(()=>{j.value.isZooming=!1,j.value.zoomTimeout=null},300)},Bo=t=>{if(!ul.value||!Be.value||j.value.scale<=1)return;Je.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,j.value.isDragging=!0,j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY,t.preventDefault()},Mo=()=>{j.value.isDragging=!1},Kn=()=>{!ul.value||!Be.value||(j.value.scale=1,j.value.offsetX=0,j.value.isDragging=!1,j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1)},Gn=()=>!ul.value||!Kl.value||!Be.value?"default":j.value.isDragging?"grabbing":j.value.scale>1?"grab":"dss-crosshair",In=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 s=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],V=t[Math.min(l+2,t.length-1)],w=p.x+(g.x-i.x)/6*x.value,L=p.y+(g.y-i.y)/6*x.value,T=g.x-(V.x-p.x)/6*x.value,H=g.y-(V.y-p.y)/6*x.value;s+=` C ${w} ${L} ${T} ${H} ${g.x} ${g.y}`}return s},xl=e.computed(()=>{const s=$.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(Tt.value?30:0)+60;if(en.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(dl.value){const B=!_t.value,Q=jl.value,ye=Q?hn.value+cn.value+Math.max(24,xn.value+16):0,Oe=B?12:p;let oe=0;it.value&&(oe+=B?8:15),Et.value&&(oe+=B?6:10);const ue=qe();let ke=Oe+(B?4:16)+(Q?ye:0),ie=Oe+(Q?ye:0);_t.value&&Nt.value==="left"?ke+=ue.legendWidth||150:_t.value&&Nt.value==="right"&&(ie+=ue.legendWidth||150);const Pe=Ue.value==="semi-radial"?Q?ye:8:Q?ye:B?8:p+80,_e=Q?14:0,Se=Oe+oe+_e,Ie={left:ke,top:Se,right:ie,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Ie.left,top:i.top??Ie.top,right:i.right??Ie.right,bottom:i.bottom??Ie.bottom}:Ie}let V=0;it.value&&(V+=15),Et.value&&(V+=10);const w=qe();let L=p+16,T=p;_t.value&&Nt.value==="left"?L+=w.legendWidth||150:_t.value&&Nt.value==="right"&&(T+=w.legendWidth||150);const H={left:L,top:p+V,right:T,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),P=e.computed(()=>({left:xl.value.left,top:xl.value.top,right:$e.value-xl.value.right,bottom:Ze.value-xl.value.bottom,width:$e.value-(xl.value.left+xl.value.right),height:Ze.value-(xl.value.top+xl.value.bottom)})),ul=e.computed(()=>["line","area","bar"].includes(Ue.value)||Lt.value),$l=e.computed(()=>Lt.value),dl=e.computed(()=>["radial","semi-radial"].includes(Ue.value)),en=e.computed(()=>Ue.value==="spider"),Wt=e.computed(()=>Ue.value==="bubble"),ol=e.computed(()=>$.value?.chart?.orientation==="horizontal"&&(Ue.value==="bar"||$l.value)),tn=t=>{const{minY:s,maxY:l}=It.value,i=l-s||1;return P.value.left+(t-s)/i*P.value.width},Tl=t=>{const{maxX:s}=It.value,l=s+1,p=P.value.height/l;return P.value.top+(t+.5)*p},St=e.computed(()=>dl.value?xl.value.left+($e.value-xl.value.left-xl.value.right)/2:$e.value/2),Bt=e.computed(()=>en.value?Ze.value/2-40:dl.value?xl.value.top+(Ze.value-xl.value.top-xl.value.bottom)/2:Ze.value/2),Ct=e.computed(()=>{if(en.value){const t=P.value.width-80,s=P.value.height-80;return Math.min(t,s)/2}return Math.min(P.value.width,P.value.height)/2}),Xt=e.computed(()=>{const t=$.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return Ct.value*l}),fo=e.computed(()=>{const t=$.value,s=typeof R.innerSize=="number"?R.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(dl.value||en.value)?1:1+s/100}),ln=e.computed(()=>{const t=fo.value;if(t===1||t<=0)return;const s=St.value,l=Bt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Ll=e.ref(0),nn=e.computed(()=>`semi-radial-fill-clip-${R.chartId}`),Il=e.computed(()=>Ue.value==="semi-radial"),Ft=e.computed(()=>Il.value&&O.value&&!tl.value),Ln=e.computed(()=>Il.value&&O.value&&!tl.value&&K.value==="fill"),vo=e.computed(()=>{const t=Ft.value?Ll.value:1,s=St.value,l=Bt.value,i=Xt.value,p=Ct.value,g=Math.PI,V=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const w=s+p*Math.cos(g),L=l+p*Math.sin(g),T=s+p*Math.cos(V),H=l+p*Math.sin(V),B=s+i*Math.cos(V),Q=l+i*Math.sin(V),ye=s+i*Math.cos(g),Oe=l+i*Math.sin(g),oe=t>.5?1:0;return`M ${s} ${l} L ${w} ${L} A ${p} ${p} 0 ${oe} 1 ${T} ${H} L ${B} ${Q} A ${i} ${i} 0 ${oe} 1 ${ye} ${Oe} Z`}),mn=e.computed(()=>{if(!(!Il.value||!Ft.value)&&!Ln.value)return`url(#${nn.value})`}),Cn=t=>{if(!(!Ln.value||t!==0))return`url(#${nn.value})`},Hl=e.ref(0),pn=e.computed(()=>`radial-reveal-clip-${R.chartId}`),El=e.computed(()=>Ue.value==="radial"),_o=e.computed(()=>{const t=El.value?Hl.value:1,s=St.value,l=Bt.value,i=Math.max(Ct.value*1.5,$e.value,Ze.value);if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;if(t>=1){const B=s-i,Q=s+i;return`M ${B} ${l} A ${i} ${i} 0 0 1 ${Q} ${l} A ${i} ${i} 0 0 1 ${B} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,V=s+i*Math.cos(p),w=l+i*Math.sin(p),L=s+i*Math.cos(g),T=l+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${l} L ${V} ${w} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),$o=e.computed(()=>{if(mn.value)return mn.value;if(El.value)return`url(#${pn.value})`});let on=null;const go=()=>{if(!Ft.value)return;Ll.value=0;const t=Te.value,s=performance.now(),l=i=>{const p=i-s,g=Math.min(1,p/t);Ll.value=Pl(Me.value,g),g<1&&(on=requestAnimationFrame(l))};on=requestAnimationFrame(l)},Sn=e.computed(()=>$.value?.bubbles?.minSize||8),ho=e.computed(()=>$.value?.bubbles?.maxSize||50),yo=e.computed(()=>$.value?.bubbles?.opacity||.7),Co=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},zn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Qn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},zl=e.computed(()=>R.series),kn=e.computed(()=>R.series.filter((t,s)=>!ht.value.has(s))),an="auto",It=e.computed(()=>{if(Wt.value)return ko();if(!kn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,l=0;kn.value.forEach(w=>{w.data&&w.data.length&&(l=Math.max(l,w.data.length-1),w.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),R.categories.length>0&&(l=Math.max(l,R.categories.length-1)),t===1/0&&(t=0,s=100);const i=lt.value,p=kt.value;let g,V;if(i===an){const w=s-t,L=w>0?w*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const w=s-t,L=w>0?w*.1:1;g=Math.max(0,t-L)}if(p===an){const w=s-t,L=w>0?w*.1:2;V=s+L}else if(typeof p=="number")V=p;else{const w=s-t,L=w>0?w*.1:2;V=s+L}return{minX:0,maxX:l,minY:g,maxY:V}}),ko=()=>{if(!kn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,l=1/0,i=-1/0,p=1/0,g=-1/0,V=!1;if(kn.value.forEach((ye,Oe)=>{ye?.data?.length&&ye.data.forEach((oe,ue)=>{let ke,ie,je;if(typeof oe=="object"&&oe!==null&&!Array.isArray(oe))ke=typeof oe.x=="number"?oe.x:ue,ie=typeof oe.y=="number"?oe.y:0,je=typeof oe.size=="number"?oe.size:20;else if(Array.isArray(oe)&&oe.length>=3)ke=typeof oe[0]=="number"?oe[0]:ue,ie=typeof oe[1]=="number"?oe[1]:0,je=typeof oe[2]=="number"?oe[2]:20;else if(typeof oe=="number")ke=ue,ie=oe,je=Co(Oe,ue);else return;isFinite(ke)&&isFinite(ie)&&isFinite(je)&&(t=Math.min(t,ke),s=Math.max(s,ke),l=Math.min(l,ie),i=Math.max(i,ie),p=Math.min(p,je),g=Math.max(g,je),V=!0)})}),!V)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,R.categories?.length-1||8)),l===i&&(l=Math.max(0,l-10),i=l+20);const w=s-t,L=i-l;let T,H,B,Q;return $t.value!==null?T=$t.value:T=t-w*.1,Dt.value!==null?H=Dt.value:H=s+w*.1,lt.value!==null&&typeof lt.value=="number"?B=lt.value:B=Math.max(0,l-L*.1),kt.value!==null&&typeof kt.value=="number"?Q=kt.value:Q=i+L*.1,{minX:T,maxX:H,minY:B,maxY:Q,minSize:p,maxSize:g}},qt=t=>{if(Wt.value){const{minX:w,maxX:L}=It.value,T=L-w||1;return P.value.left+(t-w)/T*P.value.width}const{minX:s,maxX:l}=It.value,i=l-s;if(l===0||i===0)return P.value.left+P.value.width/2;const p=i/j.value.scale,g=s-j.value.offsetX/P.value.width*i,V=(t-g)/p;return P.value.left+V*P.value.width},al=t=>{const{minY:s,maxY:l}=It.value,i=l-s||1;return P.value.bottom-(t-s)/i*P.value.height},bo=t=>{if(!Wt.value)return de.value||4;const{maxSize:s}=It.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return Sn.value+i*(ho.value-Sn.value)},To=e.computed(()=>Pn.value.map(t=>({y:t.y}))),bn=e.computed(()=>{if(Wt.value)return fn();if(Ue.value==="bar"){if(ol.value){const Se=[],{minY:Ie,maxY:Vt}=It.value,Mt=5,Ml=Vt-Ie||1;for(let Ot=0;Ot<=Mt;Ot++){const Ol=Ie+Ml*(Ot/Mt),Vo=tn(Ol);Se.push({x:Vo,y:P.value.bottom+20,text:Vl(Math.round(Ol))})}return Se}const ue=[],{maxX:ke}=It.value,ie=ke+1,je=5,_e=(P.value.width-je*2)/ie;for(let Se=0;Se<=ke;Se++){const Ie=P.value.left+je+(Se+.5)*_e;ue.push({x:Ie,y:P.value.bottom+20,text:R.categories[Se]||A("chart.fallback.item",{number:Se+1})})}return ue}const t=[],{minX:s,maxX:l}=It.value,i=$t.value!==null?$t.value:s,p=Dt.value!==null?Dt.value:l,g=p-i||1,V=g/j.value.scale,w=i-j.value.offsetX/P.value.width*g,L=w+V,T=Math.max(0,Math.floor(w-2)),H=Math.min(p,Math.ceil(L+2)),B=H-T,Q=P.value.width,Oe=Math.floor(Q/60);let oe=1;B>Oe&&(oe=Math.ceil(B/Oe));for(let ue=T;ue<=H;ue+=oe)if(ue>=0&&ue<=p){const ke=qt(ue);ke>=P.value.left-100&&ke<=P.value.right+100&&t.push({x:ke,y:P.value.bottom+20,text:R.categories[ue]||`Item ${ue+1}`})}return t}),fn=()=>{const t=[],{minX:s,maxX:l}=It.value,i=l-s||1,p=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let g=0;g<=p;g++){const V=s+i*g/p,w=qt(V);if(w>=P.value.left-10&&w<=P.value.right+10){const L=Math.round(V),T=R.categories?.[L];t.push({x:w,y:P.value.bottom+20,text:T||(Number.isInteger(V)?V.toString():V.toFixed(1))})}}return t},Pn=e.computed(()=>{if(ol.value){const p=[],{maxX:g}=It.value;for(let V=0;V<=g;V++)p.push({x:P.value.left-10,y:Tl(V),text:R.categories[V]||`Item ${V+1}`});return p}const t=[],{minY:s,maxY:l}=It.value,i=5;for(let p=0;p<=i;p++){const g=s+(l-s)*(p/i),V=Math.round(g);t.push({x:P.value.left-10,y:al(g),text:Vl(V)})}return t}),Rt=t=>{const s=S.value;if(!s||s.length===0){const l=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return l[t%l.length]}return s[t%s.length]},Lo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let l=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)l=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),l=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,p=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const B=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)l=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},Jn=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),l=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(l){const g=Math.max(0,Math.floor(Number(l[1])*.65)),V=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${V}, ${w})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),V=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${V}, ${w}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const V=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[V,w,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},eo=(t,s)=>{const i=$.value?.stroke?.color;return i==null?Jn(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??Jn(s):Jn(s)},Bn=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+p*p)}return s},Dl=e.computed(()=>Ue.value==="line"||$l.value?($l.value?R.series.filter(s=>(s.type||Ue.value)==="line"):zl.value).map((s,l)=>{const i=R.series.findIndex(B=>B===s),p=[];let g=[];s.data.forEach((B,Q)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:ol.value?tn(B):qt(Q),y:ol.value?Tl(Q):al(B),index:Q})}),g.length>0&&p.push(g);let V="";p.forEach(B=>{if(B.length>0){let Q="";ae.value?Q=In(B):Q=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(ye=>` L ${ye.x} ${ye.y}`).join(""),V+=(V?" ":"")+Q}});const w=p.reduce((B,Q)=>B+Bn(Q),0),L=ht.value.has(i),T=pe.value===i,H=pe.value!==null&&pe.value!==i;return{path:V,color:Rt(i),pathLength:w,seriesIndex:i,animationDelay:l*be.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),wo=e.computed(()=>{if(!(Ue.value==="line"||$l.value))return[];const t=$l.value?R.series.filter(l=>(l.type||Ue.value)==="line"):zl.value,s=[];return t.forEach((l,i)=>{const p=R.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const V=l.data[g];if(V!=null){let w=-1,L=0;for(let T=g+1;T<l.data.length;T++){const H=l.data[T];if(H==null)L++;else{w=T;break}}if(L>0&&w!==-1){const T=l.data[w],H=ol.value?tn(V):qt(g),B=ol.value?Tl(g):al(V),Q=ol.value?tn(T):qt(w),ye=ol.value?Tl(w):al(T),Oe=ht.value.has(p),oe=pe.value===p,ue=pe.value!==null&&pe.value!==p;s.push({path:`M ${H} ${B} L ${Q} ${ye}`,color:Rt(p),seriesIndex:p,animationDelay:i*be.value,isHighlighted:oe,isDimmed:ue,isHidden:Oe,gapSize:L}),g=w-1}}}}),s}),wn=e.computed(()=>Ue.value==="line"||$l.value?!O.value||tl.value||ct.value.hasAnimated?[]:($l.value?R.series.filter(s=>(s.type||Ue.value)==="line"):zl.value).map((s,l)=>{const i=R.series.findIndex(L=>L===s);let p="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:ol.value?tn(L):qt(T),y:ol.value?Tl(T):al(L)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((B,Q)=>Q>T&&B!==null&&B!==void 0);if(H!==-1){const B={x:ol.value?tn(s.data[H]):qt(H),y:ol.value?Tl(H):al(s.data[H])};p+=` L ${B.x} ${B.y}`,g=B}}});const V=s.data.map((L,T)=>L==null?null:{x:ol.value?tn(L):qt(T),y:ol.value?Tl(T):al(L)}).filter(L=>L!==null),w=Bn(V);return{path:p,pathLength:w,color:Rt(i),animationDelay:l*be.value,seriesIndex:i}}):[]),to=e.computed(()=>{if(Ue.value!=="line")return[];const t=[];return zl.value.forEach((s,l)=>{const i=pe.value===l,p=pe.value!==null&&pe.value!==l,g=ht.value.has(l);s.data.forEach((V,w)=>{V!=null&&t.push({x:qt(w),y:al(V),color:Rt(l),value:V,label:R.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(l*s.data.length+w)*(be.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Ho=e.computed(()=>{if(!$l.value)return[];const t=[];return R.series.filter(l=>(l.type||Ue.value)==="line").forEach((l,i)=>{const p=R.series.findIndex(L=>L===l),g=pe.value===p,V=pe.value!==null&&pe.value!==p,w=ht.value.has(p);l.data.forEach((L,T)=>{L!=null&&t.push({x:qt(T),y:al(L),color:Rt(p),value:L,label:R.categories[T]||T.toString(),seriesName:l.name,categoryIndex:T,dataIndex:T,animationDelay:(i*l.data.length+T)*(be.value/8),isHighlighted:g,isDimmed:V,isHidden:w})})}),t}),Hn=e.computed(()=>{if(!Wt.value)return[];const t=[];return zl.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=pe.value,p=i!==null&&i===l,g=i!==null&&i!==l,V=ht.value.has(l);s.data.forEach((w,L)=>{let T,H,B,Q,ye;if(typeof w=="object"&&w!==null&&!Array.isArray(w))T=typeof w.x=="number"?w.x:L,H=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,Q=w.label||R.categories?.[L]||`Point ${L+1}`,ye=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)T=typeof w[0]=="number"?w[0]:L,H=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,Q=w[3]||R.categories?.[L]||`Point ${L+1}`,ye=w[4];else if(typeof w=="number")T=L,H=w,B=Co(l,L),Q=R.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(B)||t.push({x:qt(T),y:al(H),radius:bo(B),originalX:T,originalY:H,originalSize:B,color:Rt(l),seriesName:s.name||`Series ${l+1}`,label:Q,imageUrl:ye,seriesIndex:l,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:p,isDimmed:g,isHidden:V,opacity:yo.value})})}),t}),On=e.computed(()=>Ue.value!=="area"?[]:zl.value.map((t,s)=>{const l=[];let i=[];if(t.data.forEach((B,Q)=>{B==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:qt(Q),y:al(B),index:Q})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Rt(s),isHidden:ht.value.has(s)};const p=P.value.bottom+1;let g="",V="";l.forEach((B,Q)=>{if(B.length===0)return;let ye=`M ${B[0].x} ${B[0].y}`;ae.value&&B.length>1?ye=In(B):B.slice(1).forEach(oe=>{ye+=` L ${oe.x} ${oe.y}`}),g+=(g?" ":"")+ye;let Oe=`M ${B[0].x} ${p}`;if(Oe+=` L ${B[0].x} ${B[0].y}`,ae.value&&B.length>1){const oe=In(B),ue=oe.substring(oe.indexOf("C")||oe.indexOf("Q")||oe.indexOf("L"));ue?Oe+=" "+ue:B.slice(1).forEach(ke=>{Oe+=` L ${ke.x} ${ke.y}`})}else B.slice(1).forEach(oe=>{Oe+=` L ${oe.x} ${oe.y}`});Oe+=` L ${B[B.length-1].x} ${p} Z`,V+=(V?" ":"")+Oe});const w=pe.value===s,L=pe.value!==null&&pe.value!==s,T=ht.value.has(s),H=l.reduce((B,Q)=>B+Bn(Q),0);return{linePath:g,areaPath:V,color:Rt(s),pathLength:H,isHighlighted:w,isDimmed:L,isHidden:T}})),o=e.computed(()=>{if(!(["bar"].includes(Ue.value)||$l.value))return[];const t=[],{maxX:s}=It.value,l=$l.value?R.series.filter(p=>(p.type||Ue.value)==="bar"):zl.value,i=l.length;if(ol.value){const p=s+1,V=P.value.height/p,w=V*(2/3),L=Math.min(4,w/i*.15),T=w-(i-1)*L,H=Math.max(4,T/i);l.forEach((B,Q)=>{const ye=R.series.findIndex(ke=>ke===B),Oe=pe.value===ye,oe=pe.value!==null&&pe.value!==ye,ue=ht.value.has(ye);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const _e=P.value.top+(ie+.5)*V-w/2+Q*(H+L),Se=P.value.left,Ie=Math.abs(tn(ke)-P.value.left);let Vt="";if(ae.value&&Ie>0){const Mt=Math.min(b.value,H/2,Ie/2);Vt=[`M ${Se} ${_e}`,`L ${Se+Ie-Mt} ${_e}`,`Q ${Se+Ie} ${_e} ${Se+Ie} ${_e+Mt}`,`L ${Se+Ie} ${_e+H-Mt}`,`Q ${Se+Ie} ${_e+H} ${Se+Ie-Mt} ${_e+H}`,`L ${Se} ${_e+H}`,"Z"].join(" ")}t.push({x:Se,y:_e,width:Ie,height:H,color:Rt(i===1?ie:ye),value:ke,label:R.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(Q*l.length+ie)*(be.value/4),isHighlighted:Oe,isDimmed:oe,isHidden:ue,barPath:Vt,isSmooth:ae.value&&Ie>0})})})}else{const p=s+1,V=P.value.width/p,w=V*.8,L=w/i,T=L*.05,H=L-T;l.forEach((B,Q)=>{const ye=R.series.findIndex(ke=>ke===B),Oe=pe.value===ye,oe=pe.value!==null&&pe.value!==ye,ue=ht.value.has(ye);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const _e=P.value.left+(ie+.5)*V-w/2+Q*L+T/2,Se=al(Math.max(0,ke)),Ie=Math.abs(al(0)-al(ke));let Vt="";if(ae.value&&Ie>0){const Mt=Math.min(b.value,H/2,Ie/2);Vt=[`M ${_e} ${Se+Ie}`,`L ${_e} ${Se+Mt}`,`Q ${_e} ${Se} ${_e+Mt} ${Se}`,`L ${_e+H-Mt} ${Se}`,`Q ${_e+H} ${Se} ${_e+H} ${Se+Mt}`,`L ${_e+H} ${Se+Ie}`,"Z"].join(" ")}t.push({x:_e,y:Se,width:H,height:Ie,color:Rt(i===1?ie:ye),value:ke,label:R.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(Q*l.length+ie)*(be.value/4),isHighlighted:Oe,isDimmed:oe,isHidden:ue,barPath:Vt,isSmooth:ae.value&&Ie>0})})})}return t}),n=e.computed(()=>{if(!dl.value)return[];const t=zl.value.map((g,V)=>({series:g,originalIndex:V})).filter(({originalIndex:g})=>!ht.value.has(g));if(t.length===0)return[];let s=Ue.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Ue.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:V}=t[0],w=g.data[0]||0,L=s,T=s+l-.001,H=L+l/2,B=St.value+Math.cos(L)*Xt.value,Q=Bt.value+Math.sin(L)*Xt.value,ye=St.value+Math.cos(T)*Xt.value,Oe=Bt.value+Math.sin(T)*Xt.value,oe=St.value+Math.cos(T)*Ct.value,ue=Bt.value+Math.sin(T)*Ct.value,ke=St.value+Math.cos(L)*Ct.value,ie=Bt.value+Math.sin(L)*Ct.value,je=1,Pe=[`M ${B} ${Q}`,`A ${Xt.value} ${Xt.value} 0 ${je} 1 ${ye} ${Oe}`,`L ${oe} ${ue}`,`A ${Ct.value} ${Ct.value} 0 ${je} 0 ${ke} ${ie}`,"Z"].join(" "),_e=Rt(V);return i.push({path:Pe,color:_e,strokeWidth:st.value,strokeColor:eo(0,_e),value:w,seriesName:g.name,opacity:.8,isHighlighted:pe.value===V,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(Ln.value&&t.length===2){const g=t[0],V=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),L=w/100*l,T=(H,B,Q,ye,Oe)=>{const oe=H+(B-H)/2,ue=B-H,ke=St.value+Math.cos(H)*Xt.value,ie=Bt.value+Math.sin(H)*Xt.value,je=St.value+Math.cos(B)*Xt.value,Pe=Bt.value+Math.sin(B)*Xt.value,_e=St.value+Math.cos(B)*Ct.value,Se=Bt.value+Math.sin(B)*Ct.value,Ie=St.value+Math.cos(H)*Ct.value,Vt=Bt.value+Math.sin(H)*Ct.value,Mt=ue>Math.PI?1:0,Ml=[`M ${ke} ${ie}`,`A ${Xt.value} ${Xt.value} 0 ${Mt} 1 ${je} ${Pe}`,`L ${_e} ${Se}`,`A ${Ct.value} ${Ct.value} 0 ${Mt} 0 ${Ie} ${Vt}`,"Z"].join(" "),Ot=Rt(ye);return{path:Ml,color:Ot,strokeWidth:st.value,strokeColor:eo(i.length,Ot),value:Oe,seriesName:Q.name,opacity:.8,isHighlighted:pe.value===ye,isDimmed:pe.value!==null&&pe.value!==ye,isHidden:!1,startAngle:H,endAngle:B,midAngle:oe}};return i.push(T(s,s+L,g.series,g.originalIndex,w)),i.push(T(s,s+l,V.series,V.originalIndex,100)),i}const p=t.reduce((g,{series:V})=>g+(V.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:V})=>{const w=g.data[0]||0,L=w/p*l,T=s,H=s+L,B=T+L/2,Q=St.value+Math.cos(T)*Xt.value,ye=Bt.value+Math.sin(T)*Xt.value,Oe=St.value+Math.cos(H)*Xt.value,oe=Bt.value+Math.sin(H)*Xt.value,ue=St.value+Math.cos(H)*Ct.value,ke=Bt.value+Math.sin(H)*Ct.value,ie=St.value+Math.cos(T)*Ct.value,je=Bt.value+Math.sin(T)*Ct.value,Pe=L>Math.PI?1:0,_e=[`M ${Q} ${ye}`,`A ${Xt.value} ${Xt.value} 0 ${Pe} 1 ${Oe} ${oe}`,`L ${ue} ${ke}`,`A ${Ct.value} ${Ct.value} 0 ${Pe} 0 ${ie} ${je}`,"Z"].join(" "),Se=Rt(V);i.push({path:_e,color:Se,strokeWidth:st.value,strokeColor:eo(i.length,Se),value:w,seriesName:g.name,opacity:.8,isHighlighted:pe.value===V,isDimmed:pe.value!==null&&pe.value!==V,isHidden:!1,startAngle:T,endAngle:H,midAngle:B}),s=H}),i)}),a=e.computed(()=>{const t=n.value;return Ln.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,l)=>({segment:s,originalIndex:l}))}),r=e.computed(()=>{if(!jl.value||!dl.value)return[];const t=xn.value,s=hn.value,l=cn.value,i=qn.value,p=15,g=t*1.3,V=.55,w=(B,Q)=>{const ye=St.value+Math.cos(B.midAngle)*Ct.value,Oe=Bt.value+Math.sin(B.midAngle)*Ct.value,oe=St.value+Math.cos(B.midAngle)*(Ct.value+s),ue=Bt.value+Math.sin(B.midAngle)*(Ct.value+s),ie=oe+l*(Q?1:-1),je=Q?oe+p:oe-p,Pe=ue-i,_e=`${B.seriesName}: ${Vl(B.value)}`,Se=_e.length*t*V;return{pointerStartX:ye,pointerStartY:Oe,pointerEndX:oe,pointerEndY:ue,horizontalEndX:ie,horizontalEndY:ue,textX:je,textY:Pe,text:_e,textWidth:Se,textAnchor:Q?"start":"end",isRightSide:Q,pointerLineLength:Math.hypot(oe-ye,ue-Oe),horizontalLineLength:Math.hypot(ie-oe,0)}},L=(B,Q)=>{const ye=Math.abs(B.textY-Q.textY)<g,Oe=B.isRightSide?B.textX:B.textX-B.textWidth,oe=B.isRightSide?B.textX+B.textWidth:B.textX,ue=Q.isRightSide?Q.textX:Q.textX-Q.textWidth,ke=Q.isRightSide?Q.textX+Q.textWidth:Q.textX,ie=Oe<ke&&ue<oe;return ye&&ie},T=n.value.filter(B=>!B.isHidden),H=[];for(let B=0;B<T.length;B++){const Q=T[B];let ye=Math.cos(Q.midAngle)>=0;if(B>0){const oe=H[B-1],ue=w(Q,ye);L(oe,ue)&&(ye=!ye)}const Oe=w(Q,ye);H.push({...Oe,color:Q.color,isHighlighted:Q.isHighlighted,isDimmed:Q.isDimmed})}return H}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||yo.value||.7;return pe.value===null||pe.value===void 0?s:pe.value!==null?t.seriesIndex===pe.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},d=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return pe.value!==null?t.seriesIndex===pe.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(pe.value===t.seriesIndex?pe.value=null:pe.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:R.chartId}});window.dispatchEvent(l)}}catch(l){console.error("Error in onBubbleClick:",l)}},m=(t,s)=>{const l=[`dss-bubble-fallback-${s}`];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(" ")},v=(t,s)=>{if(!t||(s.stopPropagation(),Dn.value=!0,pe.value=t.seriesIndex,Je.value.show=!1,!gl.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const V=200,w=120;p+V>$e.value&&(p=s.clientX-i.left-V-10),g+w>i.height&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const L=Rn.value,T=yn.value,H=L.map(B=>{const Q=T[B]||B,ye=h(B,t);return ye?{seriesName:t.seriesName,label:t.label,value:`${Q}: ${ye}`,color:t.color}:null}).filter(Boolean);Ae.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},h=(t,s)=>{let l;switch(t){case"x":l=s.originalX;break;case"y":l=s.originalY;break;case"size":l=s.originalSize;break;case"label":l=s.label;break;case"seriesName":l=s.seriesName;break;default:l=s[t]||""}const i=Wl.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const p=l.toFixed(1);return Al.value?p+Al.value:p}return l?.toString()||""},M=()=>{if(!Wt.value||!Je.value.data||Je.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Je.value.data.forEach(l=>{if(l.seriesName&&l.label){const i=`${l.seriesName} - ${l.label}`;s.has(i)||(t.push(i),s.add(i))}else l.seriesName&&(s.has(l.seriesName)||(t.push(l.seriesName),s.add(l.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_=(t,s)=>{t&&(Dn.value=!1,pe.value=null,Ae.value.show=!1,Ae.value.bubbleData=[])},N=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=un(t.categoryIndex),g=t.description||t.comment||"";let V=s.clientX-i.left+15,w=s.clientY-i.top-10;const L=200,T=g?80:50;V+L>$e.value&&(V=s.clientX-i.left-L-15),w+T>Ze.value&&(w=s.clientY-i.top-T-10),V<0&&(V=10),w<0&&(w=10),pt.value={show:!0,x:V,y:w,categoryValue:p,description:g}},ee=()=>{pt.value.show=!1},U=e.computed(()=>R.categories.length||Math.max(...kn.value.map(t=>t.data.length))),Fe=e.computed(()=>{let t=0;return kn.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Ce=e.computed(()=>{const t=[],s=U.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,p=St.value+Math.cos(i)*Ct.value,g=Bt.value+Math.sin(i)*Ct.value;t.push({x:p,y:g,angle:i,index:l})}return t}),mt=e.computed(()=>{const t=[],s=U.value;return Ce.value.forEach((l,i)=>{const p=Ct.value+15,g=i*2*Math.PI/s-Math.PI/2,V=St.value+Math.cos(g)*p,w=Bt.value+Math.sin(g)*p+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x:V,y:w,text:R.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),sl=e.ref(new Set),Qt=(t,s,l)=>{const i=`current-${l}`,p=sl.value.has(i);return!p&&pe.value===null?s.fillOpacity||De.value:s.isHighlighted||p?(s.fillOpacity||De.value)+.15:s.isDimmed?(s.fillOpacity||De.value)*.3:s.fillOpacity||De.value},Pt=e.computed(()=>{if(!en.value)return[];const t=[],s=U.value;return zl.value.forEach((l,i)=>{const p=[],g=[],V=[],w=pe.value===i,L=pe.value!==null&&pe.value!==i,T=ht.value.has(i);for(let H=0;H<s;H++){const B=l.data[H]||0,ye=B/Fe.value*Ct.value,Oe=H*2*Math.PI/s-Math.PI/2,oe=St.value+Math.cos(Oe)*ye,ue=Bt.value+Math.sin(Oe)*ye;p.push(`${oe},${ue}`),g.push({x:oe,y:ue}),V.push({x:oe,y:ue,value:B,label:R.categories[H]||`Axis ${H+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:V,color:Rt(i),fillOpacity:De.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:w,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),Jt=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,V=s[i].y,w=s[p].x,L=s[p].y;V>t.y!=L>t.y&&t.x<(w-g)*(t.y-V)/(L-V)+g&&(l=!l)}return l},el=t=>{if(!en.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=Ve.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,V=Pt.value.filter(w=>w.isHidden?!1:Jt({x:p,y:g},w.polygonPoints));if(V.length>0){V.length,pe.value=V[0].seriesIndex;const w=t.clientX-l.left+10,L=t.clientY-l.top-10,T=200,H=50+V.length*25;let B=w,Q=L;B+T>$e.value&&(B=t.clientX-l.left-T-10),Q+H>Ze.value&&(Q=t.clientY-l.top-H-10),B<0&&(B=10),Q<0&&(Q=10);const ye=V.map(Oe=>{let oe=Oe.dataPoints[0],ue=1/0;return Oe.dataPoints.forEach(ke=>{const ie=Math.sqrt(Math.pow(ke.x-p,2)+Math.pow(ke.y-g,2));ie<ue&&(ue=ie,oe=ke)}),{seriesName:Oe.seriesName,color:Oe.color,value:Vl(oe.value!==void 0?oe.value:Oe.value)}});Ae.value={show:!0,x:B,y:Q,title:V.length===1?V[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ye}}else rn()},zt=e.computed(()=>{const t=$.value;return t.logos.map((s,l)=>{const i=R.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||ht.value.has(s.seriesIndex))return null;let p,g;if(ul.value){let w=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){w=H,L=i.data[H];break}if(w===-1||L===null)return null;const T=i.data.map((H,B)=>H==null?null:{x:qt(B),y:al(H),index:B}).filter(H=>H!==null);if(t.animations.enabled&&!tl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(ct.value.isAnimating||!ct.value.hasAnimated))if(ct.value.isAnimating){const H=ct.value.currentFrame/ct.value.totalFrames,B=Pl(t.animations.easing,Math.min(H,1)),Q=Jo(T,B);p=Q.x+(s.offsetX||0),g=Q.y+(s.offsetY||0)}else p=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else p=qt(w)+(s.offsetX||0),g=al(L)+(s.offsetY||0)}else if(dl.value||en.value){const w=Math.PI*2/t.logos.length*l;p=St.value+Math.cos(w)*(Ct.value+30)+(s.offsetX||0),g=Bt.value+Math.sin(w)*(Ct.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Ul=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),l&&(l.style.opacity="1")},vn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Xl=t=>{ht.value.has(t)?ht.value.delete(t):ht.value.add(t)},xo=e.computed(()=>{if(!Ae.value.show&&!(G.value&&Je.value.show&&!j.value.isZooming))return{display:"none"};let t,s;if(G.value&&Je.value.show&&!j.value.isZooming){t=Je.value.x+15,s=P.value.top;const l=Wt.value?200:150;t+l>$e.value&&(t=Je.value.x-l-15),t<0&&(t=10),s<10&&(s=10)}else t=Ae.value.x,s=Ae.value.y;return{left:t+"px",top:s+"px"}}),sn=(t,s)=>{if(!gl.value||Mn.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const V=200,w=120,L=$e.value,T=Ze.value;p+V>L&&(p=s.clientX-i.left-V-10),g+w>T&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&R.categories.includes(t.label)&&(H=R.categories.indexOf(t.label));const B=(ol.value||Ue.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Ae.value={show:!0,x:p,y:g,title:B,value:Vl(t.value)||"",categoryIndex:H,spiderSeries:[]}},lo=e.ref(!1),Dn=e.ref(!1),rn=()=>{Ae.value.show=!1,Ae.value.spiderSeries=[],Ae.value.bubbleData=[],Je.value.show=!1,lo.value||(pe.value=null)},Mn=e.ref(!1),gn=(t,s)=>{Mn.value=!0,Ae.value.show=!1,Je.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const V=250;p+V>$e.value&&(p=s.clientX-i.left-V-15),p<0&&(p=10),g<0&&(g=10),Kt.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},_n=()=>{Mn.value=!1,Kt.value.show=!1},ct=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Pl=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},tl=e.computed(()=>Ge.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Do=()=>{if(!O.value||tl.value){ct.value.hasAnimated=!0,El.value&&(Hl.value=1);return}El.value&&(Hl.value=0),ct.value.isAnimating=!0,ct.value.currentFrame=0,ct.value.totalFrames=Math.ceil(Te.value/16.67);const t=()=>{const s=ct.value.currentFrame/ct.value.totalFrames,l=Pl(Me.value,Math.min(s,1));Yo(l),El.value&&(Hl.value=l),s<1?(ct.value.currentFrame++,ct.value.animationId=requestAnimationFrame(t)):jo()};ct.value.animationId=requestAnimationFrame(t)},Yo=t=>{const s=C.value;s&&s.style.setProperty("--dss-animation-progress",t)},jo=()=>{ct.value.isAnimating=!1,ct.value.hasAnimated=!0,El.value&&(Hl.value=1),ct.value.animationId&&(cancelAnimationFrame(ct.value.animationId),ct.value.animationId=null)},Ao=e.computed(()=>!dl.value||ct.value.hasAnimated?!0:El.value?Hl.value>=1:Il.value?Ll.value>=1:!0),Zo=e.computed(()=>jl.value&&Ao.value),Eo=e.ref(!1);e.watch(Zo,t=>{t?(Eo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Eo.value=!0})})):Eo.value=!1},{immediate:!0});const Ko=e.computed(()=>{if(!O.value||tl.value||ct.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Te.value}ms`,t["--dss-animation-easing"]=Go(Me.value),t["--dss-stagger-delay"]=`${be.value}ms`,t}),Go=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Qo=()=>{if(!O.value||tl.value)return"";const t=["dss-chart-animated"];return ct.value.hasAnimated||t.push(`dss-animate-${K.value}`),ct.value.hasAnimated||(dl.value&&Ue.value!=="semi-radial"?t.push("dss-animate-fill"):dl.value||t.push(`dss-animate-${K.value}`)),ct.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>R.series,(t,s)=>{wt.value&&s&&ct.value.hasAnimated&&(ct.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Do(),ze.value)}))},{deep:!0}),e.watch(()=>j.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Un()},50)}),e.watch(()=>[j.value.scale,j.value.offsetX],()=>{!j.value.isZooming&&!j.value.isDragging&&Un()},{flush:"post"}),e.watch([Ne,Ke],([t,s])=>{j.value.minScale=t,j.value.maxScale=s,(j.value.scale<t||j.value.scale>s)&&Kn()},{immediate:!0}),e.watch(()=>R.locale,t=>{t&&t!==D.value&&(D.value=t)},{immediate:!0}),e.watch(()=>vt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Yn)}):document.removeEventListener("click",Yn)}),e.onMounted(()=>{pe.value=null,El.value&&(!O.value||tl.value)&&(Hl.value=1),Nn(),C.value&&typeof ResizeObserver<"u"&&(ce=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:l,height:i}=s.contentRect;et.value=Math.round(l),f.value=Math.round(i),ne.value&&(ft.value=ne.value.offsetHeight||fe)}))}),ce.observe(C.value)),O.value&&!tl.value?Ue.value==="semi-radial"?setTimeout(()=>go(),ze.value):setTimeout(()=>Do(),ze.value):(ct.value.hasAnimated=!0,Ue.value==="semi-radial"&&(Ll.value=1)),document.addEventListener("mousemove",Wo),document.addEventListener("mouseup",qo),document.addEventListener("click",po)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ce&&C.value&&(ce.unobserve(C.value),ce.disconnect(),ce=null),ct.value.animationId&&cancelAnimationFrame(ct.value.animationId),on&&(cancelAnimationFrame(on),on=null),j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout),document.removeEventListener("mousemove",Wo),document.removeEventListener("mouseup",qo),document.removeEventListener("click",po),document.removeEventListener("click",Yn)});const Wo=t=>{if(j.value.isDragging&&j.value.scale>1&&ul.value){Je.value.show=!1;const s=t.clientX-j.value.lastMouseX,{minX:l,maxX:i}=It.value,p=i-l||1,V=s*.8;j.value.offsetX+=V;const w=p/j.value.scale,L=p-w,T=0,H=-L/p*P.value.width,B=T;j.value.offsetX=Math.max(H,Math.min(B,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY}},qo=()=>{j.value.isDragging&&(j.value.isDragging=!1,setTimeout(()=>{!j.value.isDragging&&j.value.isZooming},100))},Jo=(t,s)=>{const l=t.filter(w=>w!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||s<=0)return l[0];if(s>=1)return l[l.length-1];let i=0;const p=[];for(let w=1;w<l.length;w++){const L=l[w].x-l[w-1].x,T=l[w].y-l[w-1].y,H=Math.sqrt(L*L+T*T);p.push(H),i+=H}const g=i*s;let V=0;for(let w=0;w<p.length;w++){const L=V+p[w];if(g<=L){const T=(g-V)/p[w],H=l[w],B=l[w+1];return{x:H.x+(B.x-H.x)*T,y:H.y+(B.y-H.y)*T}}V=L}return l[l.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Qo(),{"dss-chart-fill-width":me.value,"dss-chart-fill-height":tt.value,"dss-chart-compact":dl.value&&!_t.value}]]),style:e.normalizeStyle({width:me.value?"100%":$e.value+"px",height:xt.value,...me.value||tt.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ko.value,cursor:Gn()}),"data-chart-type":Ue.value,ref_key:"containerEl",ref:C,onWheel:jn,onMousedown:Bo,onMousemove:E,onMouseup:Mo,onMouseleave:q,onDblclick:Kn,onContextmenu:e.withModifiers(J,["prevent"]),onClick:e.withModifiers(We,["left"]),onWheelCapture:jn},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ne},[e.createElementVNode("div",Ua,[it.value?(e.openBlock(),e.createElementBlock("div",Xa,e.toDisplayString(it.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",Ya,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0)]),_t.value&&Nt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ht.value==="horizontal","dss-legend-vertical":Ht.value==="vertical","dss-legend-top":Nt.value==="top","dss-legend-bottom":Nt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ht.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xl(i),onMouseenter:p=>k(i),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(l.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0),_t.value&&(Nt.value==="left"||Nt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Nt.value==="left","dss-legend-right":Nt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ht.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xl(i),onMouseenter:p=>k(i),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(l.name),1)],46,Ga))),128))],2)):e.createCommentVNode("",!0)],512),F.showAddMarkerButton&&Zt.value&&ll.value.addMarker&&(ul.value||Wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:mo,title:e.unref(A)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:il.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,es),s[4]||(s[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,Ja)):e.createCommentVNode("",!0),e.createElementVNode("div",ts,[Wt.value&&rl.value?(e.openBlock(),e.createElementBlock("div",ls,"Bubble size: "+e.toDisplayString(rl.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:$e.value,height:Ze.value,class:"dss-chart-svg","data-smooth":ae.value,"data-animated":O.value,ref_key:"svgEl",ref:Ve},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:te.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:$e.value,height:P.value.height*4},null,8,as)],8,os),Il.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:nn.value},[e.createElementVNode("path",{d:vo.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0),El.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:pn.value},[e.createElementVNode("path",{d:_o.value},null,8,cs)],8,is)):e.createCommentVNode("",!0)]),ul.value||Wt.value?(e.openBlock(),e.createElementBlock("g",us,[at.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":le.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(To.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:P.value.left,x2:P.value.right,y1:l.y,y2:l.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ms))),128))],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",ps,[e.createElementVNode("line",{x1:P.value.left,x2:P.value.right,y1:P.value.bottom,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,fs),e.createElementVNode("line",{x1:P.value.left,x2:P.value.left,y1:P.value.top,y2:P.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,vs)]),e.createElementVNode("g",gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:l.x,y:l.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(l.text),13,ys))),128)),Tt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:P.value.left+P.value.width/2,y:P.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Tt.value),9,Cs)):e.createCommentVNode("",!0),gt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:P.value.top+12+P.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${P.value.top+P.value.height/2})`},e.toDisplayString(gt.value),9,ks)):e.createCommentVNode("",!0)]),Fl.value.length>0?(e.openBlock(),e.createElementBlock("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":le.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:_n},null,40,xs)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:_n},null,40,Es)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:P.value.bottom,y2:P.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:_n},null,40,Vs)):e.createCommentVNode("",!0)],8,ws),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,P.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>gn(l,i),onMouseleave:_n},null,40,Ns)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,P.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>gn(l,i),onMouseleave:_n},null,40,Ss),e.createElementVNode("text",{x:l.x,y:Math.max(15,P.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(l.totalCount),9,Bs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":le.value},[$l.value?(e.openBlock(),e.createElementBlock("g",_s,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ol.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,$s)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,Ts))],64))),128))],2),e.createElementVNode("g",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,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,Hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.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,Ds))),128)),de.value>0||Ye.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?Y(l,de.value)+2:Y(l,de.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,As))),128)):e.createCommentVNode("",!0)])])):Ue.value==="line"?(e.openBlock(),e.createElementBlock("g",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":ct.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,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,Is))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.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,zs))),128)),de.value>0||Ye.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(to.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?Y(l,de.value)+2:Y(l,de.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,Ps))),128)):e.createCommentVNode("",!0)])):Ue.value==="area"?(e.openBlock(),e.createElementBlock("g",Os,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${F.chartId}`},[e.createElementVNode("rect",{x:P.value.left-10,y:P.value.top-10,width:P.value.width+20,height:P.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${P.value.width+20}px`})},null,12,Ws)],8,Zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?X.value+.2:X.value,mask:`url(#area-mask-${i}-${F.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,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(On.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+1:Xe.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:`${i*be.value}ms`})},null,14,Us))),128))])):Ue.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ol.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,Xs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>sn(l,p),onMouseleave:rn},null,46,Ys))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ms),G.value&&Je.value.show&&!j.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":le.value},[e.createElementVNode("line",{x1:Je.value.x,x2:Je.value.x,y1:P.value.top,y2:P.value.bottom,stroke:he.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Je.value.x,cy:l.y,r:Z(de.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,Gs))),128))],8,js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("g",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",Js,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:Z(l.radius),fill:l.color,"fill-opacity":c(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>v(l,p),onMouseleave:p=>_(l),onClick:p=>u(l,p)},null,42,er),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-${i} ${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:d(l)}),onLoad:p=>zn(i),onError:p=>Qn(i),onMouseenter:p=>v(l,p),onMouseleave:p=>_(l),onClick:p=>u(l,p)},null,46,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),dl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:ln.value},[Ue.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:St.value,cy:Bt.value,r:Ct.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,nr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ue.value,"clip-path":$o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${l.originalIndex}-${i}`,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":Cn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>sn(l.segment,p),onMouseleave:rn},null,42,ar))),128))],8,or),Zl.value&&Ao.value?(e.openBlock(),e.createElementBlock("g",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($n.value,(l,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,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,rr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Sl.value&&(Ao.value||Il.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:An.value.x,y:An.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":En.value,fill:Vn.value,class:"dss-radial-data-center"},e.toDisplayString(fl.value),9,ir)):e.createCommentVNode("",!0),Zo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Eo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":l.isHighlighted,"dss-label-dimmed":l.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.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,cr),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,ur),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":xn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,dr)],6))),128))],2)):e.createCommentVNode("",!0)],8,lr)):e.createCommentVNode("",!0),en.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:ln.value},[at.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:St.value,cy:Bt.value,r:Z(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,fr))),128)),e.createElementVNode("g",vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:St.value-16,y:Bt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,gr),e.createElementVNode("text",{x:St.value,y:Bt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(yl(i)),9,hr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:St.value,x2:l.x,y1:Bt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,yr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/U.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/U.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:`${i*120}ms`})},e.toDisplayString(l.text.charAt(0).toUpperCase()+l.text.slice(1)),13,kr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:el,onMouseleave:rn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":Qt("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+1:Xe.value,"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:`${i*be.value}ms`,transition:"all 0.2s ease"})},null,14,br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:Z(l.isHighlighted?de.value+1:de.value>0?de.value:0),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:`${i*be.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:V=>sn(p,V),onMouseleave:rn},null,46,wr))),128))]))),128))],32)],8,mr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:Z(l.width/2),fill:Rt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Er))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>Ul(i),onError:p=>vn(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Vr))),128))])],8,ns))]),re.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:$e.value+"px",height:Ze.value+"px",backgroundImage:`url('${Rl.value}')`,backgroundRepeat:"no-repeat",...ot.value,opacity:Le.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(l,i)=>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:nl.value+"px",height:nl.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>vl(l),["stop"]),onMouseenter:p=>N(l,p),onMouseleave:ee},[e.createElementVNode("img",{src:At(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Sr)],44,Nr)),[[e.vShow,I.value]])),128)),pt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:pt.value.x+"px",top:pt.value.y+"px"})},[e.createElementVNode("div",Br,e.toDisplayString(pt.value.categoryValue),1),pt.value.description?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(pt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),gl.value&&(Ae.value.show||G.value&&Je.value.show&&!j.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":G.value&&Je.value.show&&!j.value.isZooming}]),style:e.normalizeStyle(xo.value)},[!G.value||!Je.value.show||j.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[en.value&&Ae.value.spiderSeries&&Ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_r,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.spiderSeries,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",Tr,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Lr,e.toDisplayString(l.value),1)]))),128))])):Wt.value&&Ae.value.bubbleData&&Ae.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Dr,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.bubbleData,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Fr,e.toDisplayString(Ae.value.title),1),e.createElementVNode("div",Ir,e.toDisplayString(Ae.value.value),1)])),Ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[jt(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pr,e.toDisplayString(e.unref(A)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt(Ae.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Or,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),jt(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ur,e.toDisplayString(e.unref(A)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt(Ae.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",jr,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",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(Wt.value?M():F.categories[Je.value.categoryIndex]||`Category ${Je.value.categoryIndex+1}`),1),Wt.value?(e.openBlock(),e.createElementBlock("div",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(l.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Je.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",Jr,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",ei,e.toDisplayString(Vl(l.value)),1)]))),128))]),jt(Je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ti,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",li,e.toDisplayString(e.unref(A)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt(Je.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ni,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",oi,[e.createElementVNode("div",ai,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),jt(Je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",si,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ri,e.toDisplayString(e.unref(A)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt(Je.value.categoryIndex).markers,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("div",ii,[e.createElementVNode("div",ci,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ui,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),ul.value&&Be.value&&j.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Kn},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(j.value.scale*100))+"% "+e.toDisplayString(e.unref(A)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,qa),_t.value&&Nt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ht.value==="horizontal","dss-legend-vertical":Ht.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ht.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xl(i),onMouseenter:p=>k(i),onMouseleave:y,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",mi,e.toDisplayString(l.name),1)],46,di))),128))],2)):e.createCommentVNode("",!0),vt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:vt.value.x+"px",top:vt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[ll.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:uo},e.toDisplayString(e.unref(A)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),ll.value.addMarker&&(ll.value.downloadSvg||ll.value.downloadPng||ll.value.downloadCsv||Yl.value.length>0)?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),ll.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(A)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),ll.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Xn},e.toDisplayString(e.unref(A)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),ll.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Tn},e.toDisplayString(e.unref(A)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Yl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[ll.value.downloadSvg||ll.value.downloadPng||ll.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",fi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",vi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(kl(l)),style:e.normalizeStyle(bl(l)),onClick:p=>So(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:yt(l),class:"dss-custom-menu-content"},null,8,hi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",yi,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,gi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Re.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Gt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ci,[e.createElementVNode("h3",null,e.toDisplayString(Ql.value?e.unref(A)("chart.modalMarker.viewMarker"):hl.value?e.unref(A)("chart.modalMarker.editMarker"):e.unref(A)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Gt},"×")]),e.createElementVNode("div",ki,[e.createElementVNode("div",bi,[e.createVNode(Oo,{id:"dss-marker-date",mode:"single",modelValue:Re.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>Re.value.date=l),"min-date":Gl.value,"max-date":Cl.value,disabled:Ql.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",wi,[e.createElementVNode("label",xi,e.toDisplayString(e.unref(A)("chart.modalMarker.description")),1),Ql.value?(e.openBlock(),e.createElementBlock("div",Ei,e.toDisplayString(Re.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>Re.value.description=l),placeholder:e.unref(A)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Vi)),[[e.vModelText,Re.value.description]])])]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Si,[hl.value&&!Ql.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(A)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Gt},e.toDisplayString(Ql.value?e.unref(A)("chart.modalMarker.close"):e.unref(A)("chart.modalMarker.cancel")),1),Ql.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(Re.value.description&&Re.value.description.length)},e.toDisplayString(hl.value?e.unref(A)("chart.modalMarker.save"):e.unref(A)("chart.contextMenu.addMarker")),9,Mi))])])])])):e.createCommentVNode("",!0)],64))}}),Ti={class:"dss-modal-title"},Li={class:"dss-modal-actions"},Ro={__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(F,{emit:we}){const A=F,D=we,xe=e.ref(null),C=e.ref(null),Ve=e.computed(()=>{const te={"max-width":A.width};return A.height!=="auto"&&(te.height=A.height,te["min-height"]="0"),te}),ne=e.computed(()=>({}));function et(){D("close-modal")}function f(){A.backDrop&&!xe.value&&D("close-modal")}function ce(te){te.target.tagName==="INPUT"&&(xe.value=te.target.tagName)}function ve(){setTimeout(()=>{xe.value=null},300)}function fe(){const te=document.body,le=document.documentElement;C.value={bodyOverflow:te.style.overflow,bodyPosition:te.style.position,bodyTop:te.style.top,bodyWidth:te.style.width,htmlOverflow:le.style.overflow,scrollY:window.scrollY},te.style.overflow="hidden",te.style.position="fixed",te.style.top=`-${C.value.scrollY}px`,te.style.width="100%",te.style.left="0",le.style.overflow="hidden"}function se(){if(!C.value)return;const te=document.body,le=document.documentElement,{bodyOverflow:R,bodyPosition:Ee,bodyTop:He,bodyWidth:qe,htmlOverflow:ut,scrollY:$}=C.value;te.style.overflow=R||"",te.style.position=Ee||"",te.style.top=He||"",te.style.width=qe||"",te.style.left="",le.style.overflow=ut||"",window.scrollTo(0,$||0)}return e.watch(()=>A.showModal,te=>{if(te)fe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const le=document.getElementById("dss-modal-backdrop");le&&(le.addEventListener("focusin",ce),le.addEventListener("focusout",ve))},100);else{se(),document.body.classList.remove("dss-modal-open");const le=document.getElementById("dss-modal-backdrop");le&&(le.removeEventListener("focusin",ce),le.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{A.showModal&&se()}),(te,le)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:f},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ve.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:le[0]||(le[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":F.headerType,"font-size":F.titleSize})},[e.createElementVNode("h1",Ti,[e.renderSlot(te.$slots,"title",{},()=>[le[1]||(le[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(te.$slots,"title-data"),F.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:et,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ne.value)},[e.renderSlot(te.$slots,"content",{},()=>[le[2]||(le[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Li,[e.renderSlot(te.$slots,"actions")])])],4),[[e.vShow,F.showModal]])])):e.createCommentVNode("",!0)]))}},Hi={key:0,class:"dss-table-toolbar"},Di={class:"dss-table-toolbar-left"},Ai=["aria-expanded"],Ri={class:"dss-pagination-select-dropdown",role:"listbox"},Fi={class:"dss-table-column-visibility-label"},Ii={class:"dss-table-checkbox-wrapper"},zi=["checked","onChange"],Pi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Oi={class:"dss-table-column-visibility-text"},Zi={class:"dss-table-toolbar-right"},Wi=["placeholder"],qi=["aria-expanded"],Ui={key:1,class:"dss-table-toolbar-extra"},Xi={class:"dss-table-thead"},Yi={key:0,class:"dss-table-th dss-table-selection-column"},ji={key:0,class:"dss-table-checkbox-wrapper"},Ki=["checked","indeterminate"],Gi={key:0,class:"dss-table-checkbox__indeterminate"},Qi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ji={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ec=["onClick"],tc={class:"dss-table-th-content"},lc={class:"dss-table-th-text"},nc={key:0},oc={key:1},ac={key:2},sc=["data-filter-column-key","aria-expanded","onClick"],rc={class:"dss-table-tbody"},ic=["onClick"],cc={class:"dss-table-checkbox-wrapper"},uc=["type","name","checked","onChange"],dc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},mc={key:1,class:"dss-table-checkbox__dot"},pc=["onClick"],fc=["aria-expanded","aria-label"],vc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},gc={key:0,class:"dss-table-expansion-row"},hc=["colspan"],yc=["colspan"],Cc={key:1,class:"dss-table-pagination"},kc={class:"dss-pagination-center"},bc={class:"dss-pagination-controls"},wc=["disabled","title"],xc=["disabled","title"],Ec={class:"dss-pagination-pages"},Vc=["onClick"],Nc={key:1,class:"dss-pagination-ellipsis"},Sc=["disabled","title"],Bc=["disabled","title"],Mc=["aria-expanded"],_c={class:"dss-pagination-select-dropdown",role:"listbox"},$c=["aria-selected","onClick"],Tc={key:0,class:"dss-table-filter-row"},Lc=["value","placeholder"],Hc=["min","max","value"],Dc=["min","max","value"],Ac={class:"dss-table-filter-double-range-values"},Rc={key:2,class:"dss-table-filter-daterange"},Fc={class:"dss-table-filter-daterange-row"},Ic={class:"dss-table-filter-daterange-label"},zc=["value"],Pc={class:"dss-table-filter-daterange-row"},Oc={class:"dss-table-filter-daterange-label"},Zc=["value"],Wc=["value","placeholder"],qc={class:"dss-table-filter-list"},Uc=["checked","onChange"],Xc={class:"dss-table-filter-actions"},Yc={name:"DSSTable"},jc=Object.assign(Yc,{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:F=>typeof F=="object"&&F!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(F,{emit:we}){const{t:A,locale:D}=no.useI18n(),xe=F,C=we,Ve={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"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ne(k,y){const E=Object.assign({},k);return et(k)&&et(y)&&Object.keys(y).forEach(q=>{et(y[q])?q in k?E[q]=ne(k[q],y[q]):Object.assign(E,{[q]:y[q]}):Object.assign(E,{[q]:y[q]})}),E}function et(k){return k&&typeof k=="object"&&!Array.isArray(k)}const f=e.computed(()=>ne(Ve,xe.options)),ce=e.computed(()=>{const k=f.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),ve=e.computed(()=>f.value.table.height),fe=e.computed(()=>f.value.table.rowHeight??"auto"),se=e.computed(()=>({height:fe.value})),te=e.computed(()=>f.value.table.expandable===!0),le=e.computed(()=>f.value.table.expandableRowData??null),R=e.computed(()=>f.value.table.expandableRowCondition??null),Ee=e.computed(()=>f.value.table.truncated===!0),He=e.computed(()=>f.value.table.striped),qe=e.computed(()=>f.value.table.bordered),ut=e.computed(()=>f.value.table.hoverable),$=e.computed(()=>f.value.table.size),me=e.computed(()=>f.value.table.align||"left");e.computed(()=>f.value.title.text),e.computed(()=>f.value.subtitle.text);const tt=e.computed(()=>f.value.selection.enabled),$e=e.computed(()=>f.value.selection.mode),ft=e.computed(()=>f.value.sorting.enabled),ge=e.computed(()=>f.value.sorting.mode),Ze=e.computed(()=>f.value.pagination.enabled),xt=e.computed(()=>f.value.pagination.rows),Ue=e.computed(()=>f.value.pagination.rowsPerPageOptions),Lt=e.computed(()=>f.value.scrollable),it=e.computed(()=>f.value.emptyMessage),Et=e.computed(()=>f.value.toolbar?.downloads?.pdf!==!1),rl=e.computed(()=>f.value.toolbar?.downloads?.excel!==!1),Tt=e.computed(()=>f.value.toolbar?.search!==!1),gt=e.computed(()=>Et.value||rl.value||Tt.value||lt.value),lt=e.computed(()=>f.value.toolbar?.columnVisibility!==!1),kt=e.ref(""),$t=e.ref(!1),Dt=e.ref(null);let at=null;function _t(){$t.value?(at&&(clearTimeout(at),at=null),$t.value=!1,kt.value="",C("search",""),Dt.value?.blur()):($t.value=!0,at=setTimeout(()=>{at=null,Dt.value?.focus()},80))}function Nt(){kt.value||($t.value=!1)}function Ht(){kt.value="",C("search",""),Dt.value?.focus()}const gl=e.computed(()=>({"dss-table-striped":He.value,"dss-table-bordered":qe.value,"dss-table-hoverable":ut.value,[`dss-table-${$.value}`]:$.value!=="default","dss-table-truncated":Ee.value})),G=(k,y)=>k?.field??k?.key??y,he=e.ref(new Set);function Be(){const k=new Set;xe.columns.forEach((y,E)=>{y?.hidden!==!0&&k.add(G(y,E))}),he.value=k}const Ne=e.computed(()=>xe.columns.filter((k,y)=>he.value.has(G(k,y)))),Ke=k=>{const y=xe.columns.findIndex(E=>E===k);return G(k,y>=0?y:0)},Xe=(k,y)=>he.value.has(G(k,y));function st(k,y){const E=G(k,y),q=new Set(he.value);q.has(E)?q.delete(E):q.add(E),he.value=q}const de=e.ref(null),Ye=e.ref(!1);function Y(k){de.value&&!de.value.contains(k.target)&&(Ye.value=!1)}const Z=e.computed(()=>Ne.value.length+(tt.value?1:0)+(te.value?1:0)),X=(k,y)=>k?.id??k?.key??y,ae=e.ref(new Set),x=e.ref(null),b=(k,y)=>ae.value.has(X(k,y)),S=(k,y)=>{if(!te.value)return!1;if(typeof R.value=="function")return!!R.value(k,y);if(typeof le.value=="string"&&le.value.trim()){const E=Cl(k,le.value.trim());return Array.isArray(E)?E.length>0:E&&typeof E=="object"?Object.keys(E).length>0:E!=null&&E!==""}return!0},O=(k,y,E)=>{if(E&&E.stopPropagation(),!S(k,y))return;const q=X(k,y),J=new Set(ae.value);J.has(q)?(J.delete(q),C("row-collapse",{data:k,index:y})):(J.add(q),C("row-expand",{data:k,index:y})),ae.value=J},K=(k,y)=>{if(!Ee.value)return;const E=X(k,y);x.value!==E&&(x.value=E)},Te=e.ref(null),ze=e.ref(0),Me=e.ref([]),be=k=>{if(ge.value==="single")return Te.value===k.field?ze.value:0;{const y=Me.value.find(E=>E.field===k.field);return y?y.order:0}},wt=k=>{const y=be(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Ge=e.ref({}),De=e.ref(null),bt=e.ref(null),dt=220,yl=e.ref(null),ml=e.computed(()=>Ne.value.find(k=>Ke(k)===De.value)??null),Zt=e.computed(()=>{if(!ml.value||ml.value.filter!=="range")return null;const k=ml.value,y=De.value,{min:E,max:q}=Qe(k),J=k.filterMin??E,We=k.filterMax??q,yt=Yt(y),kl=yt.min??J,bl=yt.max??We,At=We-J,un=At===0?0:(kl-J)/At*100,Fn=At===0?100:(bl-J)/At*100;return{rangeMin:J,rangeMax:We,currentMin:kl,currentMax:bl,minPct:un,maxPct:Fn}}),ll=e.ref(null),Yl=e.ref("max");function il(k){const y=ll.value,E=Zt.value;if(!y||!E)return;const q=y.getBoundingClientRect(),We=(k.clientX-q.left)/q.width*100,yt=(E.minPct+E.maxPct)/2;Yl.value=We<yt?"min":"max"}function Yt(k){return Ge.value[k]??{}}function nl(k,y){Ge.value={...Ge.value,[k]:y}}function Al(k){const y=Ge.value[k];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function Vl(k){const y={...Ge.value};delete y[k],Ge.value=y,De.value=null,bt.value=null}function I(){if(!De.value){bt.value=null;return}const k=yl.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${De.value}"]`);if(!y)return;const E=y.getBoundingClientRect();bt.value={top:E.bottom+6,left:Math.max(8,E.right-dt)}}const W=e.computed(()=>{const k=String(kt.value??"").trim().toLowerCase();return k?xe.data.filter(y=>Ne.value.some(E=>re(Gl(y,E)).some(J=>String(J).toLowerCase().includes(k)))):xe.data}),z=e.computed(()=>{let k=[...W.value];const y=(kt.value??"").trim().toLowerCase();return y&&(k=k.filter(E=>xe.columns.some(q=>{if(!q||!q.field)return!1;const J=Gl(E,q);return String(J??"").toLowerCase().includes(y)}))),Ne.value.forEach(E=>{const q=Ke(E),J=Ge.value[q];if(!J)return;const We=E.field;if(We){if(J.type==="string"&&J.value?.trim()){const yt=J.value.trim().toLowerCase();k=k.filter(kl=>{const bl=Gl(kl,E);return String(bl??"").toLowerCase().includes(yt)})}else if(J.type==="range")k=k.filter(yt=>{const kl=Cl(yt,We),bl=Number(kl);return!(Number.isNaN(bl)||J.min!=null&&bl<J.min||J.max!=null&&bl>J.max)});else if(J.type==="dateRange"){const yt=J.from?new Date(J.from).getTime():null,kl=J.to?new Date(J.to).getTime():null;k=k.filter(bl=>{const At=Cl(bl,We),un=At?new Date(At).getTime():NaN;return!(Number.isNaN(un)||yt!=null&&un<yt||kl!=null&&un>kl)})}else if(J.type==="list"&&J.selected?.length){const yt=new Set(J.selected);k=k.filter(kl=>re(Gl(kl,E)).some(At=>yt.has(At)))}}}),k});function re(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(re);if(typeof k=="object"){const y=k?.label??k?.name??k?.value??k?.title;return[y!=null?String(y):String(k)]}return[String(k)]}function Le(k){const y=new Set;return xe.data.forEach(E=>{re(Gl(E,k)).forEach(J=>y.add(J))}),Array.from(y).sort((E,q)=>String(E).localeCompare(String(q)))}function rt(k,y){if(De.value===k){De.value=null,bt.value=null;return}if(De.value=k,y?.currentTarget){const E=y.currentTarget.getBoundingClientRect();bt.value={top:E.bottom+6,left:Math.max(8,E.right-dt)}}else I()}function nt(k,y){nl(k,{type:"string",value:y})}function Qe(k){const y=k.field;if(!y)return{min:0,max:100};let E=1/0,q=-1/0;return xe.data.forEach(J=>{const We=Cl(J,y),yt=Number(We);Number.isNaN(yt)||(E=Math.min(E,yt),q=Math.max(q,yt))}),{min:E===1/0?0:E,max:q===-1/0?100:q}}function ot(k,y,E){const q={...Yt(k),type:"range"},J=E===""?null:Number(E),We=J===null||Number.isNaN(J)?null:J;q[y]=We,We!=null&&(y==="min"&&q.max!=null&&We>q.max&&(q.max=We),y==="max"&&q.min!=null&&We<q.min&&(q.min=We)),nl(k,q)}function cl(k,y,E){const q={...Yt(k),type:"dateRange"};q[y]=E||"",nl(k,q)}const jt=e.reactive({});function Nl(k,y){jt[k]=y}function Rl(k){const y=Ke(k),E=(jt[y]??"").trim().toLowerCase(),q=Le(k);return E?q.filter(J=>String(J).toLowerCase().includes(E)):q}function jl(k,y){return(Yt(k).selected??[]).includes(y!=null?String(y):"")}function xn(k,y){const q=[...Yt(k).selected??[]],J=y!=null?String(y):"",We=q.indexOf(J);We>=0?q.splice(We,1):q.push(J),nl(k,{type:"list",selected:q})}function hn(k){De.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(De.value=null,bt.value=null)}function cn(){I()}const qn=k=>{if(!(k.sortable===!1||!ft.value))if(ge.value==="single")Te.value===k.field?ze.value=ze.value===1?-1:ze.value===-1?0:1:(Te.value=k.field,ze.value=1),ze.value===0&&(Te.value=null),C("sort",{field:Te.value,order:ze.value});else{const y=Me.value.findIndex(E=>E.field===k.field);y>=0?Me.value[y].order===1?Me.value[y].order=-1:Me.value.splice(y,1):Me.value.push({field:k.field,order:1}),C("sort",{multiSortMeta:Me.value})}},Zl=e.computed(()=>{if(!ft.value)return z.value;let k=[...z.value];return ge.value==="single"&&Te.value&&ze.value!==0?k.sort((y,E)=>{const q=Cl(y,Te.value),J=Cl(E,Te.value);return q===J?0:q==null?1:J==null?-1:(q<J?-1:q>J?1:0)*ze.value}):ge.value==="multiple"&&Me.value.length>0&&k.sort((y,E)=>{for(const q of Me.value){const J=Cl(y,q.field),We=Cl(E,q.field);if(J===We)continue;if(J==null)return 1;if(We==null)return-1;const yt=J<We?-1:J>We?1:0;if(yt!==0)return yt*q.order}return 0}),k}),pl=e.ref(0),Sl=e.ref(xt.value),fl=e.ref(!1),En=e.ref(null),An=k=>{Sl.value=k,fl.value=!1,pl.value=0,C("page",{page:0,rows:Sl.value})};function Vn(k){En.value&&!En.value.contains(k.target)&&(fl.value=!1)}const $n=e.computed(()=>Zl.value.length),Fl=e.computed(()=>Math.ceil($n.value/Sl.value)),Kt=e.computed(()=>Ze.value?pl.value*Sl.value:0),Rn=e.computed(()=>Ze.value?Math.min((pl.value+1)*Sl.value,$n.value):$n.value),yn=e.computed(()=>{if(!Ze.value)return Zl.value;const k=Kt.value,y=Rn.value;return Zl.value.slice(k,y)}),Wl=e.ref(new Set),ht=e.computed(()=>Zl.value.filter((k,y)=>Wl.value.has(X(k,y)))),pe=e.computed(()=>{const k=Zl.value.length;return k>0&&Wl.value.size===k}),Kl=e.computed(()=>{const k=Zl.value.length,y=Wl.value.size;return y>0&&y<k}),Ae=(k,y)=>Wl.value.has(X(k,y)),pt=()=>{if(pe.value)Wl.value=new Set,C("unselect-all");else{const k=new Set;Zl.value.forEach((y,E)=>k.add(X(y,E))),Wl.value=k,C("select-all",ht.value)}},Je=(k,y)=>{const E=X(k,y),q=new Set(Wl.value),J=q.has(E);$e.value==="single"?J?(q.delete(E),C("row-unselect",k)):(q.clear(),q.add(E),C("row-select",k)):J?(q.delete(E),C("row-unselect",k)):(q.add(E),C("row-select",k)),Wl.value=q},vt=e.computed(()=>{const k=Fl.value,y=pl.value+1,E=2,q=[],J=[];let We;for(let yt=1;yt<=k;yt++)(yt===1||yt===k||yt>=y-E&&yt<=y+E)&&q.push(yt);for(const yt of q)We&&(yt-We===2?J.push(We+1):yt-We!==1&&J.push("...")),J.push(yt),We=yt;return J}),j=k=>{k<0||k>=Fl.value||(pl.value=k,C("page",{page:k,rows:Sl.value}))},Ut=(k,y,E)=>{C("row-click",{data:k,index:y,originalEvent:E}),K(k,Kt.value+y)},Re=(k,y)=>{const E=Kt.value+y;return{"dss-table-row-selected":Ae(k,E),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":Ee.value,"dss-table-row-truncated-expanded":x.value===X(k,E)}},Gl=(k,y)=>y.field?Cl(k,y.field):"",Cl=(k,y)=>y.split(".").reduce((E,q)=>E&&E[q],k),hl=k=>{const y=k.align??me.value;return{"dss-table-sortable":k.sortable!==!1&&ft.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ql=k=>{const y={};return k.width&&(y.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(y.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(y.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),y};return e.watch(()=>xe.locale,k=>{k&&k!==D.value&&(D.value=k)},{immediate:!0}),e.watch(xt,k=>{Sl.value=k,pl.value=0}),e.watch(kt,k=>{C("search",k??"")}),e.watch(()=>xe.columns,()=>{Be()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Vn),document.addEventListener("click",Y),document.addEventListener("click",hn),window.addEventListener("resize",cn),window.addEventListener("scroll",cn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Vn),document.removeEventListener("click",Y),document.removeEventListener("click",hn),window.removeEventListener("resize",cn),window.removeEventListener("scroll",cn,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:yl,style:e.normalizeStyle({width:ce.value+"px",height:ve.value?ve.value+"px":"auto"})},[gt.value?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("div",Di,[Et.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=E=>C("download-pdf"))},[y[21]||(y[21]=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(A)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),rl.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=E=>C("download-excel"))},[y[22]||(y[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_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(A)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),lt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:de},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ye.value}]),onClick:y[2]||(y[2]=E=>Ye.value=!Ye.value),"aria-expanded":Ye.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(A)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Ai),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,(E,q)=>(e.openBlock(),e.createElementBlock("li",{key:G(E,q),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Fi,[e.createElementVNode("span",Ii,[e.createElementVNode("input",{type:"checkbox",checked:Xe(E,q),onChange:J=>st(E,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,zi),Xe(E,q)?(e.openBlock(),e.createElementBlock("span",Pi,[...y[24]||(y[24]=[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",Oi,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,Ye.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zi,[Tt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":$t.value||kt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Dt,"onUpdate:modelValue":y[4]||(y[4]=E=>kt.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(A)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=E=>$t.value=!0),onBlur:Nt},null,40,Wi),[[e.vModelText,kt.value]]),kt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ht},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":$t.value||!!kt.value,onMousedown:e.withModifiers(_t,["prevent"])},[...y[26]||(y[26]=[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,qi)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ui,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Lt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",gl.value])},[e.createElementVNode("thead",Xi,[e.createElementVNode("tr",null,[tt.value?(e.openBlock(),e.createElementBlock("th",Yi,[$e.value==="multiple"?(e.openBlock(),e.createElementBlock("span",ji,[e.createElementVNode("input",{type:"checkbox",checked:pe.value,indeterminate:Kl.value,onChange:pt,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ki),Kl.value?(e.openBlock(),e.createElementBlock("span",Gi)):pe.value?(e.openBlock(),e.createElementBlock("span",Qi,[...y[27]||(y[27]=[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),te.value?(e.openBlock(),e.createElementBlock("th",Ji)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(E,q)=>(e.openBlock(),e.createElementBlock("th",{key:Ke(E),class:e.normalizeClass(["dss-table-th",hl(E)]),style:e.normalizeStyle(Ql(E)),onClick:J=>qn(E)},[e.createElementVNode("div",tc,[e.createElementVNode("span",lc,e.toDisplayString(E.header),1),E.sortable!==!1&&ft.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",wt(E)])},[be(E)===0?(e.openBlock(),e.createElementBlock("span",nc,[...y[28]||(y[28]=[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)])])):be(E)===1?(e.openBlock(),e.createElementBlock("span",oc,[...y[29]||(y[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:"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)])])):be(E)===-1?(e.openBlock(),e.createElementBlock("span",ac,[...y[30]||(y[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 -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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":De.value===Ke(E)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Al(Ke(E))}]),"data-filter-column-key":Ke(E),"aria-expanded":De.value===Ke(E),"aria-label":"Filter column",onClick:J=>rt(Ke(E),J)},[...y[31]||(y[31]=[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,sc)],2)):e.createCommentVNode("",!0)])],14,ec))),128))])]),e.createElementVNode("tbody",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yn.value,(E,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(E,Kt.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Re(E,q)]),style:e.normalizeStyle(se.value),onClick:J=>Ut(E,q,J)},[tt.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",cc,[e.createElementVNode("input",{type:$e.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${F.tableId}`,checked:Ae(E,Kt.value+q),onChange:J=>Je(E,Kt.value+q),class:e.normalizeClass(["dss-table-checkbox",$e.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,uc),$e.value==="multiple"&&Ae(E,Kt.value+q)?(e.openBlock(),e.createElementBlock("span",dc,[...y[32]||(y[32]=[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.value==="single"&&Ae(E,Kt.value+q)?(e.openBlock(),e.createElementBlock("span",mc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(J=>O(E,Kt.value+q,J),["stop"])},[S(E,Kt.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":b(E,Kt.value+q),"aria-label":b(E,Kt.value+q)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":b(E,Kt.value+q)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[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,fc)):(e.openBlock(),e.createElementBlock("span",vc))],8,pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ne.value,(J,We)=>(e.openBlock(),e.createElementBlock("td",{key:Ke(J),class:e.normalizeClass(["dss-table-td",hl(J)]),style:e.normalizeStyle(Ql(J))},[e.renderSlot(k.$slots,`cell-${J.field}`,{data:E,column:J,rowIndex:q},()=>[e.createTextVNode(e.toDisplayString(Gl(E,J)),1)])],6))),128))],14,ic),te.value&&S(E,Kt.value+q)&&b(E,Kt.value+q)?(e.openBlock(),e.createElementBlock("tr",gc,[e.createElementVNode("td",{colspan:Z.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:E,rowIndex:q})],8,hc)])):e.createCommentVNode("",!0)],64))),128)),yn.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(se.value)},[e.createElementVNode("td",{colspan:Z.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(it.value),1)])],8,yc)],4))])],2)],2),Ze.value?(e.openBlock(),e.createElementBlock("div",Cc,[e.createElementVNode("div",kc,[e.createElementVNode("div",bc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pl.value===0,onClick:y[8]||(y[8]=E=>j(0)),title:e.unref(A)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,wc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pl.value===0,onClick:y[9]||(y[9]=E=>j(pl.value-1)),title:e.unref(A)("table.previousPage")}," ‹ ",8,xc),e.createElementVNode("span",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===pl.value+1}]),onClick:q=>j(E-1)},e.toDisplayString(E),11,Vc)):(e.openBlock(),e.createElementBlock("span",Nc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pl.value>=Fl.value-1,onClick:y[10]||(y[10]=E=>j(pl.value+1)),title:e.unref(A)("table.nextPage")}," › ",8,Sc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pl.value>=Fl.value-1,onClick:y[11]||(y[11]=E=>j(Fl.value-1)),title:e.unref(A)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Bc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:En},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":fl.value}]),onClick:y[12]||(y[12]=E=>fl.value=!fl.value),"aria-expanded":fl.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(Sl.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Mc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",_c,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===Sl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===Sl.value}]),onClick:q=>An(E)},e.toDisplayString(E),11,$c))),128))],512),[[e.vShow,fl.value]])]),_:1})],512)])])):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(bt.value?{top:bt.value.top+"px",left:bt.value.left+"px",width:dt+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[ml.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ml.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("input",{type:"text",value:Yt(De.value).value??"",onInput:y[13]||(y[13]=E=>nt(De.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(A)("table.search")||"Search..."},null,40,Lc)])):ml.value.filter==="range"&&Zt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Zt.value.minPct+"%","--range-max-pct":Zt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:ll,class:"dss-table-filter-double-range-track",onMousemove:il,onMouseenter:il},[e.createElementVNode("input",{type:"range",min:Zt.value.rangeMin,max:Zt.value.rangeMax,value:Zt.value.currentMin,onInput:y[14]||(y[14]=E=>ot(De.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Yl.value==="min"?2:1})},null,44,Hc),e.createElementVNode("input",{type:"range",min:Zt.value.rangeMin,max:Zt.value.rangeMax,value:Zt.value.currentMax,onInput:y[15]||(y[15]=E=>ot(De.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Yl.value==="max"?2:1})},null,44,Dc)],544),e.createElementVNode("div",Ac,e.toDisplayString(Zt.value.currentMin)+" – "+e.toDisplayString(Zt.value.currentMax),1)],4)):ml.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Rc,[e.createElementVNode("div",Fc,[e.createElementVNode("label",Ic,e.toDisplayString(e.unref(A)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Yt(De.value).from??"",onInput:y[16]||(y[16]=E=>cl(De.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,zc)]),e.createElementVNode("div",Pc,[e.createElementVNode("label",Oc,e.toDisplayString(e.unref(A)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Yt(De.value).to??"",onInput:y[17]||(y[17]=E=>cl(De.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Zc)])])):ml.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:jt[De.value]??"",onInput:y[18]||(y[18]=E=>Nl(De.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(A)("table.search")||"Search..."},null,40,Wc),e.createElementVNode("div",qc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl(ml.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:jl(De.value,E),onChange:q=>xn(De.value,E)},null,40,Uc),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Xc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=E=>Vl(De.value))},e.toDisplayString(e.unref(A)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,De.value&&ml.value&&bt.value]])]),_:1})]))],64))}}),Kc={class:"dss-toolbar-left"},Gc=["title"],Qc=["title"],Jc={class:"dss-toolbar-dropdown-wrapper"},eu=["title"],tu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},au={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},su={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ru={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],fu=["title"],vu=["title"],gu=["title"],hu={key:2,class:"dss-toolbar-separator"},yu=["title"],Cu={key:4,class:"dss-toolbar-separator"},ku={key:5,class:"dss-toolbar-dropdown-wrapper"},bu=["title"],wu={class:"dss-toolbar-dropdown-ai"},xu={class:"dss-toolbar-right"},Eu={key:0,class:"dss-toolbar-custom-group"},Vu={key:1,class:"dss-toolbar-separator"},Nu={class:"dss-link-modal-content"},Su={class:"dss-link-modal-field"},Bu={class:"dss-link-modal-label"},Mu=["placeholder"],_u={class:"dss-link-modal-field"},$u={class:"dss-link-modal-label"},Tu=["placeholder"],Lu={class:"dss-image-modal-tabs"},Hu={key:0,class:"dss-image-tab-content"},Du={class:"dss-link-modal-content"},Au={class:"dss-link-modal-field"},Ru={key:0,class:"dss-link-modal-label"},Fu=["src"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={class:"dss-link-modal-field"},Zu={class:"dss-link-modal-label"},Wu=["placeholder"],qu={class:"dss-link-modal-field"},Uu={class:"dss-link-modal-label"},Xu=["placeholder"],Yu={key:1,class:"dss-image-tab-content"},ju={class:"dss-link-modal-content"},Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],ld={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},od=["placeholder"],ad={class:"dss-link-modal-field"},sd={class:"dss-link-modal-label"},rd=["placeholder"],id={class:"dss-text-editor-title-input-container"},cd={key:0,class:"dss-text-editor-title-preview"},ud={key:0},dd={key:1,class:"dss-text-editor-preview-placeholder"},md=["value","placeholder","disabled"],pd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},fd={class:"dss-text-editor-description-input-container"},vd={key:0,class:"dss-text-editor-description-preview"},gd={key:0},hd={key:1,class:"dss-text-editor-preview-placeholder"},yd=["value","placeholder","disabled"],Cd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},kd=["data-comment-id","onMouseenter"],bd=["onClick"],wd=["src","alt"],xd={key:1},Ed=["onClick"],Vd=["src","alt"],Nd={key:1},Sd=["data-has-second-user","onClick"],Bd={class:"editor-comment-marker-count"},Md={key:4,class:"dss-text-editor-textarea-wrapper"},_d=["value","placeholder","rows","disabled"],$d={class:"dss-text-editor-footer"},Td={class:"dss-text-editor-footer-content"},Ld={class:"dss-text-editor-footer-stat"},Hd={class:"dss-text-editor-footer-stat"},Dd={key:5,class:"dss-text-editor-content-wrapper"},Ad={key:0,class:"dss-comment-overlay-body"},Rd={class:"dss-comment-selection-wrapper"},Fd=["innerHTML"],Id={class:"dss-comment-messages-wrapper"},zd={key:0,class:"dss-comment-avatar-wrapper"},Pd={class:"dss-comment-avatar"},Od=["src","alt"],Zd={key:1},Wd={class:"dss-comment-header"},qd={class:"dss-comment-header-text"},Ud={class:"dss-comment-author"},Xd={key:0,class:"dss-comment-date"},Yd=["onClick","title"],jd={class:"dss-comment-overlay-inner"},Kd=["placeholder","onKeydown"],Gd={class:"dss-text-editor-footer"},Qd={class:"dss-text-editor-footer-content"},Jd={class:"dss-text-editor-footer-stat"},e1={class:"dss-text-editor-footer-stat"},t1=["title"],l1=["title"],n1={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:""},o1={class:"dss-image-popup-content"},a1={key:0,class:"dss-image-popup-no-alt-icon"},s1=["title"],r1=["title"],i1={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:""},c1={class:"dss-toolbar-left"},u1=["title"],d1=["title"],m1={class:"dss-toolbar-dropdown-wrapper"},p1=["title"],f1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},k1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1=["title"],M1=["title"],_1=["title"],$1={key:2,class:"dss-toolbar-separator"},T1={key:3,class:"dss-toolbar-dropdown-wrapper"},L1=["title"],H1={class:"dss-toolbar-dropdown-ai"},D1={key:0,class:"dss-toolbar-right"},A1={key:0,class:"dss-toolbar-separator"},R1={key:0,class:"dss-toolbar-custom-group"},F1={key:1,class:"dss-toolbar-separator"},I1={name:"DSSTextEditor"},z1=Object.assign(I1,{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:F=>typeof F=="object"&&F!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:F=>typeof F=="object"&&F!==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(F,{expose:we,emit:A}){const{t:D,locale:xe}=no.useI18n(),C=F,Ve=A,ne=e.useSlots(),et=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
99
99
  <path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
100
- </svg>`,v=e.ref(null),de=e.ref(null),ke=e.ref(!1),Ce=e.ref(!1),se=e.ref(!1),te=e.ref(""),ae=e.ref({}),A=e.ref(!1),xe=e.ref(!1),De=e.ref(""),qe=e.ref(""),mt=e.ref(null),O=e.ref(null),Le=e.ref(null),_t=e.ref(null),Xe=e.ref(""),Rt=e.ref(!1),He=e.ref({}),Ue=e.ref(!1),wt=e.ref({}),Ze=e.ref(null),$t=e.ref(null),st=e.ref(!1),kt=e.ref(""),un=e.ref(null),Tt=e.ref(""),Ge=e.ref(""),Ke=e.ref(""),Lt=e.ref(null),Ht=e.ref(null),qt=e.ref(null),pt=e.ref(null),St=e.ref(null),xt=e.ref(!1),Bt=e.ref(""),jt=e.ref({}),Q=e.ref(!1),pe=e.ref("upload"),ge=e.ref(""),_e=e.ref(null),it=e.ref(null),ze=e.ref([]),Qe=e.ref([]),me=e.ref(null),Je=e.ref(!1),q=e.ref(""),Z=e.ref(""),K=e.ref(""),ne=e.ref(""),x=e.ref(""),k=e.ref(""),V=e.ref(null),P=e.ref(null),U=e.ref(null),Re=e.ref(!1),Ye=e.ref(null),Se=e.ref(!1),le=e.ref(!1),nt=e.ref(null),tt=e.ref("p"),Ct=e.ref(!1),yt=e.ref([]),je=e.ref(null),fn=e.ref(null),jn=e.ref(null),Dn=e.ref(!1),Ft=e.ref(0),Wn=100,dn=e.ref(null),En=e.computed(()=>({"dss-text-editor-no-border":!b.border,"dss-text-editor-rounded":b.rounded,"dss-text-editor-full-height":b.fullHeight,"dss-comment-overlay-open":vn.value!==null})),mn=e.computed(()=>({})),Rn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+24+2}px`,resize:"none",overflowY:"auto"}),gn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+32}px`,overflowY:"auto"}),H=e.computed(()=>b.richText&&Qe.value.length>0),W=e.computed(()=>{if(!b.modelValue)return"";if(b.richText){let o=b.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return b.modelValue}),F=e.computed(()=>{const o=W.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),re=e.computed(()=>W.value.length),Be=e.computed(()=>pt.value!==null&&pe.value==="upload"&&Tt.value&&Tt.value.startsWith("data:")),ot=e.computed(()=>b.titlePlaceholder||D("textEditor.placeholders.title")),lt=e.computed(()=>b.descriptionPlaceholder||D("textEditor.placeholders.description")),Pe=e.computed(()=>b.placeholder||D("textEditor.placeholders.startTyping")),rt=o=>ce&&ce[o]!==void 0,pn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++)if(rt(b.customToolbarSlots[l]))return!0;return!1},on=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++){const a=b.customToolbarSlots[l];if(rt(a)&&bn(a))return!0}return!1},bn=o=>b.customToolbarFloatingMap.hasOwnProperty(o)?b.customToolbarFloatingMap[o]===!0:!0,Vn=e.computed(()=>b.customToolbarSlots.some(o=>rt(o)&&bn(o))),Nn=e.computed(()=>rt("title-slot")),kl=e.computed(()=>rt("description-slot")),Sn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},an=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Bn=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},qn=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},bl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=D("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Ll=o=>{const l=o.target.value;Ne("update:modelValue",l),Ne("change",l)},Fn=()=>{if(!V.value)return;const o=V.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},wl=()=>{Se.value=!0,Fn()},al=()=>{Se.value=!1,sn()},sn=()=>{if(!V.value)return;const o=V.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Zl=o=>{const a=o.target.value;Se.value&&Fn(),Ne("update:title",a),Ne("title-change",a),U.value="title",b.richText&&(Je.value||(Z.value=q.value,x.value=K.value,k.value=ne.value),me.value&&clearTimeout(me.value),Je.value=!0,me.value=setTimeout(()=>{Je.value=!1,Fe()},500))},sl=()=>{if(!P.value)return;const o=P.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Mn=()=>{le.value=!0,sl()},Hl=()=>{le.value=!1,rl()},rl=()=>{if(!P.value)return;const o=P.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Al=o=>{const a=o.target.value;le.value&&sl(),Ne("update:description",a),Ne("description-change",a),U.value="description",b.richText&&(Je.value||(Z.value=q.value,x.value=K.value,k.value=ne.value),me.value&&clearTimeout(me.value),Je.value=!0,me.value=setTimeout(()=>{Je.value=!1,Fe()},500))},ut=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(v.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},ve=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{v.value.focus();return}let r=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(a)}catch{v.value.focus()}},il=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),l=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(v.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Fe=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,a=b.title||"",r=b.description||"";if(!o&&l===q.value&&a===K.value&&r===ne.value)return;const c={content:Z.value||q.value,title:x.value!==void 0?x.value:K.value,description:k.value!==void 0?k.value:ne.value},d=ze.value.length>0?ze.value[ze.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&&(ze.value.push(c),ze.value.length>50&&ze.value.shift(),Qe.value=[]),q.value=l,K.value=a,ne.value=r,Z.value=l,x.value=a,k.value=r},at=o=>{if(!v.value)return;et(),v.value&&Bn(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=ut(),vt()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&nt.value&&(nt.value=null),Ce.value=!0;const r=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=Sn(r);Ne("update:modelValue",c),Ne("change",c),U.value="editor",Je.value||(Z.value=q.value,x.value=K.value,k.value=ne.value),me.value&&clearTimeout(me.value),Je.value=!0,me.value=setTimeout(()=>{Je.value=!1,Fe(),Pn(),nl()},500),e.nextTick(()=>{l&&ve(l),et();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(h=>{try{if(f&&nt.value?.command===h){He.value[h]=nt.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M;let N=!1;if(_&&((_.tagName==="STRONG"||_.tagName==="B"||_.closest&&_.closest("strong, b"))&&(N=!0),!N&&_.style&&parseInt(_.style.fontWeight)>=600&&(N=!0),!N))try{const J=window.getComputedStyle(_);parseInt(J.fontWeight)>=600&&(N=!0)}catch{}He.value[h]=N}else He.value.hasOwnProperty(h)||(He.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M,N=_&&(_.tagName==="EM"||_.tagName==="I"||_.closest&&_.closest("em, i"));He.value[h]=!!N}else{const M=document.queryCommandState(h);He.value[h]=M}else{const M=document.queryCommandState(h);He.value[h]=M}}catch{}}),Kt(),j(),y(),zt(),Jn(),An("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>nl(h),0),(h===" "||h===`
101
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Pn()},100)}Ce.value=!1})},et=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},vt=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},j=()=>{if(v.value&&!Re.value){Re.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),v.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=gt,m.appendChild(h)}else if(f&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Re.value=!1}}},At=o=>{Pn(),Ne("blur",o),zn()},Me=()=>{if(b.disabled||!b.richText||!v.value)return;Mt(),me.value&&(clearTimeout(me.value),me.value=null),Je.value&&(Fe(),Je.value=!1);const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(ze.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{at()});return}const r={content:v.value.innerHTML,title:b.title||"",description:b.description||""};Qe.value.push(r);const c=ze.value.pop();if(c!==void 0){Ce.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,q.value=d,K.value=u,ne.value=m,Z.value=d,x.value=u,k.value=m,e.nextTick(()=>{Kt(),hn(),Ln(),zt();const f=Sn(d);Ne("update:modelValue",f),Ne("update:title",u),Ne("update:description",m),Ne("change",f),Ne("title-change",u),Ne("description-change",m),Ce.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),Fn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)il();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),Fn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else v.value&&il()},10)})})}},Bl=()=>{if(b.disabled||!b.richText||!v.value)return;Mt();const o=U.value==="title",l=U.value==="description",a=U.value==="editor";if(Qe.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{at()});return}const r={content:v.value.innerHTML,title:b.title||"",description:b.description||""};ze.value.push(r);const c=Qe.value.pop();if(c!==void 0){Ce.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,q.value=d,K.value=u,ne.value=m,Z.value=d,x.value=u,k.value=m,e.nextTick(()=>{Kt(),hn(),Ln(),zt();const f=Sn(d);Ne("update:modelValue",f),Ne("update:title",u),Ne("update:description",m),Ne("change",f),Ne("title-change",u),Ne("description-change",m),Ce.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),Fn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)il();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),Fn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else v.value&&il()},10)})})}},C=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),v.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},y=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},S=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{y()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{y()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{y()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{y()})}return!0},X=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{C()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);f.appendChild(h),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}C()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{C()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{C()})}return!0},ee=(o,l=null)=>{if(b.disabled||!b.richText||!v.value)return;Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe(),Mt(),v.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&el(d)&&(r=ut())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=X();He.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(nt.value={command:"bold",state:d}),e.nextTick(()=>{r&&(ve(r),e.nextTick(()=>{const m=Oe("bold");He.value.bold=m})),at(),hn(),zt()});return}if(o==="italic"){const d=S();He.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(nt.value={command:"italic",state:d}),e.nextTick(()=>{r&&(ve(r),e.nextTick(()=>{const m=Oe("italic");He.value.italic=m})),at(),y(),hn(),zt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&ve(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Oe("bold");He.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Oe("italic");He.value.italic=u});else{const u=document.queryCommandState(o);He.value[o]=u}else{const u=document.queryCommandState(o);He.value[o]=u}}catch{He.value.hasOwnProperty(o)?He.value[o]=!He.value[o]:He.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),h=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const h=f.getAttribute("href");(!h||h===""||h==="#")&&f.setAttribute("href",l)})}at(),hn(),zt()})},Oe=(o,l=null)=>{if(b.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(f);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return He.value.hasOwnProperty(o)?He.value[o]:(He.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.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(M.nodeType===1){const _=M;if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}}if(u)break}}return He.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return He.value.hasOwnProperty(o)?He.value[o]:(He.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.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(M.nodeType===1){const _=M;if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return He.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&He.value.hasOwnProperty(o)?He.value[o]:(He.value[o]=d,d)}return He.value.hasOwnProperty(o)?He.value[o]:!1}catch{return He.value.hasOwnProperty(o)?He.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},ft=o=>{b.disabled||!b.richText||(de.value=de.value===o?null:o,o==="askAi"&&($t.value=null))},Mt=()=>{de.value=null,_e.value=null},Dt=o=>{ee("formatBlock",o),Mt()},In=o=>{if(!o||!v.value)return o;const l=$e=>{let he=$e.nodeType===Node.TEXT_NODE?$e.parentElement:$e;for(;he&&he!==v.value;){const dt=he.tagName;if(dt==="P"){const ln=he.parentElement;if(ln===v.value||ln.tagName==="BLOCKQUOTE")return he}if(dt==="BLOCKQUOTE")break;he=he.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:$e=>{const he=$e.tagName;if(he==="P"){const dt=$e.parentElement;if(dt===v.value||dt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return he==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),f=c.indexOf(r);if(m===-1||f===-1)return o;const h=Math.min(m,f),M=Math.max(m,f),_=c.slice(h,M+1);if(_.length===0)return o;const N=_[0],J=_[_.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(J),Y},cl=()=>{if(b.disabled||!b.richText||!v.value)return;Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe(),Mt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&el(l)&&(l=In(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&el(l)&&(a=ut());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const h=document.createElement("p");h.appendChild(f.cloneNode(!0)),u.insertBefore(h,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const h=document.createElement("p");h.appendChild(f.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const f=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)f.push(M);if(f.forEach(N=>{const J=document.createElement("p");N.parentNode.insertBefore(J,N),J.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(()=>{a&&ve(a),Ln(),at(),zt()})},Dl=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!v.value.contains(r))return;const c=M=>{if(!M)return!1;const _=M.textContent||"",J=(M.innerHTML||"").trim();return _.trim()===""||J===""||J==="<br>"||J==="<br/>"||J==="<p></p>"||J==="<p><br></p>"||J==="<p><br/></p>"||J==="<p> </p>"||J==="<p><br> </p>"||J==="<div></div>"||J==="<div><br></div>"||J==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const _=r.children[M];if((_.tagName==="P"||_.tagName==="DIV")&&c(_))_.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(f,r.nextSibling):r.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const h=document.createRange();h.selectNodeContents(f),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Ln(),at()})},hn=()=>{if(!v.value){ke.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ke.value=!!r}else ke.value=!1}catch{ke.value=!1}},ao=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),_t.value=ut();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),De.value="",qe.value=a,Xe.value="",Le.value=null,xe.value=!0,Mt(),e.nextTick(()=>{mt.value&&mt.value.focus()})},so=()=>{if(!v.value)return;Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Le.value&&(l=Le.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Le.value=null}else ee("unlink");ke.value=!1,Mt(),e.nextTick(()=>{at(),hn()})},ro=()=>{b.disabled||!b.richText||v.value&&(Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe(),Mt(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Kt(),at(),zt()}))},Wl=()=>{b.disabled||!b.richText||v.value&&(Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe(),Mt(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Kt(),at(),zt()}))},io=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Kt=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=io(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},co=()=>{if(b.disabled||!b.richText||!v.value)return;Mt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Kt(),at()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=io(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Kt();const f=document.createRange();f.selectNodeContents(a),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{at(),zt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Kt(),at(),zt()})},No=()=>{if(b.disabled||!b.richText||!v.value)return;Mt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Kt(),at()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Kt();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{at(),zt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Kt(),at(),zt()})},vn=e.ref(null),Kn=e.ref(null),xl=e.ref({}),_n=e.ref(""),Un=e.ref(null),yn=e.ref("");e.ref("");const ul=e.ref(null);e.ref("");const wn=e.ref([]),ql=e.ref(!1),Ml=e.ref(!1),So=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},uo=()=>{if(b.disabled||!b.richText||!v.value)return;if(vn.value!==null){vn.value=null,_n.value="",yn.value="",ul.value=null,wn.value=[],Cl(!0);return}Mt(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!el(l))return;yn.value=So(l)||"",ul.value=ut();const a=l.getBoundingClientRect(),r=v.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);xl.value={top:`${m}px`,bottom:"auto"},vn.value=Date.now(),e.nextTick(()=>{if(_n.value="",Un.value){const h=Un.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const f=r.querySelector(".dss-comment-overlay");if(f&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),_=f.getBoundingClientRect(),N=h.getBoundingClientRect(),J=_.bottom-M.top,Y=N.top-M.top,$e=8;if(J>Y-$e){const he=N.height;xl.value={bottom:`${he+$e}px`,top:"auto"}}else xl.value={top:`${m}px`,bottom:"auto"}}}})},mo=()=>{if(!_n.value.trim())return;const o=_n.value.trim(),l=new Date,a={text:o,selectionText:yn.value,selectionRange:ul.value,commentId:vn.value,user:b.commentUser||null,createdAt:l.toISOString()};wn.value=[...wn.value,a],Ne("comment-submitted",a),Mo(a),ul.value&&!Ul(ul.value)&&Bo(vn.value,ul.value),_n.value="",e.nextTick(()=>{if(Un.value){const r=Un.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}An("sendComment")})},po=(o,l)=>{if(!(!b.commentUser||!o.user||o.user.id!==b.commentUser.id)){if(wn.value=wn.value.filter((a,r)=>r!==l),vn.value!==null&&v.value){const a=String(vn.value),r=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&wn.value.length>0){const c=[],d=new Set;wn.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(wn.value.length))}else r&&wn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ne("comment-deleted",{comment:o,index:l,commentId:vn.value}),b.comments&&Array.isArray(b.comments)){const a=b.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Ne("update:comments",a)}e.nextTick(()=>{An("deleteComment")})}},Ul=o=>{if(!o||!v.value)return!1;try{const l=Xl(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Xl=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Bo=(o,l)=>{if(!(!o||!l||!v.value))try{const a=Xl(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,f=a.endContainer,h=a.startOffset,M=a.endOffset,_=m.nodeType===3?m.parentNode:m,N=f.nodeType===3?f.parentNode:f;if(_===N&&h===0&&M===(f.nodeType===3?f.length:N.childNodes.length)&&(_.tagName==="P"||_.tagName==="DIV"||_.tagName==="H1"||_.tagName==="H2"||_.tagName==="H3"||_.tagName==="H4"||_.tagName==="H5"||_.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const f=a.extractContents();d.appendChild(f),a.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{An("wrapSelectionWithCommentMarker"),at()})}catch{}},Mo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(b.comments)?[...b.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(f=>f.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}ql.value=!0,Ne("update:comments",l)},Yl=(o,l=[])=>{if(b.disabled||!b.richText||!v.value)return;const a=v.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Mt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),yn.value=r.innerHTML||"",ul.value=ut();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),_=u.bottom-M.top,J=Math.max(_+8,0);xl.value={top:`${J}px`,bottom:"auto"}}const f=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(f&&b.comments&&Array.isArray(b.comments)){const M=b.comments.find(_=>String(_.conversation_id)===String(f));if(M&&M.conversation&&Array.isArray(M.conversation)){const _=M.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:M.id||M.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(..._)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((M,_)=>{const N=$e=>{if(!$e)return 0;const he=new Date($e).getTime();return isNaN(he)?0:he},J=N(M.createdAt),Y=N(_.createdAt);return J===Y?0:J-Y}),wn.value=h,Cl(!0),vn.value=f||null,r&&(Kn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(_n.value="",Un.value){const M=Un.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const _=m.querySelector(".dss-text-editor-footer");if(_){const N=m.getBoundingClientRect(),J=M.getBoundingClientRect(),Y=_.getBoundingClientRect(),$e=J.bottom-N.top,he=Y.top-N.top,dt=8;if($e>he-dt){const ln=Y.height;xl.value={bottom:`${ln+dt}px`,top:"auto"}}}}}An("openCommentOverlayForSelector")})},jl=e.ref(null),Rl=e.ref(0),Cn=o=>{if(!(b.disabled||!b.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{Dl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,f=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,h=c.contains(m)||m===c,_=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!f||!h||_.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{at()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?No():co();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=f=>{if(!f)return!1;let h=f.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=f.parentElement;return M&&M!==v.value?m(M):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const h=f.closest("p, div");if(h&&h!==v.value){o.preventDefault(),o.stopPropagation();let M=null;const _=a.startOffset;_<u.length&&(M=u.splitText(_));const N=document.createElement("p");if(M?N.appendChild(M):N.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const J=document.createRange();M?J.setStart(M,0):J.setStart(N,0),J.collapse(!0),l.removeAllRanges(),l.addRange(J),e.nextTick(()=>{at()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const $e=Y.textContent||"",dt=(Y.innerHTML||"").trim(),ln=dt.replace(/<br\s*\/?>/gi,"").trim();return $e.trim()===""||dt===""||ln===""||dt==="<br>"||dt==="<br/>"||dt==="<p></p>"||dt==="<p><br></p>"||dt==="<p><br/></p>"||dt==="<p> </p>"||dt==="<p><br> </p>"||dt==="<div></div>"||dt==="<div><br></div>"||dt==="<div><br/></div>"},f=c.lastChild,h=f&&f.nodeType===1&&f.tagName==="BR",M=a.startContainer,_=M.nodeType===3?M.parentElement:M,N=_===c||_&&_.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{Dl()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-Rl.value;if(jl.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),co();return}}}}jl.value=" ",Rl.value=l}else jl.value=o.key}},z=o=>{if(b.disabled||!b.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Fe();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const f=new DOMParser().parseFromString(u,"text/html");let h=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(_=>{if(h>0){const N=f.createElement("p");N.innerHTML=_.innerHTML,_.parentNode.replaceChild(N,_)}else h++}),c){const _=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(f.body.children).filter(J=>_.includes(J.tagName));if(N.length===1){const J=N[0].tagName,Y=c.tagName,$e=c.textContent.trim()===""&&!c.querySelector("img");let he=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?he=!0:$e||(J===Y||J==="P")&&(he=!0),he)return N[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);at()},rn=o=>{if(de.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Mt()}if(Ue.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=v.value&&a.closest(".dss-text-editor-content");!r&&!c&&zn()}if($t.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&fo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(_e.value=null),!v.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Ct.value=!r.collapsed&&el(r)}else Ct.value=!1}if(vn.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,f=o.clientY;r=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(vn.value=null,_n.value="",yn.value="",ul.value=null,wn.value=[],Cl(!0))}},$n=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),it.value&&(clearTimeout(it.value),it.value=null),_e.value=l},cn=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}it.value&&clearTimeout(it.value),it.value=setTimeout(()=>{_e.value=null,it.value=null},150)},Gn=o=>{_e.value=null};let Ut=0;const tn=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Ut}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let f=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},Qn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{tn(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=f=>{const h=c.getAttribute("data-submenu-id");h&&$n(f,h)},m=cn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&$n(h,M)},m=cn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",Gn)})})})};let Tn=null;const Et=()=>{if(_e.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${_e.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${_e.value}"]`);o&&l&&zl(o,l)}if(Ue.value&&zt(),b.richText){if(Tn!==null)return;Tn=setTimeout(()=>{Tn=null,An("handleWindowResize")},150)}},Vt=()=>{if(!b.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},ht=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Se.value?Fn():sn(),le.value?sl():rl()})}),e.nextTick(()=>{ht()}),b.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",rn),window.addEventListener("resize",Et);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,Et()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const a=v.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Et()},150))};a&&(a.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Qn(),Vt()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!b.disabled&&m.preventDefault();const M=f.closest(".dss-image-no-alt-icon"),_=f.closest(".dss-image-wrapper");if(M||_&&f===_){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),J=document.createRange();J.setStartAfter(_),J.collapse(!0),N.removeAllRanges(),N.addRange(J)}else _&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,$e=Y.nodeType===3?Y.parentElement:Y;if(_.contains($e)&&$e!==_.querySelector("img")){const he=document.createRange();he.setStartAfter(_),he.collapse(!0),N.removeAllRanges(),N.addRange(he)}}else{const J=document.createRange();J.setStartAfter(_),J.collapse(!0),N.addRange(J)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,h=f.closest(".dss-image-no-alt-icon"),M=f.closest(".dss-image-wrapper");if(h||M&&f.tagName!=="IMG"){m.preventDefault();const _=window.getSelection(),N=document.createRange();M&&(N.setStartAfter(M),N.collapse(!0),_.removeAllRanges(),_.addRange(N))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const _=h.getAttribute("alt")||h.alt||"";if(_){const N=h.getAttribute("src")||h.src||"",J=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=_===N||_===J;(_.startsWith("http://")||_.startsWith("https://")||_.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),j()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,h=f.tagName==="IMG"?f:f.closest("img"),M=h?.closest(".dss-image-wrapper");h&&v.value.contains(h)&&(Ye.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!Ye.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=Ye.value,h=f.classList?.contains("dss-image-wrapper"),M=h?f.querySelector("img"):f,_=h?f:M?.closest(".dss-image-wrapper");if(!M||!v.value.contains(M)){Ye.value=null;return}let N=null;const J=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(J,Y);else{const Zt=window.getSelection();Zt.rangeCount>0?N=Zt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(v.value),N.collapse(!1))}if(!N){Ye.value=null;return}const $e=N.commonAncestorContainer,he=$e.nodeType===3?$e.parentElement:$e;if(he?.closest(".dss-image-wrapper")===_||_&&_.contains(he)){Ye.value=null;return}if(_&&(he===_||_.contains(he))){Ye.value=null;return}const ln=M.getAttribute("src");let Gt=null;_?Gt=_.cloneNode(!0):Gt=M.cloneNode(!0);try{let Zt=N.startContainer;if(Zt.nodeType===3&&(Zt=Zt.parentElement),_&&(Zt===_||_.contains(Zt))){const Ot=document.createRange();Ot.setStartAfter(_),Ot.collapse(!0),N=Ot}N.insertNode(Gt);const Qt=document.createRange();Qt.setStartAfter(Gt),Qt.collapse(!0);const Jt=window.getSelection();Jt.removeAllRanges(),Jt.addRange(Qt)}catch{if(v.value.childNodes.length===0){const Qt=document.createElement("p");Qt.appendChild(Gt),v.value.appendChild(Qt)}else{const Qt=v.value.lastChild;if(Qt&&Qt.nodeType===1)Qt.appendChild(Gt);else{const Jt=document.createElement("p");Jt.appendChild(Gt),v.value.appendChild(Jt)}}}_?_.remove():M.remove(),Ye.value=null,e.nextTick(()=>{const Zt=v.value.querySelectorAll("img");let Qt=!1;Zt.forEach(Jt=>{if(Jt.getAttribute("src")===ln)if(!Qt)Qt=!0;else{const Ot=Jt.closest(".dss-image-wrapper");Ot?Ot.remove():Jt.remove()}}),j(),at()})}),v.value.addEventListener("dragend",m=>{Ye.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(_=>{_.removeAttribute("alt"),_.removeAttribute("data-alt"),_.setAttribute("alt",""),_.setAttribute("data-alt",""),_.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{j(),Vt(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Vt()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),b.modelValue){const m=an(b.modelValue);v.value.innerHTML=m,vt()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=b.title||"",h=b.description||"";q.value=m,K.value=f,ne.value=h,x.value=f,k.value=h,Kt(),j(),y(),Jn(),$l(),Il()}),hn(),Ln(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",rn),window.removeEventListener("resize",Et),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Tn!==null&&(clearTimeout(Tn),Tn=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),me.value&&clearTimeout(me.value),it.value&&clearTimeout(it.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),je.value&&je.value.disconnect(),fn.value!==null&&(cancelAnimationFrame(fn.value),fn.value=null),jn.value!==null&&(clearTimeout(jn.value),jn.value=null),dn.value!==null&&(clearTimeout(dn.value),dn.value=null),Cl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Yt=o=>{const l=o.target,a=l.closest("a");if(a&&!b.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const f=document.createRange();f.setStartAfter(r),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}j(),hn(),Ln(),zt(),Jn()}):e.nextTick(()=>{j(),hn(),Ln(),zt(),Jn()})},vo=()=>{et();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);Ct.value=!a.collapsed&&el(a),!a.collapsed&&nt.value&&(nt.value=null)}else Ct.value=!1;if(j(),hn(),Ln(),zt(),Jn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),Ct.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}He.value[a]=m}else{const d=document.queryCommandState(a);He.value[a]=d}}}catch{}})},Jn=()=>{if(!b.richText||b.disabled||!v.value){tt.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){tt.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!v.value.contains(r)){tt.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){tt.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?tt.value=d:tt.value="p"}catch{tt.value="p"}},Ln=()=>{if(!v.value){Rt.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}Rt.value=l}catch{Rt.value=!1}},el=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?v.value.contains(a):!1},zn=()=>{Ue.value=!1},zt=()=>{if(!b.floatingToolbar||!b.richText||b.disabled){Ue.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Ue.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!el(l)){Ue.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ue.value=!1;return}const r=v.value;if(!r){Ue.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){Ue.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let f=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Ze.value&&(M=Ze.value.getBoundingClientRect().width);const _=(M||320)/2;let N=c.left+_,J=c.right-_;if(J<N){const Y=c.left+c.width/2;N=Y,J=Y}if(h>0){const Y=_+u,$e=h-_-u;if(N=Math.max(N,Y),J=Math.min(J,$e),J<N){const he=h/2;N=he,J=he}}f<N?f=N:f>J&&(f=J),wt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ue.value=!0},_l=o=>{b.disabled||!b.richText||($t.value=$t.value===o?null:o,o==="askAi"&&(de.value=null))},fo=()=>{$t.value=null,_e.value=null},dl=o=>{Dt(o),fo()};let gl=null,Hn=null,ml=null,kn=null;const _o=o=>{if(b.disabled||!b.richText){tl(),El();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(gl&&(clearTimeout(gl),gl=null),ml&&(clearTimeout(ml),ml=null),a&&a!==Hn){El(),Hn=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Le.value=a,te.value=c,se.value=!0,A.value=!0,go(a)}else!a&&Hn?(Hn=null,gl=setTimeout(()=>{A.value||tl()},150)):a&&a===Hn&&go(a);if(r&&r!==kn){tl(),kn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),pt.value=r,Bt.value=c.trim()||D("textEditor.image.noAlt"),xt.value=!0,Q.value=!0,ho(r)}else!r&&kn?(kn=null,ml=setTimeout(()=>{Q.value||El()},150)):r&&r===kn&&ho(r)},$o=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Hn=null,kn=null,gl&&(clearTimeout(gl),gl=null),ml&&(clearTimeout(ml),ml=null),tl(),El())},tl=()=>{A.value=!1,setTimeout(()=>{A.value||(se.value=!1,te.value="",xe.value||(Le.value=null))},100)},go=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ae.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},El=()=>{Q.value=!1,setTimeout(()=>{Q.value||(xt.value=!1,Bt.value="",st.value||(pt.value=null))},100)},ho=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;jt.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},yo=()=>{if(!te.value||!Le.value)return;let l=Le.value.getAttribute("href")||te.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Co=()=>{if(Le.value){const o=Le.value.textContent||"",l=Le.value.getAttribute("href")||"",a=Le.value;De.value=l,qe.value=o,Xe.value=o,A.value=!1,se.value=!1,te.value="",Le.value=a,xe.value=!0}else if(ke.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";De.value=d,qe.value=c,Xe.value=c,Le.value=r,xe.value=!0}}}else{_t.value=ut();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),De.value="",qe.value=l,Xe.value="",Le.value=null,xe.value=!0}e.nextTick(()=>{mt.value&&(mt.value.focus(),mt.value.select())})},Fl=()=>{xe.value=!1,De.value="",qe.value="",Xe.value="",Le.value=null,_t.value=null},Kl=()=>{if(!De.value.trim()){Fl();return}if(Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe(),qe.value.trim()||(qe.value=De.value.trim()),Le.value&&v.value&&v.value.contains(Le.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Le.value;if(l.setAttribute("href",De.value.trim()),qe.value.trim()!==Xe.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=qe.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),at()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),_t.value&&ve(_t.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=De.value.trim(),a.textContent=qe.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=De.value.trim(),d.textContent=qe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
102
- `){const _=document.createTextNode(" ");l.insertNode(_),l.setStartAfter(_)}}l.insertNode(d);const f=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(f),l.setStartAfter(f),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),f=m[m.length-1];if(f&&f!==" "&&f!==" "&&f!==`
103
- `){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}at()}e.nextTick(()=>{hn(),Fl()})},Pn=()=>{if(!v.value||Ce.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=ut());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],h=f.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const _=M.filter(Y=>{const $e=Y[0],he=Y.index;if(he>0&&h[he-1]==="@"||he+$e.length<h.length&&h[he+$e.length]==="@")return!1;const dt=f.parentElement;return!(dt&&dt.closest("a"))});if(_.length===0)continue;if(_.length===1&&_[0][0]===h.trim()){const Y=_[0][0],$e=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,he=document.createElement("a");he.href=$e,he.textContent=Y,he.style.color="#60afdf",he.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(he,f),u=!0);continue}let N=0;const J=document.createDocumentFragment();if(_.forEach(Y=>{const $e=Y.index,he=Y[0];if($e>N){const Gt=h.substring(N,$e);Gt&&J.appendChild(document.createTextNode(Gt))}const dt=he.startsWith("http://")||he.startsWith("https://")?he:`https://${he}`,ln=document.createElement("a");ln.href=dt,ln.textContent=he,ln.style.color="#60afdf",ln.style.textDecoration="underline",J.appendChild(ln),N=$e+he.length}),N<h.length){const Y=h.substring(N);Y&&J.appendChild(document.createTextNode(Y))}f.parentNode&&J.childNodes.length>0&&(f.parentNode.replaceChild(J,f),u=!0)}u&&l&&e.nextTick(()=>{ve(l),hn()})},hl=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const h=document.createDocumentFragment();m.forEach(M=>{const _=M.index,N=M[0].startsWith("<u>")?"u":"ins",J=M[1]||M[2]||"";_>f&&h.appendChild(document.createTextNode(u.substring(f,_)));const Y=document.createElement(N);Y.textContent=J,h.appendChild(Y),f=_+M[0].length}),f<u.length&&h.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},nl=o=>{if(!v.value||Ce.value)return;if(!o){hl();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let Gt="",Zt=0,Qt=!1;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Xn=>Xn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Ot=0;for(;Jt.nextNode();){const Xn=Jt.currentNode,vl=Xn.textContent||"",Yn=Ot;if(Ot+=vl.length,Xn===r.startContainer){Gt+=vl.substring(0,r.startOffset),Zt=Yn+r.startOffset,Qt=!0;break}Gt+=vl}return Qt||(Zt=Gt.length),{textBeforeCursor:Gt,cursorCharOffset:Zt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],_=u.length-h.length,J=(Gt=>{let Zt=0;const Qt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ot=>Ot.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Jt;for(;Jt=Qt.nextNode();){const Ot=(Jt.textContent||"").length;if(Zt+Ot>=Gt)return{node:Jt,offset:Gt-Zt};Zt+=Ot}return null})(_);if(!J)return;const Y=document.createRange();Y.setStart(J.node,J.offset),Y.setEnd(r.endContainer,r.endOffset);const $e=document.createElement(f);$e.textContent=M,Y.deleteContents(),Y.insertNode($e);const he=window.getSelection(),dt=document.createRange();dt.setStartAfter($e),dt.collapse(!0),he.removeAllRanges(),he.addRange(dt);const ln=ut();e.nextTick(()=>{at(),ln&&ve(ln)})},Pt=()=>{v.value&&(St.value=ut(),kt.value="",Tt.value="",ge.value="",Ge.value="",Ke.value="",un.value=null,pt.value=null,pe.value="upload",st.value=!0,Mt(),e.nextTick(()=>{Lt.value&&Lt.value.focus(),Ht.value&&(Ht.value.value="")}))},ko=o=>{const l=o.target?.files?.[0];if(!l){un.value=null,Tt.value="";return}un.value=l;const a=new FileReader;a.onload=r=>{Tt.value=r.target?.result||""},a.readAsDataURL(l)},Xt=()=>{Ht.value&&Ht.value.click()},nn=()=>{Ge.value&&(Ke.value="")},bo=()=>{Ke.value&&(Ge.value="")},To=()=>{let o=pt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";pt.value=o,kt.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(ge.value=a,Tt.value="",pe.value="url"):(Tt.value=a,ge.value="",pe.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Ge.value=c.endsWith("px")?c.replace("px",""):c,Ke.value=d.endsWith("px")?d.replace("px",""):d,St.value=null}else{Pt();return}st.value=!0,Q.value=!1,xt.value=!1,e.nextTick(()=>{pe.value==="url"&&qt.value?(qt.value.focus(),qt.value.select()):Lt.value&&(Lt.value.focus(),Lt.value.select()),Ht.value&&(Ht.value.value="")})},yl=()=>{st.value=!1,kt.value="",Tt.value="",ge.value="",Ge.value="",Ke.value="",un.value=null,pt.value=null,St.value=null,pe.value="upload"},pl=()=>{const o=(kt.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),Je.value?(me.value&&(clearTimeout(me.value),me.value=null),Fe(),Je.value=!1):Fe();const a=pe.value==="url"?ge.value.trim():Tt.value;if(pt.value&&v.value&&v.value.contains(pt.value)){a&&(pt.value.src=a),pt.value.setAttribute("alt",o),pt.value.setAttribute("data-alt",o),Ge.value?(pt.value.style.width=`${Ge.value}px`,pt.value.setAttribute("width",Ge.value)):(pt.value.style.removeProperty("width"),pt.value.removeAttribute("width")),Ke.value?(pt.value.style.height=`${Ke.value}px`,pt.value.setAttribute("height",Ke.value)):(pt.value.style.removeProperty("height"),pt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(pt.value),c.collapse(!0),r.addRange(c)}at()}else{if(!a){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),yl();return}if(v.value){v.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(St.value&&(ve(St.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 h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){yl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=a,f.setAttribute("alt",o),f.setAttribute("data-alt",o),Ge.value&&(f.style.width=`${Ge.value}px`,f.setAttribute("width",Ge.value)),Ke.value&&(f.style.height=`${Ke.value}px`,f.setAttribute("height",Ke.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const _=document.createElement("p");v.value.appendChild(_),_.appendChild(f)}else{const _=v.value.lastChild;if(_&&_.nodeType===1)_.appendChild(f);else{const N=document.createElement("p");v.value.appendChild(N),N.appendChild(f)}}const M=document.createRange();M.setStartAfter(f),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}pt.value=f,at()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),hn(),zt(),yl()})};e.watch(()=>b.modelValue,o=>{if(b.richText&&v.value&&!Ce.value){const l=an(o||""),r=v.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=l.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=ut();v.value.innerHTML=l,e.nextTick(()=>{vt();const u=v.value.innerHTML||"",m=b.title||"",f=b.description||"";q.value=u,K.value=m,ne.value=f,Z.value=u,x.value=m,k.value=f,ze.value=[],Qe.value=[],me.value&&(clearTimeout(me.value),me.value=null),Je.value=!1,d&&ve(d),Kt(),j(),y(),hn(),zt(),Jn(),An("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>b.richText,o=>{o?(zt(),e.nextTick(()=>{$l()})):(zn(),yt.value=[],je.value&&(je.value.disconnect(),je.value=null)),Jn()}),e.watch(()=>b.floatingToolbar,o=>{o?zt():zn()}),e.watch(()=>b.disabled,o=>{o&&zn(),Jn()}),e.watch(()=>b.description,()=>{e.nextTick(()=>{le.value?sl():rl()})}),e.watch(()=>b.title,()=>{e.nextTick(()=>{Se.value?Fn():sn()})}),e.watch(()=>b.customToolbarSlots,()=>{e.nextTick(()=>{Vt()})},{deep:!0}),e.watch(()=>b.comments,(o,l)=>{if(ql.value){ql.value=!1;return}Ml.value||b.richText&&v.value&&e.nextTick(()=>{Il()})},{deep:!0,immediate:!1});const Il=()=>{if(!Ml.value&&!(!b.comments||!Array.isArray(b.comments)||b.comments.length===0)&&!(!b.richText||!v.value)){Ml.value=!0;try{const o=new Set,l=b.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const f=String(m);if(d.has(f))return;const h=v.value.querySelector(`[data-comment="${f}"]`);if(h){Vl(h,u),d.add(f);return}try{const M=Ql(u.selection_range,u.selection_text);if(M&&!M.collapsed){const _=M.commonAncestorContainer,N=_.nodeType===3?_.parentElement:_;if(N){const $e=N.closest("[data-comment], [data-fake-comment]");if($e){const he=$e.getAttribute("data-comment")||$e.getAttribute("data-fake-comment");if(String(he)===String(m)){$e.setAttribute("data-comment",f),$e.removeAttribute("data-fake-comment"),Vl($e,u),d.add(f);return}else return}}const J=v.value.querySelector(`[data-comment="${f}"]`);if(J){Vl(J,u),d.add(f);return}const Y=document.createElement("span");Y.setAttribute("data-comment",f),Vl(Y,u);try{M.surroundContents(Y),c++,d.add(f)}catch{try{const he=document.createRange();he.setStart(M.startContainer,M.startOffset),he.setEnd(M.endContainer,M.endOffset),It(he),he.surroundContents(Y),c++,d.add(f)}catch{try{const dt=M.extractContents();Y.appendChild(dt),M.insertNode(Y),c++,d.add(f)}catch(dt){console.warn("Failed to create comment marker:",dt)}}}}}catch{}}),e.nextTick(()=>{An("restoreCommentsFromModel"),at(),Ml.value=!1})}catch{Ml.value=!1}}},It=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Lo(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!Gl(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Lo=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},Gl=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Ql=(o,l)=>{if(!o||!v.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?It(a):null}}catch{return null}return null},Vl=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},An=(o="unknown")=>{if(!b.richText||!v.value){yt.value=[];return}Date.now()-Ft.value<Wn&&fn.value!==null||fn.value===null&&(fn.value=requestAnimationFrame(()=>{if(fn.value=null,Ft.value=Date.now(),Dn.value)return;Dn.value=!0;const a={},r=v.value;if(!r){Dn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Dn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");J&&N.tagName==="SPAN"&&(m.has(J)||(u.push(N),m.add(J)))}),d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!J||m.has(J)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${J}"], span[data-fake-comment="${J}"]`)||(u.push(N),m.add(J)):N.tagName!=="SPAN"&&(u.push(N),m.add(J)))});const f=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,J)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const ct=N.textContent?.trim(),On=b.comments?.find(en=>(typeof en.conversation_id=="string"&&en.conversation_id.startsWith("comment-")?null:en.conversation_id)&&en.selection_text?.trim()===ct);On?(Y=String(On.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const $e=N.getBoundingClientRect(),he=window.getComputedStyle(N),dt=parseFloat(he.lineHeight)||parseFloat(he.fontSize)*1.2,Zt=$e.top-h.top+dt/2-15,Jt=h.top-f.top+Zt;let Ot=null,Xn=null,vl=0;const Yn=[],xo=new Set;if(Y&&b.comments){const ct=b.comments.find(On=>String(On.conversation_id||On.id)===String(Y));if(ct){const On=ct.conversation||[];On.length>0?(On.forEach(en=>{en.user&&en.user.id&&!xo.has(en.user.id)&&(xo.add(en.user.id),Yn.push(en.user))}),vl=On.length):(vl=0,Ot=null,Xn=null),Yn.length>0?Ot=Yn[0]:Ot=null,Yn.length>1?Xn=Yn[1]:Xn=null}}const ll=$e.top+dt/2-15,eo=ll+30,Tl=5,Nl=eo>h.top+Tl&&ll<h.bottom-Tl?1:0;yt.value.find(ct=>ct.id===Y);let fl=N;if(!fl&&Y&&v.value){const ct=String(Y);fl=v.value.querySelector(`[data-comment="${ct}"], [data-fake-comment="${ct}"]`)}const Sl=Yn.length;a[Y]?(a[Y].top=Jt,a[Y].opacity=Nl,a[Y].element=fl,a[Y].firstUser=Ot,a[Y].secondUser=Xn,a[Y].totalCount=vl,a[Y].uniqueUserCount=Sl):a[Y]={id:Y,top:Jt,opacity:Nl,element:fl,firstUser:Ot,secondUser:Xn,totalCount:vl,uniqueUserCount:Sl}});const M=Object.values(a).map(N=>{const J=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&v.value){const $e=String(N.id);N.element=v.value.querySelector(`[data-comment="${$e}"], [data-fake-comment="${$e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:J}});(yt.value.length!==M.length||M.some((N,J)=>{const Y=yt.value[J];if(!Y)return!0;const $e=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),he=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||$e||he||Y.element!==N.element}))&&(yt.value=M),Dn.value=!1}))},wo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const a=String(o.id);l=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(Cl(),Kn.value=l,l.classList.add("editor-comment-highlighted"))},Cl=(o=!1)=>{!o&&vn.value!==null&&Kn.value&&(Kn.value.getAttribute("data-comment")||Kn.value.getAttribute("data-fake-comment"))===vn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kn.value&&(Kn.value.classList.remove("editor-comment-highlighted"),Kn.value=null))},Jl=o=>{if(!o||!o.element)return;Cl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Ne("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},Ho=()=>{Cl()},$l=()=>{!b.richText||!v.value||(je.value&&je.value.disconnect(),dn.value!==null&&(clearTimeout(dn.value),dn.value=null),je.value=new MutationObserver(()=>{dn.value===null&&(dn.value=setTimeout(()=>{dn.value=null,e.nextTick(()=>{An("MutationObserver")})},200))}),je.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"]}),An("setupCommentMarkersObserver-initial"))},zl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=a.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>_e.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{zl(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[de.value,$t.value],()=>{de.value==="askAi"||$t.value==="askAi"?e.nextTick(()=>{Qn()}):(_e.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>b.locale,o=>{o&&o!==Ve.value&&(Ve.value=o)},{immediate:!0}),be({openCommentOverlayForSelector:Yl,updateCommentMarkers:An,restoreCommentsFromModel:Il}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",En.value]),style:e.normalizeStyle(mn.value)},[R.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",jc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Me,title:e.unref(D)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!H.value}]),onClick:Bl,title:e.unref(D)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Gc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Qc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>ft("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",nu,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",lu,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ou,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",au,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",su,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Jc),de.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>Dt("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>Dt("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>Dt("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>Dt("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>Dt("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>Dt("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>Dt("<p>"))},[l[61]||(l[61]=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(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("bold")}]),onClick:l[9]||(l[9]=a=>ee("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[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,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("italic")}]),onClick:l[10]||(l[10]=a=>ee("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[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,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("underline")}]),onClick:l[11]||(l[11]=a=>ee("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[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,cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Rt.value}]),onClick:cl,title:e.unref(D)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[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,uu),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ke.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:so,title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[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,mu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ao,title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[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,du)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("insertUnorderedList")}]),onClick:ro,title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[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,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("insertOrderedList")}]),onClick:Wl,title:e.unref(D)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[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,vu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Pt,title:e.unref(D)("textEditor.toolbar.image")},[...l[70]||(l[70]=[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,fu),Ct.value?(e.openBlock(),e.createElementBlock("div",gu)):e.createCommentVNode("",!0),Ct.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:uo},[...l[71]||(l[71]=[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,hu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",yu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>ft("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[l[72]||(l[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",bu,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,ku),de.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[rt(a)?(e.openBlock(),e.createElementBlock("div",xu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),rt(a)&&r<R.customToolbarSlots.length-1&&pn(r)?(e.openBlock(),e.createElementBlock("div",Eu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(de.value==="paragraph"||de.value==="askAi")&&R.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Mt})):e.createCommentVNode("",!0),e.createVNode(Ro,{showModal:xe.value,width:"500px",height:"55vh",onCloseModal:Fl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Vu,[e.createElementVNode("div",Nu,[e.createElementVNode("label",Su,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:O,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Kl,["enter"])},null,40,Bu),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Mu,[e.createElementVNode("label",_u,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:mt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>De.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Kl,["enter"])},null,40,$u),[[e.vModelText,De.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fl},e.toDisplayString(e.unref(D)("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(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ro,{showModal:st.value,width:"500px",height:"80vh",onCloseModal:yl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pt.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Tu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":pe.value==="upload"}]),onClick:l[17]||(l[17]=a=>pe.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),l[77]||(l[77]=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":pe.value==="url"}]),onClick:l[18]||(l[18]=a=>pe.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),pe.value==="upload"?(e.openBlock(),e.createElementBlock("div",Lu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",Au,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Du,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Xt},[e.createElementVNode("img",{src:Tt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ru),l[78]||(l[78]=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:Ht,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ko},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ht,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ko},null,544))]),e.createElementVNode("div",Fu,[e.createElementVNode("label",Iu,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Lt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(pl,["enter"])},null,40,zu),[[e.vModelText,kt.value]])]),e.createElementVNode("div",Pu,[e.createElementVNode("label",Ou,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(pl,["enter"]),onInput:nn},null,40,Zu),[[e.vModelText,Ge.value]])]),e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(pl,["enter"]),onInput:bo},null,40,Uu),[[e.vModelText,Ke.value]])])])])):e.createCommentVNode("",!0),pe.value==="url"?(e.openBlock(),e.createElementBlock("div",Xu,[e.createElementVNode("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:qt,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(pl,["enter"])},null,40,Gu),[[e.vModelText,ge.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>kt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(pl,["enter"])},null,40,ed),[[e.vModelText,kt.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(pl,["enter"]),onInput:nn},null,40,ld),[[e.vModelText,Ge.value]])]),e.createElementVNode("div",od,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(pl,["enter"]),onInput:bo},null,40,sd),[[e.vModelText,Ke.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:yl},e.toDisplayString(e.unref(D)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:pl},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Nn.value&&Se.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",rd,[Se.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",id,[R.title?(e.openBlock(),e.createElementBlock("span",cd,e.toDisplayString(R.title),1)):(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(ot.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:R.title,onInput:Zl,onFocus:wl,onBlur:al,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Se.value}]),placeholder:ot.value,disabled:R.disabled,rows:"1"},null,42,dd)])],2),Nn.value&&Se.value?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":kl.value&&le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",pd,[le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vd,[R.description?(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(R.description),1)):(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(lt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:R.description,onInput:Al,onFocus:Mn,onBlur:Hl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!le.value}]),placeholder:lt.value,disabled:R.disabled,rows:"1"},null,42,hd)])],2),kl.value&&le.value?(e.openBlock(),e.createElementBlock("div",yd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":vn.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>wo(a),onMouseleave:Ho},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Jl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,bd)):(e.openBlock(),e.createElementBlock("span",wd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,kd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Jl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ed)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,xd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>Jl(a),["stop"])},[e.createElementVNode("span",Sd,"+"+e.toDisplayString(a.additionalCount),1)],12,Nd)):e.createCommentVNode("",!0)],46,Cd))),128)),R.richText?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":R.disabled,"dss-text-editor-fixed-height":R.fixedHeight}]),style:e.normalizeStyle(gn.value),onInput:at,onBlur:At,onClick:Yt,onMouseup:vo,onKeyup:vo,onKeydown:Cn,onPaste:z,onMousemove:_o,onMouseleave:$o},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[vn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(xl.value)},[yn.value||wn.value.length>0?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("div",Dd,[yn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:yn.value},null,8,Rd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",zd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Pd)):(e.openBlock(),e.createElementBlock("span",Od,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.createElementVNode("div",Wd,[e.createElementVNode("div",qd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Ud,e.toDisplayString(qn(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":bl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),b.commentUser&&a.user&&a.user.id===b.commentUser.id&&!bl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>po(a,r),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[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,Xd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Yd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Un,"onUpdate:modelValue":l[26]||(l[26]=a=>_n.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(mo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Un.value){const a=Un.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,jd),[[e.vModelText,_n.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(mo,["stop"])},[...l[81]||(l[81]=[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",Kd,[e.createElementVNode("div",Gd,[e.createElementVNode("span",Qd,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Jd,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("textarea",{value:R.modelValue,onInput:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":R.fixedHeight}]),placeholder:Pe.value,rows:R.rows,disabled:R.disabled,style:e.normalizeStyle(Rn.value)},null,46,Md),e.createElementVNode("div",_d,[e.createElementVNode("div",$d,[e.createElementVNode("span",Td,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Ld,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[se.value&&te.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ae.value),onMouseenter:l[28]||(l[28]=a=>A.value=!0),onMouseleave:tl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(yo,["stop"]),title:te.value},e.toDisplayString(te.value),9,e1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",n1,[...l[83]||(l[83]=[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,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xt.value&&Bt.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(jt.value),onMouseenter:l[29]||(l[29]=a=>Q.value=!0),onMouseleave:El},[e.createElementVNode("div",l1,[Bt.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",o1,[...l[84]||(l[84]=[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:Bt.value},e.toDisplayString(Bt.value),9,a1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(To,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",r1,[...l[85]||(l[85]=[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,s1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.floatingToolbar&&R.richText&&Ue.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ze,class:"dss-floating-toolbar",style:e.normalizeStyle(wt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",i1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Me,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[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,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!H.value}]),onClick:e.withModifiers(Bl,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[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,u1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",d1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>_l("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[tt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):tt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",v1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):tt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):tt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",g1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):tt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",h1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):tt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",y1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",C1,[...l[94]||(l[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,m1),$t.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>dl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>dl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>dl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>dl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>dl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>dl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>dl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>ee("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[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,k1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>ee("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[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,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>ee("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[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,w1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Rt.value}]),onClick:e.withModifiers(cl,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[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,x1),l[110]||(l[110]=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(so,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[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,V1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[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,E1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("insertUnorderedList")}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[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,N1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Oe("insertOrderedList")}]),onClick:e.withModifiers(Wl,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[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,S1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Pt,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...l[104]||(l[104]=[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,B1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(uo,["stop"])},[...l[105]||(l[105]=[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,M1),R.askAi?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>_l("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[l[106]||(l[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",L1,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,T1),$t.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Vn.value?(e.openBlock(),e.createElementBlock("div",H1,[R.askAi&&Vn.value?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[rt(a)&&bn(a)?(e.openBlock(),e.createElementBlock("div",D1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),rt(a)&&bn(a)&&r<R.customToolbarSlots.length-1&&on(r)?(e.openBlock(),e.createElementBlock("div",R1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),z1={class:"dss-color-picker__section-title"},P1={class:"dss-color-picker__presets-row"},O1=["title","onClick"],Z1={key:1,class:"dss-color-picker__section"},W1={class:"dss-color-picker__presets-row"},q1=["title","onClick"],U1={class:"dss-color-picker__section"},X1={class:"dss-color-picker__section-header"},Y1={class:"dss-color-picker__presets-row"},j1=["title","onClick"],K1=["onClick"],G1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Q1=["title","onClick"],J1={class:"dss-color-picker__input-row"},em=["value"],tm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(R,{emit:be}){function I(q){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(q);if(!Z)return{h:0,s:0,l:50};const K=parseInt(Z[1],16)/255,ne=parseInt(Z[2],16)/255,x=parseInt(Z[3],16)/255,k=Math.max(K,ne,x),V=Math.min(K,ne,x);let P=0,U=0;const Re=(k+V)/2;if(k!==V){const Ye=k-V;switch(U=Re>.5?Ye/(2-k-V):Ye/(k+V),k){case K:P=((ne-x)/Ye+(ne<x?6:0))/6;break;case ne:P=((x-K)/Ye+2)/6;break;case x:P=((K-ne)/Ye+4)/6;break}}return{h:P*360,s:U*100,l:Re*100}}function D(q,Z,K){Z/=100,K/=100;const ne=Z*Math.min(K,1-K),x=k=>{const V=(k+q/30)%12,P=K-ne*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function Ve(q){const Z=q.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let K=Z[1];return K.length===3&&(K=K.split("").map(ne=>ne+ne).join("")),"#"+K}function b(q,Z,K){Z/=100,K/=100;const ne=K+Z*Math.min(K,1-K),x=ne===0?0:2-2*K/ne;return{h:q,s:x*100,v:ne*100}}function Ne(q,Z,K){Z/=100,K/=100;const ne=K*(1-Z/2),x=ne===0||ne===1?0:(K-ne)/Math.min(ne,1-ne);return{h:q,s:x*100,l:ne*100}}const ce=R,gt=be,v=e.ref(!1),de=e.ref(!1),ke=e.ref(!1),Ce=e.ref(-1),se=e.ref(-1),te=e.ref(null),ae=e.ref(null),A=e.ref(null),xe=e.ref(null),De=e.ref({top:0,left:0}),qe=e.ref(I(ce.modelValue||"#b8a5de")),mt=e.computed(()=>Array.isArray(ce.presetGroups)&&ce.presetGroups.length>0),O=e.computed(()=>mt.value?0:ce.initialPresetCount!=null?ce.initialPresetCount:se.value<0?null:se.value),Le=e.computed(()=>{const q=O.value;return q==null?!0:Math.max(0,ce.presetColors.length-q)<ce.max}),_t=e.computed(()=>!!(de.value||Ce.value>=0||!Xe.value&&ce.presetColors.length===0));e.computed(()=>{const q=O.value;return q!=null&&ce.presetColors.length>q});const Xe=e.computed(()=>mt.value||O.value!=null),Rt=e.computed(()=>{const q=O.value;return q==null?[]:ce.presetColors.slice(0,q)}),He=e.computed(()=>{const q=O.value;return q==null?[]:ce.presetColors.slice(q)});function Ue(q){const Z=O.value;return Z!=null?Z+q:-1}function wt(q){const Z=O.value;return Z!=null&&q>=Z}function Ze(q){wt(q)&&(Ce.value=q,qe.value=I(ce.presetColors[q]),de.value=!0,e.nextTick(()=>xe.value?.focus()))}function $t(q){if(!wt(q))return;const Z=ce.presetColors.filter((x,k)=>k!==q);gt("update:presetColors",Z);const K=Ve(ce.modelValue),ne=Ve(ce.presetColors[q]);if(K&&ne&&K.toLowerCase()===ne.toLowerCase()){const x=Z[Math.max(0,q-1)]||Z[0];x&&gt("update:modelValue",x)}}function st(){ke.value=!ke.value,ke.value||(Ce.value=-1,de.value=!1)}function kt(){if(Ce.value<0)return;const q=Ke.value,Z=Ve(q);if(Z){const K=[...ce.presetColors];K[Ce.value]=Z,gt("update:presetColors",K),gt("update:modelValue",Z),Ce.value=-1,de.value=!1}}function un(){ce.disabled||(Ce.value=-1,de.value=!de.value,de.value&&(Bt(),e.nextTick(()=>xe.value?.focus())))}function Tt(q){const Z=Ve(q),K=Ve(ce.modelValue);return Z&&K&&Z.toLowerCase()===K.toLowerCase()}function Ge(){if(ce.disabled||!Le.value)return;const q=Ke.value,Z=Ve(q);if(Z){const K=[...ce.presetColors,Z];gt("update:presetColors",K),gt("update:modelValue",Z);const ne=O.value??se.value;ne>=0&&K.length-ne>=ce.max&&(de.value=!1)}}const Ke=e.computed(()=>{const{h:q,s:Z,l:K}=qe.value;return D(q,Z,K)}),Lt=e.computed(()=>Ke.value.toLowerCase()),Ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),qt=e.computed(()=>{const q=b(qe.value.h,qe.value.s,qe.value.l);return{left:`${q.s}%`,bottom:`${q.v}%`,transform:"translate(-50%, 50%)"}}),pt=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),St=e.computed(()=>({position:"fixed",left:`${De.value.left}px`,top:`${De.value.top}px`,zIndex:1002}));function xt(){if(!te.value||!v.value)return;const q=te.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let K=q.bottom+4;const ne=ae.value;ne&&K+ne.offsetHeight>Z-8&&(K=q.top-4-ne.offsetHeight),De.value={top:K,left:q.left}}function Bt(){const q=ce.modelValue||"#b8a5de";Ve(q)&&(qe.value=I(q))}function jt(){gt("update:modelValue",Ke.value)}function Q(){ce.disabled||(v.value=!v.value,v.value&&(Bt(),e.nextTick(()=>{xt(),xe.value?.focus()})))}function pe(){const q=Ke.value,Z=Ve(q);if(Z){if(Ce.value>=0){const K=[...ce.presetColors];K[Ce.value]=Z,gt("update:presetColors",K),gt("update:modelValue",Z)}else if((ce.presetColors.length>0||mt.value)&&de.value&&Le.value&&!ce.presetColors.some(ne=>Ve(ne)?.toLowerCase()===Z.toLowerCase())){const ne=[...ce.presetColors,Z];gt("update:presetColors",ne),gt("update:modelValue",Z)}}v.value=!1,de.value=!1,ke.value=!1,Ce.value=-1}function ge(q){if(!A.value)return;const Z=A.value.getBoundingClientRect(),K=ne=>{const x=Math.max(0,Math.min(1,(ne.clientX-Z.left)/Z.width)),k=Math.max(0,Math.min(1,1-(ne.clientY-Z.top)/Z.height)),V={h:qe.value.h,s:x*100,v:k*100};qe.value=Ne(V.h,V.s,V.v)};K(q),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),jt()},{once:!0})}function _e(q){if(!q.currentTarget)return;const K=q.currentTarget.getBoundingClientRect(),ne=x=>{const k=Math.max(0,Math.min(1,(x.clientX-K.left)/K.width));qe.value={...qe.value,h:k*360}};ne(q),document.addEventListener("mousemove",ne),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ne),jt()},{once:!0})}function it(q){const Z=q.target.value,K=Ve(Z);K&&(qe.value=I(K),gt("update:modelValue",K))}function ze(q){if(ce.disabled)return;const Z=Ve(q);Z&&(qe.value=I(Z),gt("update:modelValue",Z))}let Qe=null,me=null;function Je(){Qe&&(document.removeEventListener("keydown",Qe),Qe=null),me&&(window.removeEventListener("resize",me),me=null)}return e.watch(v,q=>{if(Je(),q){if(!mt.value&&ce.initialPresetCount==null){const Z=ce.presetColors.length;Z>0&&(se.value<0||Z<se.value)&&(se.value=Z)}Qe=Z=>{Z.key==="Escape"&&pe()},me=xt,document.addEventListener("keydown",Qe),window.addEventListener("resize",me)}}),e.watch(()=>ce.modelValue,()=>{v.value&&Bt()},{immediate:!1}),e.watch(He,q=>{q.length===0&&(ke.value=!1,Ce.value=-1,de.value=!1)}),e.onBeforeUnmount(Je),(q,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":R.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:te,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":v.value}]),onClick:Q},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Ke.value})},[...Z[0]||(Z[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"},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(pe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ae,class:"dss-color-picker__dropdown",style:e.normalizeStyle(St.value)},[Xe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[mt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.presetGroups,(K,ne)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ne,class:"dss-color-picker__section"},[e.createElementVNode("span",z1,e.toDisplayString(K.title),1),e.createElementVNode("div",P1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(x,k)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ne+"-"+k,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>ze(x),["stop"])},null,14,O1))),128))])]))),128)):Rt.value.length?(e.openBlock(),e.createElementBlock("div",Z1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",W1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,(K,ne)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ne,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>ze(K),["stop"])},null,14,q1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",U1,[e.createElementVNode("div",X1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),He.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":ke.value}]),title:"Manage custom colors",onClick:e.withModifiers(st,["stop"])},[...Z[2]||(Z[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",Y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(K,ne)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ne,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ke.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ke.value&&Tt(K),"dss-color-picker__preset-bubble--editing":ke.value&&Ce.value===Ue(ne)}]),style:e.normalizeStyle({backgroundColor:Ce.value===Ue(ne)?Ke.value:K}),title:Ce.value===Ue(ne)?Ke.value:K,onClick:e.withModifiers(x=>ke.value?Ze(Ue(ne)):ze(K),["stop"])},null,14,j1),ke.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(x=>$t(Ue(ne)),["stop"])},[...Z[4]||(Z[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,K1)):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":de.value}]),onClick:e.withModifiers(un,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):R.presetColors.length?(e.openBlock(),e.createElementBlock("div",G1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.presetColors,(K,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>ze(K),["stop"])},null,14,Q1))),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":de.value}]),onClick:e.withModifiers(un,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:A,onMousedown:ge},[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(qt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:_e},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(pt.value)},null,4)],32),e.createElementVNode("div",J1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:xe,type:"text",class:"dss-color-picker__hex-input",value:Lt.value,onInput:it},null,40,em)]),Xe.value&&(R.presetColors.length||mt.value)&&Le.value&&Ce.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ge}," Save color ")):e.createCommentVNode("",!0),Xe.value&&Ce.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:kt}," Save color ")):e.createCommentVNode("",!0),Xe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:pe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},nm={key:0,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:1,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:2,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:3,class:"dss-loader"},cm={key:0,class:"dss-loader-label"},um={key:4,class:"dss-loader"},dm={key:0,class:"dss-loader-label"},mm={key:5,class:"dss-loader dss-loader--inline"},pm={class:"dss-loader-inline-text"},vm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(R){const be=R,I=e.computed(()=>be.size==="small"?"dss-loaders--size-small":be.size==="large"?"dss-loaders--size-large":be.size==="medium"||be.size==null?"dss-loaders--size-medium":null),D=e.computed(()=>be.size==="small"||be.size==="medium"||be.size==="large"||be.size==null?{}:{"--dss-loader-size":typeof be.size=="number"?`${be.size}px`:String(be.size)});return(Ve,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",I.value]),style:e.normalizeStyle(D.value)},[R.type==="spinner"?(e.openBlock(),e.createElementBlock("div",nm,[b[0]||(b[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="dots"?(e.openBlock(),e.createElementBlock("div",om,[b[1]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="battery"?(e.openBlock(),e.createElementBlock("div",sm,[b[2]||(b[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",im,[b[3]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",cm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="bars"?(e.openBlock(),e.createElementBlock("div",um,[b[4]||(b[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)),R.label?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="inline"?(e.openBlock(),e.createElementBlock("div",mm,[b[5]||(b[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",pm,[e.renderSlot(Ve.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(R.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",fm={__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:R=>["single","multiple"].includes(R)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(R){const be=R,I=e.computed(()=>{const b={"dss-skeleton--loading":be.loading,"dss-skeleton--static":!be.shimmer,"dss-skeleton--multiple":be.mode==="multiple","dss-skeleton--dark":be.darkMode};return be.mode==="multiple"&&be.targetClass!==Xo&&(b[`dss-skeleton--target-${be.targetClass}`]=!0),b}),D=e.computed(()=>{const b={};return be.borderRadius&&(b.borderRadius=be.borderRadius),b}),Ve=e.computed(()=>{const b={};return be.borderRadius&&(b["--dss-skeleton-border-radius"]=be.borderRadius),be.darkMode?(b["--dss-skeleton-bg"]=be.bgDark||"#322c3f",b["--dss-skeleton-shimmer"]=be.shimmerDark||"#3e3f41",b):(be.bgColor&&(b["--dss-skeleton-bg"]=be.bgColor),be.shimmerColor&&(b["--dss-skeleton-shimmer"]=be.shimmerColor),b)});return(b,Ne)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",I.value]),style:e.normalizeStyle(Ve.value)},[R.loading&&R.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(D.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":R.loading&&R.mode==="single"}])},[e.renderSlot(b.$slots,"default")],2)],6))}},gm={key:0,class:"dss-dnd-column-header"},hm={class:"dss-dnd-column-title"},ym={class:"dss-dnd-column-count"},Cm=["data-column"],km={key:0,class:"dss-dnd-indicator"},bm=["onPointerdown"],wm=["onPointerdown"],xm={class:"dss-dnd-item-content"},Em={class:"dss-dnd-item-default"},Vm={key:0,class:"dss-dnd-empty"},Nm={name:"DSSDnd"},Sm=Object.assign(Nm,{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(R,{emit:be}){const I=R,D=be,Ve=e.useSlots(),b=e.computed(()=>!!Ve["delete-zone"]),Ne={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},ce=e.computed(()=>({...Ne,...I.options})),gt=e.computed(()=>({"--dss-dnd-col-min-w":ce.value.columnMinWidth,"--dss-dnd-col-max-w":ce.value.columnMaxWidth,"--dss-dnd-col-gap":ce.value.columnGap,"--dss-dnd-indicator-color":ce.value.indicatorColor,"--dss-dnd-body-max-h":ce.value.columnBodyMaxHeight}));function v(Q){if(!ce.value.ColColor||!Q)return{};const pe=Q.background||Q.color;return pe?{background:pe}:{}}const de=e.ref(null),ke=e.ref(null),Ce=e.ref(!1),se=e.ref(-1),te=e.ref(null);let ae=null,A=null,xe=null,De=null,qe=0,mt=0,O="",Le=null;const _t=5,Xe=e.computed(()=>{const Q={};for(const pe of I.columns)Q[pe.value]=I.items.filter(ge=>ge[I.columnKey]===pe.value).sort((ge,_e)=>(ge[I.positionKey]??0)-(_e[I.positionKey]??0));return Q}),Rt=e.computed(()=>{const Q={},pe=!!de.value,ge=de.value?.[I.itemKey],_e=ke.value,it=se.value;for(const ze of I.columns){const Qe=Xe.value[ze.value]||[],me=[],Je=_e==ze.value;let q=0;for(let Z=0;Z<Qe.length;Z++){const K=Qe[Z],ne=pe&&K[I.itemKey]===ge;!ne&&Je&&it===q&&me.push({type:"indicator",key:`ind-${q}`}),ne||q++,me.push({type:"item",item:K,isDragged:ne,key:`item-${K[I.itemKey]}`})}Je&&it>=q&&me.push({type:"indicator",key:"ind-end"}),Q[ze.value]=me}return Q});function He(Q,pe){const _e=(Xe.value[Q]||[]).filter(Qe=>Qe[I.itemKey]!==de.value?.[I.itemKey]);if(_e.length===0)return 1;if(pe<=0){const Qe=_e[0][I.positionKey];return Qe!=null&&Qe>0?Qe/2:.5}if(pe>=_e.length){const Qe=_e[_e.length-1][I.positionKey];return(Qe??0)+1}const it=_e[pe-1][I.positionKey]??0,ze=_e[pe][I.positionKey]??0;return(it+ze)/2}function Ue(Q,pe,ge){xe&&xe.remove();const _e=Q.getBoundingClientRect(),it=Q.cloneNode(!0);it.classList.add("dss-dnd-ghost"),it.style.cssText=`
100
+ </svg>`,f=e.ref(null),ce=e.ref(null),ve=e.ref(!1),fe=e.ref(!1),se=e.ref(!1),te=e.ref(""),le=e.ref({}),R=e.ref(!1),Ee=e.ref(!1),He=e.ref(""),qe=e.ref(""),ut=e.ref(null),$=e.ref(null),me=e.ref(null),tt=e.ref(null),$e=e.ref(""),ft=e.ref(!1),ge=e.ref({}),Ze=e.ref(!1),xt=e.ref({}),Ue=e.ref(null),Lt=e.ref(null),it=e.ref(!1),Et=e.ref(""),rl=e.ref(null),Tt=e.ref(""),gt=e.ref(""),lt=e.ref(""),kt=e.ref(null),$t=e.ref(null),Dt=e.ref(null),at=e.ref(null),_t=e.ref(null),Nt=e.ref(!1),Ht=e.ref(""),gl=e.ref({}),G=e.ref(!1),he=e.ref("upload"),Be=e.ref(""),Ne=e.ref(null),Ke=e.ref(null),Xe=e.ref([]),st=e.ref([]),de=e.ref(null),Ye=e.ref(!1),Y=e.ref(""),Z=e.ref(""),X=e.ref(""),ae=e.ref(""),x=e.ref(""),b=e.ref(""),S=e.ref(null),O=e.ref(null),K=e.ref(null),Te=e.ref(!1),ze=e.ref(null),Me=e.ref(!1),be=e.ref(!1),wt=e.ref(null),Ge=e.ref("p"),De=e.ref(!1),bt=e.ref([]),dt=e.ref(null),yl=e.ref(null),ml=e.ref(null),Zt=e.ref(!1),ll=e.ref(0),Yl=100,il=e.ref(null),Yt=e.computed(()=>({"dss-text-editor-no-border":!C.border,"dss-text-editor-rounded":C.rounded,"dss-text-editor-full-height":C.fullHeight,"dss-comment-overlay-open":vl.value!==null})),nl=e.computed(()=>({})),Al=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),Vl=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),I=e.computed(()=>C.richText&&st.value.length>0),W=e.computed(()=>{if(!C.modelValue)return"";if(C.richText){let o=C.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/&nbsp;/g," "),o=o.replace(/&amp;/g,"&"),o=o.replace(/&lt;/g,"<"),o=o.replace(/&gt;/g,">"),o=o.replace(/&quot;/g,'"'),o=o.replace(/&#39;/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return C.modelValue}),z=e.computed(()=>{const o=W.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),re=e.computed(()=>W.value.length),Le=e.computed(()=>at.value!==null&&he.value==="upload"&&Tt.value&&Tt.value.startsWith("data:")),rt=e.computed(()=>C.titlePlaceholder||D("textEditor.placeholders.title")),nt=e.computed(()=>C.descriptionPlaceholder||D("textEditor.placeholders.description")),Qe=e.computed(()=>C.placeholder||D("textEditor.placeholders.startTyping")),ot=o=>ne&&ne[o]!==void 0,cl=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++)if(ot(C.customToolbarSlots[n]))return!0;return!1},jt=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++){const a=C.customToolbarSlots[n];if(ot(a)&&Nl(a))return!0}return!1},Nl=o=>C.customToolbarFloatingMap.hasOwnProperty(o)?C.customToolbarFloatingMap[o]===!0:!0,Rl=e.computed(()=>C.customToolbarSlots.some(o=>ot(o)&&Nl(o))),jl=e.computed(()=>ot("title-slot")),xn=e.computed(()=>ot("description-slot")),hn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},cn=o=>{if(!o||o.trim()==="")return"";const n=o.replace(/<!--[\s\S]*?-->/g,""),a=n.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():n},qn=o=>{if(!o)return;const n=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=n.nextNode();for(;r;)a.push(r),r=n.nextNode();a.forEach(c=>c.remove())},Zl=o=>{try{const n=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${n} ${r} ${c}`}catch{return""}},pl=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=D("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Sl=o=>{const n=o.target.value;Ve("update:modelValue",n),Ve("change",n)},fl=()=>{if(!S.value)return;const o=S.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},En=()=>{Me.value=!0,fl()},An=()=>{Me.value=!1,Vn()},Vn=()=>{if(!S.value)return;const o=S.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},$n=o=>{const a=o.target.value;Me.value&&fl(),Ve("update:title",a),Ve("title-change",a),K.value="title",C.richText&&(Ye.value||(Z.value=Y.value,x.value=X.value,b.value=ae.value),de.value&&clearTimeout(de.value),Ye.value=!0,de.value=setTimeout(()=>{Ye.value=!1,Ae()},500))},Fl=()=>{if(!O.value)return;const o=O.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},Kt=()=>{be.value=!0,Fl()},Rn=()=>{be.value=!1,yn()},yn=()=>{if(!O.value)return;const o=O.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const n=o.value;o.value="M";const a=o.scrollHeight;o.value=n,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Wl=o=>{const a=o.target.value;be.value&&Fl(),Ve("update:description",a),Ve("description-change",a),K.value="description",C.richText&&(Ye.value||(Z.value=Y.value,x.value=X.value,b.value=ae.value),de.value&&clearTimeout(de.value),Ye.value=!0,de.value=setTimeout(()=>{Ye.value=!1,Ae()},500))},ht=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},pe=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},Kl=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},Ae=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=C.title||"",r=C.description||"";if(!o&&n===Y.value&&a===X.value&&r===ae.value)return;const c={content:Z.value||Y.value,title:x.value!==void 0?x.value:X.value,description:b.value!==void 0?b.value:ae.value},d=Xe.value.length>0?Xe.value[Xe.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&&(Xe.value.push(c),Xe.value.length>50&&Xe.value.shift(),st.value=[]),Y.value=n,X.value=a,ae.value=r,Z.value=n,x.value=a,b.value=r},pt=o=>{if(!f.value)return;Je(),f.value&&qn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=ht(),vt()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&wt.value&&(wt.value=null),fe.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=hn(r);Ve("update:modelValue",c),Ve("change",c),K.value="editor",Ye.value||(Z.value=Y.value,x.value=X.value,b.value=ae.value),de.value&&clearTimeout(de.value),Ye.value=!0,de.value=setTimeout(()=>{Ye.value=!1,Ae(),zl(),an()},500),e.nextTick(()=>{n&&pe(n),Je();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&wt.value?.command===h){ge.value[h]=wt.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M;let N=!1;if(_&&((_.tagName==="STRONG"||_.tagName==="B"||_.closest&&_.closest("strong, b"))&&(N=!0),!N&&_.style&&parseInt(_.style.fontWeight)>=600&&(N=!0),!N))try{const ee=window.getComputedStyle(_);parseInt(ee.fontWeight)>=600&&(N=!0)}catch{}ge.value[h]=N}else ge.value.hasOwnProperty(h)||(ge.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M,N=_&&(_.tagName==="EM"||_.tagName==="I"||_.closest&&_.closest("em, i"));ge.value[h]=!!N}else{const M=document.queryCommandState(h);ge.value[h]=M}else{const M=document.queryCommandState(h);ge.value[h]=M}}catch{}}),Gt(),j(),hl(),Ft(),ln(),Dl("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>an(h),0),(h===" "||h===`
101
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{zl()},100)}fe.value=!1})},Je=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},vt=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},j=()=>{if(f.value&&!Te.value){Te.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=et,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Te.value=!1}}},Ut=o=>{zl(),Ve("blur",o),Il()},Re=()=>{if(C.disabled||!C.richText||!f.value)return;J(),de.value&&(clearTimeout(de.value),de.value=null),Ye.value&&(Ae(),Ye.value=!1);const o=K.value==="title",n=K.value==="description",a=K.value==="editor";if(Xe.value.length===0){o&&S.value?S.value.focus():n&&O.value?O.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{pt()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};st.value.push(r);const c=Xe.value.pop();if(c!==void 0){fe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Y.value=d,X.value=u,ae.value=m,Z.value=d,x.value=u,b.value=m,e.nextTick(()=>{Gt(),At(),Ll(),Ft();const v=hn(d);Ve("update:modelValue",v),Ve("update:title",u),Ve("update:description",m),Ve("change",v),Ve("title-change",u),Ve("description-change",m),fe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(S.value){S.value.focus();const h=u.length;S.value.setSelectionRange&&S.value.setSelectionRange(h,h),fl()}}else if(n){if(O.value){O.value.focus();const h=m.length;O.value.setSelectionRange(h,h)}}else if(a)Kl();else if(S.value&&document.activeElement===S.value){const h=u.length;S.value.setSelectionRange&&S.value.setSelectionRange(h,h),fl()}else if(O.value&&document.activeElement===O.value){const h=m.length;O.value.setSelectionRange(h,h)}else f.value&&Kl()},10)})})}},Gl=()=>{if(C.disabled||!C.richText||!f.value)return;J();const o=K.value==="title",n=K.value==="description",a=K.value==="editor";if(st.value.length===0){o&&S.value?S.value.focus():n&&O.value?O.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{pt()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};Xe.value.push(r);const c=st.value.pop();if(c!==void 0){fe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Y.value=d,X.value=u,ae.value=m,Z.value=d,x.value=u,b.value=m,e.nextTick(()=>{Gt(),At(),Ll(),Ft();const v=hn(d);Ve("update:modelValue",v),Ve("update:title",u),Ve("update:description",m),Ve("change",v),Ve("title-change",u),Ve("description-change",m),fe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(S.value){S.value.focus();const h=u.length;S.value.setSelectionRange&&S.value.setSelectionRange(h,h),fl()}}else if(n){if(O.value){O.value.focus();const h=m.length;O.value.setSelectionRange(h,h)}}else if(a)Kl();else if(S.value&&document.activeElement===S.value){const h=u.length;S.value.setSelectionRange&&S.value.setSelectionRange(h,h),fl()}else if(O.value&&document.activeElement===O.value){const h=m.length;O.value.setSelectionRange(h,h)}else f.value&&Kl()},10)})})}},Cl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},hl=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Ql=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{hl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{hl()});else try{const r=n.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{hl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{hl()})}return!0},k=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,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"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Cl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Cl()});else try{const r=n.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),n.insertNode(c),n.setStartAfter(c),n.collapse(!0),o.removeAllRanges(),o.addRange(n),e.nextTick(()=>{Cl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Cl()})}return!0},y=(o,n=null)=>{if(C.disabled||!C.richText||!f.value)return;Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae(),J(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&nn(d)&&(r=ht())}if(o==="createLink"&&n){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const v=document.createTextNode(n);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=k();ge.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(wt.value={command:"bold",state:d}),e.nextTick(()=>{r&&(pe(r),e.nextTick(()=>{const m=E("bold");ge.value.bold=m})),pt(),At(),Ft()});return}if(o==="italic"){const d=Ql();ge.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(wt.value={command:"italic",state:d}),e.nextTick(()=>{r&&(pe(r),e.nextTick(()=>{const m=E("italic");ge.value.italic=m})),pt(),hl(),At(),Ft()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&pe(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=E("bold");ge.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=E("italic");ge.value.italic=u});else{const u=document.queryCommandState(o);ge.value[o]=u}else{const u=document.queryCommandState(o);ge.value[o]=u}}catch{ge.value.hasOwnProperty(o)?ge.value[o]=!ge.value[o]:ge.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}pt(),At(),Ft()})},E=(o,n=null)=>{if(C.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let N=M.parentElement;for(;N&&N!==f.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(M.nodeType===1){const _=M;if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let N=M.parentElement;for(;N&&N!==f.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(M.nodeType===1){const _=M;if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=d,d)}return ge.value.hasOwnProperty(o)?ge.value[o]:!1}catch{return ge.value.hasOwnProperty(o)?ge.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},q=o=>{C.disabled||!C.richText||(ce.value=ce.value===o?null:o,o==="askAi"&&(Lt.value=null))},J=()=>{ce.value=null,Ne.value=null},We=o=>{y("formatBlock",o),J()},yt=o=>{if(!o||!f.value)return o;const n=Fe=>{let Ce=Fe.nodeType===Node.TEXT_NODE?Fe.parentElement:Fe;for(;Ce&&Ce!==f.value;){const mt=Ce.tagName;if(mt==="P"){const sl=Ce.parentElement;if(sl===f.value||sl.tagName==="BLOCKQUOTE")return Ce}if(mt==="BLOCKQUOTE")break;Ce=Ce.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Fe=>{const Ce=Fe.tagName;if(Ce==="P"){const mt=Fe.parentElement;if(mt===f.value||mt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ce==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),_=c.slice(h,M+1);if(_.length===0)return o;const N=_[0],ee=_[_.length-1],U=document.createRange();return U.setStartBefore(N),U.setEndAfter(ee),U},kl=()=>{if(C.disabled||!C.richText||!f.value)return;Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae(),J(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&nn(n)&&(n=yt(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&nn(n)&&(a=ht());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(N=>{const ee=document.createElement("p");N.parentNode.insertBefore(ee,N),ee.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(()=>{a&&pe(a),Ll(),pt(),Ft()})},bl=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const _=M.textContent||"",ee=(M.innerHTML||"").trim();return _.trim()===""||ee===""||ee==="<br>"||ee==="<br/>"||ee==="<p></p>"||ee==="<p><br></p>"||ee==="<p><br/></p>"||ee==="<p> </p>"||ee==="<p><br> </p>"||ee==="<div></div>"||ee==="<div><br></div>"||ee==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const _=r.children[M];if((_.tagName==="P"||_.tagName==="DIV")&&c(_))_.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Ll(),pt()})},At=()=>{if(!f.value){ve.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},un=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),tt.value=ht();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),He.value="",qe.value=a,$e.value="",me.value=null,Ee.value=!0,J(),e.nextTick(()=>{ut.value&&ut.value.focus()})},Fn=()=>{if(!f.value)return;Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae();const o=window.getSelection();let n=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;n=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!n&&me.value&&(n=me.value),n&&n.parentNode){const a=document.createDocumentFragment();for(;n.firstChild;)a.appendChild(n.firstChild);if(n.parentNode.replaceChild(a,n),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}me.value=null}else y("unlink");ve.value=!1,J(),e.nextTick(()=>{pt(),At()})},ro=()=>{C.disabled||!C.richText||f.value&&(Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae(),J(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Gt(),pt(),Ft()}))},Un=()=>{C.disabled||!C.richText||f.value&&(Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae(),J(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Gt(),pt(),Ft()}))},io=o=>{const n=o.parentElement;if(!n||n.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Gt=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=io(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},co=()=>{if(C.disabled||!C.richText||!f.value)return;J(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Gt(),pt()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=io(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Gt();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{pt(),Ft()})}else document.execCommand("indent",!1),e.nextTick(()=>{Gt(),pt(),Ft()})},No=()=>{if(C.disabled||!C.richText||!f.value)return;J(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Gt(),pt()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Gt();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{pt(),Ft()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Gt(),pt(),Ft()})},vl=e.ref(null),Jl=e.ref(null),Nn=e.ref({}),_l=e.ref(""),ql=e.ref(null),wl=e.ref("");e.ref("");const dn=e.ref(null);e.ref("");const Bl=e.ref([]),Xn=e.ref(!1),Tn=e.ref(!1),So=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},uo=()=>{if(C.disabled||!C.richText||!f.value)return;if(vl.value!==null){vl.value=null,_l.value="",wl.value="",dn.value=null,Bl.value=[],wn(!0);return}J(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!nn(n))return;wl.value=So(n)||"",dn.value=ht();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);Nn.value={top:`${m}px`,bottom:"auto"},vl.value=Date.now(),e.nextTick(()=>{if(_l.value="",ql.value){const h=ql.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),_=v.getBoundingClientRect(),N=h.getBoundingClientRect(),ee=_.bottom-M.top,U=N.top-M.top,Fe=8;if(ee>U-Fe){const Ce=N.height;Nn.value={bottom:`${Ce+Fe}px`,top:"auto"}}else Nn.value={top:`${m}px`,bottom:"auto"}}}})},mo=()=>{if(!_l.value.trim())return;const o=_l.value.trim(),n=new Date,a={text:o,selectionText:wl.value,selectionRange:dn.value,commentId:vl.value,user:C.commentUser||null,createdAt:n.toISOString()};Bl.value=[...Bl.value,a],Ve("comment-submitted",a),Mo(a),dn.value&&!Yn(dn.value)&&Bo(vl.value,dn.value),_l.value="",e.nextTick(()=>{if(ql.value){const r=ql.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Dl("sendComment")})},po=(o,n)=>{if(!(!C.commentUser||!o.user||o.user.id!==C.commentUser.id)){if(Bl.value=Bl.value.filter((a,r)=>r!==n),vl.value!==null&&f.value){const a=String(vl.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Bl.value.length>0){const c=[],d=new Set;Bl.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(Bl.value.length))}else r&&Bl.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ve("comment-deleted",{comment:o,index:n,commentId:vl.value}),C.comments&&Array.isArray(C.comments)){const a=C.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Ve("update:comments",a)}e.nextTick(()=>{Dl("deleteComment")})}},Yn=o=>{if(!o||!f.value)return!1;try{const n=jn(o);if(!n)return!1;const a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},jn=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(n.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(n.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Bo=(o,n)=>{if(!(!o||!n||!f.value))try{const a=jn(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,M=a.endOffset,_=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if(_===N&&h===0&&M===(v.nodeType===3?v.length:N.childNodes.length)&&(_.tagName==="P"||_.tagName==="DIV"||_.tagName==="H1"||_.tagName==="H2"||_.tagName==="H3"||_.tagName==="H4"||_.tagName==="H5"||_.tagName==="H6")){const U=a.extractContents();d.appendChild(U),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Dl("wrapSelectionWithCommentMarker"),pt()})}catch{}},Mo=o=>{if(!o||!o.commentId)return;const n=Array.isArray(C.comments)?[...C.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=n.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=n[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&n.length>0){const u=n.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=n.length>0&&n.find(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};n.push(m)}Xn.value=!0,Ve("update:comments",n)},Kn=(o,n=[])=>{if(C.disabled||!C.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;J(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),wl.value=r.innerHTML||"",dn.value=ht();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),_=u.bottom-M.top,ee=Math.max(_+8,0);Nn.value={top:`${ee}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&C.comments&&Array.isArray(C.comments)){const M=C.comments.find(_=>String(_.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const _=M.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:M.id||M.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(..._)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((M,_)=>{const N=Fe=>{if(!Fe)return 0;const Ce=new Date(Fe).getTime();return isNaN(Ce)?0:Ce},ee=N(M.createdAt),U=N(_.createdAt);return ee===U?0:ee-U}),Bl.value=h,wn(!0),vl.value=v||null,r&&(Jl.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(_l.value="",ql.value){const M=ql.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const _=m.querySelector(".dss-text-editor-footer");if(_){const N=m.getBoundingClientRect(),ee=M.getBoundingClientRect(),U=_.getBoundingClientRect(),Fe=ee.bottom-N.top,Ce=U.top-N.top,mt=8;if(Fe>Ce-mt){const sl=U.height;Nn.value={bottom:`${sl+mt}px`,top:"auto"}}}}}Dl("openCommentOverlayForSelector")})},Gn=e.ref(null),In=e.ref(0),xl=o=>{if(!(C.disabled||!C.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{bl()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,_=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||_.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),n.removeAllRanges(),n.addRange(m),e.nextTick(()=>{pt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?No():co();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const _=a.startOffset;_<u.length&&(M=u.splitText(_));const N=document.createElement("p");if(M?N.appendChild(M):N.innerHTML="<br>",u.length===0){const U=u.parentElement;U&&(U.removeChild(u),U.childNodes.length===0&&U.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const ee=document.createRange();M?ee.setStart(M,0):ee.setStart(N,0),ee.collapse(!0),n.removeAllRanges(),n.addRange(ee),e.nextTick(()=>{pt()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=U=>{if(!U)return!1;const Fe=U.textContent||"",mt=(U.innerHTML||"").trim(),sl=mt.replace(/<br\s*\/?>/gi,"").trim();return Fe.trim()===""||mt===""||sl===""||mt==="<br>"||mt==="<br/>"||mt==="<p></p>"||mt==="<p><br></p>"||mt==="<p><br/></p>"||mt==="<p> </p>"||mt==="<p><br> </p>"||mt==="<div></div>"||mt==="<div><br></div>"||mt==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=a.startContainer,_=M.nodeType===3?M.parentElement:M,N=_===c||_&&_.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{bl()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-In.value;if(Gn.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),co();return}}}}Gn.value=" ",In.value=n}else Gn.value=o.key}},P=o=>{if(C.disabled||!C.richText)return;o.preventDefault();let n=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");n&&(n=n.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Ae();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(_=>{if(h>0){const N=v.createElement("p");N.innerHTML=_.innerHTML,_.parentNode.replaceChild(N,_)}else h++}),c){const _=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(ee=>_.includes(ee.tagName));if(N.length===1){const ee=N[0].tagName,U=c.tagName,Fe=c.textContent.trim()===""&&!c.querySelector("img");let Ce=!1;if(["H1","H2","H3","H4","H5","H6"].includes(U)?Ce=!0:Fe||(ee===U||ee==="P")&&(Ce=!0),Ce)return N[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(n){const u=d(n);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);pt()},ul=o=>{if(ce.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&J()}if(Ze.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&Il()}if(Lt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&vo()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ne.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);De.value=!r.collapsed&&nn(r)}else De.value=!1}if(vl.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=n.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(vl.value=null,_l.value="",wl.value="",dn.value=null,Bl.value=[],wn(!0))}},$l=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Ke.value&&(clearTimeout(Ke.value),Ke.value=null),Ne.value=n},dl=o=>{const n=o.relatedTarget;if(n){const a=n.closest(".dss-toolbar-dropdown-submenu"),r=n.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}Ke.value&&clearTimeout(Ke.value),Ke.value=setTimeout(()=>{Ne.value=null,Ke.value=null},150)},en=o=>{Ne.value=null};let Wt=0;const ol=o=>{if(!o)return;const n=Array.from(o.children);n.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),n.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Wt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},tn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{ol(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=v=>{const h=c.getAttribute("data-submenu-id");h&&$l(v,h)},m=dl;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),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=h=>{const M=c.getAttribute("data-submenu-id");M&&$l(h,M)},m=dl;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",en)})})})};let Tl=null;const St=()=>{if(Ne.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ne.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ne.value}"]`);o&&n&&On(o,n)}if(Ze.value&&Ft(),C.richText){if(Tl!==null)return;Tl=setTimeout(()=>{Tl=null,Dl("handleWindowResize")},150)}},Bt=()=>{if(!C.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(n=>{Array.from(n.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},Ct=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),n=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",n),a.addEventListener("mousedown",n),a.addEventListener("dragstart",n),a.addEventListener("contextmenu",n),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Me.value?fl():Vn(),be.value?Fl():yn()})}),e.nextTick(()=>{Ct()}),C.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",ul),window.addEventListener("resize",St);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,St()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,St()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{tn(),Bt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!C.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(M||_&&v===_){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),ee=document.createRange();ee.setStartAfter(_),ee.collapse(!0),N.removeAllRanges(),N.addRange(ee)}else _&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const U=N.getRangeAt(0).commonAncestorContainer,Fe=U.nodeType===3?U.parentElement:U;if(_.contains(Fe)&&Fe!==_.querySelector("img")){const Ce=document.createRange();Ce.setStartAfter(_),Ce.collapse(!0),N.removeAllRanges(),N.addRange(Ce)}}else{const ee=document.createRange();ee.setStartAfter(_),ee.collapse(!0),N.addRange(ee)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const _=window.getSelection(),N=document.createRange();M&&(N.setStartAfter(M),N.collapse(!0),_.removeAllRanges(),_.addRange(N))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const _=h.getAttribute("alt")||h.alt||"";if(_){const N=h.getAttribute("src")||h.src||"",ee=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),U=_===N||_===ee;(_.startsWith("http://")||_.startsWith("https://")||_.startsWith("data:")||U||U)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),j()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(ze.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{ze.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{ze.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!ze.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=ze.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,_=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){ze.value=null;return}let N=null;const ee=m.clientX,U=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(ee,U);else{const Pt=window.getSelection();Pt.rangeCount>0?N=Pt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(f.value),N.collapse(!1))}if(!N){ze.value=null;return}const Fe=N.commonAncestorContainer,Ce=Fe.nodeType===3?Fe.parentElement:Fe;if(Ce?.closest(".dss-image-wrapper")===_||_&&_.contains(Ce)){ze.value=null;return}if(_&&(Ce===_||_.contains(Ce))){ze.value=null;return}const sl=M.getAttribute("src");let Qt=null;_?Qt=_.cloneNode(!0):Qt=M.cloneNode(!0);try{let Pt=N.startContainer;if(Pt.nodeType===3&&(Pt=Pt.parentElement),_&&(Pt===_||_.contains(Pt))){const zt=document.createRange();zt.setStartAfter(_),zt.collapse(!0),N=zt}N.insertNode(Qt);const Jt=document.createRange();Jt.setStartAfter(Qt),Jt.collapse(!0);const el=window.getSelection();el.removeAllRanges(),el.addRange(Jt)}catch{if(f.value.childNodes.length===0){const Jt=document.createElement("p");Jt.appendChild(Qt),f.value.appendChild(Jt)}else{const Jt=f.value.lastChild;if(Jt&&Jt.nodeType===1)Jt.appendChild(Qt);else{const el=document.createElement("p");el.appendChild(Qt),f.value.appendChild(el)}}}_?_.remove():M.remove(),ze.value=null,e.nextTick(()=>{const Pt=f.value.querySelectorAll("img");let Jt=!1;Pt.forEach(el=>{if(el.getAttribute("src")===sl)if(!Jt)Jt=!0;else{const zt=el.closest(".dss-image-wrapper");zt?zt.remove():el.remove()}}),j(),pt()})}),f.value.addEventListener("dragend",m=>{ze.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(_=>{_.removeAttribute("alt"),_.removeAttribute("data-alt"),_.setAttribute("alt",""),_.setAttribute("data-alt",""),_.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{j(),Bt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Bt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),C.modelValue){const m=cn(C.modelValue);f.value.innerHTML=m,vt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=C.title||"",h=C.description||"";Y.value=m,X.value=v,ae.value=h,x.value=v,b.value=h,Gt(),j(),hl(),ln(),Hn(),Pn()}),At(),Ll(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",ul),window.removeEventListener("resize",St),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Tl!==null&&(clearTimeout(Tl),Tl=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),de.value&&clearTimeout(de.value),Ke.value&&clearTimeout(Ke.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),dt.value&&dt.value.disconnect(),yl.value!==null&&(cancelAnimationFrame(yl.value),yl.value=null),ml.value!==null&&(clearTimeout(ml.value),ml.value=null),il.value!==null&&(clearTimeout(il.value),il.value=null),wn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Xt=o=>{const n=o.target,a=n.closest("a");if(a&&!C.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=n.closest(".dss-image-wrapper");r&&n.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}j(),At(),Ll(),Ft(),ln()}):e.nextTick(()=>{j(),At(),Ll(),Ft(),ln()})},fo=()=>{Je();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);De.value=!a.collapsed&&nn(a),!a.collapsed&&wt.value&&(wt.value=null)}else De.value=!1;if(j(),At(),Ll(),Ft(),ln(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),De.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ge.value[a]=m}else{const d=document.queryCommandState(a);ge.value[a]=d}}}catch{}})},ln=()=>{if(!C.richText||C.disabled||!f.value){Ge.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){Ge.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){Ge.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){Ge.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Ge.value=d:Ge.value="p"}catch{Ge.value="p"}},Ll=()=>{if(!f.value){ft.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}ft.value=n}catch{ft.value=!1}},nn=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},Il=()=>{Ze.value=!1},Ft=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){Ze.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Ze.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!nn(n)){Ze.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ze.value=!1;return}const r=f.value;if(!r){Ze.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){Ze.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Ue.value&&(M=Ue.value.getBoundingClientRect().width);const _=(M||320)/2;let N=c.left+_,ee=c.right-_;if(ee<N){const U=c.left+c.width/2;N=U,ee=U}if(h>0){const U=_+u,Fe=h-_-u;if(N=Math.max(N,U),ee=Math.min(ee,Fe),ee<N){const Ce=h/2;N=Ce,ee=Ce}}v<N?v=N:v>ee&&(v=ee),xt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ze.value=!0},Ln=o=>{C.disabled||!C.richText||(Lt.value=Lt.value===o?null:o,o==="askAi"&&(ce.value=null))},vo=()=>{Lt.value=null,Ne.value=null},mn=o=>{We(o),vo()};let Cn=null,Hl=null,pn=null,El=null;const _o=o=>{if(C.disabled||!C.richText){on(),Sn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(Cn&&(clearTimeout(Cn),Cn=null),pn&&(clearTimeout(pn),pn=null),a&&a!==Hl){Sn(),Hl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),me.value=a,te.value=c,se.value=!0,R.value=!0,go(a)}else!a&&Hl?(Hl=null,Cn=setTimeout(()=>{R.value||on()},150)):a&&a===Hl&&go(a);if(r&&r!==El){on(),El=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),at.value=r,Ht.value=c.trim()||D("textEditor.image.noAlt"),Nt.value=!0,G.value=!0,ho(r)}else!r&&El?(El=null,pn=setTimeout(()=>{G.value||Sn()},150)):r&&r===El&&ho(r)},$o=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Hl=null,El=null,Cn&&(clearTimeout(Cn),Cn=null),pn&&(clearTimeout(pn),pn=null),on(),Sn())},on=()=>{R.value=!1,setTimeout(()=>{R.value||(se.value=!1,te.value="",Ee.value||(me.value=null))},100)},go=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;le.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Sn=()=>{G.value=!1,setTimeout(()=>{G.value||(Nt.value=!1,Ht.value="",it.value||(at.value=null))},100)},ho=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;gl.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},yo=()=>{if(!te.value||!me.value)return;let n=me.value.getAttribute("href")||te.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},Co=()=>{if(me.value){const o=me.value.textContent||"",n=me.value.getAttribute("href")||"",a=me.value;He.value=n,qe.value=o,$e.value=o,R.value=!1,se.value=!1,te.value="",me.value=a,Ee.value=!0}else if(ve.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";He.value=d,qe.value=c,$e.value=c,me.value=r,Ee.value=!0}}}else{tt.value=ht();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),He.value="",qe.value=n,$e.value="",me.value=null,Ee.value=!0}e.nextTick(()=>{ut.value&&(ut.value.focus(),ut.value.select())})},zn=()=>{Ee.value=!1,He.value="",qe.value="",$e.value="",me.value=null,tt.value=null},Qn=()=>{if(!He.value.trim()){zn();return}if(Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae(),qe.value.trim()||(qe.value=He.value.trim()),me.value&&f.value&&f.value.contains(me.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=me.value;if(n.setAttribute("href",He.value.trim()),qe.value.trim()!==$e.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=qe.value.trim()}n.style.color="#60afdf",n.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(n),a.collapse(!1),o.removeAllRanges(),o.addRange(a),pt()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),tt.value&&pe(tt.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=He.value.trim(),a.textContent=qe.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,c=r&&n.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=He.value.trim(),d.textContent=qe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
102
+ `){const _=document.createTextNode(" ");n.insertNode(_),n.setStartAfter(_)}}n.insertNode(d);const v=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(v),n.setStartAfter(v),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}}else{if(r&&n.startOffset>0){const m=a.textContent.substring(0,n.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
103
+ `){const h=document.createTextNode(" ");n.insertNode(h),n.setStartAfter(h)}}n.insertNode(d);const u=document.createTextNode(" ");n.setStartAfter(d),n.insertNode(u),n.setStartAfter(u),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}}pt()}e.nextTick(()=>{At(),zn()})},zl=()=>{if(!f.value||fe.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=ht());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const _=M.filter(U=>{const Fe=U[0],Ce=U.index;if(Ce>0&&h[Ce-1]==="@"||Ce+Fe.length<h.length&&h[Ce+Fe.length]==="@")return!1;const mt=v.parentElement;return!(mt&&mt.closest("a"))});if(_.length===0)continue;if(_.length===1&&_[0][0]===h.trim()){const U=_[0][0],Fe=U.startsWith("http://")||U.startsWith("https://")?U:`https://${U}`,Ce=document.createElement("a");Ce.href=Fe,Ce.textContent=U,Ce.style.color="#60afdf",Ce.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ce,v),u=!0);continue}let N=0;const ee=document.createDocumentFragment();if(_.forEach(U=>{const Fe=U.index,Ce=U[0];if(Fe>N){const Qt=h.substring(N,Fe);Qt&&ee.appendChild(document.createTextNode(Qt))}const mt=Ce.startsWith("http://")||Ce.startsWith("https://")?Ce:`https://${Ce}`,sl=document.createElement("a");sl.href=mt,sl.textContent=Ce,sl.style.color="#60afdf",sl.style.textDecoration="underline",ee.appendChild(sl),N=Fe+Ce.length}),N<h.length){const U=h.substring(N);U&&ee.appendChild(document.createTextNode(U))}v.parentNode&&ee.childNodes.length>0&&(v.parentNode.replaceChild(ee,v),u=!0)}u&&n&&e.nextTick(()=>{pe(n),At()})},kn=()=>{if(!f.value)return;const o=/<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}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const _=M.index,N=M[0].startsWith("<u>")?"u":"ins",ee=M[1]||M[2]||"";_>v&&h.appendChild(document.createTextNode(u.substring(v,_)));const U=document.createElement(N);U.textContent=ee,h.appendChild(U),v=_+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},an=o=>{if(!f.value||fe.value)return;if(!o){kn();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let Qt="",Pt=0,Jt=!1;const el=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ul=>Ul.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let zt=0;for(;el.nextNode();){const Ul=el.currentNode,vn=Ul.textContent||"",Xl=zt;if(zt+=vn.length,Ul===r.startContainer){Qt+=vn.substring(0,r.startOffset),Pt=Xl+r.startOffset,Jt=!0;break}Qt+=vn}return Jt||(Pt=Qt.length),{textBeforeCursor:Qt,cursorCharOffset:Pt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],_=u.length-h.length,ee=(Qt=>{let Pt=0;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:zt=>zt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let el;for(;el=Jt.nextNode();){const zt=(el.textContent||"").length;if(Pt+zt>=Qt)return{node:el,offset:Qt-Pt};Pt+=zt}return null})(_);if(!ee)return;const U=document.createRange();U.setStart(ee.node,ee.offset),U.setEnd(r.endContainer,r.endOffset);const Fe=document.createElement(v);Fe.textContent=M,U.deleteContents(),U.insertNode(Fe);const Ce=window.getSelection(),mt=document.createRange();mt.setStartAfter(Fe),mt.collapse(!0),Ce.removeAllRanges(),Ce.addRange(mt);const sl=ht();e.nextTick(()=>{pt(),sl&&pe(sl)})},It=()=>{f.value&&(_t.value=ht(),Et.value="",Tt.value="",Be.value="",gt.value="",lt.value="",rl.value=null,at.value=null,he.value="upload",it.value=!0,J(),e.nextTick(()=>{kt.value&&kt.value.focus(),$t.value&&($t.value.value="")}))},ko=o=>{const n=o.target?.files?.[0];if(!n){rl.value=null,Tt.value="";return}rl.value=n;const a=new FileReader;a.onload=r=>{Tt.value=r.target?.result||""},a.readAsDataURL(n)},qt=()=>{$t.value&&$t.value.click()},al=()=>{gt.value&&(lt.value="")},bo=()=>{lt.value&&(gt.value="")},To=()=>{let o=at.value;if(!o){const n=window.getSelection();if(n&&n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const n=o.getAttribute("data-alt")||o.getAttribute("alt")||"";at.value=o,Et.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Be.value=a,Tt.value="",he.value="url"):(Tt.value=a,Be.value="",he.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";gt.value=c.endsWith("px")?c.replace("px",""):c,lt.value=d.endsWith("px")?d.replace("px",""):d,_t.value=null}else{It();return}it.value=!0,G.value=!1,Nt.value=!1,e.nextTick(()=>{he.value==="url"&&Dt.value?(Dt.value.focus(),Dt.value.select()):kt.value&&(kt.value.focus(),kt.value.select()),$t.value&&($t.value.value="")})},bn=()=>{it.value=!1,Et.value="",Tt.value="",Be.value="",gt.value="",lt.value="",rl.value=null,at.value=null,_t.value=null,he.value="upload"},fn=()=>{const o=(Et.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),Ye.value?(de.value&&(clearTimeout(de.value),de.value=null),Ae(),Ye.value=!1):Ae();const a=he.value==="url"?Be.value.trim():Tt.value;if(at.value&&f.value&&f.value.contains(at.value)){a&&(at.value.src=a),at.value.setAttribute("alt",o),at.value.setAttribute("data-alt",o),gt.value?(at.value.style.width=`${gt.value}px`,at.value.setAttribute("width",gt.value)):(at.value.style.removeProperty("width"),at.value.removeAttribute("width")),lt.value?(at.value.style.height=`${lt.value}px`,at.value.setAttribute("height",lt.value)):(at.value.style.removeProperty("height"),at.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(at.value),c.collapse(!0),r.addRange(c)}pt()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),bn();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(_t.value&&(pe(_t.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 h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){bn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),gt.value&&(v.style.width=`${gt.value}px`,v.setAttribute("width",gt.value)),lt.value&&(v.style.height=`${lt.value}px`,v.setAttribute("height",lt.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const _=document.createElement("p");f.value.appendChild(_),_.appendChild(v)}else{const _=f.value.lastChild;if(_&&_.nodeType===1)_.appendChild(v);else{const N=document.createElement("p");f.value.appendChild(N),N.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}at.value=v,pt()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),At(),Ft(),bn()})};e.watch(()=>C.modelValue,o=>{if(C.richText&&f.value&&!fe.value){const n=cn(o||""),r=f.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=ht();f.value.innerHTML=n,e.nextTick(()=>{vt();const u=f.value.innerHTML||"",m=C.title||"",v=C.description||"";Y.value=u,X.value=m,ae.value=v,Z.value=u,x.value=m,b.value=v,Xe.value=[],st.value=[],de.value&&(clearTimeout(de.value),de.value=null),Ye.value=!1,d&&pe(d),Gt(),j(),hl(),At(),Ft(),ln(),Dl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,o=>{o?(Ft(),e.nextTick(()=>{Hn()})):(Il(),bt.value=[],dt.value&&(dt.value.disconnect(),dt.value=null)),ln()}),e.watch(()=>C.floatingToolbar,o=>{o?Ft():Il()}),e.watch(()=>C.disabled,o=>{o&&Il(),ln()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{be.value?Fl():yn()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{Me.value?fl():Vn()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{Bt()})},{deep:!0}),e.watch(()=>C.comments,(o,n)=>{if(Xn.value){Xn.value=!1;return}Tn.value||C.richText&&f.value&&e.nextTick(()=>{Pn()})},{deep:!0,immediate:!1});const Pn=()=>{if(!Tn.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!f.value)){Tn.value=!0;try{const o=new Set,n=C.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){Bn(h,u),d.add(v);return}try{const M=eo(u.selection_range,u.selection_text);if(M&&!M.collapsed){const _=M.commonAncestorContainer,N=_.nodeType===3?_.parentElement:_;if(N){const Fe=N.closest("[data-comment], [data-fake-comment]");if(Fe){const Ce=Fe.getAttribute("data-comment")||Fe.getAttribute("data-fake-comment");if(String(Ce)===String(m)){Fe.setAttribute("data-comment",v),Fe.removeAttribute("data-fake-comment"),Bn(Fe,u),d.add(v);return}else return}}const ee=f.value.querySelector(`[data-comment="${v}"]`);if(ee){Bn(ee,u),d.add(v);return}const U=document.createElement("span");U.setAttribute("data-comment",v),Bn(U,u);try{M.surroundContents(U),c++,d.add(v)}catch{try{const Ce=document.createRange();Ce.setStart(M.startContainer,M.startOffset),Ce.setEnd(M.endContainer,M.endOffset),Rt(Ce),Ce.surroundContents(U),c++,d.add(v)}catch{try{const mt=M.extractContents();U.appendChild(mt),M.insertNode(U),c++,d.add(v)}catch(mt){console.warn("Failed to create comment marker:",mt)}}}}}catch{}}),e.nextTick(()=>{Dl("restoreCommentsFromModel"),pt(),Tn.value=!1})}catch{Tn.value=!1}}},Rt=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&n.includes(u.tagName)&&(r===0&&!Lo(a)||o.setStartBefore(u))}else a.nodeType===1&&n.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&n.includes(u.tagName)&&(d===c.length&&!Jn(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Lo=o=>{let n=o.previousSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.previousSibling}return!1},Jn=o=>{let n=o.nextSibling;for(;n;){if(n.nodeType===3&&n.textContent.trim().length>0||n.nodeType===1&&n.textContent.trim().length>0)return!0;n=n.nextSibling}return!1},eo=(o,n)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Rt(a):null}}catch{return null}return null},Bn=(o,n)=>{if(!o||!n)return;const a=n.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Dl=(o="unknown")=>{if(!C.richText||!f.value){bt.value=[];return}Date.now()-ll.value<Yl&&yl.value!==null||yl.value===null&&(yl.value=requestAnimationFrame(()=>{if(yl.value=null,ll.value=Date.now(),Zt.value)return;Zt.value=!0;const a={},r=f.value;if(!r){Zt.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Zt.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const ee=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");ee&&N.tagName==="SPAN"&&(m.has(ee)||(u.push(N),m.add(ee)))}),d.forEach(N=>{const ee=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!ee||m.has(ee)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${ee}"], span[data-fake-comment="${ee}"]`)||(u.push(N),m.add(ee)):N.tagName!=="SPAN"&&(u.push(N),m.add(ee)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,ee)=>{let U=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!U)return;if(typeof U=="string"&&U.startsWith("comment-")){const ct=N.textContent?.trim(),Pl=C.comments?.find(tl=>(typeof tl.conversation_id=="string"&&tl.conversation_id.startsWith("comment-")?null:tl.conversation_id)&&tl.selection_text?.trim()===ct);Pl?(U=String(Pl.conversation_id),N.setAttribute("data-comment",U),N.removeAttribute("data-fake-comment")):(U=String(Date.now()),N.setAttribute("data-comment",U),N.removeAttribute("data-fake-comment"))}const Fe=N.getBoundingClientRect(),Ce=window.getComputedStyle(N),mt=parseFloat(Ce.lineHeight)||parseFloat(Ce.fontSize)*1.2,Pt=Fe.top-h.top+mt/2-15,el=h.top-v.top+Pt;let zt=null,Ul=null,vn=0;const Xl=[],xo=new Set;if(U&&C.comments){const ct=C.comments.find(Pl=>String(Pl.conversation_id||Pl.id)===String(U));if(ct){const Pl=ct.conversation||[];Pl.length>0?(Pl.forEach(tl=>{tl.user&&tl.user.id&&!xo.has(tl.user.id)&&(xo.add(tl.user.id),Xl.push(tl.user))}),vn=Pl.length):(vn=0,zt=null,Ul=null),Xl.length>0?zt=Xl[0]:zt=null,Xl.length>1?Ul=Xl[1]:Ul=null}}const sn=Fe.top+mt/2-15,lo=sn+30,Dn=5,Mn=lo>h.top+Dn&&sn<h.bottom-Dn?1:0;bt.value.find(ct=>ct.id===U);let gn=N;if(!gn&&U&&f.value){const ct=String(U);gn=f.value.querySelector(`[data-comment="${ct}"], [data-fake-comment="${ct}"]`)}const _n=Xl.length;a[U]?(a[U].top=el,a[U].opacity=Mn,a[U].element=gn,a[U].firstUser=zt,a[U].secondUser=Ul,a[U].totalCount=vn,a[U].uniqueUserCount=_n):a[U]={id:U,top:el,opacity:Mn,element:gn,firstUser:zt,secondUser:Ul,totalCount:vn,uniqueUserCount:_n}});const M=Object.values(a).map(N=>{const ee=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&f.value){const Fe=String(N.id);N.element=f.value.querySelector(`[data-comment="${Fe}"], [data-fake-comment="${Fe}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:ee}});(bt.value.length!==M.length||M.some((N,ee)=>{const U=bt.value[ee];if(!U)return!0;const Fe=(U.firstUser?.id||null)!==(N.firstUser?.id||null),Ce=(U.secondUser?.id||null)!==(N.secondUser?.id||null);return U.id!==N.id||Math.abs(U.top-N.top)>1||U.opacity!==N.opacity||U.totalCount!==N.totalCount||U.additionalCount!==N.additionalCount||Fe||Ce||U.element!==N.element}))&&(bt.value=M),Zt.value=!1}))},wo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const a=String(o.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(wn(),Jl.value=n,n.classList.add("editor-comment-highlighted"))},wn=(o=!1)=>{!o&&vl.value!==null&&Jl.value&&(Jl.value.getAttribute("data-comment")||Jl.value.getAttribute("data-fake-comment"))===vl.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jl.value&&(Jl.value.classList.remove("editor-comment-highlighted"),Jl.value=null))},to=o=>{if(!o||!o.element)return;wn(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;Ve("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},Ho=()=>{wn()},Hn=()=>{!C.richText||!f.value||(dt.value&&dt.value.disconnect(),il.value!==null&&(clearTimeout(il.value),il.value=null),dt.value=new MutationObserver(()=>{il.value===null&&(il.value=setTimeout(()=>{il.value=null,e.nextTick(()=>{Dl("MutationObserver")})},200))}),dt.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"]}),Dl("setupCommentMarkersObserver-initial"))},On=(o,n)=>{if(!o||!n)return;const a=n.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>Ne.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{On(a,c),a.offsetHeight,a.setAttribute("data-active","true"),a.style.visibility="visible",a.style.opacity="1"})})}else a.setAttribute("data-active","true")}else a.setAttribute("data-active","false"),a.style.display="none",a.style.top="",a.style.left="",a.style.visibility="",a.style.opacity=""})})}),e.watch(()=>[ce.value,Lt.value],()=>{ce.value==="askAi"||Lt.value==="askAi"?e.nextTick(()=>{tn()}):(Ne.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(n=>{if(n.parentNode===document.body){const a=n.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(n.dataset.originalParentRef==="inside")r.appendChild(n);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(n,r.nextSibling)}}}})}))}),e.watch(()=>C.locale,o=>{o&&o!==xe.value&&(xe.value=o)},{immediate:!0}),we({openCommentOverlayForSelector:Kn,updateCommentMarkers:Dl,restoreCommentsFromModel:Pn}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Yt.value]),style:e.normalizeStyle(nl.value)},[F.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Kc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Re,title:e.unref(D)("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,Gc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:Gl,title:e.unref(D)("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,Qc),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Jc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>q("paragraph")),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[Ge.value==="h1"?(e.openBlock(),e.createElementBlock("svg",tu,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h2"?(e.openBlock(),e.createElementBlock("svg",lu,[...n[48]||(n[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h3"?(e.openBlock(),e.createElementBlock("svg",nu,[...n[49]||(n[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h4"?(e.openBlock(),e.createElementBlock("svg",ou,[...n[50]||(n[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h5"?(e.openBlock(),e.createElementBlock("svg",au,[...n[51]||(n[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h6"?(e.openBlock(),e.createElementBlock("svg",su,[...n[52]||(n[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",ru,[...n[53]||(n[53]=[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[54]||(n[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,eu),ce.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]=a=>We("<h1>"))},[n[55]||(n[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>We("<h2>"))},[n[56]||(n[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>We("<h3>"))},[n[57]||(n[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>We("<h4>"))},[n[58]||(n[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>We("<h5>"))},[n[59]||(n[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>We("<h6>"))},[n[60]||(n[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>We("<p>"))},[n[61]||(n[61]=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(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("bold")}]),onClick:n[9]||(n[9]=a=>y("bold")),title:e.unref(D)("textEditor.toolbar.bold")},[...n[62]||(n[62]=[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,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("italic")}]),onClick:n[10]||(n[10]=a=>y("italic")),title:e.unref(D)("textEditor.toolbar.italic")},[...n[63]||(n[63]=[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,cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("underline")}]),onClick:n[11]||(n[11]=a=>y("underline")),title:e.unref(D)("textEditor.toolbar.underline")},[...n[64]||(n[64]=[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,uu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ft.value}]),onClick:kl,title:e.unref(D)("textEditor.toolbar.citation")},[...n[65]||(n[65]=[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,du),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Fn,title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[67]||(n[67]=[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,pu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:un,title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[66]||(n[66]=[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,mu)),n[75]||(n[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("insertUnorderedList")}]),onClick:ro,title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[68]||(n[68]=[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,fu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("insertOrderedList")}]),onClick:Un,title:e.unref(D)("textEditor.toolbar.numberList")},[...n[69]||(n[69]=[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,vu),n[76]||(n[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:It,title:e.unref(D)("textEditor.toolbar.image")},[...n[70]||(n[70]=[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,gu),De.value?(e.openBlock(),e.createElementBlock("div",hu)):e.createCommentVNode("",!0),De.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:uo},[...n[71]||(n[71]=[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,yu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",Cu)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",ku,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>q("askAi")),title:e.unref(D)("textEditor.toolbar.askAi")},[n[72]||(n[72]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",wu,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,bu),ce.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",xu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ot(a)?(e.openBlock(),e.createElementBlock("div",Eu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),ot(a)&&r<F.customToolbarSlots.length-1&&cl(r)?(e.openBlock(),e.createElementBlock("div",Vu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ce.value==="paragraph"||ce.value==="askAi")&&F.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:J})):e.createCommentVNode("",!0),e.createVNode(Ro,{showModal:Ee.value,width:"500px",height:"55vh",onCloseModal:zn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(D)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nu,[e.createElementVNode("div",Su,[e.createElementVNode("label",Bu,e.toDisplayString(e.unref(D)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:$,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Qn,["enter"])},null,40,Mu),[[e.vModelText,qe.value]])]),e.createElementVNode("div",_u,[e.createElementVNode("label",$u,e.toDisplayString(e.unref(D)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:ut,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>He.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Qn,["enter"])},null,40,Tu),[[e.vModelText,He.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:zn},e.toDisplayString(e.unref(D)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Qn},e.toDisplayString(e.unref(D)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ro,{showModal:it.value,width:"500px",height:"80vh",onCloseModal:bn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(at.value?e.unref(D)("textEditor.image.editImage"):e.unref(D)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Lu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":he.value==="upload"}]),onClick:n[17]||(n[17]=a=>he.value="upload")},e.toDisplayString(e.unref(D)("textEditor.image.upload")),3),n[77]||(n[77]=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":he.value==="url"}]),onClick:n[18]||(n[18]=a=>he.value="url")},e.toDisplayString(e.unref(D)("textEditor.image.imageLink")),3)]),he.value==="upload"?(e.openBlock(),e.createElementBlock("div",Hu,[e.createElementVNode("div",Du,[e.createElementVNode("div",Au,[Le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Ru,e.toDisplayString(e.unref(D)("textEditor.image.uploadImage")),1)),Le.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:qt},[e.createElementVNode("img",{src:Tt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Fu),n[78]||(n[78]=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:$t,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ko},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:$t,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ko},null,544))]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:kt,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Et.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,Pu),[[e.vModelText,Et.value]])]),e.createElementVNode("div",Ou,[e.createElementVNode("label",Zu,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>gt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:al},null,40,Wu),[[e.vModelText,gt.value]])]),e.createElementVNode("div",qu,[e.createElementVNode("label",Uu,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:bo},null,40,Xu),[[e.vModelText,lt.value]])])])])):e.createCommentVNode("",!0),he.value==="url"?(e.openBlock(),e.createElementBlock("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(D)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Dt,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Be.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(fn,["enter"])},null,40,Qu),[[e.vModelText,Be.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(D)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Et.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,td),[[e.vModelText,Et.value]])]),e.createElementVNode("div",ld,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(D)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>gt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:al},null,40,od),[[e.vModelText,gt.value]])]),e.createElementVNode("div",ad,[e.createElementVNode("label",sd,e.toDisplayString(e.unref(D)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>lt.value=a),class:"dss-link-modal-input",placeholder:e.unref(D)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:bo},null,40,rd),[[e.vModelText,lt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:bn},e.toDisplayString(e.unref(D)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:fn},e.toDisplayString(e.unref(D)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":jl.value&&Me.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.title")),1),e.createElementVNode("div",id,[Me.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",cd,[F.title?(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(F.title),1)):(e.openBlock(),e.createElementBlock("span",dd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:S,value:F.title,onInput:$n,onFocus:En,onBlur:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Me.value}]),placeholder:rt.value,disabled:F.disabled,rows:"1"},null,42,md)])],2),jl.value&&Me.value?(e.openBlock(),e.createElementBlock("div",pd,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":xn.value&&be.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.labels.description")),1),e.createElementVNode("div",fd,[be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vd,[F.description?(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(F.description),1)):(e.openBlock(),e.createElementBlock("span",hd,e.toDisplayString(nt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:O,value:F.description,onInput:Wl,onFocus:Kt,onBlur:Rn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!be.value}]),placeholder:nt.value,disabled:F.disabled,rows:"1"},null,42,yd)])],2),xn.value&&be.value?(e.openBlock(),e.createElementBlock("div",Cd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":vl.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>wo(a),onMouseleave:Ho},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>to(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,wd)):(e.openBlock(),e.createElementBlock("span",xd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,bd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>to(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Vd)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ed)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>to(a),["stop"])},[e.createElementVNode("span",Bd,"+"+e.toDisplayString(a.additionalCount),1)],12,Sd)):e.createCommentVNode("",!0)],46,kd))),128)),F.richText?(e.openBlock(),e.createElementBlock("div",Dd,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":F.disabled,"dss-text-editor-fixed-height":F.fixedHeight}]),style:e.normalizeStyle(Vl.value),onInput:pt,onBlur:Ut,onClick:Xt,onMouseup:fo,onKeyup:fo,onKeydown:xl,onPaste:P,onMousemove:_o,onMouseleave:$o},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[vl.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Nn.value)},[wl.value||Bl.value.length>0?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("div",Rd,[wl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:wl.value},null,8,Fd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Id,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",zd,[e.createElementVNode("div",Pd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Od)):(e.openBlock(),e.createElementBlock("span",Zd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Wd,[e.createElementVNode("div",qd,[e.createElementVNode("div",Ud,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Xd,e.toDisplayString(Zl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":pl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),C.commentUser&&a.user&&a.user.id===C.commentUser.id&&!pl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>po(a,r),["stop"]),title:e.unref(D)("textEditor.comment.delete")||"Delete comment"},[...n[80]||(n[80]=[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,Yd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",jd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:ql,"onUpdate:modelValue":n[26]||(n[26]=a=>_l.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(D)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(mo,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(ql.value){const a=ql.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Kd),[[e.vModelText,_l.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(mo,["stop"])},[...n[81]||(n[81]=[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",Gd,[e.createElementVNode("div",Qd,[e.createElementVNode("span",Jd,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",e1,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("textarea",{value:F.modelValue,onInput:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":F.fixedHeight}]),placeholder:Qe.value,rows:F.rows,disabled:F.disabled,style:e.normalizeStyle(Al.value)},null,46,_d),e.createElementVNode("div",$d,[e.createElementVNode("div",Td,[e.createElementVNode("span",Ld,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref(D)("textEditor.footer.word"):e.unref(D)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Hd,e.toDisplayString(re.value)+" "+e.toDisplayString(re.value===1?e.unref(D)("textEditor.footer.character"):e.unref(D)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[se.value&&te.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(le.value),onMouseenter:n[28]||(n[28]=a=>R.value=!0),onMouseleave:on},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(yo,["stop"]),title:te.value},e.toDisplayString(te.value),9,t1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(D)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",n1,[...n[83]||(n[83]=[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,l1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Nt.value&&Ht.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(gl.value),onMouseenter:n[29]||(n[29]=a=>G.value=!0),onMouseleave:Sn},[e.createElementVNode("div",o1,[Ht.value===e.unref(D)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",a1,[...n[84]||(n[84]=[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:Ht.value},e.toDisplayString(Ht.value),9,s1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(To,["stop"]),title:e.unref(D)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",i1,[...n[85]||(n[85]=[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,r1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[F.floatingToolbar&&F.richText&&Ze.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ue,class:"dss-floating-toolbar",style:e.normalizeStyle(xt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",c1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Re,["stop"]),title:e.unref(D)("textEditor.toolbar.undo")},[...n[86]||(n[86]=[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,u1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:e.withModifiers(Gl,["stop"]),title:e.unref(D)("textEditor.toolbar.redo")},[...n[87]||(n[87]=[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,d1),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",m1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>Ln("paragraph"),["stop"])),title:e.unref(D)("textEditor.toolbar.paragraphFormat")},[Ge.value==="h1"?(e.openBlock(),e.createElementBlock("svg",f1,[...n[88]||(n[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h2"?(e.openBlock(),e.createElementBlock("svg",v1,[...n[89]||(n[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h3"?(e.openBlock(),e.createElementBlock("svg",g1,[...n[90]||(n[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h4"?(e.openBlock(),e.createElementBlock("svg",h1,[...n[91]||(n[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h5"?(e.openBlock(),e.createElementBlock("svg",y1,[...n[92]||(n[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Ge.value==="h6"?(e.openBlock(),e.createElementBlock("svg",C1,[...n[93]||(n[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",k1,[...n[94]||(n[94]=[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[95]||(n[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,p1),Lt.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]=a=>mn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>mn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>mn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>mn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>mn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>mn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>mn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(D)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[108]||(n[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>y("bold"),["stop"])),title:e.unref(D)("textEditor.toolbar.bold")},[...n[96]||(n[96]=[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,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>y("italic"),["stop"])),title:e.unref(D)("textEditor.toolbar.italic")},[...n[97]||(n[97]=[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,w1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>y("underline"),["stop"])),title:e.unref(D)("textEditor.toolbar.underline")},[...n[98]||(n[98]=[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,x1),n[109]||(n[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ft.value}]),onClick:e.withModifiers(kl,["stop"]),title:e.unref(D)("textEditor.toolbar.citation")},[...n[99]||(n[99]=[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,E1),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Fn,["stop"]),title:e.unref(D)("textEditor.toolbar.removeLink")},[...n[101]||(n[101]=[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,N1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(un,["stop"]),title:e.unref(D)("textEditor.toolbar.insertLink")},[...n[100]||(n[100]=[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,V1)),n[111]||(n[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("insertUnorderedList")}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(D)("textEditor.toolbar.bulletList")},[...n[102]||(n[102]=[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,S1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":E("insertOrderedList")}]),onClick:e.withModifiers(Un,["stop"]),title:e.unref(D)("textEditor.toolbar.numberList")},[...n[103]||(n[103]=[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,B1),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(It,["stop"]),title:e.unref(D)("textEditor.toolbar.image")},[...n[104]||(n[104]=[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,M1),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(D)("textEditor.toolbar.comment"),onClick:e.withModifiers(uo,["stop"])},[...n[105]||(n[105]=[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,_1),F.askAi?(e.openBlock(),e.createElementBlock("div",$1)):e.createCommentVNode("",!0),F.askAi?(e.openBlock(),e.createElementBlock("div",T1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>Ln("askAi"),["stop"])),title:e.unref(D)("textEditor.toolbar.askAi")},[n[106]||(n[106]=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:"#FFAF54"}),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:"#FFC963"})],-1)),e.createElementVNode("span",H1,e.toDisplayString(e.unref(D)("textEditor.toolbar.askAi")),1)],8,L1),Lt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[43]||(n[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Rl.value?(e.openBlock(),e.createElementBlock("div",D1,[F.askAi&&Rl.value?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[ot(a)&&Nl(a)?(e.openBlock(),e.createElementBlock("div",R1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),ot(a)&&Nl(a)&&r<F.customToolbarSlots.length-1&&jt(r)?(e.openBlock(),e.createElementBlock("div",F1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),P1={class:"dss-color-picker__section-title"},O1={class:"dss-color-picker__presets-row"},Z1=["title","onClick"],W1={key:1,class:"dss-color-picker__section"},q1={class:"dss-color-picker__presets-row"},U1=["title","onClick"],X1={class:"dss-color-picker__section"},Y1={class:"dss-color-picker__section-header"},j1={class:"dss-color-picker__presets-row"},K1=["title","onClick"],G1=["onClick"],Q1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},J1=["title","onClick"],em={class:"dss-color-picker__input-row"},tm=["value"],lm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(F,{emit:we}){function A(Y){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(Y);if(!Z)return{h:0,s:0,l:50};const X=parseInt(Z[1],16)/255,ae=parseInt(Z[2],16)/255,x=parseInt(Z[3],16)/255,b=Math.max(X,ae,x),S=Math.min(X,ae,x);let O=0,K=0;const Te=(b+S)/2;if(b!==S){const ze=b-S;switch(K=Te>.5?ze/(2-b-S):ze/(b+S),b){case X:O=((ae-x)/ze+(ae<x?6:0))/6;break;case ae:O=((x-X)/ze+2)/6;break;case x:O=((X-ae)/ze+4)/6;break}}return{h:O*360,s:K*100,l:Te*100}}function D(Y,Z,X){Z/=100,X/=100;const ae=Z*Math.min(X,1-X),x=b=>{const S=(b+Y/30)%12,O=X-ae*Math.max(Math.min(S-3,9-S,1),-1);return Math.round(255*O).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function xe(Y){const Z=Y.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let X=Z[1];return X.length===3&&(X=X.split("").map(ae=>ae+ae).join("")),"#"+X}function C(Y,Z,X){Z/=100,X/=100;const ae=X+Z*Math.min(X,1-X),x=ae===0?0:2-2*X/ae;return{h:Y,s:x*100,v:ae*100}}function Ve(Y,Z,X){Z/=100,X/=100;const ae=X*(1-Z/2),x=ae===0||ae===1?0:(X-ae)/Math.min(ae,1-ae);return{h:Y,s:x*100,l:ae*100}}const ne=F,et=we,f=e.ref(!1),ce=e.ref(!1),ve=e.ref(!1),fe=e.ref(-1),se=e.ref(-1),te=e.ref(null),le=e.ref(null),R=e.ref(null),Ee=e.ref(null),He=e.ref({top:0,left:0}),qe=e.ref(A(ne.modelValue||"#b8a5de")),ut=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),$=e.computed(()=>ut.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:se.value<0?null:se.value),me=e.computed(()=>{const Y=$.value;return Y==null?!0:Math.max(0,ne.presetColors.length-Y)<ne.max}),tt=e.computed(()=>!!(ce.value||fe.value>=0||!$e.value&&ne.presetColors.length===0));e.computed(()=>{const Y=$.value;return Y!=null&&ne.presetColors.length>Y});const $e=e.computed(()=>ut.value||$.value!=null),ft=e.computed(()=>{const Y=$.value;return Y==null?[]:ne.presetColors.slice(0,Y)}),ge=e.computed(()=>{const Y=$.value;return Y==null?[]:ne.presetColors.slice(Y)});function Ze(Y){const Z=$.value;return Z!=null?Z+Y:-1}function xt(Y){const Z=$.value;return Z!=null&&Y>=Z}function Ue(Y){xt(Y)&&(fe.value=Y,qe.value=A(ne.presetColors[Y]),ce.value=!0,e.nextTick(()=>Ee.value?.focus()))}function Lt(Y){if(!xt(Y))return;const Z=ne.presetColors.filter((x,b)=>b!==Y);et("update:presetColors",Z);const X=xe(ne.modelValue),ae=xe(ne.presetColors[Y]);if(X&&ae&&X.toLowerCase()===ae.toLowerCase()){const x=Z[Math.max(0,Y-1)]||Z[0];x&&et("update:modelValue",x)}}function it(){ve.value=!ve.value,ve.value||(fe.value=-1,ce.value=!1)}function Et(){if(fe.value<0)return;const Y=lt.value,Z=xe(Y);if(Z){const X=[...ne.presetColors];X[fe.value]=Z,et("update:presetColors",X),et("update:modelValue",Z),fe.value=-1,ce.value=!1}}function rl(){ne.disabled||(fe.value=-1,ce.value=!ce.value,ce.value&&(Ht(),e.nextTick(()=>Ee.value?.focus())))}function Tt(Y){const Z=xe(Y),X=xe(ne.modelValue);return Z&&X&&Z.toLowerCase()===X.toLowerCase()}function gt(){if(ne.disabled||!me.value)return;const Y=lt.value,Z=xe(Y);if(Z){const X=[...ne.presetColors,Z];et("update:presetColors",X),et("update:modelValue",Z);const ae=$.value??se.value;ae>=0&&X.length-ae>=ne.max&&(ce.value=!1)}}const lt=e.computed(()=>{const{h:Y,s:Z,l:X}=qe.value;return D(Y,Z,X)}),kt=e.computed(()=>lt.value.toLowerCase()),$t=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),Dt=e.computed(()=>{const Y=C(qe.value.h,qe.value.s,qe.value.l);return{left:`${Y.s}%`,bottom:`${Y.v}%`,transform:"translate(-50%, 50%)"}}),at=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),_t=e.computed(()=>({position:"fixed",left:`${He.value.left}px`,top:`${He.value.top}px`,zIndex:1002}));function Nt(){if(!te.value||!f.value)return;const Y=te.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let X=Y.bottom+4;const ae=le.value;ae&&X+ae.offsetHeight>Z-8&&(X=Y.top-4-ae.offsetHeight),He.value={top:X,left:Y.left}}function Ht(){const Y=ne.modelValue||"#b8a5de";xe(Y)&&(qe.value=A(Y))}function gl(){et("update:modelValue",lt.value)}function G(){ne.disabled||(f.value=!f.value,f.value&&(Ht(),e.nextTick(()=>{Nt(),Ee.value?.focus()})))}function he(){const Y=lt.value,Z=xe(Y);if(Z){if(fe.value>=0){const X=[...ne.presetColors];X[fe.value]=Z,et("update:presetColors",X),et("update:modelValue",Z)}else if((ne.presetColors.length>0||ut.value)&&ce.value&&me.value&&!ne.presetColors.some(ae=>xe(ae)?.toLowerCase()===Z.toLowerCase())){const ae=[...ne.presetColors,Z];et("update:presetColors",ae),et("update:modelValue",Z)}}f.value=!1,ce.value=!1,ve.value=!1,fe.value=-1}function Be(Y){if(!R.value)return;const Z=R.value.getBoundingClientRect(),X=ae=>{const x=Math.max(0,Math.min(1,(ae.clientX-Z.left)/Z.width)),b=Math.max(0,Math.min(1,1-(ae.clientY-Z.top)/Z.height)),S={h:qe.value.h,s:x*100,v:b*100};qe.value=Ve(S.h,S.s,S.v)};X(Y),document.addEventListener("mousemove",X),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",X),gl()},{once:!0})}function Ne(Y){if(!Y.currentTarget)return;const X=Y.currentTarget.getBoundingClientRect(),ae=x=>{const b=Math.max(0,Math.min(1,(x.clientX-X.left)/X.width));qe.value={...qe.value,h:b*360}};ae(Y),document.addEventListener("mousemove",ae),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ae),gl()},{once:!0})}function Ke(Y){const Z=Y.target.value,X=xe(Z);X&&(qe.value=A(X),et("update:modelValue",X))}function Xe(Y){if(ne.disabled)return;const Z=xe(Y);Z&&(qe.value=A(Z),et("update:modelValue",Z))}let st=null,de=null;function Ye(){st&&(document.removeEventListener("keydown",st),st=null),de&&(window.removeEventListener("resize",de),de=null)}return e.watch(f,Y=>{if(Ye(),Y){if(!ut.value&&ne.initialPresetCount==null){const Z=ne.presetColors.length;Z>0&&(se.value<0||Z<se.value)&&(se.value=Z)}st=Z=>{Z.key==="Escape"&&he()},de=Nt,document.addEventListener("keydown",st),window.addEventListener("resize",de)}}),e.watch(()=>ne.modelValue,()=>{f.value&&Ht()},{immediate:!1}),e.watch(ge,Y=>{Y.length===0&&(ve.value=!1,fe.value=-1,ce.value=!1)}),e.onBeforeUnmount(Ye),(Y,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":F.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:te,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":f.value}]),onClick:G},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:lt.value})},[...Z[0]||(Z[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"},[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(he,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:le,class:"dss-color-picker__dropdown",style:e.normalizeStyle(_t.value)},[$e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(F.presetGroups,(X,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ae,class:"dss-color-picker__section"},[e.createElementVNode("span",P1,e.toDisplayString(X.title),1),e.createElementVNode("div",O1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.colors,(x,b)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ae+"-"+b,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(S=>Xe(x),["stop"])},null,14,Z1))),128))])]))),128)):ft.value.length?(e.openBlock(),e.createElementBlock("div",W1,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,(X,ae)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(x=>Xe(X),["stop"])},null,14,U1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",X1,[e.createElementVNode("div",Y1,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),ge.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":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers(it,["stop"])},[...Z[2]||(Z[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",j1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,(X,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ae,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&Tt(X),"dss-color-picker__preset-bubble--editing":ve.value&&fe.value===Ze(ae)}]),style:e.normalizeStyle({backgroundColor:fe.value===Ze(ae)?lt.value:X}),title:fe.value===Ze(ae)?lt.value:X,onClick:e.withModifiers(x=>ve.value?Ue(Ze(ae)):Xe(X),["stop"])},null,14,K1),ve.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(x=>Lt(Ze(ae)),["stop"])},[...Z[4]||(Z[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,G1)):e.createCommentVNode("",!0)],2))),128)),me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ce.value}]),onClick:e.withModifiers(rl,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):F.presetColors.length?(e.openBlock(),e.createElementBlock("div",Q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.presetColors,(X,ae)=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Tt(X)}]),style:e.normalizeStyle({backgroundColor:X}),title:X,onClick:e.withModifiers(x=>Xe(X),["stop"])},null,14,J1))),128)),me.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ce.value}]),onClick:e.withModifiers(rl,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),tt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:R,onMousedown:Be},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle($t.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Dt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ne},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(at.value)},null,4)],32),e.createElementVNode("div",em,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ee,type:"text",class:"dss-color-picker__hex-input",value:kt.value,onInput:Ke},null,40,tm)]),$e.value&&(F.presetColors.length||ut.value)&&me.value&&fe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:gt}," Save color ")):e.createCommentVNode("",!0),$e.value&&fe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Et}," Save color ")):e.createCommentVNode("",!0),$e.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:he}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},nm={key:0,class:"dss-loader"},om={key:0,class:"dss-loader-label"},am={key:1,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:2,class:"dss-loader"},im={key:0,class:"dss-loader-label"},cm={key:3,class:"dss-loader"},um={key:0,class:"dss-loader-label"},dm={key:4,class:"dss-loader"},mm={key:0,class:"dss-loader-label"},pm={key:5,class:"dss-loader dss-loader--inline"},fm={class:"dss-loader-inline-text"},vm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(F){const we=F,A=e.computed(()=>we.size==="small"?"dss-loaders--size-small":we.size==="large"?"dss-loaders--size-large":we.size==="medium"||we.size==null?"dss-loaders--size-medium":null),D=e.computed(()=>we.size==="small"||we.size==="medium"||we.size==="large"||we.size==null?{}:{"--dss-loader-size":typeof we.size=="number"?`${we.size}px`:String(we.size)});return(xe,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",A.value]),style:e.normalizeStyle(D.value)},[F.type==="spinner"?(e.openBlock(),e.createElementBlock("div",nm,[C[0]||(C[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",om,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="dots"?(e.openBlock(),e.createElementBlock("div",am,[C[1]||(C[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)),F.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="battery"?(e.openBlock(),e.createElementBlock("div",rm,[C[2]||(C[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),F.label?(e.openBlock(),e.createElementBlock("span",im,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",cm,[C[3]||(C[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)),F.label?(e.openBlock(),e.createElementBlock("span",um,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="bars"?(e.openBlock(),e.createElementBlock("div",dm,[C[4]||(C[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)),F.label?(e.openBlock(),e.createElementBlock("span",mm,e.toDisplayString(F.label),1)):e.createCommentVNode("",!0)])):F.type==="inline"?(e.openBlock(),e.createElementBlock("div",pm,[C[5]||(C[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",fm,[e.renderSlot(xe.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(F.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",gm={__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:F=>["single","multiple"].includes(F)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(F){const we=F,A=e.computed(()=>{const C={"dss-skeleton--loading":we.loading,"dss-skeleton--static":!we.shimmer,"dss-skeleton--multiple":we.mode==="multiple","dss-skeleton--dark":we.darkMode};return we.mode==="multiple"&&we.targetClass!==Xo&&(C[`dss-skeleton--target-${we.targetClass}`]=!0),C}),D=e.computed(()=>{const C={};return we.borderRadius&&(C.borderRadius=we.borderRadius),C}),xe=e.computed(()=>{const C={};return we.borderRadius&&(C["--dss-skeleton-border-radius"]=we.borderRadius),we.darkMode?(C["--dss-skeleton-bg"]=we.bgDark||"#322c3f",C["--dss-skeleton-shimmer"]=we.shimmerDark||"#3e3f41",C):(we.bgColor&&(C["--dss-skeleton-bg"]=we.bgColor),we.shimmerColor&&(C["--dss-skeleton-shimmer"]=we.shimmerColor),C)});return(C,Ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",A.value]),style:e.normalizeStyle(xe.value)},[F.loading&&F.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(D.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":F.loading&&F.mode==="single"}])},[e.renderSlot(C.$slots,"default")],2)],6))}},hm={key:0,class:"dss-dnd-column-header"},ym={class:"dss-dnd-column-title"},Cm={class:"dss-dnd-column-count"},km=["data-column"],bm={key:0,class:"dss-dnd-indicator"},wm=["onPointerdown"],xm=["onPointerdown"],Em={class:"dss-dnd-item-content"},Vm={class:"dss-dnd-item-default"},Nm={key:0,class:"dss-dnd-empty"},Sm={name:"DSSDnd"},Bm=Object.assign(Sm,{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(F,{emit:we}){const A=F,D=we,xe=e.useSlots(),C=e.computed(()=>!!xe["delete-zone"]),Ve={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},ne=e.computed(()=>({...Ve,...A.options})),et=e.computed(()=>({"--dss-dnd-col-min-w":ne.value.columnMinWidth,"--dss-dnd-col-max-w":ne.value.columnMaxWidth,"--dss-dnd-col-gap":ne.value.columnGap,"--dss-dnd-indicator-color":ne.value.indicatorColor,"--dss-dnd-body-max-h":ne.value.columnBodyMaxHeight}));function f(G){if(!ne.value.ColColor||!G)return{};const he=G.background||G.color;return he?{background:he}:{}}const ce=e.ref(null),ve=e.ref(null),fe=e.ref(!1),se=e.ref(-1),te=e.ref(null);let le=null,R=null,Ee=null,He=null,qe=0,ut=0,$="",me=null;const tt=5,$e=e.computed(()=>{const G={};for(const he of A.columns)G[he.value]=A.items.filter(Be=>Be[A.columnKey]===he.value).sort((Be,Ne)=>(Be[A.positionKey]??0)-(Ne[A.positionKey]??0));return G}),ft=e.computed(()=>{const G={},he=!!ce.value,Be=ce.value?.[A.itemKey],Ne=ve.value,Ke=se.value;for(const Xe of A.columns){const st=$e.value[Xe.value]||[],de=[],Ye=Ne==Xe.value;let Y=0;for(let Z=0;Z<st.length;Z++){const X=st[Z],ae=he&&X[A.itemKey]===Be;!ae&&Ye&&Ke===Y&&de.push({type:"indicator",key:`ind-${Y}`}),ae||Y++,de.push({type:"item",item:X,isDragged:ae,key:`item-${X[A.itemKey]}`})}Ye&&Ke>=Y&&de.push({type:"indicator",key:"ind-end"}),G[Xe.value]=de}return G});function ge(G,he){const Ne=($e.value[G]||[]).filter(st=>st[A.itemKey]!==ce.value?.[A.itemKey]);if(Ne.length===0)return 1;if(he<=0){const st=Ne[0][A.positionKey];return st!=null&&st>0?st/2:.5}if(he>=Ne.length){const st=Ne[Ne.length-1][A.positionKey];return(st??0)+1}const Ke=Ne[he-1][A.positionKey]??0,Xe=Ne[he][A.positionKey]??0;return(Ke+Xe)/2}function Ze(G,he,Be){Ee&&Ee.remove();const Ne=G.getBoundingClientRect(),Ke=G.cloneNode(!0);Ke.classList.add("dss-dnd-ghost"),Ke.style.cssText=`
104
104
  position: fixed;
105
- left: ${pe-qe}px;
106
- top: ${ge-mt}px;
107
- width: ${_e.width}px;
108
- height: ${_e.height}px;
105
+ left: ${he-qe}px;
106
+ top: ${Be-ut}px;
107
+ width: ${Ne.width}px;
108
+ height: ${Ne.height}px;
109
109
  z-index: 9999;
110
110
  pointer-events: none;
111
- opacity: ${ce.value.dragGhostOpacity};
111
+ opacity: ${ne.value.dragGhostOpacity};
112
112
  box-sizing: border-box;
113
113
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
114
- background-color: ${ce.value.dragSourceBackground};
114
+ background-color: ${ne.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(it),xe=it}function wt(Q,pe){xe&&(xe.style.left=`${Q-qe}px`,xe.style.top=`${pe-mt}px`)}function Ze(Q){Q.classList.add("dss-dnd-item--dragging"),Q.style.background=ce.value.dragSourceBackground,Q.style.borderColor=ce.value.dragSourceBorder,Q.style.transform="scale(0.97)"}function $t(Q){Q.classList.remove("dss-dnd-item--dragging"),Q.style.background="",Q.style.borderColor="",Q.style.transform=""}function st(Q,pe){return document.elementFromPoint(Q,pe)?.closest(".dss-dnd-column-body")??null}function kt(Q,pe){return!!document.elementFromPoint(Q,pe)?.closest("[data-dss-dnd-delete-zone]")}function un(Q,pe){if(b.value&&kt(Q,pe)){Ce.value=!0,ke.value=null,se.value=-1;return}Ce.value=!1;const ge=st(Q,pe),_e=ge?.getAttribute("data-column")??null;if(!_e){ke.value=null,se.value=-1;return}ke.value=_e;const it=ge.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let ze=it.length;for(let Qe=0;Qe<it.length;Qe++){const me=it[Qe].getBoundingClientRect();if(pe<me.top+me.height/2){ze=Qe;break}}se.value=ze}function Tt(Q){Q.preventDefault(),wt(Q.clientX,Q.clientY),!ae&&(ae=requestAnimationFrame(()=>{ae=null,un(Q.clientX,Q.clientY)}))}function Ge(Q){window.removeEventListener("pointermove",Tt),window.removeEventListener("pointerup",Ge),window.removeEventListener("pointercancel",Ge),De?.releasePointerCapture?.(Q.pointerId),$t(De),De=null;const pe=b.value&&kt(Q.clientX,Q.clientY);if(de.value&&pe)D("delete",{item:de.value});else{const _e=st(Q.clientX,Q.clientY)?.getAttribute("data-column")??null;if(de.value&&_e){const it=de.value[I.columnKey],ze=_e,me=(Xe.value[ze]||[]).filter(K=>K[I.itemKey]!==de.value[I.itemKey]),Je=Math.max(0,Math.min(se.value,me.length)),q=He(ze,Je),Z=de.value[I.itemKey];D("move",{item:de.value,from:it,to:ze,position:q,index:Je}),A&&clearTimeout(A),te.value={id:Z,from:it,to:ze},A=setTimeout(()=>{te.value=null},3500)}}xe&&(xe.remove(),xe=null),O!==null&&(document.body.style.cursor=O,O=""),jt()}function Ke(Q,pe){Q.preventDefault();const ge=Q.target.closest(".dss-dnd-item");if(!ge)return;const _e=ge.getBoundingClientRect();qe=Q.clientX-_e.left,mt=Q.clientY-_e.top,O=document.body.style.cursor,document.body.style.cursor="grabbing",de.value=pe,De=ge,Ue(ge,Q.clientX,Q.clientY),requestAnimationFrame(()=>Ze(ge)),ge.setPointerCapture?.(Q.pointerId),window.addEventListener("pointermove",Tt),window.addEventListener("pointerup",Ge,{once:!0}),window.addEventListener("pointercancel",Ge,{once:!0})}function Lt(){Le&&(window.removeEventListener("pointermove",Ht),window.removeEventListener("pointerup",qt),window.removeEventListener("pointercancel",qt),Le=null)}function Ht(Q){if(!Le||Q.pointerId!==Le.pointerId)return;const pe=Q.clientX-Le.startX,ge=Q.clientY-Le.startY;if(Math.abs(pe)>=_t||Math.abs(ge)>=_t){const _e=Le.item;Lt(),Ke(Q,_e)}}function qt(Q){!Le||Q.pointerId!==Le.pointerId||Lt()}function pt(Q,pe){Lt(),Le={item:pe,startX:Q.clientX,startY:Q.clientY,pointerId:Q.pointerId},window.addEventListener("pointermove",Ht),window.addEventListener("pointerup",qt),window.addEventListener("pointercancel",qt)}function St(Q,pe){ce.value.useHandle||pt(Q,pe)}function xt(Q,pe){pt(Q,pe)}function Bt(){ae&&(cancelAnimationFrame(ae),ae=null)}function jt(){Bt(),de.value=null,ke.value=null,Ce.value=!1,se.value=-1}return e.onBeforeUnmount(()=>{Bt(),Lt(),A&&clearTimeout(A),xe&&(xe.remove(),xe=null)}),(Q,pe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ce.value.unstyled}]),style:e.normalizeStyle(gt.value)},[b.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(Q.$slots,"delete-zone",{isDragging:!!de.value,isOver:Ce.value})],2),[[e.vShow,!!de.value||ce.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,ge=>(e.openBlock(),e.createElementBlock("div",{key:ge.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ke.value==ge.value},ge.class||""]]),style:e.normalizeStyle(v(ge))},[ce.value.showHeader?(e.openBlock(),e.createElementBlock("div",gm,[e.renderSlot(Q.$slots,"column-header",{column:ge,items:Xe.value[ge.value]||[]},()=>[e.createElementVNode("span",hm,e.toDisplayString(ge.title||ge.value),1),e.createElementVNode("span",ym,e.toDisplayString((Xe.value[ge.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":ge.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value[ge.value],_e=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_e.key},[_e.type==="indicator"?(e.openBlock(),e.createElementBlock("div",km)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":_e.isDragged,"dss-dnd-item--no-handle":!ce.value.useHandle}]),onPointerdown:it=>St(it,_e.item)},[ce.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(it=>xt(it,_e.item),["stop"])},[e.renderSlot(Q.$slots,"handle",{},()=>[pe[0]||(pe[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,wm)):e.createCommentVNode("",!0),e.createElementVNode("div",xm,[e.renderSlot(Q.$slots,"item",{item:_e.item,column:ge,justDropped:te.value?.id===_e.item[R.itemKey],droppedFrom:te.value?.id===_e.item[R.itemKey]?te.value.from:null,droppedTo:te.value?.id===_e.item[R.itemKey]?te.value.to:null},()=>[e.createElementVNode("div",Em,e.toDisplayString(_e.item[R.itemKey]),1)])])],42,bm))],64))),128)),(Xe.value[ge.value]||[]).length===0&&ke.value!=ge.value?(e.openBlock(),e.createElementBlock("div",Vm,[e.renderSlot(Q.$slots,"empty",{column:ge},()=>[pe[1]||(pe[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Cm)],6))),128))],6))}}),Bm={name:"DSSConfetti"},Mm=Object.assign(Bm,{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(R){const be=R,I=e.ref(null),D=e.ref(!1);let Ve=[],b=null,Ne=null;function ce(se,te){const ae=[];for(let A=0;A<be.count;A++)ae.push(gt(se));return ae}function gt(se,te){return{x:Math.random()*se,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:be.colors[Math.floor(Math.random()*be.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 v(se,te,ae,A){se.clearRect(0,0,te,ae);for(const xe of Ve)se.save(),se.globalAlpha=xe.opacity*A,se.beginPath(),se.lineWidth=xe.r,se.strokeStyle=xe.color,se.moveTo(xe.x+xe.tilt+xe.r/2,xe.y),se.lineTo(xe.x+xe.tilt,xe.y+xe.tilt+xe.r/2),se.stroke(),se.restore()}function de(se,te,ae){const A=.3+ae*.7;for(let xe=0;xe<Ve.length;xe++){const De=Ve[xe];De.tiltAngle+=De.tiltInc,De.y+=De.speed*A,De.x+=Math.sin(De.d)*.5*A,De.tilt=Math.sin(De.tiltAngle)*15,ae>=.99&&De.y>te+20&&(Ve[xe]=gt(se))}}function ke(){D.value=!0,e.nextTick(()=>{const se=I.value;if(!se)return;const te=se.getContext("2d"),ae=se.parentElement;if(!ae)return;const A=ae.getBoundingClientRect();se.width=A.width,se.height=A.height,Ve=ce(se.width,se.height);const xe=Date.now(),De=xe+be.duration,qe=()=>{const mt=Date.now(),O=mt-xe;if(mt<De){let Le=1;O>be.fadeStart&&(Le=1-(O-be.fadeStart)/(be.duration-be.fadeStart)),v(te,se.width,se.height,Le),de(se.width,se.height,Le),b=requestAnimationFrame(qe)}else Ce()};qe()})}function Ce(){b&&(cancelAnimationFrame(b),b=null),Ve=[],D.value=!1}return e.watch(()=>be.trigger,se=>{se&&(Ne&&clearTimeout(Ne),Ne=setTimeout(ke,be.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{Ce(),Ne&&clearTimeout(Ne)}),(se,te)=>D.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:I,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),_m={class:"dss-filter-global-inner"},$m=["value"],Tm=["title"],Lm={key:0,class:"dss-filter-funnel-badge"},Hm={class:"dss-filter-panel"},Am={key:0,class:"dss-filter-empty"},Dm={class:"dss-filter-row-prefix"},Rm={class:"dss-filter-cell"},Fm=["onClick"],Im={class:"dss-filter-trigger-text"},zm={class:"dss-filter-popup-list"},Pm=["onClick"],Om={key:0,class:"dss-filter-popup-empty"},Zm={key:0,class:"dss-filter-cell"},Wm=["onClick"],qm={class:"dss-filter-trigger-text"},Um={class:"dss-filter-popup-list"},Xm=["onClick"],Ym={key:1,class:"dss-filter-cell dss-filter-cell--value"},jm=["onUpdate:modelValue"],Km={key:1,class:"dss-filter-date-wrap"},Gm=["onUpdate:modelValue"],Qm=["value","onInput","step"],Jm={key:4,class:"dss-filter-between"},e2=["value","onInput","step"],t2=["value","onInput","step"],n2={key:5,class:"dss-filter-multiselect"},l2=["onClick"],o2={class:"dss-filter-trigger-text"},a2={class:"dss-filter-popup-list dss-filter-popup-list--check"},s2=["onClick"],r2=["checked"],i2={key:0,class:"dss-filter-popup-empty"},c2=["onClick"],u2={class:"dss-filter-foot"},d2={class:"dss-filter-cell"},m2={class:"dss-filter-popup-list"},p2=["onClick"],v2={key:0,class:"dss-filter-popup-divider"},f2=["onClick"],g2={class:"dss-filter-popup-list"},h2=["onClick"],y2={key:0,class:"dss-filter-popup-empty"},C2={class:"dss-filter-popup-list"},k2=["onClick"],b2={key:0,class:"dss-filter-popup-empty"},w2={name:"DSSFilter"},x2=Object.assign(w2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(R,{expose:be,emit:I}){const D=R,Ve=I,b={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Ne=e.computed(()=>({...b,...D.options})),ce={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},gt=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],de=e.ref(""),ke=e.ref([]),Ce=e.ref(null),se=e.ref(!1),te=e.ref(null),ae=e.ref(""),A=e.ref(null);let xe=1;function De(x){const k=x.find(V=>V&&typeof V=="object");if(!k)return null;for(const V of v)if(V in k&&typeof k[V]=="string")return V;return Object.keys(k).find(V=>typeof k[V]=="string")||null}function qe(x,k){const V=k.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(Re=>Re).filter(Re=>Re!=null);return P.length===0?null:typeof P.find(Re=>Re!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Ne.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Ne.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const mt=e.computed(()=>{if(!D.data?.length)return[];const x=new Set;for(const U of D.data)if(U&&typeof U=="object")for(const Re of Object.keys(U))x.add(Re);const k=new Set(D.exclude),V=[];for(const U of x){if(k.has(U))continue;const Re=D.config[U]||{},Ye=D.data.map(Ct=>Ct?.[U]),Se=Re.type||qe(U,Ye);if(!Se)continue;const le=Re.filterMode||"contain",nt=le==="date"?"date":le==="string"?"text":Se,tt={key:U,label:Re.label||K(U),type:nt,filterMode:le};if(Se==="select"){const Ct=Ye.filter(yt=>yt!=null&&yt!=="NULL");tt.uniqueValues=[...new Set(Ct)].sort((yt,je)=>typeof yt=="number"&&typeof je=="number"?yt-je:String(yt).localeCompare(String(je)))}else if(Se==="range"||Se==="int"){const Ct=Ye.filter(yt=>typeof yt=="number");tt.min=Math.min(...Ct),tt.max=Math.max(...Ct)}else if(Se==="arraySelect"){const Ct=Re.displayKey||De(Ye.flatMap(je=>Array.isArray(je)?je:[]));tt.displayKey=Ct;const yt=Ye.flatMap(je=>Array.isArray(je)?je:[]).filter(je=>je!=null).map(je=>Ct&&typeof je=="object"?je[Ct]:String(je)).filter(je=>je!=null&&je!=="");tt.uniqueValues=[...new Set(yt)].sort((je,fn)=>String(je).localeCompare(String(fn)))}V.push(tt)}const P=D.config._order;return P&&V.sort((U,Re)=>{const Ye=P.indexOf(U.key),Se=P.indexOf(Re.key);return Ye===-1&&Se===-1?0:Ye===-1?1:Se===-1?-1:Ye-Se}),V}),O=e.computed(()=>{const x={};for(const k of mt.value)x[k.key]=k;return x}),Le=e.computed(()=>Array.isArray(D.config.groups)&&D.config.groups.length>0),_t=e.computed(()=>{if(!Le.value)return[];const x=new Set(mt.value.map(k=>k.key));return D.config.groups.map(k=>({...k,keys:k.keys.filter(V=>x.has(V))})).filter(k=>k.keys.length>0)}),Xe=e.computed(()=>{if(!Le.value)return[];const x=new Set(D.config.groups.flatMap(k=>k.keys));return mt.value.filter(k=>!x.has(k.key))}),Rt=e.computed(()=>{if(!A.value)return[];const x=new Set(A.value.keys),k=mt.value.filter(P=>x.has(P.key));if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>P.label.toLowerCase().includes(V))}),He=e.computed(()=>{if(!ae.value)return mt.value;const x=ae.value.toLowerCase();return mt.value.filter(k=>k.label.toLowerCase().includes(x))});function Ue(x){Ce.value===x?wt():(Ce.value=x,ae.value="",A.value=null)}function wt(){Ce.value=null,ae.value="",A.value=null}function Ze(x){const k=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");Ce.value&&!k&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&&wt(),se.value&&te.value&&!te.value.contains(x.target)&&(k||(se.value=!1))}e.onMounted(()=>document.addEventListener("click",Ze)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ze));function $t(x){return O.value[x]?.label||K(x)}function st(x){return O.value[x.key]?.filterMode||"contain"}function kt(x){for(const k of Object.values(ce)){const V=k.find(P=>P.value===x);if(V)return V.label}return x}function un(x){const k=O.value[x.key];return ce[k?.type]||ce.text}function Tt(x){return gt.has(x)}function Ge(x){const k=O.value[x.key];return k?k.type==="date"?"date":k.type==="boolean"?"boolean":k.type==="text"||k.type==="arrayText"?"text":k.type==="select"||k.type==="arraySelect"?"multiselect":k.type==="range"||k.type==="int"?x.operator==="between"?"between":"number":"text":"text"}function Ke(x){return ce[x]?.[0]?.value||"contains"}function Lt(x,k){return gt.has(k)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&k==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function Ht(x){return O.value[x.key]?.uniqueValues||[]}function qt(x){const k=Ht(x);if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>String(P).toLowerCase().includes(V))}function pt(x){const k=x.value;return!k||k.length===0?"Select...":k.length<=2?k.join(", "):`${k.length} selected`}function St(x){const k=O.value[x],V=k?.filterMode||"contain",P=k?.type||"text",U=V==="string"?"contains":Ke(P);ke.value.push(e.reactive({id:xe++,key:x,operator:U,value:Lt(P,U)})),wt()}function xt(x){ke.value=ke.value.filter(k=>k.id!==x)}function Bt(x,k){const P=O.value[k]?.type||"text";x.key=k,x.operator=Ke(P),x.value=Lt(P,x.operator),wt()}function jt(x,k){const V=Ge(x);x.operator=k;const P=Ge(x);if(V!==P||gt.has(k)){const U=O.value[x.key];x.value=Lt(U?.type||"text",k)}wt()}function Q(x,k){const V=k.target.value;x.value=V===""?null:Number(V)}function pe(x,k,V){const P=V.target.value,U=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[k]:isNaN(U)?null:U}}function ge(x,k){const V=x.value||[],P=V.indexOf(k);x.value=P>=0?V.filter(U=>U!==k):[...V,k]}function _e(){ke.value=[],de.value="",wt()}function it(x){de.value=x.target.value}const ze=e.computed(()=>{if(!D.data)return[];let x=D.data;if(de.value){const k=de.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const U=V[P];if(typeof U=="string"&&U.toLowerCase().includes(k)||typeof U=="number"&&String(U).includes(k)||Array.isArray(U)&&U.some(Re=>Re!=null&&(typeof Re=="string"?Re.toLowerCase().includes(k):typeof Re=="object"?Object.values(Re).some(Ye=>typeof Ye=="string"&&Ye.toLowerCase().includes(k)):!1)))return!0}return!1})}for(const k of ke.value){if(!Qe(k))continue;const V=O.value[k.key];V&&(x=x.filter(P=>me(P,k,V)))}return x});function Qe(x){return gt.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function me(x,k,V){const P=x?.[k.key],U=k.value,Re=k.operator;if(Re==="is_empty")return Z(P);if(Re==="is_not_empty")return!Z(P);const Ye=V.type;if(Ye==="text"||Ye==="arrayText"){const Se=Ye==="arrayText"&&Array.isArray(P)?P.filter(tt=>tt!=null).map(String).join(" "):P!=null?String(P):"",le=String(U).toLowerCase(),nt=Se.toLowerCase();switch(Re){case"contains":return nt.includes(le);case"not_contains":return!nt.includes(le);case"equals":return nt===le;case"not_equals":return nt!==le;case"starts_with":return nt.startsWith(le);case"ends_with":return nt.endsWith(le);default:return!0}}if(Ye==="select")switch(Re){case"is_any_of":return U.includes(P);case"is_none_of":return!U.includes(P);default:return!0}if(Ye==="range"||Ye==="int"){const Se=typeof P=="number"?P:Number(P);if(typeof Se!="number"||isNaN(Se))return!1;if(Re==="between"){const nt=U?.min!=null?Number(U.min):null,tt=U?.max!=null?Number(U.max):null,Ct=nt!=null&&!isNaN(nt)?nt:null,yt=tt!=null&&!isNaN(tt)?tt:null;return(Ct==null||Se>=Ct)&&(yt==null||Se<=yt)}const le=typeof U=="number"&&!isNaN(U)?U:Number(U);if(Re==="contains"||Re==="not_contains"){const nt=String(Se),tt=String(U??"").toLowerCase(),Ct=nt.toLowerCase().includes(tt);return Re==="contains"?Ct:!Ct}if(typeof le!="number"||isNaN(le))return!1;switch(Re){case"eq":return Se===le;case"neq":return Se!==le;case"gt":return Se>le;case"gte":return Se>=le;case"lt":return Se<le;case"lte":return Se<=le;default:return!0}}if(Ye==="arraySelect"){if(!Array.isArray(P))return!1;const Se=P.filter(le=>le!=null).map(le=>V.displayKey&&typeof le=="object"?le[V.displayKey]:String(le));switch(Re){case"contains_any":return Se.some(le=>U.includes(le));case"contains_all":return U.every(le=>Se.includes(le));case"not_contains_any":return!Se.some(le=>U.includes(le));default:return!0}}if(Ye==="date"){const Se=Je(U);if(!Se||isNaN(Se.getTime()))return!1;const le=Je(P);if(!le||isNaN(le.getTime()))return!1;const nt=q(le),tt=q(Se);switch(Re){case"eq":return nt===tt;case"before":return nt<tt;case"after":return nt>tt;default:return!0}}if(Ye==="boolean"){const Se=P===!0||P==="true"||P===1,le=P===!1||P==="false"||P===0;switch(Re){case"is_true":return Se;case"is_false":return le;default:return!0}}return!0}function Je(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const k=new Date(x);return isNaN(k.getTime())?null:k}return null}function q(x){const k=x.getFullYear(),V=String(x.getMonth()+1).padStart(2,"0"),P=String(x.getDate()).padStart(2,"0");return`${k}-${V}-${P}`}function Z(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(k=>k==null))}e.watch(ze,x=>Ve("update:modelValue",x),{immediate:!0}),e.watch(()=>D.data,()=>{ke.value=[],de.value="",se.value=!1,wt()});function K(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,k=>k.toUpperCase())}function ne(){const x=k=>{if(k==null)return k;if(k instanceof Date)return{_type:"Date",value:k.toISOString(),local:k.toLocaleDateString()};if(Array.isArray(k))return k.map(x);if(typeof k=="object"&&!Array.isArray(k)){const V={};for(const P of Object.keys(k))V[P]=x(k[P]);return V}return k};return{globalSearch:de.value,rows:ke.value.map(k=>({key:k.key,operator:k.operator,value:x(k.value),defType:O.value[k.key]?.type,defFilterMode:O.value[k.key]?.filterMode})),filteredCount:ze.value?.length??0}}return be({getDebugState:ne}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Ne.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:te},[e.createElementVNode("div",_m,[k[15]||(k[15]=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:"Search across all fields...",value:de.value,onInput:it},null,40,$m),de.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:k[0]||(k[0]=V=>de.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:se.value||ke.value.length>0}]),onClick:k[1]||(k[1]=V=>se.value=!se.value),type:"button",title:se.value?"Close advanced filter":"Open advanced filter"},[k[14]||(k[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",Lm,e.toDisplayString(ke.value.length),1)):e.createCommentVNode("",!0)],10,Tm)]),se.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:k[13]||(k[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Hm,[ke.value.length===0?(e.openBlock(),e.createElementBlock("div",Am," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ke.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Dm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Rm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>Ue(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Im,e.toDisplayString($t(V.key)),1),k[16]||(k[16]=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,Fm),Ce.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[2]||(k[2]=U=>ae.value=U),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,U=>(e.openBlock(),e.createElementBlock("li",{key:U.key,class:"dss-filter-popup-item",onClick:Re=>Bt(V,U.key)},e.toDisplayString(U.label),9,Pm))),128)),He.value.length===0?(e.openBlock(),e.createElementBlock("li",Om,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),st(V)==="contain"||st(V)==="date"?(e.openBlock(),e.createElementBlock("div",Zm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>Ue(`${V.id}:op`),["stop"])},[e.createElementVNode("span",qm,e.toDisplayString(kt(V.operator)),1),k[17]||(k[17]=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,Wm),Ce.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[4]||(k[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===U.value}]),onClick:Re=>jt(V,U.value)},e.toDisplayString(U.label),11,Xm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Tt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[st(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,jm)),[[e.vModelText,V.value]]):st(V)==="date"?(e.openBlock(),e.createElementBlock("div",Km,[e.createVNode(Oo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":U=>V.value=U},null,8,["modelValue","onUpdate:modelValue"])])):Ge(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":U=>V.value=U},null,8,Gm)),[[e.vModelText,V.value]]):Ge(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:U=>Q(V,U),step:O.value[V.key]?.type==="int"?1:void 0},null,40,Qm)):Ge(V)==="between"?(e.openBlock(),e.createElementBlock("div",Jm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:U=>pe(V,"min",U),step:O.value[V.key]?.type==="int"?1:void 0},null,40,e2),k[18]||(k[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:U=>pe(V,"max",U),step:O.value[V.key]?.type==="int"?1:void 0},null,40,t2)])):Ge(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(U=>Ue(`${V.id}:val`),["stop"])},[e.createElementVNode("span",o2,e.toDisplayString(pt(V)),1),k[19]||(k[19]=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,l2),Ce.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[Ht(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[5]||(k[5]=U=>ae.value=U),placeholder:"Search..."},null,512)),[[e.vModelText,ae.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",a2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt(V),U=>(e.openBlock(),e.createElementBlock("li",{key:U,class:"dss-filter-popup-item",onClick:Re=>ge(V,U)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(U),tabindex:"-1"},null,8,r2),e.createElementVNode("span",null,e.toDisplayString(U),1)],8,s2))),128)),qt(V).length===0?(e.openBlock(),e.createElementBlock("li",i2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:U=>xt(V.id)},[...k[20]||(k[20]=[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,c2)]))),128)),e.createElementVNode("div",u2,[e.createElementVNode("div",d2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:k[7]||(k[7]=e.withModifiers(V=>Ue("add"),["stop"]))}," Add filter "),Ce.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:k[12]||(k[12]=e.withModifiers(()=>{},["stop"]))},[Le.value&&!A.value&&!ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[8]||(k[8]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>A.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),k[21]||(k[21]=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,p2))),128)),Xe.value.length>0?(e.openBlock(),e.createElementBlock("li",v2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>St(V.key)},e.toDisplayString(V.label),9,f2))),128))])],64)):A.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:k[9]||(k[9]=V=>A.value=null)},[k[22]||(k[22]=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(A.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[10]||(k[10]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",g2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>St(V.key)},e.toDisplayString(V.label),9,h2))),128)),Rt.value.length===0?(e.openBlock(),e.createElementBlock("li",y2,"No match")):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":k[11]||(k[11]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>St(V.key)},e.toDisplayString(V.label),9,k2))),128)),He.value.length===0?(e.openBlock(),e.createElementBlock("li",b2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ke.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:_e}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),E2={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"}},V2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},N2={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},S2={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"}},no={chart:E2,table:V2,datepicker:N2,textEditor:S2},B2={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"}},M2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},_2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},$2={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"}},lo={chart:B2,table:M2,datepicker:_2,textEditor:$2},T2={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"}},L2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},H2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},A2={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"}},oo={chart:T2,table:L2,datepicker:H2,textEditor:A2},Fo={en:no,fr:lo,nl:oo};function D2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Fo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Fo[I])})}const Io={en:{textEditor:no.textEditor},fr:{textEditor:lo.textEditor},nl:{textEditor:oo.textEditor}};function R2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Io).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Io[I])})}const zo={en:{table:no.table},fr:{table:lo.table},nl:{table:oo.table}};function F2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(zo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,zo[I])})}const Po={en:{datepicker:no.datepicker},fr:{datepicker:lo.datepicker},nl:{datepicker:oo.datepicker}};function I2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Po).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Po[I])})}const z2={en:{...no},fr:{...lo},nl:{...oo}};to.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:z2});exports.DSSChart=$i;exports.DSSChartMessages=Fo;exports.DSSColorPicker=tm;exports.DSSConfetti=Mm;exports.DSSDatepicker=Oo;exports.DSSDatepickerMessages=Po;exports.DSSDnd=Sm;exports.DSSFilter=x2;exports.DSSLoader=vm;exports.DSSModal=Ro;exports.DSSSkeleton=fm;exports.DSSTable=Yc;exports.DSSTableMessages=zo;exports.DSSTextEditor=I1;exports.DSSTextEditorMessages=Io;exports.addDSSChartTranslations=D2;exports.addDSSDatepickerTranslations=I2;exports.addDSSTableTranslations=F2;exports.addDSSTextEditorTranslations=R2;
117
+ `,document.body.appendChild(Ke),Ee=Ke}function xt(G,he){Ee&&(Ee.style.left=`${G-qe}px`,Ee.style.top=`${he-ut}px`)}function Ue(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=ne.value.dragSourceBackground,G.style.borderColor=ne.value.dragSourceBorder,G.style.transform="scale(0.97)"}function Lt(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function it(G,he){return document.elementFromPoint(G,he)?.closest(".dss-dnd-column-body")??null}function Et(G,he){return!!document.elementFromPoint(G,he)?.closest("[data-dss-dnd-delete-zone]")}function rl(G,he){if(C.value&&Et(G,he)){fe.value=!0,ve.value=null,se.value=-1;return}fe.value=!1;const Be=it(G,he),Ne=Be?.getAttribute("data-column")??null;if(!Ne){ve.value=null,se.value=-1;return}ve.value=Ne;const Ke=Be.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Xe=Ke.length;for(let st=0;st<Ke.length;st++){const de=Ke[st].getBoundingClientRect();if(he<de.top+de.height/2){Xe=st;break}}se.value=Xe}function Tt(G){G.preventDefault(),xt(G.clientX,G.clientY),!le&&(le=requestAnimationFrame(()=>{le=null,rl(G.clientX,G.clientY)}))}function gt(G){window.removeEventListener("pointermove",Tt),window.removeEventListener("pointerup",gt),window.removeEventListener("pointercancel",gt),He?.releasePointerCapture?.(G.pointerId),Lt(He),He=null;const he=C.value&&Et(G.clientX,G.clientY);if(ce.value&&he)D("delete",{item:ce.value});else{const Ne=it(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(ce.value&&Ne){const Ke=ce.value[A.columnKey],Xe=Ne,de=($e.value[Xe]||[]).filter(X=>X[A.itemKey]!==ce.value[A.itemKey]),Ye=Math.max(0,Math.min(se.value,de.length)),Y=ge(Xe,Ye),Z=ce.value[A.itemKey];D("move",{item:ce.value,from:Ke,to:Xe,position:Y,index:Ye}),R&&clearTimeout(R),te.value={id:Z,from:Ke,to:Xe},R=setTimeout(()=>{te.value=null},3500)}}Ee&&(Ee.remove(),Ee=null),$!==null&&(document.body.style.cursor=$,$=""),gl()}function lt(G,he){G.preventDefault();const Be=G.target.closest(".dss-dnd-item");if(!Be)return;const Ne=Be.getBoundingClientRect();qe=G.clientX-Ne.left,ut=G.clientY-Ne.top,$=document.body.style.cursor,document.body.style.cursor="grabbing",ce.value=he,He=Be,Ze(Be,G.clientX,G.clientY),requestAnimationFrame(()=>Ue(Be)),Be.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",Tt),window.addEventListener("pointerup",gt,{once:!0}),window.addEventListener("pointercancel",gt,{once:!0})}function kt(){me&&(window.removeEventListener("pointermove",$t),window.removeEventListener("pointerup",Dt),window.removeEventListener("pointercancel",Dt),me=null)}function $t(G){if(!me||G.pointerId!==me.pointerId)return;const he=G.clientX-me.startX,Be=G.clientY-me.startY;if(Math.abs(he)>=tt||Math.abs(Be)>=tt){const Ne=me.item;kt(),lt(G,Ne)}}function Dt(G){!me||G.pointerId!==me.pointerId||kt()}function at(G,he){kt(),me={item:he,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",$t),window.addEventListener("pointerup",Dt),window.addEventListener("pointercancel",Dt)}function _t(G,he){ne.value.useHandle||at(G,he)}function Nt(G,he){at(G,he)}function Ht(){le&&(cancelAnimationFrame(le),le=null)}function gl(){Ht(),ce.value=null,ve.value=null,fe.value=!1,se.value=-1}return e.onBeforeUnmount(()=>{Ht(),kt(),R&&clearTimeout(R),Ee&&(Ee.remove(),Ee=null)}),(G,he)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ne.value.unstyled}]),style:e.normalizeStyle(et.value)},[C.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":fe.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!ce.value,isOver:fe.value})],2),[[e.vShow,!!ce.value||ne.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.columns,Be=>(e.openBlock(),e.createElementBlock("div",{key:Be.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":ve.value==Be.value},Be.class||""]]),style:e.normalizeStyle(f(Be))},[ne.value.showHeader?(e.openBlock(),e.createElementBlock("div",hm,[e.renderSlot(G.$slots,"column-header",{column:Be,items:$e.value[Be.value]||[]},()=>[e.createElementVNode("span",ym,e.toDisplayString(Be.title||Be.value),1),e.createElementVNode("span",Cm,e.toDisplayString(($e.value[Be.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Be.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value[Be.value],Ne=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ne.key},[Ne.type==="indicator"?(e.openBlock(),e.createElementBlock("div",bm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ne.isDragged,"dss-dnd-item--no-handle":!ne.value.useHandle}]),onPointerdown:Ke=>_t(Ke,Ne.item)},[ne.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(Ke=>Nt(Ke,Ne.item),["stop"])},[e.renderSlot(G.$slots,"handle",{},()=>[he[0]||(he[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,xm)):e.createCommentVNode("",!0),e.createElementVNode("div",Em,[e.renderSlot(G.$slots,"item",{item:Ne.item,column:Be,justDropped:te.value?.id===Ne.item[F.itemKey],droppedFrom:te.value?.id===Ne.item[F.itemKey]?te.value.from:null,droppedTo:te.value?.id===Ne.item[F.itemKey]?te.value.to:null},()=>[e.createElementVNode("div",Vm,e.toDisplayString(Ne.item[F.itemKey]),1)])])],42,wm))],64))),128)),($e.value[Be.value]||[]).length===0&&ve.value!=Be.value?(e.openBlock(),e.createElementBlock("div",Nm,[e.renderSlot(G.$slots,"empty",{column:Be},()=>[he[1]||(he[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,km)],6))),128))],6))}}),Mm={name:"DSSConfetti"},_m=Object.assign(Mm,{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(F){const we=F,A=e.ref(null),D=e.ref(!1);let xe=[],C=null,Ve=null;function ne(se,te){const le=[];for(let R=0;R<we.count;R++)le.push(et(se));return le}function et(se,te){return{x:Math.random()*se,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:we.colors[Math.floor(Math.random()*we.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 f(se,te,le,R){se.clearRect(0,0,te,le);for(const Ee of xe)se.save(),se.globalAlpha=Ee.opacity*R,se.beginPath(),se.lineWidth=Ee.r,se.strokeStyle=Ee.color,se.moveTo(Ee.x+Ee.tilt+Ee.r/2,Ee.y),se.lineTo(Ee.x+Ee.tilt,Ee.y+Ee.tilt+Ee.r/2),se.stroke(),se.restore()}function ce(se,te,le){const R=.3+le*.7;for(let Ee=0;Ee<xe.length;Ee++){const He=xe[Ee];He.tiltAngle+=He.tiltInc,He.y+=He.speed*R,He.x+=Math.sin(He.d)*.5*R,He.tilt=Math.sin(He.tiltAngle)*15,le>=.99&&He.y>te+20&&(xe[Ee]=et(se))}}function ve(){D.value=!0,e.nextTick(()=>{const se=A.value;if(!se)return;const te=se.getContext("2d"),le=se.parentElement;if(!le)return;const R=le.getBoundingClientRect();se.width=R.width,se.height=R.height,xe=ne(se.width,se.height);const Ee=Date.now(),He=Ee+we.duration,qe=()=>{const ut=Date.now(),$=ut-Ee;if(ut<He){let me=1;$>we.fadeStart&&(me=1-($-we.fadeStart)/(we.duration-we.fadeStart)),f(te,se.width,se.height,me),ce(se.width,se.height,me),C=requestAnimationFrame(qe)}else fe()};qe()})}function fe(){C&&(cancelAnimationFrame(C),C=null),xe=[],D.value=!1}return e.watch(()=>we.trigger,se=>{se&&(Ve&&clearTimeout(Ve),Ve=setTimeout(ve,we.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{fe(),Ve&&clearTimeout(Ve)}),(se,te)=>D.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:A,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),$m={class:"dss-filter-global-inner"},Tm=["value"],Lm=["title"],Hm={key:0,class:"dss-filter-funnel-badge"},Dm={class:"dss-filter-panel"},Am={key:0,class:"dss-filter-empty"},Rm={class:"dss-filter-row-prefix"},Fm={class:"dss-filter-cell"},Im=["onClick"],zm={class:"dss-filter-trigger-text"},Pm={class:"dss-filter-popup-list"},Om=["onClick"],Zm={key:0,class:"dss-filter-popup-empty"},Wm={key:0,class:"dss-filter-cell"},qm=["onClick"],Um={class:"dss-filter-trigger-text"},Xm={class:"dss-filter-popup-list"},Ym=["onClick"],jm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Km=["onUpdate:modelValue"],Gm={key:1,class:"dss-filter-date-wrap"},Qm=["onUpdate:modelValue"],Jm=["value","onInput","step"],e2={key:4,class:"dss-filter-between"},t2=["value","onInput","step"],l2=["value","onInput","step"],n2={key:5,class:"dss-filter-multiselect"},o2=["onClick"],a2={class:"dss-filter-trigger-text"},s2={class:"dss-filter-popup-list dss-filter-popup-list--check"},r2=["onClick"],i2=["checked"],c2={key:0,class:"dss-filter-popup-empty"},u2=["onClick"],d2={class:"dss-filter-foot"},m2={class:"dss-filter-cell"},p2={class:"dss-filter-popup-list"},f2=["onClick"],v2={key:0,class:"dss-filter-popup-divider"},g2=["onClick"],h2={class:"dss-filter-popup-list"},y2=["onClick"],C2={key:0,class:"dss-filter-popup-empty"},k2={class:"dss-filter-popup-list"},b2=["onClick"],w2={key:0,class:"dss-filter-popup-empty"},x2={name:"DSSFilter"},E2=Object.assign(x2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(F,{expose:we,emit:A}){const D=F,xe=A,C={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Ve=e.computed(()=>({...C,...D.options})),ne={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},et=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],ce=e.ref(""),ve=e.ref([]),fe=e.ref(null),se=e.ref(!1),te=e.ref(null),le=e.ref(""),R=e.ref(null);let Ee=1;function He(x){const b=x.find(S=>S&&typeof S=="object");if(!b)return null;for(const S of f)if(S in b&&typeof b[S]=="string")return S;return Object.keys(b).find(S=>typeof b[S]=="string")||null}function qe(x,b){const S=b.filter(O=>O!=null&&O!=="NULL");if(S.length===0)return null;if(S.every(O=>Array.isArray(O))){const O=S.flatMap(Te=>Te).filter(Te=>Te!=null);return O.length===0?null:typeof O.find(Te=>Te!=null)=="object"?"arraySelect":"arrayText"}return S.every(O=>typeof O=="boolean")?"boolean":S.every(O=>typeof O=="number")?new Set(S).size<=Ve.value.maxUniqueForEnum?"select":"range":S.every(O=>typeof O=="string")?new Set(S).size<=Ve.value.maxUniqueForSelect?"select":"text":S.some(O=>typeof O=="object"&&!Array.isArray(O))?null:"text"}const ut=e.computed(()=>{if(!D.data?.length)return[];const x=new Set;for(const K of D.data)if(K&&typeof K=="object")for(const Te of Object.keys(K))x.add(Te);const b=new Set(D.exclude),S=[];for(const K of x){if(b.has(K))continue;const Te=D.config[K]||{},ze=D.data.map(De=>De?.[K]),Me=Te.type||qe(K,ze);if(!Me)continue;const be=Te.filterMode||"contain",wt=be==="date"?"date":be==="string"?"text":Me,Ge={key:K,label:Te.label||X(K),type:wt,filterMode:be};if(Me==="select"){const De=ze.filter(bt=>bt!=null&&bt!=="NULL");Ge.uniqueValues=[...new Set(De)].sort((bt,dt)=>typeof bt=="number"&&typeof dt=="number"?bt-dt:String(bt).localeCompare(String(dt)))}else if(Me==="range"||Me==="int"){const De=ze.filter(bt=>typeof bt=="number");Ge.min=Math.min(...De),Ge.max=Math.max(...De)}else if(Me==="arraySelect"){const De=Te.displayKey||He(ze.flatMap(dt=>Array.isArray(dt)?dt:[]));Ge.displayKey=De;const bt=ze.flatMap(dt=>Array.isArray(dt)?dt:[]).filter(dt=>dt!=null).map(dt=>De&&typeof dt=="object"?dt[De]:String(dt)).filter(dt=>dt!=null&&dt!=="");Ge.uniqueValues=[...new Set(bt)].sort((dt,yl)=>String(dt).localeCompare(String(yl)))}S.push(Ge)}const O=D.config._order;return O&&S.sort((K,Te)=>{const ze=O.indexOf(K.key),Me=O.indexOf(Te.key);return ze===-1&&Me===-1?0:ze===-1?1:Me===-1?-1:ze-Me}),S}),$=e.computed(()=>{const x={};for(const b of ut.value)x[b.key]=b;return x}),me=e.computed(()=>Array.isArray(D.config.groups)&&D.config.groups.length>0),tt=e.computed(()=>{if(!me.value)return[];const x=new Set(ut.value.map(b=>b.key));return D.config.groups.map(b=>({...b,keys:b.keys.filter(S=>x.has(S))})).filter(b=>b.keys.length>0)}),$e=e.computed(()=>{if(!me.value)return[];const x=new Set(D.config.groups.flatMap(b=>b.keys));return ut.value.filter(b=>!x.has(b.key))}),ft=e.computed(()=>{if(!R.value)return[];const x=new Set(R.value.keys),b=ut.value.filter(O=>x.has(O.key));if(!le.value)return b;const S=le.value.toLowerCase();return b.filter(O=>O.label.toLowerCase().includes(S))}),ge=e.computed(()=>{if(!le.value)return ut.value;const x=le.value.toLowerCase();return ut.value.filter(b=>b.label.toLowerCase().includes(x))});function Ze(x){fe.value===x?xt():(fe.value=x,le.value="",R.value=null)}function xt(){fe.value=null,le.value="",R.value=null}function Ue(x){const b=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");fe.value&&!b&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&&xt(),se.value&&te.value&&!te.value.contains(x.target)&&(b||(se.value=!1))}e.onMounted(()=>document.addEventListener("click",Ue)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ue));function Lt(x){return $.value[x]?.label||X(x)}function it(x){return $.value[x.key]?.filterMode||"contain"}function Et(x){for(const b of Object.values(ne)){const S=b.find(O=>O.value===x);if(S)return S.label}return x}function rl(x){const b=$.value[x.key];return ne[b?.type]||ne.text}function Tt(x){return et.has(x)}function gt(x){const b=$.value[x.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?x.operator==="between"?"between":"number":"text":"text"}function lt(x){return ne[x]?.[0]?.value||"contains"}function kt(x,b){return et.has(b)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&b==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function $t(x){return $.value[x.key]?.uniqueValues||[]}function Dt(x){const b=$t(x);if(!le.value)return b;const S=le.value.toLowerCase();return b.filter(O=>String(O).toLowerCase().includes(S))}function at(x){const b=x.value;return!b||b.length===0?"Select...":b.length<=2?b.join(", "):`${b.length} selected`}function _t(x){const b=$.value[x],S=b?.filterMode||"contain",O=b?.type||"text",K=S==="string"?"contains":lt(O);ve.value.push(e.reactive({id:Ee++,key:x,operator:K,value:kt(O,K)})),xt()}function Nt(x){ve.value=ve.value.filter(b=>b.id!==x)}function Ht(x,b){const O=$.value[b]?.type||"text";x.key=b,x.operator=lt(O),x.value=kt(O,x.operator),xt()}function gl(x,b){const S=gt(x);x.operator=b;const O=gt(x);if(S!==O||et.has(b)){const K=$.value[x.key];x.value=kt(K?.type||"text",b)}xt()}function G(x,b){const S=b.target.value;x.value=S===""?null:Number(S)}function he(x,b,S){const O=S.target.value,K=O===""?null:Number(O);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[b]:isNaN(K)?null:K}}function Be(x,b){const S=x.value||[],O=S.indexOf(b);x.value=O>=0?S.filter(K=>K!==b):[...S,b]}function Ne(){ve.value=[],ce.value="",xt()}function Ke(x){ce.value=x.target.value}const Xe=e.computed(()=>{if(!D.data)return[];let x=D.data;if(ce.value){const b=ce.value.toLowerCase();x=x.filter(S=>{for(const O of Object.keys(S)){const K=S[O];if(typeof K=="string"&&K.toLowerCase().includes(b)||typeof K=="number"&&String(K).includes(b)||Array.isArray(K)&&K.some(Te=>Te!=null&&(typeof Te=="string"?Te.toLowerCase().includes(b):typeof Te=="object"?Object.values(Te).some(ze=>typeof ze=="string"&&ze.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of ve.value){if(!st(b))continue;const S=$.value[b.key];S&&(x=x.filter(O=>de(O,b,S)))}return x});function st(x){return et.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function de(x,b,S){const O=x?.[b.key],K=b.value,Te=b.operator;if(Te==="is_empty")return Z(O);if(Te==="is_not_empty")return!Z(O);const ze=S.type;if(ze==="text"||ze==="arrayText"){const Me=ze==="arrayText"&&Array.isArray(O)?O.filter(Ge=>Ge!=null).map(String).join(" "):O!=null?String(O):"",be=String(K).toLowerCase(),wt=Me.toLowerCase();switch(Te){case"contains":return wt.includes(be);case"not_contains":return!wt.includes(be);case"equals":return wt===be;case"not_equals":return wt!==be;case"starts_with":return wt.startsWith(be);case"ends_with":return wt.endsWith(be);default:return!0}}if(ze==="select")switch(Te){case"is_any_of":return K.includes(O);case"is_none_of":return!K.includes(O);default:return!0}if(ze==="range"||ze==="int"){const Me=typeof O=="number"?O:Number(O);if(typeof Me!="number"||isNaN(Me))return!1;if(Te==="between"){const wt=K?.min!=null?Number(K.min):null,Ge=K?.max!=null?Number(K.max):null,De=wt!=null&&!isNaN(wt)?wt:null,bt=Ge!=null&&!isNaN(Ge)?Ge:null;return(De==null||Me>=De)&&(bt==null||Me<=bt)}const be=typeof K=="number"&&!isNaN(K)?K:Number(K);if(Te==="contains"||Te==="not_contains"){const wt=String(Me),Ge=String(K??"").toLowerCase(),De=wt.toLowerCase().includes(Ge);return Te==="contains"?De:!De}if(typeof be!="number"||isNaN(be))return!1;switch(Te){case"eq":return Me===be;case"neq":return Me!==be;case"gt":return Me>be;case"gte":return Me>=be;case"lt":return Me<be;case"lte":return Me<=be;default:return!0}}if(ze==="arraySelect"){if(!Array.isArray(O))return!1;const Me=O.filter(be=>be!=null).map(be=>S.displayKey&&typeof be=="object"?be[S.displayKey]:String(be));switch(Te){case"contains_any":return Me.some(be=>K.includes(be));case"contains_all":return K.every(be=>Me.includes(be));case"not_contains_any":return!Me.some(be=>K.includes(be));default:return!0}}if(ze==="date"){const Me=Ye(K);if(!Me||isNaN(Me.getTime()))return!1;const be=Ye(O);if(!be||isNaN(be.getTime()))return!1;const wt=Y(be),Ge=Y(Me);switch(Te){case"eq":return wt===Ge;case"before":return wt<Ge;case"after":return wt>Ge;default:return!0}}if(ze==="boolean"){const Me=O===!0||O==="true"||O===1,be=O===!1||O==="false"||O===0;switch(Te){case"is_true":return Me;case"is_false":return be;default:return!0}}return!0}function Ye(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const b=new Date(x);return isNaN(b.getTime())?null:b}return null}function Y(x){const b=x.getFullYear(),S=String(x.getMonth()+1).padStart(2,"0"),O=String(x.getDate()).padStart(2,"0");return`${b}-${S}-${O}`}function Z(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(b=>b==null))}e.watch(Xe,x=>xe("update:modelValue",x),{immediate:!0}),e.watch(()=>D.data,()=>{ve.value=[],ce.value="",se.value=!1,xt()});function X(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function ae(){const x=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(x);if(typeof b=="object"&&!Array.isArray(b)){const S={};for(const O of Object.keys(b))S[O]=x(b[O]);return S}return b};return{globalSearch:ce.value,rows:ve.value.map(b=>({key:b.key,operator:b.operator,value:x(b.value),defType:$.value[b.key]?.type,defFilterMode:$.value[b.key]?.filterMode})),filteredCount:Xe.value?.length??0}}return we({getDebugState:ae}),(x,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Ve.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:te},[e.createElementVNode("div",$m,[b[15]||(b[15]=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:"Search across all fields...",value:ce.value,onInput:Ke},null,40,Tm),ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=S=>ce.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:se.value||ve.value.length>0}]),onClick:b[1]||(b[1]=S=>se.value=!se.value),type:"button",title:se.value?"Close advanced filter":"Open advanced filter"},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",Hm,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,Lm)]),se.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Dm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",Am," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(S,O)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",Rm,e.toDisplayString(O===0?"Where":"And"),1),e.createElementVNode("div",Fm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(K=>Ze(`${S.id}:field`),["stop"])},[e.createElementVNode("span",zm,e.toDisplayString(Lt(S.key)),1),b[16]||(b[16]=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,Im),fe.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[3]||(b[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[2]||(b[2]=K=>le.value=K),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,K=>(e.openBlock(),e.createElementBlock("li",{key:K.key,class:"dss-filter-popup-item",onClick:Te=>Ht(S,K.key)},e.toDisplayString(K.label),9,Om))),128)),ge.value.length===0?(e.openBlock(),e.createElementBlock("li",Zm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),it(S)==="contain"||it(S)==="date"?(e.openBlock(),e.createElementBlock("div",Wm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(K=>Ze(`${S.id}:op`),["stop"])},[e.createElementVNode("span",Um,e.toDisplayString(Et(S.operator)),1),b[17]||(b[17]=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,qm),fe.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Xm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl(S),K=>(e.openBlock(),e.createElementBlock("li",{key:K.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===K.value}]),onClick:Te=>gl(S,K.value)},e.toDisplayString(K.label),11,Ym))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Tt(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",jm,[it(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":K=>S.value=K},null,8,Km)),[[e.vModelText,S.value]]):it(S)==="date"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createVNode(Oo,{mode:"single",modelValue:S.value,"onUpdate:modelValue":K=>S.value=K},null,8,["modelValue","onUpdate:modelValue"])])):gt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":K=>S.value=K},null,8,Qm)),[[e.vModelText,S.value]]):gt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:S.value,onInput:K=>G(S,K),step:$.value[S.key]?.type==="int"?1:void 0},null,40,Jm)):gt(S)==="between"?(e.openBlock(),e.createElementBlock("div",e2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:S.value?.min,onInput:K=>he(S,"min",K),step:$.value[S.key]?.type==="int"?1:void 0},null,40,t2),b[18]||(b[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:S.value?.max,onInput:K=>he(S,"max",K),step:$.value[S.key]?.type==="int"?1:void 0},null,40,l2)])):gt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(K=>Ze(`${S.id}:val`),["stop"])},[e.createElementVNode("span",a2,e.toDisplayString(at(S)),1),b[19]||(b[19]=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,o2),fe.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[$t(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=K=>le.value=K),placeholder:"Search..."},null,512)),[[e.vModelText,le.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",s2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(S),K=>(e.openBlock(),e.createElementBlock("li",{key:K,class:"dss-filter-popup-item",onClick:Te=>Be(S,K)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(K),tabindex:"-1"},null,8,i2),e.createElementVNode("span",null,e.toDisplayString(K),1)],8,r2))),128)),Dt(S).length===0?(e.openBlock(),e.createElementBlock("li",c2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:K=>Nt(S.id)},[...b[20]||(b[20]=[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,u2)]))),128)),e.createElementVNode("div",d2,[e.createElementVNode("div",m2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(S=>Ze("add"),["stop"]))}," Add filter "),fe.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[me.value&&!R.value&&!le.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[8]||(b[8]=S=>le.value=S),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",p2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:O=>R.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),b[21]||(b[21]=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,f2))),128)),$e.value.length>0?(e.openBlock(),e.createElementBlock("li",v2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:O=>_t(S.key)},e.toDisplayString(S.label),9,g2))),128))])],64)):R.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=S=>R.value=null)},[b[22]||(b[22]=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(R.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=S=>le.value=S),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",h2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:O=>_t(S.key)},e.toDisplayString(S.label),9,y2))),128)),ft.value.length===0?(e.openBlock(),e.createElementBlock("li",C2,"No match")):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=S=>le.value=S),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",k2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:O=>_t(S.key)},e.toDisplayString(S.label),9,b2))),128)),ge.value.length===0?(e.openBlock(),e.createElementBlock("li",w2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ne}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V2={class:"dss-pill-field__pills"},N2=["disabled"],S2={class:"dss-pill-field__pill-text"},B2={key:0,class:"dss-pill-field__pill-actions"},M2=["onClick"],_2=["onClick"],$2=["placeholder","disabled"],T2=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(F,{emit:we}){const A=F,D=we,xe=e.ref(""),C=e.ref([...A.modelValue]),Ve=e.ref(null);let ne=null;const et=e.ref(null),f=e.ref(""),ce=e.ref(null),ve=e.computed(()=>new Set(C.value.map($=>$.trim()).filter(Boolean)));function fe($){Ve.value=$,ne&&clearTimeout(ne),ne=setTimeout(()=>{Ve.value=null,ne=null},900)}function se($){const me=$.trim();return me?ve.value.has(me)?(fe(me),!1):(C.value=[...C.value,me],D("update:modelValue",[...C.value]),!0):!1}function te($){const me=$.split(/\r?\n/g).map(ge=>ge.trim()).filter(Boolean);if(!me.length)return;const tt=new Set(C.value.map(ge=>ge.trim()).filter(Boolean)),$e=[...C.value];let ft=null;for(const ge of me){if(tt.has(ge)){ft??=ge;continue}tt.add(ge),$e.push(ge)}$e.length!==C.value.length&&(C.value=$e,D("update:modelValue",[...C.value])),ft&&fe(ft)}function le($){A.disabled||(et.value===$&&(et.value=null,f.value=""),C.value=C.value.filter((me,tt)=>tt!==$),D("update:modelValue",[...C.value]))}async function R($){A.disabled||(et.value=$,f.value=C.value[$]??"",await e.nextTick(),ce.value?.focus(),ce.value?.select())}function Ee(){et.value=null,f.value=""}function He(){if(A.disabled||et.value===null)return;const $=et.value,me=C.value[$]??"",tt=f.value.trim();if(et.value=null,f.value="",tt!==me&&ve.value.has(tt)){fe(tt);return}if(!tt){C.value=C.value.filter((ft,ge)=>ge!==$),D("update:modelValue",[...C.value]);return}const $e=C.value.map((ft,ge)=>ge===$?tt:ft);C.value=$e,D("update:modelValue",[...C.value])}function qe($){$.preventDefault(),!A.disabled&&(se(xe.value),xe.value="")}function ut($){if(A.disabled)return;const me=$.clipboardData?.getData("text")??"";!me.includes(`
118
+ `)&&!me.includes("\r")||($.preventDefault(),te(me),xe.value="")}return e.watch(()=>A.modelValue,$=>{C.value=Array.isArray($)?[...$]:[]},{deep:!0}),e.onBeforeUnmount(()=>{ne&&clearTimeout(ne)}),($,me)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":$.disabled}])},[e.createElementVNode("div",V2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(tt,$e)=>(e.openBlock(),e.createElementBlock("span",{key:tt,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":Ve.value===tt}])},[et.value===$e?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:ce,"onUpdate:modelValue":me[0]||(me[0]=ft=>f.value=ft),class:"dss-pill-field__pill-edit",type:"text",disabled:$.disabled,onKeydown:[e.withKeys(He,["enter"]),e.withKeys(Ee,["esc"])],onBlur:He},null,40,N2)),[[e.vModelText,f.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",S2,e.toDisplayString(tt),1),$.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",B2,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:ft=>R($e)},[...me[2]||(me[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,M2),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:ft=>le($e)}," × ",8,_2)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":me[1]||(me[1]=tt=>xe.value=tt),class:"dss-pill-field__input",type:"text",placeholder:C.value.length?"":$.placeholder,disabled:$.disabled,onPaste:ut,onKeydown:e.withKeys(qe,["enter"])},null,40,$2),[[e.vModelText,xe.value]])])],2))}}),L2={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"}},H2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},D2={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},A2={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"}},oo={chart:L2,table:H2,datepicker:D2,textEditor:A2},R2={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"}},F2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},I2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},z2={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"}},ao={chart:R2,table:F2,datepicker:I2,textEditor:z2},P2={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"}},O2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},Z2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},W2={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"}},so={chart:P2,table:O2,datepicker:Z2,textEditor:W2},Fo={en:oo,fr:ao,nl:so};function q2(F){if(!F||!F.global)return;const we=F.global.availableLocales||[];Object.keys(Fo).forEach(A=>{we.includes(A)&&F.global.mergeLocaleMessage(A,Fo[A])})}const Io={en:{textEditor:oo.textEditor},fr:{textEditor:ao.textEditor},nl:{textEditor:so.textEditor}};function U2(F){if(!F||!F.global)return;const we=F.global.availableLocales||[];Object.keys(Io).forEach(A=>{we.includes(A)&&F.global.mergeLocaleMessage(A,Io[A])})}const zo={en:{table:oo.table},fr:{table:ao.table},nl:{table:so.table}};function X2(F){if(!F||!F.global)return;const we=F.global.availableLocales||[];Object.keys(zo).forEach(A=>{we.includes(A)&&F.global.mergeLocaleMessage(A,zo[A])})}const Po={en:{datepicker:oo.datepicker},fr:{datepicker:ao.datepicker},nl:{datepicker:so.datepicker}};function Y2(F){if(!F||!F.global)return;const we=F.global.availableLocales||[];Object.keys(Po).forEach(A=>{we.includes(A)&&F.global.mergeLocaleMessage(A,Po[A])})}const j2={en:{...oo},fr:{...ao},nl:{...so}};no.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:j2});exports.DSSChart=$i;exports.DSSChartMessages=Fo;exports.DSSColorPicker=lm;exports.DSSConfetti=_m;exports.DSSDatepicker=Oo;exports.DSSDatepickerMessages=Po;exports.DSSDnd=Bm;exports.DSSFilter=E2;exports.DSSLoader=vm;exports.DSSModal=Ro;exports.DSSPillField=T2;exports.DSSSkeleton=gm;exports.DSSTable=jc;exports.DSSTableMessages=zo;exports.DSSTextEditor=z1;exports.DSSTextEditorMessages=Io;exports.addDSSChartTranslations=q2;exports.addDSSDatepickerTranslations=Y2;exports.addDSSTableTranslations=X2;exports.addDSSTextEditorTranslations=U2;