dsp-semactic 0.6.32 → 0.6.34

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"),Kn=require("vue-i18n"),ia={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ca=["value"],ua=["placeholder","value","disabled"],da=["placeholder","value"],ma={key:0,class:"dss-datepicker__double-wrap"},pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fa=["onClick"],va={class:"dss-datepicker__double-calendars"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ka=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__double-calendar"},Sa={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},La=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__calendar-header"},Za={class:"dss-datepicker__month-year-row"},Wa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},qa={class:"dss-datepicker__months-grid"},Ua=["onClick"],Xa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ya={class:"dss-datepicker__month-year"},ja={class:"dss-datepicker__years-grid"},Ka=["data-year","onClick"],Xo=27,Zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:re}){const M=L,$=re,{t:se,locale:C}=Kn.useI18n(),Ee=e.ref(!1),le=e.ref("days"),Ge=new Date,p=e.computed(()=>M.minDate instanceof Date?M.minDate:Ge),ve=e.ref(p.value.getMonth()),xe=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ne=e.ref(p.value.getFullYear()),X=e.ref(p.value.getMonth()),pe=e.ref(p.value.getFullYear()),A=e.ref("start"),ge=e.ref(null),Le=e.ref(null);function qe(){const I=p.value,O=I.getMonth(),z=I.getFullYear(),ie=O===11?0:O+1,Te=O===11?z+1:z;return{left:{month:O,year:z},right:{month:ie,year:Te}}}const vt=e.ref(null),R=e.ref(null),Y=e.ref(null),_e=e.ref(null),fe=e.ref(null),st=e.ref(null),Ce=new Date().getFullYear(),Ue=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),Lt=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),Pe=e.computed(()=>{if(M.mode!=="single"&&M.mode!=="singleFromAvailable")return null;const I=M.modelValue;return I instanceof Date?I:null}),At=e.computed(()=>{if(!Lt.value)return{start:null,end:null};const I=M.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 pt(I){if(!I||!(I instanceof Date))return"";const O=I.getDate(),z=I.getMonth()+1,ie=I.getFullYear(),Te=rt=>String(rt).padStart(2,"0");return`${Te(O)}/${Te(z)}/${ie}`}const Ct=e.computed(()=>pt(Pe.value)),ml=e.computed(()=>{const{start:I,end:O}=At.value;if(!I&&!O)return"";const z=!O||I&&I<=O?I:O,ie=!I||O&&O>=I?O:I;return W(z,ie)?pt(z):`${pt(z)} - ${pt(ie)}`}),Dt=e.computed(()=>{if(M.mode!=="readonly")return"—";const I=M.modelValue;if(I instanceof Date)return pt(I)||"—";if(I&&typeof I=="object"&&("start"in I||"end"in I)){const O=I.start instanceof Date?I.start:null,z=I.end instanceof Date?I.end:null;if(!O&&!z)return"—";const ie=!z||O&&O<=z?O:z,Te=!O||z&&z>=O?z:O;return W(ie,Te)?pt(ie):`${pt(ie)} - ${pt(Te)}`}return"—"});e.computed(()=>{const I=new Date(xe.value,ve.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const $t=e.computed(()=>Le.value==="left"?de.value:Le.value==="right"?X.value:ve.value),tt=e.computed(()=>Le.value==="left"?ne.value:Le.value==="right"?pe.value:xe.value),It=e.computed(()=>{const I=new Date(xe.value,ve.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ft=e.computed(()=>{const I=new Date(tt.value,$t.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ut=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{month:"short"});return Array.from({length:12},(O,z)=>I.format(new Date(2024,z,1)))}),ft=e.computed(()=>{const O=(Le.value?tt.value:xe.value)-Math.floor(Xo/2);return Array.from({length:Xo},(z,ie)=>O+ie)}),Tt=e.computed(()=>{const I=ft.value;return I.length?`${I[0]} – ${I[I.length-1]}`:""}),lt=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{weekday:"short"}),O=new Date(2024,0,1),z=[];for(let ie=0;ie<7;ie++){const Te=new Date(O);Te.setDate(O.getDate()+ie),z.push(I.format(Te).slice(0,2))}return z});function Nt(I,O){const z=new Date(I,O,1),ie=new Date(I,O+1,0),Te=z.getDay(),rt=ie.getDate(),it=[];for(let Ye=0;Ye<Te;Ye++)it.push(null);for(let Ye=1;Ye<=rt;Ye++)it.push(new Date(I,O,Ye));return it}const rl=e.computed(()=>Nt(xe.value,ve.value)),G=e.computed(()=>Nt(ne.value,de.value)),Ve=e.computed(()=>Nt(pe.value,X.value));e.computed(()=>{const I=new Date(ne.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)}),e.computed(()=>{const I=new Date(pe.value,X.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const Ne=e.computed(()=>{const I=new Date(ne.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ie=e.computed(()=>{const I=new Date(pe.value,X.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),ut=e.computed(()=>M.availableDates&&M.availableDates.length>0),Ze=e.computed(()=>ut.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"}]),et=e.ref({top:0,left:0});function he(){if(!_e.value||!Ee.value)return;const I=_e.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,z=window.innerHeight||document.documentElement.clientHeight;let ie=I.left,Te=I.bottom+4;const rt=fe.value;if(rt){const it=rt.offsetWidth,Ye=rt.offsetHeight;if(ie+it>O-8&&(ie=I.right-it,ie<8&&(ie=8)),Te+Ye>z-8){const nt=I.top-4-Ye;nt>=8?Te=nt:Te=Math.max(8,z-Ye-8)}}et.value={top:Te,left:ie}}const Ke=e.computed(()=>!_e.value||!Ee.value?{}:{position:"fixed",left:`${et.value.left}px`,top:`${et.value.top}px`,zIndex:1002});function W(I,O){return!I||!O?!1:I.getFullYear()===O.getFullYear()&&I.getMonth()===O.getMonth()&&I.getDate()===O.getDate()}function Z(I){return new Date(I.getFullYear(),I.getMonth(),I.getDate()).getTime()}function j(I){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(O=>O instanceof Date&&W(O,I))}function oe(I){const O=Z(I);return!(M.minDate instanceof Date&&O<Z(M.minDate)||M.maxDate instanceof Date&&O>Z(M.maxDate))}function He(I){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(O=>O instanceof Date&&W(O,I))}function N(I){return He(I)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?j(I):oe(I)}function b(I){const O=Pe.value,z=At.value,ie=Z(I),Te=Lt.value&&z.start&&z.end&&ie>Z(z.start)&&ie<Z(z.end),rt=Lt.value&&z.start&&W(I,z.start),it=Lt.value&&z.end&&W(I,z.end),Ye=rt&&it,nt=Ue.value&&O&&W(I,O)||rt||it;let yl=!1;if(Lt.value&&z.start&&!z.end&&ge.value){const fl=Z(z.start),Nl=Z(ge.value),zl=Math.min(fl,Nl),ql=Math.max(fl,Nl);yl=ie>zl&&ie<ql}return{"dss-datepicker__day--selected":nt&&!Ye,"dss-datepicker__day--range-start":rt&&!Ye,"dss-datepicker__day--range-end":it&&!Ye,"dss-datepicker__day--range-single":Ye,"dss-datepicker__day--in-range":Te&&!rt&&!it,"dss-datepicker__day--in-range-preview":yl&&!rt&&!it&&!Te,"dss-datepicker__day--disabled":!N(I)}}function V(I){if(!Lt.value)return;const O=At.value;if(!O.start||O.end){ge.value=null;return}if(!N(I)){ge.value=null;return}ge.value=new Date(I.getFullYear(),I.getMonth(),I.getDate())}function ee(){ge.value=null}function J(){if(!M.doubleCalendar||!Lt.value)return;const I=At.value,{start:O,end:z}=I;if(O&&z){const rt=O<=z?O:z,it=O<=z?z:O,Ye=rt.getMonth(),nt=rt.getFullYear(),yl=it.getMonth(),fl=it.getFullYear();if(Ye!==yl||nt!==fl){const Nl=de.value===Ye&&ne.value===nt,zl=X.value===yl&&pe.value===fl;if(Nl&&zl)return;de.value=Ye,ne.value=nt,X.value=yl,pe.value=fl}else{const Nl=Ye===0?11:Ye-1,zl=Ye===0?nt-1:nt;de.value===Nl&&ne.value===zl&&X.value===Ye&&pe.value===nt||(de.value=Ye,ne.value=nt,Ye===11?(X.value=0,pe.value=nt+1):(X.value=Ye+1,pe.value=nt))}return}const ie=O||z;if(ie){const rt=ie.getMonth(),it=ie.getFullYear(),Ye=de.value===rt&&ne.value===it,nt=X.value===rt&&pe.value===it;if(Ye||nt)return;de.value=rt,ne.value=it,rt===11?(X.value=0,pe.value=it+1):(X.value=rt+1,pe.value=it);return}const Te=qe();de.value=Te.left.month,ne.value=Te.left.year,X.value=Te.right.month,pe.value=Te.right.year}function Se(I="start"){if(M.mode==="readonly")return;A.value=I;const O=Pe.value,z=At.value;if(Ue.value&&O)ve.value=O.getMonth(),xe.value=O.getFullYear();else if(Lt.value)if(M.doubleCalendar)J();else{const ie=I==="start"&&z.start?z.start:z.end||z.start;ie&&(ve.value=ie.getMonth(),xe.value=ie.getFullYear())}_e.value=Ue.value?vt.value?.closest(".dss-datepicker__input-wrap"):R.value,le.value="days",Le.value=null,Ee.value=!0,e.nextTick(()=>{he()})}function ot(){le.value="days",Le.value=null,ge.value=null,Ee.value=!1}function Be(I,O){Le.value=I,le.value=O}function We(){le.value="days",Le.value=null}function Xe(I){const O=new Date,z=O.getFullYear(),ie=O.getMonth(),Te=O.getDate();let rt,it;if(ut.value){const Ye=[...M.availableDates].filter(nt=>nt instanceof Date).map(nt=>new Date(nt.getFullYear(),nt.getMonth(),nt.getDate()));if(Ye.sort((nt,yl)=>nt.getTime()-yl.getTime()),Ye.length===0)return;if(I==="all")rt=Ye[0],it=Ye[Ye.length-1];else{const nt=parseInt(I.replace("last",""),10);if(nt<2||nt>5)return;const yl=Ye.slice(-nt);rt=yl[0],it=yl[yl.length-1]}}else{const Ye=new Date(z,ie,Te);switch(I){case"today":rt=Ye,it=Ye;break;case"lastWeek":rt=new Date(z,ie,Te-6),it=Ye;break;case"last15Days":rt=new Date(z,ie,Te-14),it=Ye;break;case"last30Days":rt=new Date(z,ie,Te-29),it=Ye;break;case"thisMonth":rt=new Date(z,ie,1),it=Ye;break;case"last3Months":rt=new Date(z,ie-3,1),it=new Date(z,ie,0);break;case"last6Months":rt=new Date(z,ie-6,1),it=new Date(z,ie,0);break;case"last12Months":rt=new Date(z,ie-12,1),it=new Date(z,ie,0);break;case"lastYear":rt=new Date(z-1,0,1),it=new Date(z-1,11,31);break;default:return}}$("update:modelValue",{start:rt,end:it}),J()}function at(I){Le.value==="left"?de.value=I:Le.value==="right"?X.value=I:ve.value=I,We()}function gt(I){Le.value==="left"?ne.value=I:Le.value==="right"?pe.value=I:xe.value=I,We()}function Et(){ve.value===0?(ve.value=11,xe.value--):ve.value--}function Vt(){ve.value===11?(ve.value=0,xe.value++):ve.value++}function kl(){de.value===0?(de.value=11,ne.value--):de.value--}function kt(){de.value===11?(de.value=0,ne.value++):de.value++}function Ht(){X.value===0?(X.value=11,pe.value--):X.value--}function Gl(){X.value===11?(X.value=0,pe.value++):X.value++}function pl(I){if(!N(I))return;const O=new Date(I.getFullYear(),I.getMonth(),I.getDate());if(Ue.value){$("update:modelValue",O),ot();return}const z=At.value;if(!z.start&&!z.end){$("update:modelValue",{start:O,end:null}),A.value="end";return}if(z.start&&z.end){$("update:modelValue",{start:O,end:null}),A.value="end";return}if(A.value==="start"){let ie=O,Te=z.end;ie&&Te&&ie>Te&&([ie,Te]=[Te,ie]),$("update:modelValue",{start:ie||Te,end:Te||ie}),A.value="end"}else{let ie=z.start,Te=O;ie&&Te&&Te<ie&&([ie,Te]=[Te,ie]),$("update:modelValue",{start:ie||Te,end:Te||ie}),A.value="start"}}e.watch(At,()=>{M.doubleCalendar&&Lt.value&&Ee.value&&J()},{deep:!0});let jt=null,Rt=null,Ll=null;function bl(){jt&&(document.removeEventListener("keydown",jt),jt=null),Rt&&(window.removeEventListener("resize",Rt),Rt=null),Ll&&(window.removeEventListener("scroll",Ll,!0),Ll=null)}return e.watch(le,I=>{I==="years"&&e.nextTick(()=>{st.value?.querySelector(`[data-year="${tt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Ee,I=>{bl(),I&&(jt=O=>{O.key==="Escape"&&(le.value==="years"||le.value==="months"?We():ot())},Rt=()=>{he()},Ll=()=>{he()},document.addEventListener("keydown",jt),window.addEventListener("resize",Rt),window.addEventListener("scroll",Ll,!0))}),e.onBeforeUnmount(()=>{bl()}),(I,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ia,[O[10]||(O[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Dt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ca)])):Ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=z=>Se("start"))},[O[11]||(O[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:vt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(se)("datepicker.selectDate"),value:Ct.value,readonly:"",disabled:L.mode==="readonly"},null,8,ua)])):Lt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:O[1]||(O[1]=z=>Se("start"))},[O[12]||(O[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:Y,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(se)("datepicker.selectRange"),value:ml.value,readonly:""},null,8,da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ot,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:fe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&Lt.value&&le.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&Lt.value&&le.value==="days"&&L.quickSelect}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ke.value)},[le.value==="days"&&L.doubleCalendar&&Lt.value?(e.openBlock(),e.createElementBlock("div",ma,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ie=>Xe(z.id)},e.toDisplayString(e.unref(se)(z.labelKey)),9,fa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",va,[e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:kl}," ‹ ",8,ya),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=z=>Be("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=z=>Be("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:kt}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>pl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])]),e.createElementVNode("div",Va,[e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Ht}," ‹ ",8,Na),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=z=>Be("right","months"))},e.toDisplayString(Ie.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=z=>Be("right","years"))},e.toDisplayString(pe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Gl}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>pl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,La)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])])])])):le.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Et}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=z=>le.value="months")},e.toDisplayString(It.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=z=>le.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Vt}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>pl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])],64)):le.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Oa,[e.createElementVNode("div",Za,[e.createElementVNode("span",Wa,e.toDisplayString(Ft.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=z=>le.value="years")},e.toDisplayString(tt.value),1)])]),e.createElementVNode("div",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(z,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ie===$t.value}]),onClick:Te=>at(ie)},e.toDisplayString(z),11,Ua))),128))])],64)):le.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Xa,[e.createElementVNode("span",Ya,e.toDisplayString(Tt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:st},[e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":z===tt.value,"dss-datepicker__year-cell--current":z===e.unref(Ce)}]),"data-year":z,onClick:ie=>gt(z)},e.toDisplayString(z),11,Ka))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ga=["data-chart-type"],Qa={class:"dss-chart-header-titles"},Ja={key:0,class:"dss-chart-title"},es={key:1,class:"dss-chart-subtitle"},ts=["onClick","onMouseenter"],ls={class:"dss-legend-text"},ns=["onClick","onMouseenter"],os={class:"dss-legend-text"},as=["title"],ss=["src"],rs={class:"dss-chart-area-wrapper"},is={key:0,class:"dss-chart-z-axis-label"},cs=["width","height","data-smooth","data-animated"],us=["id"],ds=["y","width","height"],ms=["id"],ps=["d"],fs=["id"],vs=["d"],gs={key:0},hs=["clip-path"],ys=["x1","x2","y1","y2"],Cs={class:"dss-axes"},ks=["x1","x2","y1","y2"],bs=["x1","x2","y1","y2"],ws={class:"dss-axis-labels"},xs=["x","y"],Es=["x","y"],Vs=["x","y"],Ss=["y","transform"],Ns={key:1,class:"dss-flag-markers"},Bs=["clip-path"],Ms=["x1","x2","y1","y2","onMouseover"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["cx","cy","onMouseover"],Ts=["cx","cy","fill","onMouseover"],As=["x","y"],Ds=["clip-path"],Hs={key:0},Rs=["d","onMouseover"],Fs=["x","y","width","height","fill","onMouseover"],Is={class:"dss-line-chart"},zs=["d","stroke","stroke-width"],Ps=["d","stroke","stroke-width","opacity"],Os=["cx","cy","r","fill","onMouseover"],Zs={key:1},Ws=["d","stroke","stroke-width"],qs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width","opacity"],Xs=["cx","cy","r","fill","onMouseover"],Ys={key:2},js=["id"],Ks=["x","y","width","height"],Gs=["d","fill","fill-opacity","mask"],Qs=["d","stroke","stroke-width"],Js=["d","fill","onMouseover"],er=["x","y","width","height","onMouseover"],tr=["clip-path"],lr=["x1","x2","y1","y2","stroke"],nr=["cx","cy","r","fill"],or={key:1,class:"dss-bubble-chart"},ar={key:0,class:"dss-bubble-group"},sr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ir=["transform"],cr=["cx","cy","r"],ur=["data-chart-type","clip-path"],dr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],mr={key:1,class:"dss-radial-segment-data-labels"},pr=["x","y"],fr=["x","y","font-size","fill"],vr=["x1","y1","x2","y2","stroke"],gr=["x1","y1","x2","y2","stroke"],hr=["x","y","text-anchor","font-size"],yr=["transform"],Cr={key:0,class:"dss-spider-grid"},kr=["cx","cy","r"],br={class:"dss-spider-grid-labels"},wr=["x","y"],xr=["x","y"],Er=["x1","x2","y1","y2"],Vr={class:"dss-spider-labels"},Sr=["x","y","text-anchor","dominant-baseline"],Nr=["points","fill","fill-opacity","stroke","stroke-width"],Br=["cx","cy","r","fill","onMouseover"],Mr={class:"dss-chart-logos"},_r=["cx","cy","r","fill"],$r=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Lr=["onClick","onMouseenter"],Tr=["src"],Ar={class:"dss-marker-tooltip-category"},Dr={key:0,class:"dss-marker-tooltip-description"},Hr={key:0,class:"dss-tooltip-section"},Rr={key:0,class:"dss-tooltip-title"},Fr={class:"dss-tooltip-series-name"},Ir={class:"dss-tooltip-series-value"},zr={key:1,class:"dss-tooltip-section"},Pr={key:0,class:"dss-tooltip-title"},Or={class:"dss-bubble-tooltip-data"},Zr={key:2,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-title"},qr={class:"dss-tooltip-value"},Ur={key:0,class:"dss-tooltip-section"},Xr={class:"dss-tooltip-section-title"},Yr={class:"dss-tooltip-group-header"},jr={class:"dss-tooltip-item-content"},Kr={class:"dss-tooltip-item-text"},Gr={key:1,class:"dss-tooltip-section"},Qr={class:"dss-tooltip-section-title"},Jr={class:"dss-tooltip-item-content"},ei={class:"dss-tooltip-item-title"},ti={key:0,class:"dss-tooltip-item-description"},li={class:"dss-tooltip-section"},ni={class:"dss-tooltip-title"},oi={key:0,class:"dss-bubble-tooltip-data"},ai={class:"dss-tooltip-series-name"},si={class:"dss-tooltip-series-value"},ri={key:0,class:"dss-tooltip-section"},ii={class:"dss-tooltip-section-title"},ci={class:"dss-tooltip-group-header"},ui={class:"dss-tooltip-item-content"},di={class:"dss-tooltip-item-text"},mi={key:1,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-item-content"},vi={class:"dss-tooltip-item-title"},gi={key:0,class:"dss-tooltip-item-description"},hi=["onClick","onMouseenter"],yi={class:"dss-legend-text"},Ci={key:1,class:"dss-context-menu-separator"},ki={key:0,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi=["onClick"],xi=["innerHTML"],Ei={key:0,class:"dss-context-menu-icon"},Vi={class:"dss-marker-modal-header"},Si={class:"dss-marker-modal-body"},Ni={class:"dss-form-group"},Bi={class:"dss-form-group"},Mi={for:"dss-marker-description"},_i={key:0,class:"dss-form-text-display"},$i=["placeholder"],Li={class:"dss-marker-modal-footer"},Ti={class:"modal-footer-left"},Ai={class:"dss-modal-footer-right"},Di=["disabled"],Hi={name:"DSSChart"},Ri=Object.assign(Hi,{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:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:re}){const{t:M,locale:$}=Kn.useI18n(),se=re,C=e.ref(null),Ee=e.ref(null),le=e.ref(null),Ge=e.ref(0),p=e.ref(0);let ve=null,xe=null;const de=20,ne=e.computed(()=>{if(p.value,Ge.value,!C.value||!Ee.value)return 0;try{const t=C.value.getBoundingClientRect();return Ee.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${A.chartId}`),pe=e.computed(()=>`url(#${X.value})`),A=L,ge={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 Le(t,s){const l=Object.assign({},t);return vt(t)&&vt(s)&&Object.keys(s).forEach(i=>{vt(s[i])?i in t?l[i]=Le(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(pt.value&&(t+=30),Ct.value&&(t+=25),Tt.value&&A.series.length>0){const i=A.series.filter((f,g)=>!bt.value.has(g)).length;if(lt.value==="top"||lt.value==="bottom"){if(Nt.value==="horizontal"){const g=Math.floor(fe.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 vt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Le(ge,A.options)),Y=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),_e=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),fe=e.computed(()=>{const t=R.value;return Y.value?Ge.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),st=e.ref(de),Ce=e.computed(()=>{if(_e.value){const t=Ce.value;return t??Math.max(0,(p.value||400)-st.value*5)}}),Ue=e.computed(()=>{const t=R.value;if(_e.value){const s=Ce.value;return s??Math.max(0,(p.value||400)-st.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Lt=e.computed(()=>{if(_e.value&&Pe.value==="semi-radial"&&Ce.value!=null)return st.value+Ue.value+"px";if(_e.value)return"100%";if(hl.value)return st.value+Ue.value+"px";if(Tt.value&&lt.value==="bottom"){const t=qe();return Ue.value+(t.legendHeight||35)+"px"}return Ue.value+(Tt.value?20:0)+"px"}),Pe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),At=e.computed(()=>{const t=A.series.map(s=>s.type||Pe.value);return new Set(t).size>1}),pt=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),Ct=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),ml=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Dt=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),$t=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),tt=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return on;const s=t.yAxis.min;return typeof s=="number"||s===on?s:on}),It=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return on;const s=t.yAxis.max;return typeof s=="number"||s===on?s:on}),Ft=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ut=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ft=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Tt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),lt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Nt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),rl=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),G=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),Ve=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ne=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ie=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ut=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ze=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),et=e.computed(()=>{if(!hl.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),he=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ke=e.computed(()=>{const{maxX:t}=Wt.value;return t===0}),W=(t,s)=>Ke.value&&s===0?5:s,Z=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},j=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),oe=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),He=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),N=e.computed(()=>{const t=R.value;return oe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),b=e.computed(()=>{const t=R.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),ee=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),J=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Se=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ot=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Be=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),We=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Xe=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),at=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),gt=e.computed(()=>R.value?.spider?.gridSteps||5),Et=e.computed(()=>{const t=[],s=gt.value;for(let l=1;l<=s;l++)t.push(wt.value/s*l);return t}),Vt=t=>{const s=kl.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=Et.value[t];return Math.round(l/wt.value*100)+"%"},kl=e.computed(()=>R.value?.spider?.gridLabels||null),kt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ht=e.computed(()=>{const t=R.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Gl=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),pl=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Nl.value}),jt=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Rt=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Ll=e.computed(()=>{const s=R.value?.valueFormat?.extension;return typeof s=="string"?s:""}),bl=t=>{const s=Ll.value;if(t==null)return"";const l=String(t);return s?l+s:l},I=e.computed(()=>!K.value.isZooming);e.computed(()=>yt.value.map(t=>{if(t.categoryIndex!==void 0&&(gl.value||Gt.value)){const s=Qt(t.categoryIndex),l=ne.value+P.value.bottom-Rt.value/2;return{...t,x:s,y:l}}return t}));function O(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,w]=t.split("-"),H=Number(w?.length===2?`20${w}`:w);l=new Date(H,Number(E)-1,Number(g))}else return 0;let i=0,f=1/0;return s.forEach((g,E)=>{const[w,H,D]=g.split("-"),F=Number(D?.length===2?`20${D}`:D),B=new Date(F,Number(H)-1,Number(w)),Q=Math.abs(B-l);Q<f&&(f=Q,i=E)}),i}const z=e.computed(()=>{const t=A.markers.map(l=>{const i=O(l.marker_date,A.categories),f=Qt(i),g=ne.value+P.value.bottom-Rt.value/2;return{...l,x:f,y:g,categoryIndex:i,source:"props"}}),s=yt.value.map(l=>{if(l.categoryIndex!==void 0&&(gl.value||Gt.value)){const i=Qt(l.categoryIndex),f=ne.value+P.value.bottom-Rt.value/2;return{...l,x:i,y:f,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ie=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),Te=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),rt=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),it=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Ye=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 f=parseFloat(i)/100;s=t.width*f,l=s*(96/499)}else{const f=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(f/25),l=s*(96/499)}return{width:s,height:l,area:t}}),nt=e.computed(()=>{const{width:t,height:s}=Ye.value,l=it.value;let i,f;const g=P.value.left,E=P.value.right,w=P.value.top,H=P.value.bottom,D=P.value.width,F=P.value.height;switch(l){case"center":i=g+(D-t)/2,f=w+(F-s)/2;break;case"top-left":i=g+15,f=w+5;break;case"top-right":i=E-t-15,f=w+5;break;case"bottom-left":i=g+15,f=H-s-5;break;case"bottom-right":default:i=E-t-15,f=H-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),yl=t=>!A.flags||!A.flags.length?[]:A.flags.filter(s=>s.categoryIndex===t),fl=t=>{const s=yl(t),l=$n(t),i=s.filter(E=>E.manual),f=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(E=>({text:E.text,color:"#698dbe"}))}),f.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:f.map(E=>({text:E.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(E=>({title:E.title,description:E.description,type:M("chart.tooltip.markers"),color:E.color||"#9784ba"}))}},Nl=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"),Kn=require("vue-i18n"),ia={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ca=["value"],ua=["placeholder","value","disabled"],da=["placeholder","value"],ma={key:0,class:"dss-datepicker__double-wrap"},pa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},fa=["onClick"],va={class:"dss-datepicker__double-calendars"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ka=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__double-calendar"},Sa={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Ba={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],_a={class:"dss-datepicker__weekdays"},$a={class:"dss-datepicker__grid"},La=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__calendar-header"},Za={class:"dss-datepicker__month-year-row"},Wa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},qa={class:"dss-datepicker__months-grid"},Ua=["onClick"],Xa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ya={class:"dss-datepicker__month-year"},ja={class:"dss-datepicker__years-grid"},Ka=["data-year","onClick"],Xo=27,Zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:L=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(L)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(L,{emit:re}){const M=L,$=re,{t:se,locale:C}=Kn.useI18n(),Ee=e.ref(!1),le=e.ref("days"),Ge=new Date,p=e.computed(()=>M.minDate instanceof Date?M.minDate:Ge),ve=e.ref(p.value.getMonth()),xe=e.ref(p.value.getFullYear()),de=e.ref(p.value.getMonth()),ne=e.ref(p.value.getFullYear()),X=e.ref(p.value.getMonth()),pe=e.ref(p.value.getFullYear()),A=e.ref("start"),ge=e.ref(null),Le=e.ref(null);function qe(){const I=p.value,O=I.getMonth(),z=I.getFullYear(),ie=O===11?0:O+1,Te=O===11?z+1:z;return{left:{month:O,year:z},right:{month:ie,year:Te}}}const vt=e.ref(null),R=e.ref(null),Y=e.ref(null),_e=e.ref(null),fe=e.ref(null),st=e.ref(null),Ce=new Date().getFullYear(),Ue=e.computed(()=>["single","singleFromAvailable"].includes(M.mode)),Lt=e.computed(()=>["range","rangeFromAvailable"].includes(M.mode)),Pe=e.computed(()=>{if(M.mode!=="single"&&M.mode!=="singleFromAvailable")return null;const I=M.modelValue;return I instanceof Date?I:null}),At=e.computed(()=>{if(!Lt.value)return{start:null,end:null};const I=M.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 pt(I){if(!I||!(I instanceof Date))return"";const O=I.getDate(),z=I.getMonth()+1,ie=I.getFullYear(),Te=rt=>String(rt).padStart(2,"0");return`${Te(O)}/${Te(z)}/${ie}`}const Ct=e.computed(()=>pt(Pe.value)),pl=e.computed(()=>{const{start:I,end:O}=At.value;if(!I&&!O)return"";const z=!O||I&&I<=O?I:O,ie=!I||O&&O>=I?O:I;return W(z,ie)?pt(z):`${pt(z)} - ${pt(ie)}`}),Dt=e.computed(()=>{if(M.mode!=="readonly")return"—";const I=M.modelValue;if(I instanceof Date)return pt(I)||"—";if(I&&typeof I=="object"&&("start"in I||"end"in I)){const O=I.start instanceof Date?I.start:null,z=I.end instanceof Date?I.end:null;if(!O&&!z)return"—";const ie=!z||O&&O<=z?O:z,Te=!O||z&&z>=O?z:O;return W(ie,Te)?pt(ie):`${pt(ie)} - ${pt(Te)}`}return"—"});e.computed(()=>{const I=new Date(xe.value,ve.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const $t=e.computed(()=>Le.value==="left"?de.value:Le.value==="right"?X.value:ve.value),tt=e.computed(()=>Le.value==="left"?ne.value:Le.value==="right"?pe.value:xe.value),It=e.computed(()=>{const I=new Date(xe.value,ve.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ft=e.computed(()=>{const I=new Date(tt.value,$t.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ut=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{month:"short"});return Array.from({length:12},(O,z)=>I.format(new Date(2024,z,1)))}),ft=e.computed(()=>{const O=(Le.value?tt.value:xe.value)-Math.floor(Xo/2);return Array.from({length:Xo},(z,ie)=>O+ie)}),Tt=e.computed(()=>{const I=ft.value;return I.length?`${I[0]} – ${I[I.length-1]}`:""}),lt=e.computed(()=>{const I=new Intl.DateTimeFormat(C.value,{weekday:"short"}),O=new Date(2024,0,1),z=[];for(let ie=0;ie<7;ie++){const Te=new Date(O);Te.setDate(O.getDate()+ie),z.push(I.format(Te).slice(0,2))}return z});function Nt(I,O){const z=new Date(I,O,1),ie=new Date(I,O+1,0),Te=z.getDay(),rt=ie.getDate(),it=[];for(let Ye=0;Ye<Te;Ye++)it.push(null);for(let Ye=1;Ye<=rt;Ye++)it.push(new Date(I,O,Ye));return it}const rl=e.computed(()=>Nt(xe.value,ve.value)),G=e.computed(()=>Nt(ne.value,de.value)),Ve=e.computed(()=>Nt(pe.value,X.value));e.computed(()=>{const I=new Date(ne.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)}),e.computed(()=>{const I=new Date(pe.value,X.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(I)});const Ne=e.computed(()=>{const I=new Date(ne.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),Ie=e.computed(()=>{const I=new Date(pe.value,X.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(I)}),ut=e.computed(()=>M.availableDates&&M.availableDates.length>0),Ze=e.computed(()=>ut.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"}]),et=e.ref({top:0,left:0});function he(){if(!_e.value||!Ee.value)return;const I=_e.value.getBoundingClientRect(),O=window.innerWidth||document.documentElement.clientWidth,z=window.innerHeight||document.documentElement.clientHeight;let ie=I.left,Te=I.bottom+4;const rt=fe.value;if(rt){const it=rt.offsetWidth,Ye=rt.offsetHeight;if(ie+it>O-8&&(ie=I.right-it,ie<8&&(ie=8)),Te+Ye>z-8){const nt=I.top-4-Ye;nt>=8?Te=nt:Te=Math.max(8,z-Ye-8)}}et.value={top:Te,left:ie}}const Ke=e.computed(()=>!_e.value||!Ee.value?{}:{position:"fixed",left:`${et.value.left}px`,top:`${et.value.top}px`,zIndex:1002});function W(I,O){return!I||!O?!1:I.getFullYear()===O.getFullYear()&&I.getMonth()===O.getMonth()&&I.getDate()===O.getDate()}function Z(I){return new Date(I.getFullYear(),I.getMonth(),I.getDate()).getTime()}function j(I){return!M.availableDates||!M.availableDates.length?!0:M.availableDates.some(O=>O instanceof Date&&W(O,I))}function oe(I){const O=Z(I);return!(M.minDate instanceof Date&&O<Z(M.minDate)||M.maxDate instanceof Date&&O>Z(M.maxDate))}function He(I){return!M.exceptDates||!M.exceptDates.length?!1:M.exceptDates.some(O=>O instanceof Date&&W(O,I))}function N(I){return He(I)?!1:["singleFromAvailable","rangeFromAvailable"].includes(M.mode)?j(I):oe(I)}function b(I){const O=Pe.value,z=At.value,ie=Z(I),Te=Lt.value&&z.start&&z.end&&ie>Z(z.start)&&ie<Z(z.end),rt=Lt.value&&z.start&&W(I,z.start),it=Lt.value&&z.end&&W(I,z.end),Ye=rt&&it,nt=Ue.value&&O&&W(I,O)||rt||it;let yl=!1;if(Lt.value&&z.start&&!z.end&&ge.value){const vl=Z(z.start),Nl=Z(ge.value),zl=Math.min(vl,Nl),ql=Math.max(vl,Nl);yl=ie>zl&&ie<ql}return{"dss-datepicker__day--selected":nt&&!Ye,"dss-datepicker__day--range-start":rt&&!Ye,"dss-datepicker__day--range-end":it&&!Ye,"dss-datepicker__day--range-single":Ye,"dss-datepicker__day--in-range":Te&&!rt&&!it,"dss-datepicker__day--in-range-preview":yl&&!rt&&!it&&!Te,"dss-datepicker__day--disabled":!N(I)}}function V(I){if(!Lt.value)return;const O=At.value;if(!O.start||O.end){ge.value=null;return}if(!N(I)){ge.value=null;return}ge.value=new Date(I.getFullYear(),I.getMonth(),I.getDate())}function ee(){ge.value=null}function J(){if(!M.doubleCalendar||!Lt.value)return;const I=At.value,{start:O,end:z}=I;if(O&&z){const rt=O<=z?O:z,it=O<=z?z:O,Ye=rt.getMonth(),nt=rt.getFullYear(),yl=it.getMonth(),vl=it.getFullYear();if(Ye!==yl||nt!==vl){const Nl=de.value===Ye&&ne.value===nt,zl=X.value===yl&&pe.value===vl;if(Nl&&zl)return;de.value=Ye,ne.value=nt,X.value=yl,pe.value=vl}else{const Nl=Ye===0?11:Ye-1,zl=Ye===0?nt-1:nt;de.value===Nl&&ne.value===zl&&X.value===Ye&&pe.value===nt||(de.value=Ye,ne.value=nt,Ye===11?(X.value=0,pe.value=nt+1):(X.value=Ye+1,pe.value=nt))}return}const ie=O||z;if(ie){const rt=ie.getMonth(),it=ie.getFullYear(),Ye=de.value===rt&&ne.value===it,nt=X.value===rt&&pe.value===it;if(Ye||nt)return;de.value=rt,ne.value=it,rt===11?(X.value=0,pe.value=it+1):(X.value=rt+1,pe.value=it);return}const Te=qe();de.value=Te.left.month,ne.value=Te.left.year,X.value=Te.right.month,pe.value=Te.right.year}function Se(I="start"){if(M.mode==="readonly")return;A.value=I;const O=Pe.value,z=At.value;if(Ue.value&&O)ve.value=O.getMonth(),xe.value=O.getFullYear();else if(Lt.value)if(M.doubleCalendar)J();else{const ie=I==="start"&&z.start?z.start:z.end||z.start;ie&&(ve.value=ie.getMonth(),xe.value=ie.getFullYear())}_e.value=Ue.value?vt.value?.closest(".dss-datepicker__input-wrap"):R.value,le.value="days",Le.value=null,Ee.value=!0,e.nextTick(()=>{he()})}function ot(){le.value="days",Le.value=null,ge.value=null,Ee.value=!1}function Be(I,O){Le.value=I,le.value=O}function We(){le.value="days",Le.value=null}function Xe(I){const O=new Date,z=O.getFullYear(),ie=O.getMonth(),Te=O.getDate();let rt,it;if(ut.value){const Ye=[...M.availableDates].filter(nt=>nt instanceof Date).map(nt=>new Date(nt.getFullYear(),nt.getMonth(),nt.getDate()));if(Ye.sort((nt,yl)=>nt.getTime()-yl.getTime()),Ye.length===0)return;if(I==="all")rt=Ye[0],it=Ye[Ye.length-1];else{const nt=parseInt(I.replace("last",""),10);if(nt<2||nt>5)return;const yl=Ye.slice(-nt);rt=yl[0],it=yl[yl.length-1]}}else{const Ye=new Date(z,ie,Te);switch(I){case"today":rt=Ye,it=Ye;break;case"lastWeek":rt=new Date(z,ie,Te-6),it=Ye;break;case"last15Days":rt=new Date(z,ie,Te-14),it=Ye;break;case"last30Days":rt=new Date(z,ie,Te-29),it=Ye;break;case"thisMonth":rt=new Date(z,ie,1),it=Ye;break;case"last3Months":rt=new Date(z,ie-3,1),it=new Date(z,ie,0);break;case"last6Months":rt=new Date(z,ie-6,1),it=new Date(z,ie,0);break;case"last12Months":rt=new Date(z,ie-12,1),it=new Date(z,ie,0);break;case"lastYear":rt=new Date(z-1,0,1),it=new Date(z-1,11,31);break;default:return}}$("update:modelValue",{start:rt,end:it}),J()}function at(I){Le.value==="left"?de.value=I:Le.value==="right"?X.value=I:ve.value=I,We()}function gt(I){Le.value==="left"?ne.value=I:Le.value==="right"?pe.value=I:xe.value=I,We()}function Et(){ve.value===0?(ve.value=11,xe.value--):ve.value--}function Vt(){ve.value===11?(ve.value=0,xe.value++):ve.value++}function kl(){de.value===0?(de.value=11,ne.value--):de.value--}function kt(){de.value===11?(de.value=0,ne.value++):de.value++}function Ht(){X.value===0?(X.value=11,pe.value--):X.value--}function Gl(){X.value===11?(X.value=0,pe.value++):X.value++}function fl(I){if(!N(I))return;const O=new Date(I.getFullYear(),I.getMonth(),I.getDate());if(Ue.value){$("update:modelValue",O),ot();return}const z=At.value;if(!z.start&&!z.end){$("update:modelValue",{start:O,end:null}),A.value="end";return}if(z.start&&z.end){$("update:modelValue",{start:O,end:null}),A.value="end";return}if(A.value==="start"){let ie=O,Te=z.end;ie&&Te&&ie>Te&&([ie,Te]=[Te,ie]),$("update:modelValue",{start:ie||Te,end:Te||ie}),A.value="end"}else{let ie=z.start,Te=O;ie&&Te&&Te<ie&&([ie,Te]=[Te,ie]),$("update:modelValue",{start:ie||Te,end:Te||ie}),A.value="start"}}e.watch(At,()=>{M.doubleCalendar&&Lt.value&&Ee.value&&J()},{deep:!0});let jt=null,Rt=null,Ll=null;function bl(){jt&&(document.removeEventListener("keydown",jt),jt=null),Rt&&(window.removeEventListener("resize",Rt),Rt=null),Ll&&(window.removeEventListener("scroll",Ll,!0),Ll=null)}return e.watch(le,I=>{I==="years"&&e.nextTick(()=>{st.value?.querySelector(`[data-year="${tt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Ee,I=>{bl(),I&&(jt=O=>{O.key==="Escape"&&(le.value==="years"||le.value==="months"?We():ot())},Rt=()=>{he()},Ll=()=>{he()},document.addEventListener("keydown",jt),window.addEventListener("resize",Rt),window.addEventListener("scroll",Ll,!0))}),e.onBeforeUnmount(()=>{bl()}),(I,O)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":L.mode==="readonly"}])},[L.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ia,[O[10]||(O[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Dt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ca)])):Ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:O[0]||(O[0]=z=>Se("start"))},[O[11]||(O[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:vt,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(se)("datepicker.selectDate"),value:Ct.value,readonly:"",disabled:L.mode==="readonly"},null,8,ua)])):Lt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:O[1]||(O[1]=z=>Se("start"))},[O[12]||(O[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:Y,type:"text",class:"dss-datepicker__input",placeholder:M.placeholder||e.unref(se)("datepicker.selectRange"),value:pl.value,readonly:""},null,8,da)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(ot,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:fe,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":L.doubleCalendar&&Lt.value&&le.value==="days","dss-datepicker__dropdown--quick-select":L.doubleCalendar&&Lt.value&&le.value==="days"&&L.quickSelect}]),onClick:O[9]||(O[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ke.value)},[le.value==="days"&&L.doubleCalendar&&Lt.value?(e.openBlock(),e.createElementBlock("div",ma,[L.quickSelect?(e.openBlock(),e.createElementBlock("nav",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ie=>Xe(z.id)},e.toDisplayString(e.unref(se)(z.labelKey)),9,fa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",va,[e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:kl}," ‹ ",8,ya),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[2]||(O[2]=z=>Be("left","months"))},e.toDisplayString(Ne.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[3]||(O[3]=z=>Be("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:kt}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>fl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])]),e.createElementVNode("div",Va,[e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Ht}," ‹ ",8,Na),e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[4]||(O[4]=z=>Be("right","months"))},e.toDisplayString(Ie.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[5]||(O[5]=z=>Be("right","years"))},e.toDisplayString(pe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Gl}," › ",8,Ma)]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>fl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,La)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])])])])):le.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Et}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[6]||(O[6]=z=>le.value="months")},e.toDisplayString(It.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[7]||(O[7]=z=>le.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Vt}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,z=>(e.openBlock(),e.createElementBlock("span",{key:z,class:"dss-datepicker__weekday"},e.toDisplayString(z),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rl.value,(z,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[z?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",b(z)]),disabled:!N(z),onClick:Te=>fl(z),onMouseenter:Te=>V(z),onMouseleave:ee},e.toDisplayString(z.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])],64)):le.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Oa,[e.createElementVNode("div",Za,[e.createElementVNode("span",Wa,e.toDisplayString(Ft.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:O[8]||(O[8]=z=>le.value="years")},e.toDisplayString(tt.value),1)])]),e.createElementVNode("div",qa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(z,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ie===$t.value}]),onClick:Te=>at(ie)},e.toDisplayString(z),11,Ua))),128))])],64)):le.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Xa,[e.createElementVNode("span",Ya,e.toDisplayString(Tt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:st},[e.createElementVNode("div",ja,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.value,z=>(e.openBlock(),e.createElementBlock("button",{key:z,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":z===tt.value,"dss-datepicker__year-cell--current":z===e.unref(Ce)}]),"data-year":z,onClick:ie=>gt(z)},e.toDisplayString(z),11,Ka))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Ga=["data-chart-type"],Qa={class:"dss-chart-header-titles"},Ja={key:0,class:"dss-chart-title"},es={key:1,class:"dss-chart-subtitle"},ts=["onClick","onMouseenter"],ls={class:"dss-legend-text"},ns=["onClick","onMouseenter"],os={class:"dss-legend-text"},as=["title"],ss=["src"],rs={class:"dss-chart-area-wrapper"},is={key:0,class:"dss-chart-z-axis-label"},cs=["width","height","data-smooth","data-animated"],us=["id"],ds=["y","width","height"],ms=["id"],ps=["d"],fs=["id"],vs=["d"],gs={key:0},hs=["clip-path"],ys=["x1","x2","y1","y2"],Cs={class:"dss-axes"},ks=["x1","x2","y1","y2"],bs=["x1","x2","y1","y2"],ws={class:"dss-axis-labels"},xs=["x","y"],Es=["x","y"],Vs=["x","y"],Ss=["y","transform"],Ns={key:1,class:"dss-flag-markers"},Bs=["clip-path"],Ms=["x1","x2","y1","y2","onMouseover"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["cx","cy","onMouseover"],Ts=["cx","cy","fill","onMouseover"],As=["x","y"],Ds=["clip-path"],Hs={key:0},Rs=["d","onMouseover"],Fs=["x","y","width","height","fill","onMouseover"],Is={class:"dss-line-chart"},zs=["d","stroke","stroke-width"],Ps=["d","stroke","stroke-width","opacity"],Os=["cx","cy","r","fill","onMouseover"],Zs={key:1},Ws=["d","stroke","stroke-width"],qs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width","opacity"],Xs=["cx","cy","r","fill","onMouseover"],Ys={key:2},js=["id"],Ks=["x","y","width","height"],Gs=["d","fill","fill-opacity","mask"],Qs=["d","stroke","stroke-width"],Js=["d","fill","onMouseover"],er=["x","y","width","height","onMouseover"],tr=["clip-path"],lr=["x1","x2","y1","y2","stroke"],nr=["cx","cy","r","fill"],or={key:1,class:"dss-bubble-chart"},ar={key:0,class:"dss-bubble-group"},sr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],rr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],ir=["transform"],cr=["cx","cy","r"],ur=["data-chart-type","clip-path"],dr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],mr={key:1,class:"dss-radial-segment-data-labels"},pr=["x","y"],fr=["x","y","font-size","fill"],vr=["x1","y1","x2","y2","stroke"],gr=["x1","y1","x2","y2","stroke"],hr=["x","y","text-anchor","font-size"],yr=["transform"],Cr={key:0,class:"dss-spider-grid"},kr=["cx","cy","r"],br={class:"dss-spider-grid-labels"},wr=["x","y"],xr=["x","y"],Er=["x1","x2","y1","y2"],Vr={class:"dss-spider-labels"},Sr=["x","y","text-anchor","dominant-baseline"],Nr=["points","fill","fill-opacity","stroke","stroke-width"],Br=["cx","cy","r","fill","onMouseover"],Mr={class:"dss-chart-logos"},_r=["cx","cy","r","fill"],$r=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Lr=["onClick","onMouseenter"],Tr=["src"],Ar={class:"dss-marker-tooltip-category"},Dr={key:0,class:"dss-marker-tooltip-description"},Hr={key:0,class:"dss-tooltip-section"},Rr={key:0,class:"dss-tooltip-title"},Fr={class:"dss-tooltip-series-name"},Ir={class:"dss-tooltip-series-value"},zr={key:1,class:"dss-tooltip-section"},Pr={key:0,class:"dss-tooltip-title"},Or={class:"dss-bubble-tooltip-data"},Zr={key:2,class:"dss-tooltip-section"},Wr={class:"dss-tooltip-title"},qr={class:"dss-tooltip-value"},Ur={key:0,class:"dss-tooltip-section"},Xr={class:"dss-tooltip-section-title"},Yr={class:"dss-tooltip-group-header"},jr={class:"dss-tooltip-item-content"},Kr={class:"dss-tooltip-item-text"},Gr={key:1,class:"dss-tooltip-section"},Qr={class:"dss-tooltip-section-title"},Jr={class:"dss-tooltip-item-content"},ei={class:"dss-tooltip-item-title"},ti={key:0,class:"dss-tooltip-item-description"},li={class:"dss-tooltip-section"},ni={class:"dss-tooltip-title"},oi={key:0,class:"dss-bubble-tooltip-data"},ai={class:"dss-tooltip-series-name"},si={class:"dss-tooltip-series-value"},ri={key:0,class:"dss-tooltip-section"},ii={class:"dss-tooltip-section-title"},ci={class:"dss-tooltip-group-header"},ui={class:"dss-tooltip-item-content"},di={class:"dss-tooltip-item-text"},mi={key:1,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-item-content"},vi={class:"dss-tooltip-item-title"},gi={key:0,class:"dss-tooltip-item-description"},hi=["onClick","onMouseenter"],yi={class:"dss-legend-text"},Ci={key:1,class:"dss-context-menu-separator"},ki={key:0,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi=["onClick"],xi=["innerHTML"],Ei={key:0,class:"dss-context-menu-icon"},Vi={class:"dss-marker-modal-header"},Si={class:"dss-marker-modal-body"},Ni={class:"dss-form-group"},Bi={class:"dss-form-group"},Mi={for:"dss-marker-description"},_i={key:0,class:"dss-form-text-display"},$i=["placeholder"],Li={class:"dss-marker-modal-footer"},Ti={class:"modal-footer-left"},Ai={class:"dss-modal-footer-right"},Di=["disabled"],Hi={name:"DSSChart"},Ri=Object.assign(Hi,{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:L=>typeof L=="object"&&L!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(L,{emit:re}){const{t:M,locale:$}=Kn.useI18n(),se=re,C=e.ref(null),Ee=e.ref(null),le=e.ref(null),Ge=e.ref(0),p=e.ref(0);let ve=null,xe=null;const de=20,ne=e.computed(()=>{if(p.value,Ge.value,!C.value||!Ee.value)return 0;try{const t=C.value.getBoundingClientRect();return Ee.value.getBoundingClientRect().top-t.top}catch{return 0}}),X=e.computed(()=>`chart-clip-${A.chartId}`),pe=e.computed(()=>`url(#${X.value})`),A=L,ge={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 Le(t,s){const l=Object.assign({},t);return vt(t)&&vt(s)&&Object.keys(s).forEach(i=>{vt(s[i])?i in t?l[i]=Le(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(pt.value&&(t+=30),Ct.value&&(t+=25),Tt.value&&A.series.length>0){const i=A.series.filter((f,g)=>!bt.value.has(g)).length;if(lt.value==="top"||lt.value==="bottom"){if(Nt.value==="horizontal"){const g=Math.floor(fe.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 vt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Le(ge,A.options)),Y=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),_e=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),fe=e.computed(()=>{const t=R.value;return Y.value?Ge.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),st=e.ref(de),Ce=e.computed(()=>{if(_e.value){const t=Ce.value;return t??Math.max(0,(p.value||400)-st.value*5)}}),Ue=e.computed(()=>{const t=R.value;if(_e.value){const s=Ce.value;return s??Math.max(0,(p.value||400)-st.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Lt=e.computed(()=>{if(_e.value&&Pe.value==="semi-radial"&&Ce.value!=null)return st.value+Ue.value+"px";if(_e.value)return"100%";if(cl.value)return st.value+Ue.value+"px";if(Tt.value&&lt.value==="bottom"){const t=qe();return Ue.value+(t.legendHeight||35)+"px"}return Ue.value+(Tt.value?20:0)+"px"}),Pe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),At=e.computed(()=>{const t=A.series.map(s=>s.type||Pe.value);return new Set(t).size>1}),pt=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),Ct=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),pl=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Dt=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),$t=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),tt=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return on;const s=t.yAxis.min;return typeof s=="number"||s===on?s:on}),It=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return on;const s=t.yAxis.max;return typeof s=="number"||s===on?s:on}),Ft=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Ut=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),ft=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Tt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),lt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Nt=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),rl=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),G=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),Ve=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ne=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ie=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ut=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ze=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),et=e.computed(()=>{if(!cl.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),he=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ke=e.computed(()=>{const{maxX:t}=Wt.value;return t===0}),W=(t,s)=>Ke.value&&s===0?5:s,Z=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},j=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),oe=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),He=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),N=e.computed(()=>{const t=R.value;return oe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),b=e.computed(()=>{const t=R.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),ee=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),J=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Se=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ot=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Be=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),We=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Xe=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),at=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),gt=e.computed(()=>R.value?.spider?.gridSteps||5),Et=e.computed(()=>{const t=[],s=gt.value;for(let l=1;l<=s;l++)t.push(wt.value/s*l);return t}),Vt=t=>{const s=kl.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=Et.value[t];return Math.round(l/wt.value*100)+"%"},kl=e.computed(()=>R.value?.spider?.gridLabels||null),kt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ht=e.computed(()=>{const t=R.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Gl=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),fl=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Nl.value}),jt=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),Rt=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Ll=e.computed(()=>{const s=R.value?.valueFormat?.extension;return typeof s=="string"?s:""}),bl=t=>{const s=Ll.value;if(t==null)return"";const l=String(t);return s?l+s:l},I=e.computed(()=>!K.value.isZooming);e.computed(()=>yt.value.map(t=>{if(t.categoryIndex!==void 0&&(hl.value||Gt.value)){const s=Qt(t.categoryIndex),l=ne.value+P.value.bottom-Rt.value/2;return{...t,x:s,y:l}}return t}));function O(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,w]=t.split("-"),H=Number(w?.length===2?`20${w}`:w);l=new Date(H,Number(E)-1,Number(g))}else return 0;let i=0,f=1/0;return s.forEach((g,E)=>{const[w,H,D]=g.split("-"),F=Number(D?.length===2?`20${D}`:D),B=new Date(F,Number(H)-1,Number(w)),Q=Math.abs(B-l);Q<f&&(f=Q,i=E)}),i}const z=e.computed(()=>{const t=A.markers.map(l=>{const i=O(l.marker_date,A.categories),f=Qt(i),g=ne.value+P.value.bottom-Rt.value/2;return{...l,x:f,y:g,categoryIndex:i,source:"props"}}),s=yt.value.map(l=>{if(l.categoryIndex!==void 0&&(hl.value||Gt.value)){const i=Qt(l.categoryIndex),f=ne.value+P.value.bottom-Rt.value/2;return{...l,x:i,y:f,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ie=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),Te=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),rt=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),it=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Ye=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 f=parseFloat(i)/100;s=t.width*f,l=s*(96/499)}else{const f=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(f/25),l=s*(96/499)}return{width:s,height:l,area:t}}),nt=e.computed(()=>{const{width:t,height:s}=Ye.value,l=it.value;let i,f;const g=P.value.left,E=P.value.right,w=P.value.top,H=P.value.bottom,D=P.value.width,F=P.value.height;switch(l){case"center":i=g+(D-t)/2,f=w+(F-s)/2;break;case"top-left":i=g+15,f=w+5;break;case"top-right":i=E-t-15,f=w+5;break;case"bottom-left":i=g+15,f=H-s-5;break;case"bottom-right":default:i=E-t-15,f=H-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:f+"px",backgroundSize:`${t}px ${s}px`}}),yl=t=>!A.flags||!A.flags.length?[]:A.flags.filter(s=>s.categoryIndex===t),vl=t=>{const s=yl(t),l=$n(t),i=s.filter(E=>E.manual),f=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:M("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(E=>({text:E.text,color:"#698dbe"}))}),f.length>0&&g.push({type:M("chart.tooltip.autoFlags"),color:"#a1d499",flags:f.map(E=>({text:E.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(E=>({title:E.title,description:E.description,type:M("chart.tooltip.markers"),color:E.color||"#9784ba"}))}},Nl=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">
2
2
  <path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
3
3
  <path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
4
4
  <path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
@@ -41,8 +41,8 @@
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)}`}),ql=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),vn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const rn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Nn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),eo=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Rn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Fn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Bn=e.computed(()=>{const s=R.value?.radialBar?.dataCenter;return Pl.value&&s&&(s.show===!0||s.enabled===!0)}),Bl=e.computed(()=>{if(!Bn.value||!n.value.length)return"";const l=R.value?.radialBar?.dataCenter?.showValueOnly===!0?n.value[0]?.value??0:n.value.reduce((i,f)=>i+(f.value??0),0);return bl(l)}),In=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Ul=e.computed(()=>({x:Bt.value,y:Mt.value-In.value/2})),il=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Tl=e.computed(()=>{if(!Rn.value||!hl.value||!n.value.length)return[];const t=Fn.value*Math.PI/180,s=(ll.value+wt.value)/2;return n.value.map(l=>{const f=l.endAngle-l.startAngle>=t&&!l.isHidden,g=Bt.value+Math.cos(l.midAngle)*s,E=Mt.value+Math.sin(l.midAngle)*s;return{value:bl(l.value),x:g,y:E,show:f,color:l.color,contrastColor:Fo(l.color)}})}),wl=e.computed(()=>{if(!A.flags||!A.flags.length)return[];const t=new Map;return A.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),f=l.filter(E=>E.manual),g=l.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:f.length,autoCount:g.length,totalCount:l.length,hasManual:f.length>0,hasAuto:g.length>0,texts:l.map(E=>E.text).join(`
45
- `)}})}),cn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Mn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),gn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),zn=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),bt=e.ref(new Set),ye=e.ref(null),Ql=e.ref(!1),Ae=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),ct=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Je=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),K=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),yt=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return jt.value&&t.push(...Object.keys(jt.value)),t}),e.computed(()=>{if(!A.categories||A.categories.length===0){const{maxX:t}=Wt.value;return Array.from({length:t+1},(s,l)=>M("chart.fallback.item",{number:l+1}))}return A.categories});const _n=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[0],[s,l,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;return!g||!l||!f?null:new Date(f,E,g)}),Ml=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[A.categories.length-1],[s,l,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;return!g||!l||!f?null:new Date(f,E,g)}),El=e.computed(()=>De.value.editingMarkerId!==null),Xl=e.computed(()=>De.value.readonly),wn=t=>{bt.value.has(t)||(uo.value=!0,ye.value=t)},xl=()=>{uo.value=!1,ye.value=null},Cl=t=>{if(Vn.value||Hn.value){Je.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,f=t.clientY-l.top,g=Gt.value?i>=P.value.left-50&&i<=P.value.right+50&&f>=P.value.top-50&&f<=P.value.bottom+100:i>=P.value.left&&i<=P.value.right&&f>=P.value.top&&f<=P.value.bottom;if(Ql.value=g,Gt.value){if(!G.value||!g||K.value.isDragging||K.value.isZooming){Je.value.show=!1;return}if(Dn.value.find(ae=>!ae||ae.isHidden?!1:Math.sqrt(Math.pow(ae.x-i,2)+Math.pow(ae.y-f,2))<=ae.radius+3))Je.value.show=!1;else{const ae=Dn.value.filter(me=>!me||me.isHidden?!1:Math.sqrt(Math.pow(me.x-i,2)+Math.pow(me.y-f,2))<=250);if(ae.length>0){let me=ae[0],we=Math.sqrt(Math.pow(me.x-i,2)+Math.pow(me.y-f,2));ae.forEach(ze=>{const $e=Math.sqrt(Math.pow(ze.x-i,2)+Math.pow(ze.y-f,2));$e<we&&(we=$e,me=ze)});const ce=30,je=Dn.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-me.x)<=ce).sort((ze,$e)=>ze.y-$e.y);Je.value={show:!0,x:me.x,categoryIndex:Math.round(me.originalX),data:(()=>{const ze=Mn.value,$e=gn.value,Me=[];return je.forEach(Fe=>{ze.forEach(St=>{const _t=$e[St]||St,$l=h(St,Fe);$l&&Me.push({seriesName:Fe.seriesName,label:Fe.label,value:`${_t}: ${$l}`,color:Fe.color,y:Fe.y})})}),Me})()}}else Je.value.show=!1}return}if(K.value.isDragging&&K.value.scale>1&&gl.value&&Ne.value){Je.value.show=!1;const Oe=t.clientX-K.value.lastMouseX,{minX:ae,maxX:me}=Wt.value,we=me-ae||1,je=Oe*.8;K.value.offsetX+=je;const ze=we/K.value.scale,$e=we-ze,Me=0,Fe=-$e/we*P.value.width,St=Me;K.value.offsetX=Math.max(Fe,Math.min(St,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY;return}if(!G.value||!gl.value||K.value.isDragging||K.value.isZooming||!g){Je.value.show=!1;return}const{minX:E,maxX:w}=Wt.value,H=w-E||1,D=H/K.value.scale,F=E-K.value.offsetX/P.value.width*H,B=(i-P.value.left)/P.value.width,Q=F+B*D,ke=Math.round(Q);if(ke>=0&&ke<=w){const Oe=Qt(ke),ae=Cn.value.map((me,we)=>{const ce=A.series.findIndex(ze=>ze===me),je=me.data[ke];return{seriesName:me.name,value:je!==void 0?je:null,color:Pt(ce),y:je!==void 0?ul(je):null}}).filter(me=>me.value!==null);Je.value={show:!0,x:Oe,categoryIndex:ke,data:ae}}},Pn=()=>{Je.value.show=!1,Ql.value=!1,Hn.value=!1,Vn.value||(cn.value.show=!1),K.value.isDragging&&(K.value.isDragging=!1),K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1,setTimeout(()=>{ye.value=null,Ae.value.show=!1},150)},Ot=t=>{if(t.preventDefault(),t.stopPropagation(),!kt.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(hl.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const f=Math.max(0,P.value.left-20),g=P.value.right,E=P.value.top,w=P.value.bottom+80;l>=f&&l<=g&&i>=E&&i<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const H=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,F=P.value.width/kn.value.length,B=Math.floor(H/F);B>=0&&B<kn.value.length&&(ht.value.categoryIndex=B)}))},vl=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ht.value.show=!1}},hn=t=>{if(typeof t.template=="function"){const s={series:A.series,categories:A.categories,markers:yt.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},On=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Zn=t=>t.style||{},Kt=t=>t.type&&jt.value[t.type]?jt.value[t.type]:t.customIcon?t.customIcon:pl.value,Al=t=>t==null?"":A.categories&&A.categories[t]?A.categories[t]:"",$n=t=>yt.value.length?yt.value.filter(s=>s.categoryIndex===t):[],Ln=t=>{if(!gl.value&&!Gt.value)return{x:0,y:0};const s=Qt(t),l=ne.value+P.value.bottom-Rt.value/2;return{x:s,y:l}},k=()=>{yt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(gl.value||Gt.value)){const s=Ln(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(El.value){const t=yt.value.findIndex(s=>s.id===De.value.editingMarkerId);t!==-1?(yt.value[t].description=De.value.description||"",yt.value[t].color=De.value.color||"",yt.value[t].type=De.value.type||"default",se("update-marker",yt.value[t])):se("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=O(De.value.date,A.categories||[]);if(Gt.value){const{maxX:E}=Wt.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else gl.value&&(s=Math.max(0,Math.min(s,Wt.value.maxX)));const l=Qt(s),i=ne.value+P.value.bottom-Rt.value/2,f=Array.isArray(A.categories)?A.categories[s]:null,g={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:f||null};De.value.categoryIndex=s,yt.value.push(g),se("add-marker",g)}x(),xt()}},x=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},q=()=>{El.value&&(ue(De.value.editingMarkerId),x())},ue=t=>{const s=yt.value.findIndex(l=>l.id===t);s!==-1&&(yt.value.splice(s,1),xt()),se("delete-marker",t)},Qe=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;g&&l&&f?De.value.date=new Date(f,E,g):De.value.date=null}else De.value.date=null},xt=()=>{try{const t=`dss-chart-markers-${A.chartId}`;localStorage.setItem(t,JSON.stringify(yt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Jt=()=>{try{const t=`dss-chart-markers-${A.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(yt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),yt.value=[]}},zt=t=>{const s=pt.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}`},el=()=>{const t=Je.value.show,s=Ae.value.show;return Je.value.show=!1,Ae.value.show=!1,{originalCrosshair:t,originalTooltip:s}},tl=t=>{Je.value.show=t.originalCrosshair,Ae.value.show=t.originalTooltip},Yl=async(t,s=32,l=32)=>new Promise((i,f)=>{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"),H=w.getContext("2d");w.width=s,w.height=l,H.fillStyle="#fafafa",H.fillRect(0,0,s,l),H.drawImage(g,0,0,s,l);const D=w.toDataURL("image/png");i(D)}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}),_l=async()=>{try{const t=el();setTimeout(async()=>{try{const s=Ee.value;if(!s){console.error("Chart SVG element not found"),tl(t);return}const l=qe(),i=fe.value,f=Ue.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(ce=>ce.remove());const w=g.querySelectorAll("image"),H=Array.from(w).map(async ce=>{const je=ce.getAttribute("xlink:href")||ce.getAttribute("href");if(je&&!je.startsWith("data:"))try{const ze=await Yl(je,32,32);ce.setAttribute("xlink:href",ze),ce.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(H);const F=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",Q=30;if(pt.value&&(B+=`
44
+ </svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),ql=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),vn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const rn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Nn=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),eo=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Rn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Fn=e.computed(()=>{const s=R.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),Bn=e.computed(()=>{const s=R.value?.radialBar?.dataCenter;return Pl.value&&s&&(s.show===!0||s.enabled===!0)}),Bl=e.computed(()=>{if(!Bn.value||!n.value.length)return"";const l=R.value?.radialBar?.dataCenter?.showValueOnly===!0?n.value[0]?.value??0:n.value.reduce((i,f)=>i+(f.value??0),0);return bl(l)}),In=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Ul=e.computed(()=>({x:Bt.value,y:Mt.value-In.value/2})),il=e.computed(()=>{const s=R.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Tl=e.computed(()=>{if(!Rn.value||!cl.value||!n.value.length)return[];const t=Fn.value*Math.PI/180,s=(ll.value+wt.value)/2;return n.value.map(l=>{const f=l.endAngle-l.startAngle>=t&&!l.isHidden,g=Bt.value+Math.cos(l.midAngle)*s,E=Mt.value+Math.sin(l.midAngle)*s;return{value:bl(l.value),x:g,y:E,show:f,color:l.color,contrastColor:Fo(l.color)}})}),wl=e.computed(()=>{if(!A.flags||!A.flags.length)return[];const t=new Map;return A.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),f=l.filter(E=>E.manual),g=l.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:f.length,autoCount:g.length,totalCount:l.length,hasManual:f.length>0,hasAuto:g.length>0,texts:l.map(E=>E.text).join(`
45
+ `)}})}),cn=e.ref({show:!1,x:0,y:0,content:"",count:0}),Mn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),gn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),zn=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),bt=e.ref(new Set),ye=e.ref(null),Ql=e.ref(!1),Ae=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),ct=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Je=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ht=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),K=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),yt=e.ref([]),De=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return jt.value&&t.push(...Object.keys(jt.value)),t}),e.computed(()=>{if(!A.categories||A.categories.length===0){const{maxX:t}=Wt.value;return Array.from({length:t+1},(s,l)=>M("chart.fallback.item",{number:l+1}))}return A.categories});const _n=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[0],[s,l,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;return!g||!l||!f?null:new Date(f,E,g)}),Ml=e.computed(()=>{if(!A.categories||A.categories.length===0)return null;const t=A.categories[A.categories.length-1],[s,l,i]=String(t).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;return!g||!l||!f?null:new Date(f,E,g)}),El=e.computed(()=>De.value.editingMarkerId!==null),Xl=e.computed(()=>De.value.readonly),wn=t=>{bt.value.has(t)||(uo.value=!0,ye.value=t)},xl=()=>{uo.value=!1,ye.value=null},Cl=t=>{if(Vn.value||Hn.value){Je.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,f=t.clientY-l.top,g=Gt.value?i>=P.value.left-50&&i<=P.value.right+50&&f>=P.value.top-50&&f<=P.value.bottom+100:i>=P.value.left&&i<=P.value.right&&f>=P.value.top&&f<=P.value.bottom;if(Ql.value=g,Gt.value){if(!G.value||!g||K.value.isDragging||K.value.isZooming){Je.value.show=!1;return}if(Dn.value.find(ae=>!ae||ae.isHidden?!1:Math.sqrt(Math.pow(ae.x-i,2)+Math.pow(ae.y-f,2))<=ae.radius+3))Je.value.show=!1;else{const ae=Dn.value.filter(me=>!me||me.isHidden?!1:Math.sqrt(Math.pow(me.x-i,2)+Math.pow(me.y-f,2))<=250);if(ae.length>0){let me=ae[0],we=Math.sqrt(Math.pow(me.x-i,2)+Math.pow(me.y-f,2));ae.forEach(ze=>{const $e=Math.sqrt(Math.pow(ze.x-i,2)+Math.pow(ze.y-f,2));$e<we&&(we=$e,me=ze)});const ce=30,je=Dn.value.filter(ze=>!ze||ze.isHidden?!1:Math.abs(ze.x-me.x)<=ce).sort((ze,$e)=>ze.y-$e.y);Je.value={show:!0,x:me.x,categoryIndex:Math.round(me.originalX),data:(()=>{const ze=Mn.value,$e=gn.value,Me=[];return je.forEach(Fe=>{ze.forEach(St=>{const _t=$e[St]||St,$l=h(St,Fe);$l&&Me.push({seriesName:Fe.seriesName,label:Fe.label,value:`${_t}: ${$l}`,color:Fe.color,y:Fe.y})})}),Me})()}}else Je.value.show=!1}return}if(K.value.isDragging&&K.value.scale>1&&hl.value&&Ne.value){Je.value.show=!1;const Oe=t.clientX-K.value.lastMouseX,{minX:ae,maxX:me}=Wt.value,we=me-ae||1,je=Oe*.8;K.value.offsetX+=je;const ze=we/K.value.scale,$e=we-ze,Me=0,Fe=-$e/we*P.value.width,St=Me;K.value.offsetX=Math.max(Fe,Math.min(St,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY;return}if(!G.value||!hl.value||K.value.isDragging||K.value.isZooming||!g){Je.value.show=!1;return}const{minX:E,maxX:w}=Wt.value,H=w-E||1,D=H/K.value.scale,F=E-K.value.offsetX/P.value.width*H,B=(i-P.value.left)/P.value.width,Q=F+B*D,ke=Math.round(Q);if(ke>=0&&ke<=w){const Oe=Qt(ke),ae=Cn.value.map((me,we)=>{const ce=A.series.findIndex(ze=>ze===me),je=me.data[ke];return{seriesName:me.name,value:je!==void 0?je:null,color:Pt(ce),y:je!==void 0?dl(je):null}}).filter(me=>me.value!==null);Je.value={show:!0,x:Oe,categoryIndex:ke,data:ae}}},Pn=()=>{Je.value.show=!1,Ql.value=!1,Hn.value=!1,Vn.value||(cn.value.show=!1),K.value.isDragging&&(K.value.isDragging=!1),K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1,setTimeout(()=>{ye.value=null,Ae.value.show=!1},150)},Ot=t=>{if(t.preventDefault(),t.stopPropagation(),!kt.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(cl.value){ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null});return}const f=Math.max(0,P.value.left-20),g=P.value.right,E=P.value.top,w=P.value.bottom+80;l>=f&&l<=g&&i>=E&&i<=w&&(ht.value.show=!1,e.nextTick(()=>{ht.value.show=!0,ht.value.x=t.clientX,ht.value.y=t.clientY,ht.value.categoryIndex=null;const H=Math.max(P.value.left,Math.min(l,P.value.right))-P.value.left,F=P.value.width/kn.value.length,B=Math.floor(H/F);B>=0&&B<kn.value.length&&(ht.value.categoryIndex=B)}))},gl=t=>{if(!(t&&t.button===2)){if(ht.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ht.value.show=!1}},hn=t=>{if(typeof t.template=="function"){const s={series:A.series,categories:A.categories,markers:yt.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:ht.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},On=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Zn=t=>t.style||{},Kt=t=>t.type&&jt.value[t.type]?jt.value[t.type]:t.customIcon?t.customIcon:fl.value,Al=t=>t==null?"":A.categories&&A.categories[t]?A.categories[t]:"",$n=t=>yt.value.length?yt.value.filter(s=>s.categoryIndex===t):[],Ln=t=>{if(!hl.value&&!Gt.value)return{x:0,y:0};const s=Qt(t),l=ne.value+P.value.bottom-Rt.value/2;return{x:s,y:l}},k=()=>{yt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(hl.value||Gt.value)){const s=Ln(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(De.value.description&&De.value.description.length&&De.value.date){if(El.value){const t=yt.value.findIndex(s=>s.id===De.value.editingMarkerId);t!==-1?(yt.value[t].description=De.value.description||"",yt.value[t].color=De.value.color||"",yt.value[t].type=De.value.type||"default",se("update-marker",yt.value[t])):se("update-marker",{id:De.value.editingMarkerId,description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=O(De.value.date,A.categories||[]);if(Gt.value){const{maxX:E}=Wt.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else hl.value&&(s=Math.max(0,Math.min(s,Wt.value.maxX)));const l=Qt(s),i=ne.value+P.value.bottom-Rt.value/2,f=Array.isArray(A.categories)?A.categories[s]:null,g={id:t,title:"",description:De.value.description||"",color:De.value.color||"",type:De.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:f||null};De.value.categoryIndex=s,yt.value.push(g),se("add-marker",g)}x(),xt()}},x=()=>{De.value.show=!1,De.value.title="",De.value.description="",De.value.color="#FF6B6B",De.value.type="default",De.value.editingMarkerId=null,De.value.readonly=!1,De.value.categoryIndex=null,De.value.fromButton=!1,De.value.date=null},q=()=>{El.value&&(ue(De.value.editingMarkerId),x())},ue=t=>{const s=yt.value.findIndex(l=>l.id===t);s!==-1&&(yt.value.splice(s,1),xt()),se("delete-marker",t)},Qe=t=>{if(De.value.show=!0,De.value.title=t?.title??t?.comment??"",De.value.description=t?.description??t?.comment??"",De.value.color=t?.color??"",De.value.type=t?.type??"default",De.value.editingMarkerId=t?.id??t?.marker_id??null,De.value.readonly=t?.readonly??!1,De.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),f=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(l)-1;g&&l&&f?De.value.date=new Date(f,E,g):De.value.date=null}else De.value.date=null},xt=()=>{try{const t=`dss-chart-markers-${A.chartId}`;localStorage.setItem(t,JSON.stringify(yt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Jt=()=>{try{const t=`dss-chart-markers-${A.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(yt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),yt.value=[]}},zt=t=>{const s=pt.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}`},el=()=>{const t=Je.value.show,s=Ae.value.show;return Je.value.show=!1,Ae.value.show=!1,{originalCrosshair:t,originalTooltip:s}},tl=t=>{Je.value.show=t.originalCrosshair,Ae.value.show=t.originalTooltip},Yl=async(t,s=32,l=32)=>new Promise((i,f)=>{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"),H=w.getContext("2d");w.width=s,w.height=l,H.fillStyle="#fafafa",H.fillRect(0,0,s,l),H.drawImage(g,0,0,s,l);const D=w.toDataURL("image/png");i(D)}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}),_l=async()=>{try{const t=el();setTimeout(async()=>{try{const s=Ee.value;if(!s){console.error("Chart SVG element not found"),tl(t);return}const l=qe(),i=fe.value,f=Ue.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(ce=>ce.remove());const w=g.querySelectorAll("image"),H=Array.from(w).map(async ce=>{const je=ce.getAttribute("xlink:href")||ce.getAttribute("href");if(je&&!je.startsWith("data:"))try{const ze=await Yl(je,32,32);ce.setAttribute("xlink:href",ze),ce.setAttribute("href",ze)}catch(ze){console.warn("Failed to convert logo to base64:",ze)}});await Promise.all(H);const F=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",Q=30;if(pt.value&&(B+=`
46
46
  <text x="24" y="${Q}"
47
47
  font-family="Arial, sans-serif"
48
48
  font-size="18"
@@ -89,18 +89,18 @@
89
89
  ${F}
90
90
  ${ke}
91
91
  </g>
92
- </svg>`,ae=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),me=URL.createObjectURL(ae),we=document.createElement("a");we.href=me,we.download=zt("svg"),document.body.appendChild(we),we.click(),document.body.removeChild(we),URL.revokeObjectURL(me),tl(t),vl()}catch(s){console.error("Error downloading SVG:",s),tl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},to=async()=>{try{const t=el();C.value&&C.value.offsetHeight,await new Promise(ce=>setTimeout(ce,300));const s=qe(),l=fe.value,i=Ue.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),E=2;f.width=l*E,f.height=i*E,f.style.width=l+"px",f.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let w=30;if(pt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(pt.value,24,w),w+=30),Ct.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Ct.value,24,w),w+=25),Tt.value&&A.series.length>0){let ce=l-200,je=pt.value||Ct.value?35:25;const ze=Math.floor((l-250)/120);let $e=0;g.font="12px Arial, sans-serif",A.series.forEach((Me,Fe)=>{if(!bt.value.has(Fe)){const St=Pt(Fe);g.beginPath(),g.arc(ce+6,je-4,6,0,2*Math.PI),g.fillStyle=St,g.fill(),g.fillStyle="#333",g.fillText(Me.name,ce+18,je),$e++,$e%ze===0?(ce=l-200,je+=20):ce+=Math.min(120,Me.name.length*8+35)}})}const D=Ee.value.cloneNode(!0),F=D.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=D.querySelectorAll(".dss-crosshair"),Q=D.querySelectorAll('[class*="tooltip"]');F.forEach(ce=>ce.remove()),B.forEach(ce=>ce.remove()),Q.forEach(ce=>ce.remove()),D.querySelectorAll("image").forEach((ce,je)=>{const ze=ce.getAttribute("xlink:href")||ce.getAttribute("href");if(ze&&!ze.startsWith("data:")){const $e=qt.value[je],Me=$e?Pt($e.seriesIndex):"#3B82F6",Fe=ce.getAttribute("x")||0,St=ce.getAttribute("y")||0,_t=ce.getAttribute("width")||32,$l=ce.getAttribute("height")||32,Yt=document.createElementNS("http://www.w3.org/2000/svg","circle");Yt.setAttribute("cx",parseFloat(Fe)+parseFloat(_t)/2),Yt.setAttribute("cy",parseFloat(St)+parseFloat($l)/2),Yt.setAttribute("r",Math.min(parseFloat(_t),parseFloat($l))/2-1),Yt.setAttribute("fill",Me),Yt.setAttribute("stroke","#fafafa"),Yt.setAttribute("stroke-width","2"),ce.parentNode.replaceChild(Yt,ce)}});const Oe=new XMLSerializer().serializeToString(D),ae=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),me=URL.createObjectURL(ae),we=new Image;return new Promise((ce,je)=>{we.onload=async()=>{try{if(g.drawImage(we,0,s.height),qt.value.forEach(ze=>{const $e=ze.x,Me=ze.y+s.height,Fe=(ze.width||32)/2,St=Pt(ze.seriesIndex);g.save(),g.beginPath(),g.arc($e,Me,Fe-1,0,2*Math.PI),g.fillStyle=St,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),ie.value){const ze=new Image,$e=()=>{const{width:Fe,height:St}=Ye.value,_t=it.value,$l=P.value.left,Yt=P.value.right,Wl=P.value.top,So=P.value.bottom,sa=P.value.width,ra=P.value.height;let Yn,jn;switch(_t){case"center":Yn=$l+(sa-Fe)/2,jn=Wl+s.height+(ra-St)/2;break;case"top-left":Yn=$l+15,jn=Wl+s.height+10;break;case"top-right":Yn=Yt-Fe-5,jn=Wl+s.height+10;break;case"bottom-left":Yn=$l+15,jn=So+s.height-St-5;break;case"bottom-right":default:Yn=Yt-Fe-5,jn=So+s.height-St-5;break}g.globalAlpha=Te.value,g.drawImage(ze,Yn,jn,Fe,St),g.globalAlpha=1,Me()},Me=()=>{f.toBlob(Fe=>{const St=URL.createObjectURL(Fe),_t=document.createElement("a");_t.href=St,_t.download=zt("png"),document.body.appendChild(_t),_t.click(),document.body.removeChild(_t),URL.revokeObjectURL(St),URL.revokeObjectURL(me),tl(t),vl(),ce()},"image/png")};ze.onload=$e,ze.onerror=Me,ze.src=zl.value}else f.toBlob(ze=>{const $e=URL.createObjectURL(ze),Me=document.createElement("a");Me.href=$e,Me.download=zt("png"),document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL($e),URL.revokeObjectURL(me),tl(t),vl(),ce()},"image/png")}catch(ze){URL.revokeObjectURL(me),tl(t),je(ze)}},we.onerror=()=>{URL.revokeObjectURL(me),tl(t),je(new Error("Failed to load SVG image"))},we.src=me})}catch(t){console.error("Error downloading PNG:",t)}},Tn=()=>{try{let t="";pt.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${pt.value}
92
+ </svg>`,ae=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),me=URL.createObjectURL(ae),we=document.createElement("a");we.href=me,we.download=zt("svg"),document.body.appendChild(we),we.click(),document.body.removeChild(we),URL.revokeObjectURL(me),tl(t),gl()}catch(s){console.error("Error downloading SVG:",s),tl(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},to=async()=>{try{const t=el();C.value&&C.value.offsetHeight,await new Promise(ce=>setTimeout(ce,300));const s=qe(),l=fe.value,i=Ue.value+s.height,f=document.createElement("canvas"),g=f.getContext("2d"),E=2;f.width=l*E,f.height=i*E,f.style.width=l+"px",f.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let w=30;if(pt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(pt.value,24,w),w+=30),Ct.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Ct.value,24,w),w+=25),Tt.value&&A.series.length>0){let ce=l-200,je=pt.value||Ct.value?35:25;const ze=Math.floor((l-250)/120);let $e=0;g.font="12px Arial, sans-serif",A.series.forEach((Me,Fe)=>{if(!bt.value.has(Fe)){const St=Pt(Fe);g.beginPath(),g.arc(ce+6,je-4,6,0,2*Math.PI),g.fillStyle=St,g.fill(),g.fillStyle="#333",g.fillText(Me.name,ce+18,je),$e++,$e%ze===0?(ce=l-200,je+=20):ce+=Math.min(120,Me.name.length*8+35)}})}const D=Ee.value.cloneNode(!0),F=D.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=D.querySelectorAll(".dss-crosshair"),Q=D.querySelectorAll('[class*="tooltip"]');F.forEach(ce=>ce.remove()),B.forEach(ce=>ce.remove()),Q.forEach(ce=>ce.remove()),D.querySelectorAll("image").forEach((ce,je)=>{const ze=ce.getAttribute("xlink:href")||ce.getAttribute("href");if(ze&&!ze.startsWith("data:")){const $e=qt.value[je],Me=$e?Pt($e.seriesIndex):"#3B82F6",Fe=ce.getAttribute("x")||0,St=ce.getAttribute("y")||0,_t=ce.getAttribute("width")||32,$l=ce.getAttribute("height")||32,Yt=document.createElementNS("http://www.w3.org/2000/svg","circle");Yt.setAttribute("cx",parseFloat(Fe)+parseFloat(_t)/2),Yt.setAttribute("cy",parseFloat(St)+parseFloat($l)/2),Yt.setAttribute("r",Math.min(parseFloat(_t),parseFloat($l))/2-1),Yt.setAttribute("fill",Me),Yt.setAttribute("stroke","#fafafa"),Yt.setAttribute("stroke-width","2"),ce.parentNode.replaceChild(Yt,ce)}});const Oe=new XMLSerializer().serializeToString(D),ae=new Blob([Oe],{type:"image/svg+xml;charset=utf-8"}),me=URL.createObjectURL(ae),we=new Image;return new Promise((ce,je)=>{we.onload=async()=>{try{if(g.drawImage(we,0,s.height),qt.value.forEach(ze=>{const $e=ze.x,Me=ze.y+s.height,Fe=(ze.width||32)/2,St=Pt(ze.seriesIndex);g.save(),g.beginPath(),g.arc($e,Me,Fe-1,0,2*Math.PI),g.fillStyle=St,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),ie.value){const ze=new Image,$e=()=>{const{width:Fe,height:St}=Ye.value,_t=it.value,$l=P.value.left,Yt=P.value.right,Wl=P.value.top,So=P.value.bottom,sa=P.value.width,ra=P.value.height;let Yn,jn;switch(_t){case"center":Yn=$l+(sa-Fe)/2,jn=Wl+s.height+(ra-St)/2;break;case"top-left":Yn=$l+15,jn=Wl+s.height+10;break;case"top-right":Yn=Yt-Fe-5,jn=Wl+s.height+10;break;case"bottom-left":Yn=$l+15,jn=So+s.height-St-5;break;case"bottom-right":default:Yn=Yt-Fe-5,jn=So+s.height-St-5;break}g.globalAlpha=Te.value,g.drawImage(ze,Yn,jn,Fe,St),g.globalAlpha=1,Me()},Me=()=>{f.toBlob(Fe=>{const St=URL.createObjectURL(Fe),_t=document.createElement("a");_t.href=St,_t.download=zt("png"),document.body.appendChild(_t),_t.click(),document.body.removeChild(_t),URL.revokeObjectURL(St),URL.revokeObjectURL(me),tl(t),gl(),ce()},"image/png")};ze.onload=$e,ze.onerror=Me,ze.src=zl.value}else f.toBlob(ze=>{const $e=URL.createObjectURL(ze),Me=document.createElement("a");Me.href=$e,Me.download=zt("png"),document.body.appendChild(Me),Me.click(),document.body.removeChild(Me),URL.revokeObjectURL($e),URL.revokeObjectURL(me),tl(t),gl(),ce()},"image/png")}catch(ze){URL.revokeObjectURL(me),tl(t),je(ze)}},we.onerror=()=>{URL.revokeObjectURL(me),tl(t),je(new Error("Failed to load SVG image"))},we.src=me})}catch(t){console.error("Error downloading PNG:",t)}},Tn=()=>{try{let t="";pt.value&&(t+=`# ${M("chart.csv.chartTitle")}: ${pt.value}
93
93
  `),Ct.value&&(t+=`# ${M("chart.csv.chartSubtitle")}: ${Ct.value}
94
94
  `),t+=`# ${M("chart.csv.generated")}: ${new Date().toLocaleString()}
95
95
 
96
96
  `,t+="Category",A.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
97
97
  `;const s=Math.max(...A.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let H='"'+(A.categories[g]||M("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';A.series.forEach(D=>{const F=D.data&&D.data[g]!==void 0?D.data[g]:"";H+=","+F}),t+=H+`
98
- `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),f=document.createElement("a");f.href=i,f.download=zt("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(i),vl()}catch(t){console.error("Error downloading CSV:",t)}},Lo=t=>{if(typeof t.action=="function"){const s={series:A.series,categories:A.categories,markers:yt.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(s,l)}vl()},mo=()=>{x(),De.value.show=!0,De.value.categoryIndex=ht.value.categoryIndex,De.value.fromButton=!1,vl()},po=()=>{x(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},fo=t=>{if(ht.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ht.value.show=!1)}},lo=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},no=t=>{if(!gl.value||!Ne.value)return;t.preventDefault(),t.stopPropagation(),K.value.isZooming=!0,Je.value.show=!1,K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,f=t.clientY-l.top;if(i<P.value.left-50||i>P.value.right+50||f<P.value.top-50||f>P.value.bottom+100){K.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(K.value.minScale,Math.min(K.value.maxScale,K.value.scale*g));if(E!==K.value.scale){const{minX:w,maxX:H}=Wt.value,D=H-w||1,F=D/K.value.scale,B=w-K.value.offsetX/P.value.width*D,Q=(i-P.value.left)/P.value.width,ke=B+Q*F;K.value.scale=E;const Oe=D/K.value.scale,ae=ke-Q*Oe;K.value.offsetX=-(ae-w)/D*P.value.width,K.value.scale<=1.01&&(K.value.scale=1,K.value.offsetX=0)}K.value.zoomTimeout=setTimeout(()=>{K.value.isZooming=!1,K.value.zoomTimeout=null},300)},To=t=>{if(!gl.value||!Ne.value||K.value.scale<=1)return;Je.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,K.value.isDragging=!0,K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY,t.preventDefault()},Ao=()=>{K.value.isDragging=!1},oo=()=>{!gl.value||!Ne.value||(K.value.scale=1,K.value.offsetX=0,K.value.isDragging=!1,K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1)},ao=()=>!gl.value||!Ql.value||!Ne.value?"default":K.value.isDragging?"grabbing":K.value.scale>1?"grab":"dss-crosshair",Wn=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)],f=t[l],g=t[l+1],E=t[Math.min(l+2,t.length-1)],w=f.x+(g.x-i.x)/6*He.value,H=f.y+(g.y-i.y)/6*He.value,D=g.x-(E.x-f.x)/6*He.value,F=g.y-(E.y-f.y)/6*He.value;s+=` C ${w} ${H} ${D} ${F} ${g.x} ${g.y}`}return s},Vl=e.computed(()=>{const s=R.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,f=50;let g=f+(Dt.value?30:0)+60;if(Jl.value){const B={left:f+40,top:f+40,right:f+40,bottom:f+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(hl.value){const B=!Tt.value,Q=ql.value,ke=Q?rn.value+Nn.value+Math.max(24,vn.value+16):0,Oe=B?12:f;let ae=0;pt.value&&(ae+=B?8:15),Ct.value&&(ae+=B?6:10);const me=qe();let we=Oe+(B?4:16)+(Q?ke:0),ce=Oe+(Q?ke:0);Tt.value&&lt.value==="left"?we+=me.legendWidth||150:Tt.value&&lt.value==="right"&&(ce+=me.legendWidth||150);const ze=Pe.value==="semi-radial"?Q?ke:8:Q?ke:B?8:f+80,$e=Q?14:0,Me=Oe+ae+$e,Fe={left:we,top:Me,right:ce,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let E=0;pt.value&&(E+=15),Ct.value&&(E+=10);const w=qe();let H=f+16,D=f;Tt.value&&lt.value==="left"?H+=w.legendWidth||150:Tt.value&&lt.value==="right"&&(D+=w.legendWidth||150);const F={left:H,top:f+E,right:D,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??F.left,top:i.top??F.top,right:i.right??F.right,bottom:i.bottom??F.bottom}:F}),P=e.computed(()=>({left:Vl.value.left,top:Vl.value.top,right:fe.value-Vl.value.right,bottom:Ue.value-Vl.value.bottom,width:fe.value-(Vl.value.left+Vl.value.right),height:Ue.value-(Vl.value.top+Vl.value.bottom)})),gl=e.computed(()=>["line","area","bar"].includes(Pe.value)||At.value),Dl=e.computed(()=>At.value),hl=e.computed(()=>["radial","semi-radial"].includes(Pe.value)),Jl=e.computed(()=>Pe.value==="spider"),Gt=e.computed(()=>Pe.value==="bubble"),cl=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(Pe.value==="bar"||Dl.value)),en=t=>{const{minY:s,maxY:l}=Wt.value,i=l-s||1;return P.value.left+(t-s)/i*P.value.width},Hl=t=>{const{maxX:s}=Wt.value,l=s+1,f=P.value.height/l;return P.value.top+(t+.5)*f},Bt=e.computed(()=>hl.value?Vl.value.left+(fe.value-Vl.value.left-Vl.value.right)/2:fe.value/2),Mt=e.computed(()=>Jl.value?Ue.value/2-40:hl.value?Vl.value.top+(Ue.value-Vl.value.top-Vl.value.bottom)/2:Ue.value/2),wt=e.computed(()=>{if(Jl.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}),ll=e.computed(()=>{const t=R.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return wt.value*l}),vo=e.computed(()=>{const t=R.value,s=typeof A.innerSize=="number"?A.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(hl.value||Jl.value)?1:1+s/100}),tn=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const s=Bt.value,l=Mt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Rl=e.ref(0),ln=e.computed(()=>`semi-radial-fill-clip-${A.chartId}`),Pl=e.computed(()=>Pe.value==="semi-radial"),Zt=e.computed(()=>Pl.value&&V.value&&!sl.value),An=e.computed(()=>Pl.value&&V.value&&!sl.value&&ee.value==="fill"),go=e.computed(()=>{const t=Zt.value?Rl.value:1,s=Bt.value,l=Mt.value,i=ll.value,f=wt.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const w=s+f*Math.cos(g),H=l+f*Math.sin(g),D=s+f*Math.cos(E),F=l+f*Math.sin(E),B=s+i*Math.cos(E),Q=l+i*Math.sin(E),ke=s+i*Math.cos(g),Oe=l+i*Math.sin(g),ae=t>.5?1:0;return`M ${s} ${l} L ${w} ${H} A ${f} ${f} 0 ${ae} 1 ${D} ${F} L ${B} ${Q} A ${i} ${i} 0 ${ae} 1 ${ke} ${Oe} Z`}),un=e.computed(()=>{if(!(!Pl.value||!Zt.value)&&!An.value)return`url(#${ln.value})`}),yn=t=>{if(!(!An.value||t!==0))return`url(#${ln.value})`},Fl=e.ref(0),dn=e.computed(()=>`radial-reveal-clip-${A.chartId}`),Sl=e.computed(()=>Pe.value==="radial"),Do=e.computed(()=>{const t=Sl.value?Fl.value:1,s=Bt.value,l=Mt.value,i=Math.max(wt.value*1.5,fe.value,Ue.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 f=-Math.PI/2,g=f+t*Math.PI*2,E=s+i*Math.cos(f),w=l+i*Math.sin(f),H=s+i*Math.cos(g),D=l+i*Math.sin(g),F=t>=.5?1:0;return`M ${s} ${l} L ${E} ${w} A ${i} ${i} 0 ${F} 1 ${H} ${D} Z`}),Ho=e.computed(()=>{if(un.value)return un.value;if(Sl.value)return`url(#${dn.value})`});let nn=null;const ho=()=>{if(!Zt.value)return;Rl.value=0;const t=J.value,s=performance.now(),l=i=>{const f=i-s,g=Math.min(1,f/t);Rl.value=Zl(ot.value,g),g<1&&(nn=requestAnimationFrame(l))};nn=requestAnimationFrame(l)},xn=e.computed(()=>R.value?.bubbles?.minSize||8),yo=e.computed(()=>R.value?.bubbles?.maxSize||50),Co=e.computed(()=>R.value?.bubbles?.opacity||.7),ko=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,i*f)},qn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},so=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Ol=e.computed(()=>A.series),Cn=e.computed(()=>A.series.filter((t,s)=>!bt.value.has(s))),on="auto",Wt=e.computed(()=>{if(Gt.value)return bo();if(!Cn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,l=0;Cn.value.forEach(w=>{w.data&&w.data.length&&(l=Math.max(l,w.data.length-1),w.data.forEach(H=>{typeof H=="number"&&(t=Math.min(t,H),s=Math.max(s,H))}))}),A.categories.length>0&&(l=Math.max(l,A.categories.length-1)),t===1/0&&(t=0,s=100);const i=tt.value,f=It.value;let g,E;if(i===on){const w=s-t,H=w>0?w*.1:1;g=Math.max(0,t-H)}else if(typeof i=="number")g=i;else{const w=s-t,H=w>0?w*.1:1;g=Math.max(0,t-H)}if(f===on){const w=s-t,H=w>0?w*.1:2;E=s+H}else if(typeof f=="number")E=f;else{const w=s-t,H=w>0?w*.1:2;E=s+H}return{minX:0,maxX:l,minY:g,maxY:E}}),bo=()=>{if(!Cn.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,f=1/0,g=-1/0,E=!1;if(Cn.value.forEach((ke,Oe)=>{ke?.data?.length&&ke.data.forEach((ae,me)=>{let we,ce,je;if(typeof ae=="object"&&ae!==null&&!Array.isArray(ae))we=typeof ae.x=="number"?ae.x:me,ce=typeof ae.y=="number"?ae.y:0,je=typeof ae.size=="number"?ae.size:20;else if(Array.isArray(ae)&&ae.length>=3)we=typeof ae[0]=="number"?ae[0]:me,ce=typeof ae[1]=="number"?ae[1]:0,je=typeof ae[2]=="number"?ae[2]:20;else if(typeof ae=="number")we=me,ce=ae,je=ko(Oe,me);else return;isFinite(we)&&isFinite(ce)&&isFinite(je)&&(t=Math.min(t,we),s=Math.max(s,we),l=Math.min(l,ce),i=Math.max(i,ce),f=Math.min(f,je),g=Math.max(g,je),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)),l===i&&(l=Math.max(0,l-10),i=l+20);const w=s-t,H=i-l;let D,F,B,Q;return Ft.value!==null?D=Ft.value:D=t-w*.1,Ut.value!==null?F=Ut.value:F=s+w*.1,tt.value!==null&&typeof tt.value=="number"?B=tt.value:B=Math.max(0,l-H*.1),It.value!==null&&typeof It.value=="number"?Q=It.value:Q=i+H*.1,{minX:D,maxX:F,minY:B,maxY:Q,minSize:f,maxSize:g}},Qt=t=>{if(Gt.value){const{minX:w,maxX:H}=Wt.value,D=H-w||1;return P.value.left+(t-w)/D*P.value.width}const{minX:s,maxX:l}=Wt.value,i=l-s;if(l===0||i===0)return P.value.left+P.value.width/2;const f=i/K.value.scale,g=s-K.value.offsetX/P.value.width*i,E=(t-g)/f;return P.value.left+E*P.value.width},ul=t=>{const{minY:s,maxY:l}=Wt.value,i=l-s||1;return P.value.bottom-(t-s)/i*P.value.height},wo=t=>{if(!Gt.value)return he.value||4;const{maxSize:s}=Wt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return xn.value+i*(yo.value-xn.value)},Ro=e.computed(()=>Un.value.map(t=>({y:t.y}))),kn=e.computed(()=>{if(Gt.value)return mn();if(Pe.value==="bar"){if(cl.value){const Me=[],{minY:Fe,maxY:St}=Wt.value,_t=5,$l=St-Fe||1;for(let Yt=0;Yt<=_t;Yt++){const Wl=Fe+$l*(Yt/_t),So=en(Wl);Me.push({x:So,y:P.value.bottom+20,text:bl(Math.round(Wl))})}return Me}const me=[],{maxX:we}=Wt.value,ce=we+1,je=5,$e=(P.value.width-je*2)/ce;for(let Me=0;Me<=we;Me++){const Fe=P.value.left+je+(Me+.5)*$e;me.push({x:Fe,y:P.value.bottom+20,text:A.categories[Me]||M("chart.fallback.item",{number:Me+1})})}return me}const t=[],{minX:s,maxX:l}=Wt.value,i=Ft.value!==null?Ft.value:s,f=Ut.value!==null?Ut.value:l,g=f-i||1,E=g/K.value.scale,w=i-K.value.offsetX/P.value.width*g,H=w+E,D=Math.max(0,Math.floor(w-2)),F=Math.min(f,Math.ceil(H+2)),B=F-D,Q=P.value.width,Oe=Math.floor(Q/60);let ae=1;B>Oe&&(ae=Math.ceil(B/Oe));for(let me=D;me<=F;me+=ae)if(me>=0&&me<=f){const we=Qt(me);we>=P.value.left-100&&we<=P.value.right+100&&t.push({x:we,y:P.value.bottom+20,text:A.categories[me]||`Item ${me+1}`})}return t}),mn=()=>{const t=[],{minX:s,maxX:l}=Wt.value,i=l-s||1,f=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let g=0;g<=f;g++){const E=s+i*g/f,w=Qt(E);if(w>=P.value.left-10&&w<=P.value.right+10){const H=Math.round(E),D=A.categories?.[H];t.push({x:w,y:P.value.bottom+20,text:D||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Un=e.computed(()=>{if(cl.value){const f=[],{maxX:g}=Wt.value;for(let E=0;E<=g;E++)f.push({x:P.value.left-10,y:Hl(E),text:A.categories[E]||`Item ${E+1}`});return f}const t=[],{minY:s,maxY:l}=Wt.value,i=5;for(let f=0;f<=i;f++){const g=s+(l-s)*(f/i),E=Math.round(g);t.push({x:P.value.left-10,y:ul(g),text:bl(E)})}return t}),Pt=t=>{const s=b.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]},Fo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let l=0,i=0,f=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,f=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,f=Number(w[3])/255;else{const H=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(H){let D=H[1];D.length===3&&(D=D[0]+D[0]+D[1]+D[1]+D[2]+D[2]),l=parseInt(D.slice(0,2),16)/255,i=parseInt(D.slice(2,4),16)/255,f=parseInt(D.slice(4,6),16)/255}else if(typeof document<"u"){const D=document.createElement("span");D.style.color=s,D.style.display="none",document.body.appendChild(D);const F=getComputedStyle(D).color;document.body.removeChild(D);const B=F.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,f=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*f>.5?"#3a3a3a":"#fafafa"},ro=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)),E=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[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 f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[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))),H=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,w,H].map(D=>D.toString(16).padStart(2,"0")).join("")}`}return s},io=(t,s)=>{const i=R.value?.stroke?.color;return i==null?ro(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??ro(s):ro(s)},En=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,f=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+f*f)}return s},Il=e.computed(()=>Pe.value==="line"||Dl.value?(Dl.value?A.series.filter(s=>(s.type||Pe.value)==="line"):Ol.value).map((s,l)=>{const i=A.series.findIndex(B=>B===s),f=[];let g=[];s.data.forEach((B,Q)=>{B==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:cl.value?en(B):Qt(Q),y:cl.value?Hl(Q):ul(B),index:Q})}),g.length>0&&f.push(g);let E="";f.forEach(B=>{if(B.length>0){let Q="";oe.value?Q=Wn(B):Q=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(ke=>` L ${ke.x} ${ke.y}`).join(""),E+=(E?" ":"")+Q}});const w=f.reduce((B,Q)=>B+En(Q),0),H=bt.value.has(i),D=ye.value===i,F=ye.value!==null&&ye.value!==i;return{path:E,color:Pt(i),pathLength:w,seriesIndex:i,animationDelay:l*Be.value,isHighlighted:D,isDimmed:F,isHidden:H}}):[]),xo=e.computed(()=>{if(!(Pe.value==="line"||Dl.value))return[];const t=Dl.value?A.series.filter(l=>(l.type||Pe.value)==="line"):Ol.value,s=[];return t.forEach((l,i)=>{const f=A.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const E=l.data[g];if(E!=null){let w=-1,H=0;for(let D=g+1;D<l.data.length;D++){const F=l.data[D];if(F==null)H++;else{w=D;break}}if(H>0&&w!==-1){const D=l.data[w],F=cl.value?en(E):Qt(g),B=cl.value?Hl(g):ul(E),Q=cl.value?en(D):Qt(w),ke=cl.value?Hl(w):ul(D),Oe=bt.value.has(f),ae=ye.value===f,me=ye.value!==null&&ye.value!==f;s.push({path:`M ${F} ${B} L ${Q} ${ke}`,color:Pt(f),seriesIndex:f,animationDelay:i*Be.value,isHighlighted:ae,isDimmed:me,isHidden:Oe,gapSize:H}),g=w-1}}}}),s}),bn=e.computed(()=>Pe.value==="line"||Dl.value?!V.value||sl.value||dt.value.hasAnimated?[]:(Dl.value?A.series.filter(s=>(s.type||Pe.value)==="line"):Ol.value).map((s,l)=>{const i=A.series.findIndex(H=>H===s);let f="",g=null;s.data.forEach((H,D)=>{if(H!=null){const F={x:cl.value?en(H):Qt(D),y:cl.value?Hl(D):ul(H)};g===null?f+=`M ${F.x} ${F.y}`:f+=` L ${F.x} ${F.y}`,g=F}else if(g!==null){const F=s.data.findIndex((B,Q)=>Q>D&&B!==null&&B!==void 0);if(F!==-1){const B={x:cl.value?en(s.data[F]):Qt(F),y:cl.value?Hl(F):ul(s.data[F])};f+=` L ${B.x} ${B.y}`,g=B}}});const E=s.data.map((H,D)=>H==null?null:{x:cl.value?en(H):Qt(D),y:cl.value?Hl(D):ul(H)}).filter(H=>H!==null),w=En(E);return{path:f,pathLength:w,color:Pt(i),animationDelay:l*Be.value,seriesIndex:i}}):[]),co=e.computed(()=>{if(Pe.value!=="line")return[];const t=[];return Ol.value.forEach((s,l)=>{const i=ye.value===l,f=ye.value!==null&&ye.value!==l,g=bt.value.has(l);s.data.forEach((E,w)=>{E!=null&&t.push({x:Qt(w),y:ul(E),color:Pt(l),value:E,label:A.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(l*s.data.length+w)*(Be.value/8),isHighlighted:i,isDimmed:f,isHidden:g})})}),t}),Io=e.computed(()=>{if(!Dl.value)return[];const t=[];return A.series.filter(l=>(l.type||Pe.value)==="line").forEach((l,i)=>{const f=A.series.findIndex(H=>H===l),g=ye.value===f,E=ye.value!==null&&ye.value!==f,w=bt.value.has(f);l.data.forEach((H,D)=>{H!=null&&t.push({x:Qt(D),y:ul(H),color:Pt(f),value:H,label:A.categories[D]||D.toString(),seriesName:l.name,categoryIndex:D,dataIndex:D,animationDelay:(i*l.data.length+D)*(Be.value/8),isHighlighted:g,isDimmed:E,isHidden:w})})}),t}),Dn=e.computed(()=>{if(!Gt.value)return[];const t=[];return Ol.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=ye.value,f=i!==null&&i===l,g=i!==null&&i!==l,E=bt.value.has(l);s.data.forEach((w,H)=>{let D,F,B,Q,ke;if(typeof w=="object"&&w!==null&&!Array.isArray(w))D=typeof w.x=="number"?w.x:H,F=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,Q=w.label||A.categories?.[H]||`Point ${H+1}`,ke=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)D=typeof w[0]=="number"?w[0]:H,F=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,Q=w[3]||A.categories?.[H]||`Point ${H+1}`,ke=w[4];else if(typeof w=="number")D=H,F=w,B=ko(l,H),Q=A.categories?.[H]||`Point ${H+1}`;else return;!isFinite(D)||!isFinite(F)||!isFinite(B)||t.push({x:Qt(D),y:ul(F),radius:wo(B),originalX:D,originalY:F,originalSize:B,color:Pt(l),seriesName:s.name||`Series ${l+1}`,label:Q,imageUrl:ke,seriesIndex:l,dataIndex:H,categoryIndex:Math.round(D),isHighlighted:f,isDimmed:g,isHidden:E,opacity:Co.value})})}),t}),Xn=e.computed(()=>Pe.value!=="area"?[]:Ol.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:ul(B),index:Q})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Pt(s),isHidden:bt.value.has(s)};const f=P.value.bottom+1;let g="",E="";l.forEach((B,Q)=>{if(B.length===0)return;let ke=`M ${B[0].x} ${B[0].y}`;oe.value&&B.length>1?ke=Wn(B):B.slice(1).forEach(ae=>{ke+=` L ${ae.x} ${ae.y}`}),g+=(g?" ":"")+ke;let Oe=`M ${B[0].x} ${f}`;if(Oe+=` L ${B[0].x} ${B[0].y}`,oe.value&&B.length>1){const ae=Wn(B),me=ae.substring(ae.indexOf("C")||ae.indexOf("Q")||ae.indexOf("L"));me?Oe+=" "+me:B.slice(1).forEach(we=>{Oe+=` L ${we.x} ${we.y}`})}else B.slice(1).forEach(ae=>{Oe+=` L ${ae.x} ${ae.y}`});Oe+=` L ${B[B.length-1].x} ${f} Z`,E+=(E?" ":"")+Oe});const w=ye.value===s,H=ye.value!==null&&ye.value!==s,D=bt.value.has(s),F=l.reduce((B,Q)=>B+En(Q),0);return{linePath:g,areaPath:E,color:Pt(s),pathLength:F,isHighlighted:w,isDimmed:H,isHidden:D}})),o=e.computed(()=>{if(!(["bar"].includes(Pe.value)||Dl.value))return[];const t=[],{maxX:s}=Wt.value,l=Dl.value?A.series.filter(f=>(f.type||Pe.value)==="bar"):Ol.value,i=l.length;if(cl.value){const f=s+1,E=P.value.height/f,w=E*(2/3),H=Math.min(4,w/i*.15),D=w-(i-1)*H,F=Math.max(4,D/i);l.forEach((B,Q)=>{const ke=A.series.findIndex(we=>we===B),Oe=ye.value===ke,ae=ye.value!==null&&ye.value!==ke,me=bt.value.has(ke);B.data.forEach((we,ce)=>{if(we==null||typeof we!="number"||!isFinite(we))return;const $e=P.value.top+(ce+.5)*E-w/2+Q*(F+H),Me=P.value.left,Fe=Math.abs(en(we)-P.value.left);let St="";if(oe.value&&Fe>0){const _t=Math.min(N.value,F/2,Fe/2);St=[`M ${Me} ${$e}`,`L ${Me+Fe-_t} ${$e}`,`Q ${Me+Fe} ${$e} ${Me+Fe} ${$e+_t}`,`L ${Me+Fe} ${$e+F-_t}`,`Q ${Me+Fe} ${$e+F} ${Me+Fe-_t} ${$e+F}`,`L ${Me} ${$e+F}`,"Z"].join(" ")}t.push({x:Me,y:$e,width:Fe,height:F,color:Pt(i===1?ce:ke),value:we,label:A.categories[ce]||ce.toString(),seriesName:B.name,animationDelay:(Q*l.length+ce)*(Be.value/4),isHighlighted:Oe,isDimmed:ae,isHidden:me,barPath:St,isSmooth:oe.value&&Fe>0})})})}else{const f=s+1,E=P.value.width/f,w=E*.8,H=w/i,D=H*.05,F=H-D;l.forEach((B,Q)=>{const ke=A.series.findIndex(we=>we===B),Oe=ye.value===ke,ae=ye.value!==null&&ye.value!==ke,me=bt.value.has(ke);B.data.forEach((we,ce)=>{if(we==null||typeof we!="number"||!isFinite(we))return;const $e=P.value.left+(ce+.5)*E-w/2+Q*H+D/2,Me=ul(Math.max(0,we)),Fe=Math.abs(ul(0)-ul(we));let St="";if(oe.value&&Fe>0){const _t=Math.min(N.value,F/2,Fe/2);St=[`M ${$e} ${Me+Fe}`,`L ${$e} ${Me+_t}`,`Q ${$e} ${Me} ${$e+_t} ${Me}`,`L ${$e+F-_t} ${Me}`,`Q ${$e+F} ${Me} ${$e+F} ${Me+_t}`,`L ${$e+F} ${Me+Fe}`,"Z"].join(" ")}t.push({x:$e,y:Me,width:F,height:Fe,color:Pt(i===1?ce:ke),value:we,label:A.categories[ce]||ce.toString(),seriesName:B.name,animationDelay:(Q*l.length+ce)*(Be.value/4),isHighlighted:Oe,isDimmed:ae,isHidden:me,barPath:St,isSmooth:oe.value&&Fe>0})})})}return t}),n=e.computed(()=>{if(!hl.value)return[];const t=Ol.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!bt.value.has(g));if(t.length===0)return[];let s=Pe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Pe.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,H=s,D=s+l-.001,F=H+l/2,B=Bt.value+Math.cos(H)*ll.value,Q=Mt.value+Math.sin(H)*ll.value,ke=Bt.value+Math.cos(D)*ll.value,Oe=Mt.value+Math.sin(D)*ll.value,ae=Bt.value+Math.cos(D)*wt.value,me=Mt.value+Math.sin(D)*wt.value,we=Bt.value+Math.cos(H)*wt.value,ce=Mt.value+Math.sin(H)*wt.value,je=1,ze=[`M ${B} ${Q}`,`A ${ll.value} ${ll.value} 0 ${je} 1 ${ke} ${Oe}`,`L ${ae} ${me}`,`A ${wt.value} ${wt.value} 0 ${je} 0 ${we} ${ce}`,"Z"].join(" "),$e=Pt(E);return i.push({path:ze,color:$e,strokeWidth:et.value,strokeColor:io(0,$e),value:w,seriesName:g.name,opacity:.8,isHighlighted:ye.value===E,isDimmed:!1,isHidden:!1,startAngle:H,endAngle:D,midAngle:F}),i}if(An.value&&t.length===2){const g=t[0],E=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),H=w/100*l,D=(F,B,Q,ke,Oe)=>{const ae=F+(B-F)/2,me=B-F,we=Bt.value+Math.cos(F)*ll.value,ce=Mt.value+Math.sin(F)*ll.value,je=Bt.value+Math.cos(B)*ll.value,ze=Mt.value+Math.sin(B)*ll.value,$e=Bt.value+Math.cos(B)*wt.value,Me=Mt.value+Math.sin(B)*wt.value,Fe=Bt.value+Math.cos(F)*wt.value,St=Mt.value+Math.sin(F)*wt.value,_t=me>Math.PI?1:0,$l=[`M ${we} ${ce}`,`A ${ll.value} ${ll.value} 0 ${_t} 1 ${je} ${ze}`,`L ${$e} ${Me}`,`A ${wt.value} ${wt.value} 0 ${_t} 0 ${Fe} ${St}`,"Z"].join(" "),Yt=Pt(ke);return{path:$l,color:Yt,strokeWidth:et.value,strokeColor:io(i.length,Yt),value:Oe,seriesName:Q.name,opacity:.8,isHighlighted:ye.value===ke,isDimmed:ye.value!==null&&ye.value!==ke,isHidden:!1,startAngle:F,endAngle:B,midAngle:ae}};return i.push(D(s,s+H,g.series,g.originalIndex,w)),i.push(D(s,s+l,E.series,E.originalIndex,100)),i}const f=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const w=g.data[0]||0,H=w/f*l,D=s,F=s+H,B=D+H/2,Q=Bt.value+Math.cos(D)*ll.value,ke=Mt.value+Math.sin(D)*ll.value,Oe=Bt.value+Math.cos(F)*ll.value,ae=Mt.value+Math.sin(F)*ll.value,me=Bt.value+Math.cos(F)*wt.value,we=Mt.value+Math.sin(F)*wt.value,ce=Bt.value+Math.cos(D)*wt.value,je=Mt.value+Math.sin(D)*wt.value,ze=H>Math.PI?1:0,$e=[`M ${Q} ${ke}`,`A ${ll.value} ${ll.value} 0 ${ze} 1 ${Oe} ${ae}`,`L ${me} ${we}`,`A ${wt.value} ${wt.value} 0 ${ze} 0 ${ce} ${je}`,"Z"].join(" "),Me=Pt(E);i.push({path:$e,color:Me,strokeWidth:et.value,strokeColor:io(i.length,Me),value:w,seriesName:g.name,opacity:.8,isHighlighted:ye.value===E,isDimmed:ye.value!==null&&ye.value!==E,isHidden:!1,startAngle:D,endAngle:F,midAngle:B}),s=F}),i)}),a=e.computed(()=>{const t=n.value;return An.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(!ql.value||!hl.value)return[];const t=vn.value,s=rn.value,l=Nn.value,i=eo.value,f=15,g=t*1.3,E=.55,w=(B,Q)=>{const ke=Bt.value+Math.cos(B.midAngle)*wt.value,Oe=Mt.value+Math.sin(B.midAngle)*wt.value,ae=Bt.value+Math.cos(B.midAngle)*(wt.value+s),me=Mt.value+Math.sin(B.midAngle)*(wt.value+s),ce=ae+l*(Q?1:-1),je=Q?ae+f:ae-f,ze=me-i,$e=`${B.seriesName}: ${bl(B.value)}`,Me=$e.length*t*E;return{pointerStartX:ke,pointerStartY:Oe,pointerEndX:ae,pointerEndY:me,horizontalEndX:ce,horizontalEndY:me,textX:je,textY:ze,text:$e,textWidth:Me,textAnchor:Q?"start":"end",isRightSide:Q,pointerLineLength:Math.hypot(ae-ke,me-Oe),horizontalLineLength:Math.hypot(ce-ae,0)}},H=(B,Q)=>{const ke=Math.abs(B.textY-Q.textY)<g,Oe=B.isRightSide?B.textX:B.textX-B.textWidth,ae=B.isRightSide?B.textX+B.textWidth:B.textX,me=Q.isRightSide?Q.textX:Q.textX-Q.textWidth,we=Q.isRightSide?Q.textX+Q.textWidth:Q.textX,ce=Oe<we&&me<ae;return ke&&ce},D=n.value.filter(B=>!B.isHidden),F=[];for(let B=0;B<D.length;B++){const Q=D[B];let ke=Math.cos(Q.midAngle)>=0;if(B>0){const ae=F[B-1],me=w(Q,ke);H(ae,me)&&(ke=!ke)}const Oe=w(Q,ke);F.push({...Oe,color:Q.color,isHighlighted:Q.isHighlighted,isDimmed:Q.isDimmed})}return F}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||Co.value||.7;return ye.value===null||ye.value===void 0?s:ye.value!==null?t.seriesIndex===ye.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 ye.value!==null?t.seriesIndex===ye.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(ye.value===t.seriesIndex?ye.value=null:ye.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:A.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(),Hn.value=!0,ye.value=t.seriesIndex,Je.value.show=!1,!rl.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120;f+E>fe.value&&(f=s.clientX-i.left-E-10),g+w>i.height&&(g=s.clientY-i.top-w-10),f<0&&(f=10),g<0&&(g=10);const H=Mn.value,D=gn.value,F=H.map(B=>{const Q=D[B]||B,ke=h(B,t);return ke?{seriesName:t.seriesName,label:t.label,value:`${Q}: ${ke}`,color:t.color}:null}).filter(Boolean);Ae.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:F,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=zn.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const f=l.toFixed(1);return Ll.value?f+Ll.value:f}return l?.toString()||""},_=()=>{if(!Gt.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=(t,s)=>{t&&(Hn.value=!1,ye.value=null,Ae.value.show=!1,Ae.value.bubbleData=[])},S=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),f=Al(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,w=s.clientY-i.top-10;const H=200,D=g?80:50;E+H>fe.value&&(E=s.clientX-i.left-H-15),w+D>Ue.value&&(w=s.clientY-i.top-D-10),E<0&&(E=10),w<0&&(w=10),ct.value={show:!0,x:E,y:w,categoryValue:f,description:g}},te=()=>{ct.value.show=!1},U=e.computed(()=>A.categories.length||Math.max(...Cn.value.map(t=>t.data.length))),Re=e.computed(()=>{let t=0;return Cn.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),be=e.computed(()=>{const t=[],s=U.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,f=Bt.value+Math.cos(i)*wt.value,g=Mt.value+Math.sin(i)*wt.value;t.push({x:f,y:g,angle:i,index:l})}return t}),mt=e.computed(()=>{const t=[],s=U.value;return be.value.forEach((l,i)=>{const f=wt.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Bt.value+Math.cos(g)*f,w=Mt.value+Math.sin(g)*f+5;let H="middle",D="middle";Math.abs(Math.cos(g))>.5&&(H=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(D=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:w,text:A.categories[i]||`Axis ${i+1}`,anchor:H,baseline:D})}),t}),dl=e.ref(new Set),nl=(t,s,l)=>{const i=`current-${l}`,f=dl.value.has(i);return!f&&ye.value===null?s.fillOpacity||at.value:s.isHighlighted||f?(s.fillOpacity||at.value)+.15:s.isDimmed?(s.fillOpacity||at.value)*.3:s.fillOpacity||at.value},Xt=e.computed(()=>{if(!Jl.value)return[];const t=[],s=U.value;return Ol.value.forEach((l,i)=>{const f=[],g=[],E=[],w=ye.value===i,H=ye.value!==null&&ye.value!==i,D=bt.value.has(i);for(let F=0;F<s;F++){const B=l.data[F]||0,ke=B/Re.value*wt.value,Oe=F*2*Math.PI/s-Math.PI/2,ae=Bt.value+Math.cos(Oe)*ke,me=Mt.value+Math.sin(Oe)*ke;f.push(`${ae},${me}`),g.push({x:ae,y:me}),E.push({x:ae,y:me,value:B,label:A.categories[F]||`Axis ${F+1}`,seriesName:l.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:E,color:Pt(i),fillOpacity:at.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:w,isDimmed:H,isHidden:D,seriesIndex:i})}),t}),ol=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,f=s.length-1;i<s.length;f=i++){const g=s[i].x,E=s[i].y,w=s[f].x,H=s[f].y;E>t.y!=H>t.y&&t.x<(w-g)*(t.y-E)/(H-E)+g&&(l=!l)}return l},al=t=>{if(!Jl.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=Ee.value?.getBoundingClientRect();if(!i)return;const f=t.clientX-i.left,g=t.clientY-i.top,E=Xt.value.filter(w=>w.isHidden?!1:ol({x:f,y:g},w.polygonPoints));if(E.length>0){E.length,ye.value=E[0].seriesIndex;const w=t.clientX-l.left+10,H=t.clientY-l.top-10,D=200,F=50+E.length*25;let B=w,Q=H;B+D>fe.value&&(B=t.clientX-l.left-D-10),Q+F>Ue.value&&(Q=t.clientY-l.top-F-10),B<0&&(B=10),Q<0&&(Q=10);const ke=E.map(Oe=>{let ae=Oe.dataPoints[0],me=1/0;return Oe.dataPoints.forEach(we=>{const ce=Math.sqrt(Math.pow(we.x-f,2)+Math.pow(we.y-g,2));ce<me&&(me=ce,ae=we)}),{seriesName:Oe.seriesName,color:Oe.color,value:bl(ae.value!==void 0?ae.value:Oe.value)}});Ae.value={show:!0,x:B,y:Q,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ke}}else sn()},qt=e.computed(()=>{const t=R.value;return t.logos.map((s,l)=>{const i=A.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||bt.value.has(s.seriesIndex))return null;let f,g;if(gl.value){let w=-1,H=null;for(let F=i.data.length-1;F>=0;F--)if(i.data[F]!==null&&i.data[F]!==void 0){w=F,H=i.data[F];break}if(w===-1||H===null)return null;const D=i.data.map((F,B)=>F==null?null:{x:Qt(B),y:ul(F),index:B}).filter(F=>F!==null);if(t.animations.enabled&&!sl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(dt.value.isAnimating||!dt.value.hasAnimated))if(dt.value.isAnimating){const F=dt.value.currentFrame/dt.value.totalFrames,B=Zl(t.animations.easing,Math.min(F,1)),Q=aa(D,B);f=Q.x+(s.offsetX||0),g=Q.y+(s.offsetY||0)}else f=D[0].x+(s.offsetX||0),g=D[0].y+(s.offsetY||0);else f=Qt(w)+(s.offsetX||0),g=ul(H)+(s.offsetY||0)}else if(hl.value||Jl.value){const w=Math.PI*2/t.logos.length*l;f=Bt.value+Math.cos(w)*(wt.value+30)+(s.offsetX||0),g=Mt.value+Math.sin(w)*(wt.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),jl=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")},pn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Kl=t=>{bt.value.has(t)?bt.value.delete(t):bt.value.add(t)},Eo=e.computed(()=>{if(!Ae.value.show&&!(G.value&&Je.value.show&&!K.value.isZooming))return{display:"none"};let t,s;if(G.value&&Je.value.show&&!K.value.isZooming){t=Je.value.x+15,s=P.value.top;const l=Gt.value?200:150;t+l>fe.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"}}),an=(t,s)=>{if(!rl.value||Vn.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120,H=fe.value,D=Ue.value;f+E>H&&(f=s.clientX-i.left-E-10),g+w>D&&(g=s.clientY-i.top-w-10),f<0&&(f=10),g<0&&(g=10);let F;typeof t.categoryIndex=="number"?F=t.categoryIndex:typeof t.dataIndex=="number"?F=t.dataIndex:t.label&&A.categories.includes(t.label)&&(F=A.categories.indexOf(t.label));const B=(cl.value||Pe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Ae.value={show:!0,x:f,y:g,title:B,value:bl(t.value)||"",categoryIndex:F,spiderSeries:[]}},uo=e.ref(!1),Hn=e.ref(!1),sn=()=>{Ae.value.show=!1,Ae.value.spiderSeries=[],Ae.value.bubbleData=[],Je.value.show=!1,uo.value||(ye.value=null)},Vn=e.ref(!1),fn=(t,s)=>{Vn.value=!0,Ae.value.show=!1,Je.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;f+E>fe.value&&(f=s.clientX-i.left-E-15),f<0&&(f=10),g<0&&(g=10),cn.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Sn=()=>{Vn.value=!1,cn.value.show=!1},dt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Zl=(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}},sl=e.computed(()=>Xe.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),zo=()=>{if(!V.value||sl.value){dt.value.hasAnimated=!0,Sl.value&&(Fl.value=1);return}Sl.value&&(Fl.value=0),dt.value.isAnimating=!0,dt.value.currentFrame=0,dt.value.totalFrames=Math.ceil(J.value/16.67);const t=()=>{const s=dt.value.currentFrame/dt.value.totalFrames,l=Zl(ot.value,Math.min(s,1));ea(l),Sl.value&&(Fl.value=l),s<1?(dt.value.currentFrame++,dt.value.animationId=requestAnimationFrame(t)):ta()};dt.value.animationId=requestAnimationFrame(t)},ea=t=>{const s=C.value;s&&s.style.setProperty("--dss-animation-progress",t)},ta=()=>{dt.value.isAnimating=!1,dt.value.hasAnimated=!0,Sl.value&&(Fl.value=1),dt.value.animationId&&(cancelAnimationFrame(dt.value.animationId),dt.value.animationId=null)},Po=e.computed(()=>!hl.value||dt.value.hasAnimated?!0:Sl.value?Fl.value>=1:Pl.value?Rl.value>=1:!0),Wo=e.computed(()=>ql.value&&Po.value),Vo=e.ref(!1);e.watch(Wo,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const la=e.computed(()=>{if(!V.value||sl.value||dt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${J.value}ms`,t["--dss-animation-easing"]=na(ot.value),t["--dss-stagger-delay"]=`${Be.value}ms`,t}),na=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",oa=()=>{if(!V.value||sl.value)return"";const t=["dss-chart-animated"];return dt.value.hasAnimated||t.push(`dss-animate-${ee.value}`),dt.value.hasAnimated||(hl.value&&Pe.value!=="semi-radial"?t.push("dss-animate-fill"):hl.value||t.push(`dss-animate-${ee.value}`)),dt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>A.series,(t,s)=>{We.value&&s&&dt.value.hasAnimated&&(dt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>zo(),Se.value)}))},{deep:!0}),e.watch(()=>K.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[K.value.scale,K.value.offsetX],()=>{!K.value.isZooming&&!K.value.isDragging&&k()},{flush:"post"}),e.watch([Ie,ut],([t,s])=>{K.value.minScale=t,K.value.maxScale=s,(K.value.scale<t||K.value.scale>s)&&oo()},{immediate:!0}),e.watch(()=>A.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",lo)}):document.removeEventListener("click",lo)}),e.onMounted(()=>{ye.value=null,Sl.value&&(!V.value||sl.value)&&(Fl.value=1),Jt(),C.value&&typeof ResizeObserver<"u"&&(ve=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(xe&&cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{xe=null;const{width:l,height:i}=s.contentRect;Ge.value=Math.round(l),p.value=Math.round(i),le.value&&(st.value=le.value.offsetHeight||de)}))}),ve.observe(C.value)),V.value&&!sl.value?Pe.value==="semi-radial"?setTimeout(()=>ho(),Se.value):setTimeout(()=>zo(),Se.value):(dt.value.hasAnimated=!0,Pe.value==="semi-radial"&&(Rl.value=1)),document.addEventListener("mousemove",qo),document.addEventListener("mouseup",Uo),document.addEventListener("click",fo)}),e.onUnmounted(()=>{xe&&cancelAnimationFrame(xe),ve&&C.value&&(ve.unobserve(C.value),ve.disconnect(),ve=null),dt.value.animationId&&cancelAnimationFrame(dt.value.animationId),nn&&(cancelAnimationFrame(nn),nn=null),K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout),document.removeEventListener("mousemove",qo),document.removeEventListener("mouseup",Uo),document.removeEventListener("click",fo),document.removeEventListener("click",lo)});const qo=t=>{if(K.value.isDragging&&K.value.scale>1&&gl.value){Je.value.show=!1;const s=t.clientX-K.value.lastMouseX,{minX:l,maxX:i}=Wt.value,f=i-l||1,E=s*.8;K.value.offsetX+=E;const w=f/K.value.scale,H=f-w,D=0,F=-H/f*P.value.width,B=D;K.value.offsetX=Math.max(F,Math.min(B,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY}},Uo=()=>{K.value.isDragging&&(K.value.isDragging=!1,setTimeout(()=>{!K.value.isDragging&&K.value.isZooming},100))},aa=(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 f=[];for(let w=1;w<l.length;w++){const H=l[w].x-l[w-1].x,D=l[w].y-l[w-1].y,F=Math.sqrt(H*H+D*D);f.push(F),i+=F}const g=i*s;let E=0;for(let w=0;w<f.length;w++){const H=E+f[w];if(g<=H){const D=(g-E)/f[w],F=l[w],B=l[w+1];return{x:F.x+(B.x-F.x)*D,y:F.y+(B.y-F.y)*D}}E=H}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",[oa(),{"dss-chart-fill-width":Y.value,"dss-chart-fill-height":_e.value,"dss-chart-compact":hl.value&&!Tt.value}]]),style:e.normalizeStyle({width:Y.value?"100%":fe.value+"px",height:Lt.value,...Y.value||_e.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...la.value,cursor:ao()}),"data-chart-type":Pe.value,ref_key:"containerEl",ref:C,onWheel:no,onMousedown:To,onMousemove:Cl,onMouseup:Ao,onMouseleave:Pn,onDblclick:oo,onContextmenu:e.withModifiers(Ot,["prevent"]),onClick:e.withModifiers(vl,["left"]),onWheelCapture:no},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:le},[e.createElementVNode("div",Qa,[pt.value?(e.openBlock(),e.createElementBlock("div",Ja,e.toDisplayString(pt.value),1)):e.createCommentVNode("",!0),Ct.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(Ct.value),1)):e.createCommentVNode("",!0)]),Tt.value&&lt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Nt.value==="horizontal","dss-legend-vertical":Nt.value==="vertical","dss-legend-top":lt.value==="top","dss-legend-bottom":lt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",ls,e.toDisplayString(l.name),1)],46,ts))),128))],2)):e.createCommentVNode("",!0),Tt.value&&(lt.value==="left"||lt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":lt.value==="left","dss-legend-right":lt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",os,e.toDisplayString(l.name),1)],46,ns))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&kt.value&&Ht.value.addMarker&&(gl.value||Gt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:po,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:pl.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,ss),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,as)):e.createCommentVNode("",!0),e.createElementVNode("div",rs,[Gt.value&&ml.value?(e.openBlock(),e.createElementBlock("div",is,"Bubble size: "+e.toDisplayString(ml.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:fe.value,height:Ue.value,class:"dss-chart-svg","data-smooth":oe.value,"data-animated":V.value,ref_key:"svgEl",ref:Ee},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:fe.value,height:P.value.height*4},null,8,ds)],8,us),Pl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:ln.value},[e.createElementVNode("path",{d:go.value},null,8,ps)],8,ms)):e.createCommentVNode("",!0),Sl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:dn.value},[e.createElementVNode("path",{d:Do.value},null,8,vs)],8,fs)):e.createCommentVNode("",!0)]),gl.value||Gt.value?(e.openBlock(),e.createElementBlock("g",gs,[ft.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":pe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.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,ys))),128))],8,hs)):e.createCommentVNode("",!0),e.createElementVNode("g",Cs,[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,ks),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,bs)]),e.createElementVNode("g",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.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,xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Un.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,Es))),128)),Dt.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(Dt.value),9,Vs)):e.createCommentVNode("",!0),$t.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($t.value),9,Ss)):e.createCommentVNode("",!0)]),wl.value.length>0?(e.openBlock(),e.createElementBlock("g",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":pe.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=>fn(l,i),onMouseleave:Sn},null,40,Ms)):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=>fn(l,i),onMouseleave:Sn},null,40,_s)):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=>fn(l,i),onMouseleave:Sn},null,40,$s)):e.createCommentVNode("",!0)],8,Bs),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=>fn(l,i),onMouseleave:Sn},null,40,Ls)):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=>fn(l,i),onMouseleave:Sn},null,40,Ts),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,As)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":pe.value},[Dl.value?(e.openBlock(),e.createElementBlock("g",Hs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":cl.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:f=>an(l,f),onMouseleave:sn},null,46,Rs)):(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:f=>an(l,f),onMouseleave:sn},null,46,Fs))],64))),128))],2),e.createElementVNode("g",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,Ps))),128)),he.value>0||Ke.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Io.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?W(l,he.value)+2:W(l,he.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:f=>an(l,f),onMouseleave:sn},null,46,Os))),128)):e.createCommentVNode("",!0)])])):Pe.value==="line"?(e.openBlock(),e.createElementBlock("g",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":dt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ws))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,Us))),128)),he.value>0||Ke.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(co.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?W(l,he.value)+2:W(l,he.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:f=>an(l,f),onMouseleave:sn},null,46,Xs))),128)):e.createCommentVNode("",!0)])):Pe.value==="area"?(e.openBlock(),e.createElementBlock("g",Ys,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${L.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,Ks)],8,js))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?j.value+.2:j.value,mask:`url(#area-mask-${i}-${L.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,Gs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.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":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,Qs))),128))])):Pe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":cl.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:f=>an(l,f),onMouseleave:sn},null,46,Js)):(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:f=>an(l,f),onMouseleave:sn},null,46,er))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ds),G.value&&Je.value.show&&!K.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":pe.value},[e.createElementVNode("line",{x1:Je.value.x,x2:Je.value.x,y1:P.value.top,y2:P.value.bottom,stroke:Ve.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,lr),(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(he.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,nr))),128))],8,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",ar,[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:f=>v(l,f),onMouseleave:f=>T(l),onClick:f=>u(l,f)},null,42,sr),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:f=>qn(i),onError:f=>so(i),onMouseenter:f=>v(l,f),onMouseleave:f=>T(l),onClick:f=>u(l,f)},null,46,rr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),hl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:tn.value},[Pe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Bt.value,cy:Mt.value,r:wt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Pe.value,"clip-path":Ho.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":yn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:f=>an(l.segment,f),onMouseleave:sn},null,42,dr))),128))],8,ur),Rn.value&&Po.value?(e.openBlock(),e.createElementBlock("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.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,pr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Bn.value&&(Po.value||Pl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Ul.value.x,y:Ul.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":In.value,fill:il.value,class:"dss-radial-data-center"},e.toDisplayString(Bl.value),9,fr)):e.createCommentVNode("",!0),Wo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vo.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,vr),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,gr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":vn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,hr)],6))),128))],2)):e.createCommentVNode("",!0)],8,ir)):e.createCommentVNode("",!0),Jl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:tn.value},[ft.value?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Bt.value,cy:Mt.value,r:Z(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,kr))),128)),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Bt.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,wr),e.createElementVNode("text",{x:Bt.value,y:Mt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,xr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Bt.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Er))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vr,[(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,Sr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:al,onMouseleave:sn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":nl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.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,Nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:f.x,cy:f.y,r:Z(l.isHighlighted?he.value+1:he.value>0?he.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:E=>an(f,E),onMouseleave:sn},null,46,Br))),128))]))),128))],32)],8,yr)):e.createCommentVNode("",!0),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:Z(l.width/2),fill:Pt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.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:f=>jl(i),onError:f=>pn(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,$r))),128))])],8,cs))]),ie.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:fe.value+"px",height:Ue.value+"px",backgroundImage:`url('${zl.value}')`,backgroundRepeat:"no-repeat",...nt.value,opacity:Te.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:Rt.value+"px",height:Rt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>Qe(l),["stop"]),onMouseenter:f=>S(l,f),onMouseleave:te},[e.createElementVNode("img",{src:Kt(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Tr)],44,Lr)),[[e.vShow,I.value]])),128)),ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:ct.value.x+"px",top:ct.value.y+"px"})},[e.createElementVNode("div",Ar,e.toDisplayString(ct.value.categoryValue),1),ct.value.description?(e.openBlock(),e.createElementBlock("div",Dr,e.toDisplayString(ct.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),rl.value&&(Ae.value.show||G.value&&Je.value.show&&!K.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":G.value&&Je.value.show&&!K.value.isZooming}]),style:e.normalizeStyle(Eo.value)},[!G.value||!Je.value.show||K.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Jl.value&&Ae.value.spiderSeries&&Ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Rr,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",Fr,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Ir,e.toDisplayString(l.value),1)]))),128))])):Gt.value&&Ae.value.bubbleData&&Ae.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Pr,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Or,[(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",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(Ae.value.title),1),e.createElementVNode("div",qr,e.toDisplayString(Ae.value.value),1)])),Ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[fl(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ur,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xr,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl(Ae.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Yr,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",jr,[e.createElementVNode("div",Kr,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),fl(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qr,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl(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",Jr,[e.createElementVNode("div",ei,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ti,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",li,[e.createElementVNode("div",ni,e.toDisplayString(Gt.value?_():L.categories[Je.value.categoryIndex]||`Category ${Je.value.categoryIndex+1}`),1),Gt.value?(e.openBlock(),e.createElementBlock("div",oi,[(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",ai,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",si,e.toDisplayString(bl(l.value)),1)]))),128))]),fl(Je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ri,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ii,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl(Je.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ci,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ui,[e.createElementVNode("div",di,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),fl(Je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fl(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",fi,[e.createElementVNode("div",vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",gi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),gl.value&&Ne.value&&K.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(K.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ga),Tt.value&&lt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Nt.value==="horizontal","dss-legend-vertical":Nt.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,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",yi,e.toDisplayString(l.name),1)],46,hi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ht.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:mo},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ht.value.addMarker&&(Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv||Gl.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),Ht.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ht.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:to},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Tn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Gl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ki)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(On(l)),style:e.normalizeStyle(Zn(l)),onClick:f=>Lo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:hn(l),class:"dss-custom-menu-content"},null,8,xi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,wi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:x},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Vi,[e.createElementVNode("h3",null,e.toDisplayString(Xl.value?e.unref(M)("chart.modalMarker.viewMarker"):El.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Si,[e.createElementVNode("div",Ni,[e.createVNode(Zo,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>De.value.date=l),"min-date":_n.value,"max-date":Ml.value,disabled:Xl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Bi,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),Xl.value?(e.openBlock(),e.createElementBlock("div",_i,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>De.value.description=l),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,$i)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Li,[e.createElementVNode("div",Ti,[El.value&&!Xl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:q},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ai,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(Xl.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),Xl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(El.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,Di))])])])])):e.createCommentVNode("",!0)],64))}}),Fi={class:"dss-modal-title"},Ii={class:"dss-modal-actions"},Oo={__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(L,{emit:re}){const M=L,$=re,se=e.ref(null),C=e.ref(null),Ee=e.computed(()=>{const X={"max-width":M.width};return M.height!=="auto"&&(X.height=M.height,X["min-height"]="0"),X}),le=e.computed(()=>({}));function Ge(){$("close-modal")}function p(){M.backDrop&&!se.value&&$("close-modal")}function ve(X){X.target.tagName==="INPUT"&&(se.value=X.target.tagName)}function xe(){setTimeout(()=>{se.value=null},300)}function de(){const X=document.body,pe=document.documentElement;C.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:pe.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${C.value.scrollY}px`,X.style.width="100%",X.style.left="0",pe.style.overflow="hidden"}function ne(){if(!C.value)return;const X=document.body,pe=document.documentElement,{bodyOverflow:A,bodyPosition:ge,bodyTop:Le,bodyWidth:qe,htmlOverflow:vt,scrollY:R}=C.value;X.style.overflow=A||"",X.style.position=ge||"",X.style.top=Le||"",X.style.width=qe||"",X.style.left="",pe.style.overflow=vt||"",window.scrollTo(0,R||0)}return e.watch(()=>M.showModal,X=>{if(X)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.addEventListener("focusin",ve),pe.addEventListener("focusout",xe))},100);else{ne(),document.body.classList.remove("dss-modal-open");const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.removeEventListener("focusin",ve),pe.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&ne()}),(X,pe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ee.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:pe[0]||(pe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",Fi,[e.renderSlot(X.$slots,"title",{},()=>[pe[1]||(pe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ge,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(le.value)},[e.renderSlot(X.$slots,"content",{},()=>[pe[2]||(pe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Ii,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},zi={key:0,class:"dss-table-toolbar"},Pi={class:"dss-table-toolbar-left"},Oi=["aria-expanded"],Zi={class:"dss-pagination-select-dropdown",role:"listbox"},Wi={class:"dss-table-column-visibility-label"},qi={class:"dss-table-checkbox-wrapper"},Ui=["checked","onChange"],Xi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={class:"dss-table-column-visibility-text"},ji={class:"dss-table-toolbar-right"},Ki=["placeholder","aria-label"],Gi=["aria-label"],Qi=["aria-label","aria-expanded"],Ji={key:1,class:"dss-table-toolbar-extra"},ec={class:"dss-table-thead"},tc={key:0,class:"dss-table-th dss-table-selection-column"},lc={key:0,class:"dss-table-checkbox-wrapper"},nc=["checked","indeterminate"],oc={key:0,class:"dss-table-checkbox__indeterminate"},ac={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},sc=["aria-label"],rc=["onClick"],ic={class:"dss-table-th-content"},cc={class:"dss-table-th-text"},uc={key:0},dc={key:1},mc={key:2},pc=["data-filter-column-key","aria-expanded","aria-label","onClick"],fc={class:"dss-table-tbody"},vc=["onClick"],gc={class:"dss-table-checkbox-wrapper"},hc=["type","name","checked","onChange"],yc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={key:1,class:"dss-table-checkbox__dot"},kc=["onClick"],bc=["aria-expanded","aria-label"],wc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},xc={key:0,class:"dss-table-expansion-row"},Ec=["colspan"],Vc=["colspan"],Sc={key:1,class:"dss-table-pagination"},Nc={class:"dss-table-pagination-left"},Bc={key:0},Mc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},_c={class:"dss-table-pagination-center"},$c={key:0,class:"dss-pagination-controls"},Lc=["disabled","title"],Tc=["disabled","title"],Ac=["aria-label","onKeydown"],Dc={class:"dss-pagination-of"},Hc=["disabled","title"],Rc=["disabled","title"],Fc={class:"dss-table-pagination-right"},Ic={class:"dss-pagination-rows-label"},zc=["aria-expanded"],Pc=["aria-selected","onClick"],Oc={key:0,class:"dss-table-filter-row"},Zc=["value","placeholder"],Wc=["min","max","value"],qc=["min","max","value"],Uc={class:"dss-table-filter-double-range-values"},Xc={key:2,class:"dss-table-filter-daterange"},Yc={class:"dss-table-filter-daterange-row"},jc={class:"dss-table-filter-daterange-label"},Kc=["value"],Gc={class:"dss-table-filter-daterange-row"},Qc={class:"dss-table-filter-daterange-label"},Jc=["value"],eu=["value","placeholder"],tu={class:"dss-table-filter-list"},lu=["checked","onChange"],nu={class:"dss-table-filter-actions"},ou={name:"DSSTable"},au=Object.assign(ou,{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:L=>typeof L=="object"&&L!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(L,{emit:re}){const{t:M,locale:$}=Kn.useI18n(),se=L,C=re,Ee={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],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function le(k,y){const x=Object.assign({},k);return Ge(k)&&Ge(y)&&Object.keys(y).forEach(q=>{Ge(y[q])?q in k?x[q]=le(k[q],y[q]):Object.assign(x,{[q]:y[q]}):Object.assign(x,{[q]:y[q]})}),x}function Ge(k){return k&&typeof k=="object"&&!Array.isArray(k)}const p=e.computed(()=>le(Ee,se.options)),ve=e.computed(()=>{const k=p.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),xe=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:de.value})),X=e.computed(()=>p.value.table.expandable===!0),pe=e.computed(()=>p.value.table.expandableRowData??null),A=e.computed(()=>p.value.table.expandableRowCondition??null),ge=e.computed(()=>p.value.table.truncated===!0),Le=e.computed(()=>p.value.table.striped),qe=e.computed(()=>p.value.table.bordered),vt=e.computed(()=>p.value.table.hoverable),R=e.computed(()=>p.value.table.size),Y=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const _e=e.computed(()=>p.value.selection.enabled),fe=e.computed(()=>p.value.selection.mode),st=e.computed(()=>p.value.sorting.enabled),Ce=e.computed(()=>p.value.sorting.mode),Ue=e.computed(()=>p.value.pagination.enabled),Lt=e.computed(()=>p.value.pagination.rows),Pe=e.computed(()=>p.value.pagination.rowsPerPageOptions),At=e.computed(()=>p.value.pagination.showCounter!==!1),pt=e.computed(()=>p.value.pagination.showControlsGroup),Ct=e.computed(()=>pt.value===!1?!1:p.value.pagination.showControls!==!1),ml=e.computed(()=>pt.value===!1?!1:p.value.pagination.showRowsPerPage!==!1),Dt=e.computed(()=>Ue.value&&(At.value||Ct.value||ml.value)),$t=e.computed(()=>p.value.scrollable),tt=e.computed(()=>p.value.emptyMessage||M("table.emptyMessage")),It=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),Ft=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Ut=e.computed(()=>p.value.toolbar?.search!==!1),ft=e.computed(()=>It.value||Ft.value||Ut.value||Tt.value),Tt=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),Nt=e.ref(!1),rl=e.ref(null);let G=null;function Ve(){Nt.value?(G&&(clearTimeout(G),G=null),Nt.value=!1,lt.value="",C("search",""),rl.value?.blur()):(Nt.value=!0,G=setTimeout(()=>{G=null,rl.value?.focus()},80))}function Ne(){lt.value||(Nt.value=!1)}function Ie(){lt.value="",C("search",""),rl.value?.focus()}const ut=e.computed(()=>({"dss-table-striped":Le.value,"dss-table-bordered":qe.value,"dss-table-hoverable":vt.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":ge.value})),Ze=(k,y)=>k?.field??k?.key??y,et=e.ref(new Set);function he(){const k=new Set;se.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Ze(y,x))}),et.value=k}const Ke=e.computed(()=>se.columns.filter((k,y)=>et.value.has(Ze(k,y)))),W=k=>{const y=se.columns.findIndex(x=>x===k);return Ze(k,y>=0?y:0)},Z=(k,y)=>et.value.has(Ze(k,y));function j(k,y){const x=Ze(k,y),q=new Set(et.value);q.has(x)?q.delete(x):q.add(x),et.value=q}const oe=e.ref(null),He=e.ref(!1);function N(k){oe.value&&!oe.value.contains(k.target)&&(He.value=!1)}const b=e.computed(()=>Ke.value.length+(_e.value?1:0)+(X.value?1:0)),V=(k,y)=>k?.id??k?.key??y,ee=e.ref(new Set),J=e.ref(null),Se=(k,y)=>ee.value.has(V(k,y)),ot=(k,y)=>{if(!X.value)return!1;if(typeof A.value=="function")return!!A.value(k,y);if(typeof pe.value=="string"&&pe.value.trim()){const x=Al(k,pe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Be=(k,y,x)=>{if(x&&x.stopPropagation(),!ot(k,y))return;const q=V(k,y),ue=new Set(ee.value);ue.has(q)?(ue.delete(q),C("row-collapse",{data:k,index:y})):(ue.add(q),C("row-expand",{data:k,index:y})),ee.value=ue},We=(k,y)=>{if(!ge.value)return;const x=V(k,y);J.value!==x&&(J.value=x)},Xe=e.ref(null),at=e.ref(0),gt=e.ref([]),Et=k=>{if(Ce.value==="single")return Xe.value===k.field?at.value:0;{const y=gt.value.find(x=>x.field===k.field);return y?y.order:0}},Vt=k=>{const y=Et(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},kl=e.ref({}),kt=e.ref(null),Ht=e.ref(null),Gl=220,pl=e.ref(null),jt=e.computed(()=>Ke.value.find(k=>W(k)===kt.value)??null),Rt=e.computed(()=>{if(!jt.value||jt.value.filter!=="range")return null;const k=jt.value,y=kt.value,{min:x,max:q}=zl(k),ue=k.filterMin??x,Qe=k.filterMax??q,xt=O(y),Jt=xt.min??ue,zt=xt.max??Qe,el=Qe-ue,tl=el===0?0:(Jt-ue)/el*100,Yl=el===0?100:(zt-ue)/el*100;return{rangeMin:ue,rangeMax:Qe,currentMin:Jt,currentMax:zt,minPct:tl,maxPct:Yl}}),Ll=e.ref(null),bl=e.ref("max");function I(k){const y=Ll.value,x=Rt.value;if(!y||!x)return;const q=y.getBoundingClientRect(),Qe=(k.clientX-q.left)/q.width*100,xt=(x.minPct+x.maxPct)/2;bl.value=Qe<xt?"min":"max"}function O(k){return kl.value[k]??{}}function z(k,y){kl.value={...kl.value,[k]:y}}function ie(k){const y=kl.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 Te(k){const y={...kl.value};delete y[k],kl.value=y,kt.value=null,Ht.value=null}function rt(){if(!kt.value){Ht.value=null;return}const k=pl.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${kt.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ht.value={top:x.bottom+6,left:Math.max(8,x.right-Gl)}}const it=e.computed(()=>{const k=String(lt.value??"").trim().toLowerCase();return k?se.data.filter(y=>Ke.value.some(x=>nt(Kt(y,x)).some(ue=>String(ue).toLowerCase().includes(k)))):se.data}),Ye=e.computed(()=>{let k=[...it.value];const y=(lt.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>se.columns.some(q=>{if(!q||!q.field)return!1;const ue=Kt(x,q);return String(ue??"").toLowerCase().includes(y)}))),Ke.value.forEach(x=>{const q=W(x),ue=kl.value[q];if(!ue)return;const Qe=x.field;if(Qe){if(ue.type==="string"&&ue.value?.trim()){const xt=ue.value.trim().toLowerCase();k=k.filter(Jt=>{const zt=Kt(Jt,x);return String(zt??"").toLowerCase().includes(xt)})}else if(ue.type==="range")k=k.filter(xt=>{const Jt=Al(xt,Qe),zt=Number(Jt);return!(Number.isNaN(zt)||ue.min!=null&&zt<ue.min||ue.max!=null&&zt>ue.max)});else if(ue.type==="dateRange"){const xt=ue.from?new Date(ue.from).getTime():null,Jt=ue.to?new Date(ue.to).getTime():null;k=k.filter(zt=>{const el=Al(zt,Qe),tl=el?new Date(el).getTime():NaN;return!(Number.isNaN(tl)||xt!=null&&tl<xt||Jt!=null&&tl>Jt)})}else if(ue.type==="list"&&ue.selected?.length){const xt=new Set(ue.selected);k=k.filter(Jt=>nt(Kt(Jt,x)).some(el=>xt.has(el)))}}}),k});function nt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(nt);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 yl(k){const y=new Set;return se.data.forEach(x=>{nt(Kt(x,k)).forEach(ue=>y.add(ue))}),Array.from(y).sort((x,q)=>String(x).localeCompare(String(q)))}function fl(k,y){if(kt.value===k){kt.value=null,Ht.value=null;return}if(kt.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ht.value={top:x.bottom+6,left:Math.max(8,x.right-Gl)}}else rt()}function Nl(k,y){z(k,{type:"string",value:y})}function zl(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,q=-1/0;return se.data.forEach(ue=>{const Qe=Al(ue,y),xt=Number(Qe);Number.isNaN(xt)||(x=Math.min(x,xt),q=Math.max(q,xt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function ql(k,y,x){const q={...O(k),type:"range"},ue=x===""?null:Number(x),Qe=ue===null||Number.isNaN(ue)?null:ue;q[y]=Qe,Qe!=null&&(y==="min"&&q.max!=null&&Qe>q.max&&(q.max=Qe),y==="max"&&q.min!=null&&Qe<q.min&&(q.min=Qe)),z(k,q)}function vn(k,y,x){const q={...O(k),type:"dateRange"};q[y]=x||"",z(k,q)}const rn=e.reactive({});function Nn(k,y){rn[k]=y}function eo(k){const y=W(k),x=(rn[y]??"").trim().toLowerCase(),q=yl(k);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function Rn(k,y){return(O(k).selected??[]).includes(y!=null?String(y):"")}function Fn(k,y){const q=[...O(k).selected??[]],ue=y!=null?String(y):"",Qe=q.indexOf(ue);Qe>=0?q.splice(Qe,1):q.push(ue),z(k,{type:"list",selected:q})}function Bn(k){kt.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(kt.value=null,Ht.value=null)}function Bl(){rt(),wl.value&&Ql()}const In=k=>{if(!(k.sortable===!1||!st.value))if(Ce.value==="single")Xe.value===k.field?at.value=at.value===1?-1:at.value===-1?0:1:(Xe.value=k.field,at.value=1),at.value===0&&(Xe.value=null),C("sort",{field:Xe.value,order:at.value});else{const y=gt.value.findIndex(x=>x.field===k.field);y>=0?gt.value[y].order===1?gt.value[y].order=-1:gt.value.splice(y,1):gt.value.push({field:k.field,order:1}),C("sort",{multiSortMeta:gt.value})}},Ul=e.computed(()=>{if(!st.value)return Ye.value;let k=[...Ye.value];return Ce.value==="single"&&Xe.value&&at.value!==0?k.sort((y,x)=>{const q=Al(y,Xe.value),ue=Al(x,Xe.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*at.value}):Ce.value==="multiple"&&gt.value.length>0&&k.sort((y,x)=>{for(const q of gt.value){const ue=Al(y,q.field),Qe=Al(x,q.field);if(ue===Qe)continue;if(ue==null)return 1;if(Qe==null)return-1;const xt=ue<Qe?-1:ue>Qe?1:0;if(xt!==0)return xt*q.order}return 0}),k}),il=e.ref(0),Tl=e.ref(Lt.value),wl=e.ref(!1),cn=e.ref(null),Mn=e.ref(null),gn=e.ref("bottom"),zn=e.ref(null),bt=k=>{Tl.value=k,wl.value=!1,il.value=0,C("page",{page:0,rows:Tl.value})};function ye(k){cn.value&&!cn.value.contains(k.target)&&(wl.value=!1)}function Ql(){const k=cn.value,y=Mn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=y.getBoundingClientRect(),ue=x.offsetHeight||0,xt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Jt=q.top;gn.value=xt<ue+8&&Jt>xt?"top":"bottom",zn.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const Ae=e.computed(()=>Ul.value.length),ct=e.computed(()=>Math.ceil(Ae.value/Tl.value)),Je=e.computed(()=>Math.max(ct.value,1)),ht=e.computed(()=>Ae.value===0?0:yt.value+1),K=e.computed(()=>De.value),yt=e.computed(()=>Ue.value?il.value*Tl.value:0),De=e.computed(()=>Ue.value?Math.min((il.value+1)*Tl.value,Ae.value):Ae.value),_n=e.computed(()=>{if(!Ue.value)return Ul.value;const k=yt.value,y=De.value;return Ul.value.slice(k,y)}),Ml=e.ref(new Set),El=e.computed(()=>Ul.value.filter((k,y)=>Ml.value.has(V(k,y)))),Xl=e.computed(()=>{const k=Ul.value.length;return k>0&&Ml.value.size===k}),wn=e.computed(()=>{const k=Ul.value.length,y=Ml.value.size;return y>0&&y<k}),xl=(k,y)=>Ml.value.has(V(k,y)),Cl=()=>{if(Xl.value)Ml.value=new Set,C("unselect-all");else{const k=new Set;Ul.value.forEach((y,x)=>k.add(V(y,x))),Ml.value=k,C("select-all",El.value)}},Pn=(k,y)=>{const x=V(k,y),q=new Set(Ml.value),ue=q.has(x);fe.value==="single"?ue?(q.delete(x),C("row-unselect",k)):(q.clear(),q.add(x),C("row-select",k)):ue?(q.delete(x),C("row-unselect",k)):(q.add(x),C("row-select",k)),Ml.value=q},Ot=e.ref("1"),vl=()=>{const k=Number.parseInt(String(Ot.value),10);if(!Number.isFinite(k)){Ot.value=String(il.value+1);return}const y=Math.min(Je.value,Math.max(1,k));y!==il.value+1?hn(y-1):Ot.value=String(y)},hn=k=>{k<0||k>=ct.value||(il.value=k,C("page",{page:k,rows:Tl.value}))},On=(k,y,x)=>{C("row-click",{data:k,index:y,originalEvent:x}),We(k,yt.value+y)},Zn=(k,y)=>{const x=yt.value+y;return{"dss-table-row-selected":xl(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":J.value===V(k,x)}},Kt=(k,y)=>y.field?Al(k,y.field):"",Al=(k,y)=>y.split(".").reduce((x,q)=>x&&x[q],k),$n=k=>{const y=k.align??Y.value;return{"dss-table-sortable":k.sortable!==!1&&st.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ln=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(()=>se.locale,k=>{k&&k!==$.value&&($.value=k)},{immediate:!0}),e.watch(Lt,k=>{Tl.value=k,il.value=0}),e.watch(wl,async k=>{k&&(await e.nextTick(),Ql())}),e.watch(il,k=>{Ot.value=String(k+1)},{immediate:!0}),e.watch(lt,k=>{C("search",k??"")}),e.watch(()=>se.columns,()=>{he()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ye),document.addEventListener("click",N),document.addEventListener("click",Bn),window.addEventListener("resize",Bl),window.addEventListener("scroll",Bl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",ye),document.removeEventListener("click",N),document.removeEventListener("click",Bn),window.removeEventListener("resize",Bl),window.removeEventListener("scroll",Bl,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:pl,style:e.normalizeStyle({width:ve.value+"px",height:xe.value?xe.value+"px":"auto"})},[ft.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("div",Pi,[It.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>C("download-pdf"))},[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)"><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(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>C("download-excel"))},[y[23]||(y[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("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:oe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":He.value}]),onClick:y[2]||(y[2]=x=>He.value=!He.value),"aria-expanded":He.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Oi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ze(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Wi,[e.createElementVNode("span",qi,[e.createElementVNode("input",{type:"checkbox",checked:Z(x,q),onChange:ue=>j(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ui),Z(x,q)?(e.openBlock(),e.createElementBlock("span",Xi,[...y[25]||(y[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Yi,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,He.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ji,[Ut.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Nt.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:rl,"onUpdate:modelValue":y[4]||(y[4]=x=>lt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>Nt.value=!0),onBlur:Ne},null,40,Ki),[[e.vModelText,lt.value]]),lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Ie},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Gi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":Nt.value||!!lt.value,onMousedown:e.withModifiers(Ve,["prevent"])},[...y[27]||(y[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Qi)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ji,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":$t.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",ut.value])},[e.createElementVNode("thead",ec,[e.createElementVNode("tr",null,[_e.value?(e.openBlock(),e.createElementBlock("th",tc,[fe.value==="multiple"?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("input",{type:"checkbox",checked:Xl.value,indeterminate:wn.value,onChange:Cl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,nc),wn.value?(e.openBlock(),e.createElementBlock("span",oc)):Xl.value?(e.openBlock(),e.createElementBlock("span",ac,[...y[28]||(y[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,sc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:W(x),class:e.normalizeClass(["dss-table-th",$n(x)]),style:e.normalizeStyle(Ln(x)),onClick:ue=>In(x)},[e.createElementVNode("div",ic,[e.createElementVNode("span",cc,e.toDisplayString(x.header),1),x.sortable!==!1&&st.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Vt(x)])},[Et(x)===0?(e.openBlock(),e.createElementBlock("span",uc,[...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:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(x)===1?(e.openBlock(),e.createElementBlock("span",dc,[...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 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(x)===-1?(e.openBlock(),e.createElementBlock("span",mc,[...y[31]||(y[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":kt.value===W(x)}]),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":ie(W(x))}]),"data-filter-column-key":W(x),"aria-expanded":kt.value===W(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ue=>fl(W(x),ue)},[...y[32]||(y[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,pc)],2)):e.createCommentVNode("",!0)])],14,rc))),128))])]),e.createElementVNode("tbody",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(x,yt.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Zn(x,q)]),style:e.normalizeStyle(ne.value),onClick:ue=>On(x,q,ue)},[_e.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",gc,[e.createElementVNode("input",{type:fe.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:xl(x,yt.value+q),onChange:ue=>Pn(x,yt.value+q),class:e.normalizeClass(["dss-table-checkbox",fe.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,hc),fe.value==="multiple"&&xl(x,yt.value+q)?(e.openBlock(),e.createElementBlock("span",yc,[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):fe.value==="single"&&xl(x,yt.value+q)?(e.openBlock(),e.createElementBlock("span",Cc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>Be(x,yt.value+q,ue),["stop"])},[ot(x,yt.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Se(x,yt.value+q),"aria-label":Se(x,yt.value+q)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Se(x,yt.value+q)}]),"aria-hidden":"true"},[...y[34]||(y[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,bc)):(e.openBlock(),e.createElementBlock("span",wc))],8,kc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(ue,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:W(ue),class:e.normalizeClass(["dss-table-td",$n(ue)]),style:e.normalizeStyle(Ln(ue))},[e.renderSlot(k.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:J.value===V(x,yt.value+q)},()=>[e.createTextVNode(e.toDisplayString(Kt(x,ue)),1)])],6))),128))],14,vc),X.value&&ot(x,yt.value+q)&&Se(x,yt.value+q)?(e.openBlock(),e.createElementBlock("tr",xc,[e.createElementVNode("td",{colspan:b.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:q})],8,Ec)])):e.createCommentVNode("",!0)],64))),128)),_n.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:b.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])],8,Vc)],4))])],2)],2),Dt.value?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",Nc,[At.value?(e.openBlock(),e.createElementBlock("span",Bc,e.toDisplayString(e.unref(M)("table.showingRange",{start:ht.value,end:K.value,total:Ae.value})),1)):(e.openBlock(),e.createElementBlock("span",Mc," "))]),e.createElementVNode("div",_c,[Ct.value?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value===0,onClick:y[8]||(y[8]=x=>hn(0)),title:e.unref(M)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Lc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value===0,onClick:y[9]||(y[9]=x=>hn(il.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,Tc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>Ot.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:vl,onKeydown:e.withKeys(e.withModifiers(vl,["prevent"]),["enter"])},null,40,Ac),[[e.vModelText,Ot.value]]),e.createElementVNode("span",Dc,e.toDisplayString(e.unref(M)("table.ofPages",{total:Je.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value>=ct.value-1,onClick:y[11]||(y[11]=x=>hn(il.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,Hc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value>=ct.value-1,onClick:y[12]||(y[12]=x=>hn(ct.value-1)),title:e.unref(M)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Rc)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fc,[ml.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:cn},[e.createElementVNode("span",Ic,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":wl.value}]),onClick:y[13]||(y[13]=x=>wl.value=!wl.value),"aria-expanded":wl.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Mn},[e.createTextVNode(e.toDisplayString(Tl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,zc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":gn.value==="top"}]),style:e.normalizeStyle(zn.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Tl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Tl.value}]),onClick:q=>bt(x)},e.toDisplayString(x),11,Pc))),128))],6),[[e.vShow,wl.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Ht.value?{top:Ht.value.top+"px",left:Ht.value.left+"px",width:Gl+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[jt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[jt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("input",{type:"text",value:O(kt.value).value??"",onInput:y[14]||(y[14]=x=>Nl(kt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,Zc)])):jt.value.filter==="range"&&Rt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Rt.value.minPct+"%","--range-max-pct":Rt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Ll,class:"dss-table-filter-double-range-track",onMousemove:I,onMouseenter:I},[e.createElementVNode("input",{type:"range",min:Rt.value.rangeMin,max:Rt.value.rangeMax,value:Rt.value.currentMin,onInput:y[15]||(y[15]=x=>ql(kt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:bl.value==="min"?2:1})},null,44,Wc),e.createElementVNode("input",{type:"range",min:Rt.value.rangeMin,max:Rt.value.rangeMax,value:Rt.value.currentMax,onInput:y[16]||(y[16]=x=>ql(kt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:bl.value==="max"?2:1})},null,44,qc)],544),e.createElementVNode("div",Uc,e.toDisplayString(Rt.value.currentMin)+" – "+e.toDisplayString(Rt.value.currentMax),1)],4)):jt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:O(kt.value).from??"",onInput:y[17]||(y[17]=x=>vn(kt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Kc)]),e.createElementVNode("div",Gc,[e.createElementVNode("label",Qc,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:O(kt.value).to??"",onInput:y[18]||(y[18]=x=>vn(kt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Jc)])])):jt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:rn[kt.value]??"",onInput:y[19]||(y[19]=x=>Nn(kt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,eu),e.createElementVNode("div",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(eo(jt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Rn(kt.value,x),onChange:q=>Fn(kt.value,x)},null,40,lu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>Te(kt.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,kt.value&&jt.value&&Ht.value]])]),_:1})]))],64))}}),su={class:"dss-toolbar-left"},ru=["title"],iu=["title"],cu={class:"dss-toolbar-dropdown-wrapper"},uu=["title"],du={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"},mu={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"},pu={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"},fu={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"},vu={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"},gu={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"},hu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},yu=["title"],Cu=["title"],ku=["title"],bu=["title"],wu=["title"],xu=["title"],Eu=["title"],Vu=["title"],Su=["title"],Nu={key:2,class:"dss-toolbar-separator"},Bu=["title"],Mu={key:4,class:"dss-toolbar-separator"},_u={key:5,class:"dss-toolbar-dropdown-wrapper"},$u=["title"],Lu={class:"dss-toolbar-dropdown-ai"},Tu={class:"dss-toolbar-right"},Au={key:0,class:"dss-toolbar-custom-group"},Du={key:1,class:"dss-toolbar-separator"},Hu={class:"dss-link-modal-content"},Ru={class:"dss-link-modal-field"},Fu={class:"dss-link-modal-label"},Iu=["placeholder"],zu={class:"dss-link-modal-field"},Pu={class:"dss-link-modal-label"},Ou=["placeholder"],Zu={class:"dss-image-modal-tabs"},Wu={key:0,class:"dss-image-tab-content"},qu={class:"dss-link-modal-content"},Uu={class:"dss-link-modal-field"},Xu={key:0,class:"dss-link-modal-label"},Yu=["src"],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"},ld={class:"dss-link-modal-label"},nd=["placeholder"],od={key:1,class:"dss-image-tab-content"},ad={class:"dss-link-modal-content"},sd={class:"dss-link-modal-field"},rd={class:"dss-link-modal-label"},id=["placeholder"],cd={class:"dss-link-modal-field"},ud={class:"dss-link-modal-label"},dd=["placeholder"],md={class:"dss-link-modal-field"},pd={class:"dss-link-modal-label"},fd=["placeholder"],vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-text-editor-title-input-container"},Cd={key:0,class:"dss-text-editor-title-preview"},kd={key:0},bd={key:1,class:"dss-text-editor-preview-placeholder"},wd=["value","placeholder","disabled"],xd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Ed={class:"dss-text-editor-description-input-container"},Vd={key:0,class:"dss-text-editor-description-preview"},Sd={key:0},Nd={key:1,class:"dss-text-editor-preview-placeholder"},Bd=["value","placeholder","disabled"],Md={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},_d=["data-comment-id","onMouseenter"],$d=["onClick"],Ld=["src","alt"],Td={key:1},Ad=["onClick"],Dd=["src","alt"],Hd={key:1},Rd=["data-has-second-user","onClick"],Fd={class:"editor-comment-marker-count"},Id={key:4,class:"dss-text-editor-textarea-wrapper"},zd=["value","placeholder","rows","disabled"],Pd={class:"dss-text-editor-footer"},Od={class:"dss-text-editor-footer-content"},Zd={class:"dss-text-editor-footer-stat"},Wd={class:"dss-text-editor-footer-stat"},qd={key:5,class:"dss-text-editor-content-wrapper"},Ud={key:0,class:"dss-comment-overlay-body"},Xd={class:"dss-comment-selection-wrapper"},Yd=["innerHTML"],jd={class:"dss-comment-messages-wrapper"},Kd={key:0,class:"dss-comment-avatar-wrapper"},Gd={class:"dss-comment-avatar"},Qd=["src","alt"],Jd={key:1},e1={class:"dss-comment-header"},t1={class:"dss-comment-header-text"},l1={class:"dss-comment-author"},n1={key:0,class:"dss-comment-date"},o1=["onClick","title"],a1={class:"dss-comment-overlay-inner"},s1=["placeholder","onKeydown"],r1={class:"dss-text-editor-footer"},i1={class:"dss-text-editor-footer-content"},c1={class:"dss-text-editor-footer-stat"},u1={class:"dss-text-editor-footer-stat"},d1=["title"],m1=["title"],p1={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:""},f1={class:"dss-image-popup-content"},v1={key:0,class:"dss-image-popup-no-alt-icon"},g1=["title"],h1=["title"],y1={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"},k1=["title"],b1=["title"],w1={class:"dss-toolbar-dropdown-wrapper"},x1=["title"],E1={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"},S1={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"},N1={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"},B1={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"},M1={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"},_1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},$1=["title"],L1=["title"],T1=["title"],A1=["title"],D1=["title"],H1=["title"],R1=["title"],F1=["title"],I1=["title"],z1=["title"],P1={key:2,class:"dss-toolbar-separator"},O1={key:3,class:"dss-toolbar-dropdown-wrapper"},Z1=["title"],W1={class:"dss-toolbar-dropdown-ai"},q1={key:0,class:"dss-toolbar-right"},U1={key:0,class:"dss-toolbar-separator"},X1={key:0,class:"dss-toolbar-custom-group"},Y1={key:1,class:"dss-toolbar-separator"},j1={name:"DSSTextEditor"},K1=Object.assign(j1,{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:L=>typeof L=="object"&&L!==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:L=>typeof L=="object"&&L!==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(L,{expose:re,emit:M}){const{t:$,locale:se}=Kn.useI18n(),C=L,Ee=M,le=e.useSlots(),Ge=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
98
+ `}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),f=document.createElement("a");f.href=i,f.download=zt("csv"),document.body.appendChild(f),f.click(),document.body.removeChild(f),URL.revokeObjectURL(i),gl()}catch(t){console.error("Error downloading CSV:",t)}},Lo=t=>{if(typeof t.action=="function"){const s={series:A.series,categories:A.categories,markers:yt.value},l={chartX:ht.value.chartX,chartY:ht.value.chartY,dataX:ht.value.mouseDataX,dataY:ht.value.mouseDataY,categoryIndex:clampedCategoryIndex||ht.value.categoryIndex};t.action(s,l)}gl()},mo=()=>{x(),De.value.show=!0,De.value.categoryIndex=ht.value.categoryIndex,De.value.fromButton=!1,gl()},po=()=>{x(),De.value.show=!0,De.value.categoryIndex=0,De.value.fromButton=!0},fo=t=>{if(ht.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ht.value.show=!1)}},lo=t=>{ht.value.show&&!t.target.closest(".context-menu")&&(ht.value.show=!1)},no=t=>{if(!hl.value||!Ne.value)return;t.preventDefault(),t.stopPropagation(),K.value.isZooming=!0,Je.value.show=!1,K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,f=t.clientY-l.top;if(i<P.value.left-50||i>P.value.right+50||f<P.value.top-50||f>P.value.bottom+100){K.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(K.value.minScale,Math.min(K.value.maxScale,K.value.scale*g));if(E!==K.value.scale){const{minX:w,maxX:H}=Wt.value,D=H-w||1,F=D/K.value.scale,B=w-K.value.offsetX/P.value.width*D,Q=(i-P.value.left)/P.value.width,ke=B+Q*F;K.value.scale=E;const Oe=D/K.value.scale,ae=ke-Q*Oe;K.value.offsetX=-(ae-w)/D*P.value.width,K.value.scale<=1.01&&(K.value.scale=1,K.value.offsetX=0)}K.value.zoomTimeout=setTimeout(()=>{K.value.isZooming=!1,K.value.zoomTimeout=null},300)},To=t=>{if(!hl.value||!Ne.value||K.value.scale<=1)return;Je.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,K.value.isDragging=!0,K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY,t.preventDefault()},Ao=()=>{K.value.isDragging=!1},oo=()=>{!hl.value||!Ne.value||(K.value.scale=1,K.value.offsetX=0,K.value.isDragging=!1,K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1)},ao=()=>!hl.value||!Ql.value||!Ne.value?"default":K.value.isDragging?"grabbing":K.value.scale>1?"grab":"dss-crosshair",Wn=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)],f=t[l],g=t[l+1],E=t[Math.min(l+2,t.length-1)],w=f.x+(g.x-i.x)/6*He.value,H=f.y+(g.y-i.y)/6*He.value,D=g.x-(E.x-f.x)/6*He.value,F=g.y-(E.y-f.y)/6*He.value;s+=` C ${w} ${H} ${D} ${F} ${g.x} ${g.y}`}return s},Vl=e.computed(()=>{const s=R.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,f=50;let g=f+(Dt.value?30:0)+60;if(Jl.value){const B={left:f+40,top:f+40,right:f+40,bottom:f+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(cl.value){const B=!Tt.value,Q=ql.value,ke=Q?rn.value+Nn.value+Math.max(24,vn.value+16):0,Oe=B?12:f;let ae=0;pt.value&&(ae+=B?8:15),Ct.value&&(ae+=B?6:10);const me=qe();let we=Oe+(B?4:16)+(Q?ke:0),ce=Oe+(Q?ke:0);Tt.value&&lt.value==="left"?we+=me.legendWidth||150:Tt.value&&lt.value==="right"&&(ce+=me.legendWidth||150);const ze=Pe.value==="semi-radial"?Q?ke:8:Q?ke:B?8:f+80,$e=Q?14:0,Me=Oe+ae+$e,Fe={left:we,top:Me,right:ce,bottom:ze};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??Fe.left,top:i.top??Fe.top,right:i.right??Fe.right,bottom:i.bottom??Fe.bottom}:Fe}let E=0;pt.value&&(E+=15),Ct.value&&(E+=10);const w=qe();let H=f+16,D=f;Tt.value&&lt.value==="left"?H+=w.legendWidth||150:Tt.value&&lt.value==="right"&&(D+=w.legendWidth||150);const F={left:H,top:f+E,right:D,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??F.left,top:i.top??F.top,right:i.right??F.right,bottom:i.bottom??F.bottom}:F}),P=e.computed(()=>({left:Vl.value.left,top:Vl.value.top,right:fe.value-Vl.value.right,bottom:Ue.value-Vl.value.bottom,width:fe.value-(Vl.value.left+Vl.value.right),height:Ue.value-(Vl.value.top+Vl.value.bottom)})),hl=e.computed(()=>["line","area","bar"].includes(Pe.value)||At.value),Dl=e.computed(()=>At.value),cl=e.computed(()=>["radial","semi-radial"].includes(Pe.value)),Jl=e.computed(()=>Pe.value==="spider"),Gt=e.computed(()=>Pe.value==="bubble"),ul=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(Pe.value==="bar"||Dl.value)),en=t=>{const{minY:s,maxY:l}=Wt.value,i=l-s||1;return P.value.left+(t-s)/i*P.value.width},Hl=t=>{const{maxX:s}=Wt.value,l=s+1,f=P.value.height/l;return P.value.top+(t+.5)*f},Bt=e.computed(()=>cl.value?Vl.value.left+(fe.value-Vl.value.left-Vl.value.right)/2:fe.value/2),Mt=e.computed(()=>Jl.value?Ue.value/2-40:cl.value?Vl.value.top+(Ue.value-Vl.value.top-Vl.value.bottom)/2:Ue.value/2),wt=e.computed(()=>{if(Jl.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}),ll=e.computed(()=>{const t=R.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return wt.value*l}),vo=e.computed(()=>{const t=R.value,s=typeof A.innerSize=="number"?A.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cl.value||Jl.value)?1:1+s/100}),tn=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const s=Bt.value,l=Mt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Rl=e.ref(0),ln=e.computed(()=>`semi-radial-fill-clip-${A.chartId}`),Pl=e.computed(()=>Pe.value==="semi-radial"),Zt=e.computed(()=>Pl.value&&V.value&&!sl.value),An=e.computed(()=>Pl.value&&V.value&&!sl.value&&ee.value==="fill"),go=e.computed(()=>{const t=Zt.value?Rl.value:1,s=Bt.value,l=Mt.value,i=ll.value,f=wt.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const w=s+f*Math.cos(g),H=l+f*Math.sin(g),D=s+f*Math.cos(E),F=l+f*Math.sin(E),B=s+i*Math.cos(E),Q=l+i*Math.sin(E),ke=s+i*Math.cos(g),Oe=l+i*Math.sin(g),ae=t>.5?1:0;return`M ${s} ${l} L ${w} ${H} A ${f} ${f} 0 ${ae} 1 ${D} ${F} L ${B} ${Q} A ${i} ${i} 0 ${ae} 1 ${ke} ${Oe} Z`}),un=e.computed(()=>{if(!(!Pl.value||!Zt.value)&&!An.value)return`url(#${ln.value})`}),yn=t=>{if(!(!An.value||t!==0))return`url(#${ln.value})`},Fl=e.ref(0),dn=e.computed(()=>`radial-reveal-clip-${A.chartId}`),Sl=e.computed(()=>Pe.value==="radial"),Do=e.computed(()=>{const t=Sl.value?Fl.value:1,s=Bt.value,l=Mt.value,i=Math.max(wt.value*1.5,fe.value,Ue.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 f=-Math.PI/2,g=f+t*Math.PI*2,E=s+i*Math.cos(f),w=l+i*Math.sin(f),H=s+i*Math.cos(g),D=l+i*Math.sin(g),F=t>=.5?1:0;return`M ${s} ${l} L ${E} ${w} A ${i} ${i} 0 ${F} 1 ${H} ${D} Z`}),Ho=e.computed(()=>{if(un.value)return un.value;if(Sl.value)return`url(#${dn.value})`});let nn=null;const ho=()=>{if(!Zt.value)return;Rl.value=0;const t=J.value,s=performance.now(),l=i=>{const f=i-s,g=Math.min(1,f/t);Rl.value=Zl(ot.value,g),g<1&&(nn=requestAnimationFrame(l))};nn=requestAnimationFrame(l)},xn=e.computed(()=>R.value?.bubbles?.minSize||8),yo=e.computed(()=>R.value?.bubbles?.maxSize||50),Co=e.computed(()=>R.value?.bubbles?.opacity||.7),ko=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,f=1+Math.sin(s*.5)*.2;return Math.max(5,i*f)},qn=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},so=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Ol=e.computed(()=>A.series),Cn=e.computed(()=>A.series.filter((t,s)=>!bt.value.has(s))),on="auto",Wt=e.computed(()=>{if(Gt.value)return bo();if(!Cn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,l=0;Cn.value.forEach(w=>{w.data&&w.data.length&&(l=Math.max(l,w.data.length-1),w.data.forEach(H=>{typeof H=="number"&&(t=Math.min(t,H),s=Math.max(s,H))}))}),A.categories.length>0&&(l=Math.max(l,A.categories.length-1)),t===1/0&&(t=0,s=100);const i=tt.value,f=It.value;let g,E;if(i===on){const w=s-t,H=w>0?w*.1:1;g=Math.max(0,t-H)}else if(typeof i=="number")g=i;else{const w=s-t,H=w>0?w*.1:1;g=Math.max(0,t-H)}if(f===on){const w=s-t,H=w>0?w*.1:2;E=s+H}else if(typeof f=="number")E=f;else{const w=s-t,H=w>0?w*.1:2;E=s+H}return{minX:0,maxX:l,minY:g,maxY:E}}),bo=()=>{if(!Cn.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,f=1/0,g=-1/0,E=!1;if(Cn.value.forEach((ke,Oe)=>{ke?.data?.length&&ke.data.forEach((ae,me)=>{let we,ce,je;if(typeof ae=="object"&&ae!==null&&!Array.isArray(ae))we=typeof ae.x=="number"?ae.x:me,ce=typeof ae.y=="number"?ae.y:0,je=typeof ae.size=="number"?ae.size:20;else if(Array.isArray(ae)&&ae.length>=3)we=typeof ae[0]=="number"?ae[0]:me,ce=typeof ae[1]=="number"?ae[1]:0,je=typeof ae[2]=="number"?ae[2]:20;else if(typeof ae=="number")we=me,ce=ae,je=ko(Oe,me);else return;isFinite(we)&&isFinite(ce)&&isFinite(je)&&(t=Math.min(t,we),s=Math.max(s,we),l=Math.min(l,ce),i=Math.max(i,ce),f=Math.min(f,je),g=Math.max(g,je),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)),l===i&&(l=Math.max(0,l-10),i=l+20);const w=s-t,H=i-l;let D,F,B,Q;return Ft.value!==null?D=Ft.value:D=t-w*.1,Ut.value!==null?F=Ut.value:F=s+w*.1,tt.value!==null&&typeof tt.value=="number"?B=tt.value:B=Math.max(0,l-H*.1),It.value!==null&&typeof It.value=="number"?Q=It.value:Q=i+H*.1,{minX:D,maxX:F,minY:B,maxY:Q,minSize:f,maxSize:g}},Qt=t=>{if(Gt.value){const{minX:w,maxX:H}=Wt.value,D=H-w||1;return P.value.left+(t-w)/D*P.value.width}const{minX:s,maxX:l}=Wt.value,i=l-s;if(l===0||i===0)return P.value.left+P.value.width/2;const f=i/K.value.scale,g=s-K.value.offsetX/P.value.width*i,E=(t-g)/f;return P.value.left+E*P.value.width},dl=t=>{const{minY:s,maxY:l}=Wt.value,i=l-s||1;return P.value.bottom-(t-s)/i*P.value.height},wo=t=>{if(!Gt.value)return he.value||4;const{maxSize:s}=Wt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return xn.value+i*(yo.value-xn.value)},Ro=e.computed(()=>Un.value.map(t=>({y:t.y}))),kn=e.computed(()=>{if(Gt.value)return mn();if(Pe.value==="bar"){if(ul.value){const Me=[],{minY:Fe,maxY:St}=Wt.value,_t=5,$l=St-Fe||1;for(let Yt=0;Yt<=_t;Yt++){const Wl=Fe+$l*(Yt/_t),So=en(Wl);Me.push({x:So,y:P.value.bottom+20,text:bl(Math.round(Wl))})}return Me}const me=[],{maxX:we}=Wt.value,ce=we+1,je=5,$e=(P.value.width-je*2)/ce;for(let Me=0;Me<=we;Me++){const Fe=P.value.left+je+(Me+.5)*$e;me.push({x:Fe,y:P.value.bottom+20,text:A.categories[Me]||M("chart.fallback.item",{number:Me+1})})}return me}const t=[],{minX:s,maxX:l}=Wt.value,i=Ft.value!==null?Ft.value:s,f=Ut.value!==null?Ut.value:l,g=f-i||1,E=g/K.value.scale,w=i-K.value.offsetX/P.value.width*g,H=w+E,D=Math.max(0,Math.floor(w-2)),F=Math.min(f,Math.ceil(H+2)),B=F-D,Q=P.value.width,Oe=Math.floor(Q/60);let ae=1;B>Oe&&(ae=Math.ceil(B/Oe));for(let me=D;me<=F;me+=ae)if(me>=0&&me<=f){const we=Qt(me);we>=P.value.left-100&&we<=P.value.right+100&&t.push({x:we,y:P.value.bottom+20,text:A.categories[me]||`Item ${me+1}`})}return t}),mn=()=>{const t=[],{minX:s,maxX:l}=Wt.value,i=l-s||1,f=Math.min(8,Math.max(4,Math.floor(P.value.width/80)));for(let g=0;g<=f;g++){const E=s+i*g/f,w=Qt(E);if(w>=P.value.left-10&&w<=P.value.right+10){const H=Math.round(E),D=A.categories?.[H];t.push({x:w,y:P.value.bottom+20,text:D||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Un=e.computed(()=>{if(ul.value){const f=[],{maxX:g}=Wt.value;for(let E=0;E<=g;E++)f.push({x:P.value.left-10,y:Hl(E),text:A.categories[E]||`Item ${E+1}`});return f}const t=[],{minY:s,maxY:l}=Wt.value,i=5;for(let f=0;f<=i;f++){const g=s+(l-s)*(f/i),E=Math.round(g);t.push({x:P.value.left-10,y:dl(g),text:bl(E)})}return t}),Pt=t=>{const s=b.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]},Fo=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let l=0,i=0,f=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,f=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,f=Number(w[3])/255;else{const H=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(H){let D=H[1];D.length===3&&(D=D[0]+D[0]+D[1]+D[1]+D[2]+D[2]),l=parseInt(D.slice(0,2),16)/255,i=parseInt(D.slice(2,4),16)/255,f=parseInt(D.slice(4,6),16)/255}else if(typeof document<"u"){const D=document.createElement("span");D.style.color=s,D.style.display="none",document.body.appendChild(D);const F=getComputedStyle(D).color;document.body.removeChild(D);const B=F.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,f=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*f>.5?"#3a3a3a":"#fafafa"},ro=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)),E=Math.max(0,Math.floor(Number(l[2])*.65)),w=Math.max(0,Math.floor(Number(l[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 f=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(f){let g=f[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))),H=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,w,H].map(D=>D.toString(16).padStart(2,"0")).join("")}`}return s},io=(t,s)=>{const i=R.value?.stroke?.color;return i==null?ro(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??ro(s):ro(s)},En=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,f=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+f*f)}return s},Il=e.computed(()=>Pe.value==="line"||Dl.value?(Dl.value?A.series.filter(s=>(s.type||Pe.value)==="line"):Ol.value).map((s,l)=>{const i=A.series.findIndex(B=>B===s),f=[];let g=[];s.data.forEach((B,Q)=>{B==null?g.length>0&&(f.push([...g]),g=[]):g.push({x:ul.value?en(B):Qt(Q),y:ul.value?Hl(Q):dl(B),index:Q})}),g.length>0&&f.push(g);let E="";f.forEach(B=>{if(B.length>0){let Q="";oe.value?Q=Wn(B):Q=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(ke=>` L ${ke.x} ${ke.y}`).join(""),E+=(E?" ":"")+Q}});const w=f.reduce((B,Q)=>B+En(Q),0),H=bt.value.has(i),D=ye.value===i,F=ye.value!==null&&ye.value!==i;return{path:E,color:Pt(i),pathLength:w,seriesIndex:i,animationDelay:l*Be.value,isHighlighted:D,isDimmed:F,isHidden:H}}):[]),xo=e.computed(()=>{if(!(Pe.value==="line"||Dl.value))return[];const t=Dl.value?A.series.filter(l=>(l.type||Pe.value)==="line"):Ol.value,s=[];return t.forEach((l,i)=>{const f=A.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const E=l.data[g];if(E!=null){let w=-1,H=0;for(let D=g+1;D<l.data.length;D++){const F=l.data[D];if(F==null)H++;else{w=D;break}}if(H>0&&w!==-1){const D=l.data[w],F=ul.value?en(E):Qt(g),B=ul.value?Hl(g):dl(E),Q=ul.value?en(D):Qt(w),ke=ul.value?Hl(w):dl(D),Oe=bt.value.has(f),ae=ye.value===f,me=ye.value!==null&&ye.value!==f;s.push({path:`M ${F} ${B} L ${Q} ${ke}`,color:Pt(f),seriesIndex:f,animationDelay:i*Be.value,isHighlighted:ae,isDimmed:me,isHidden:Oe,gapSize:H}),g=w-1}}}}),s}),bn=e.computed(()=>Pe.value==="line"||Dl.value?!V.value||sl.value||dt.value.hasAnimated?[]:(Dl.value?A.series.filter(s=>(s.type||Pe.value)==="line"):Ol.value).map((s,l)=>{const i=A.series.findIndex(H=>H===s);let f="",g=null;s.data.forEach((H,D)=>{if(H!=null){const F={x:ul.value?en(H):Qt(D),y:ul.value?Hl(D):dl(H)};g===null?f+=`M ${F.x} ${F.y}`:f+=` L ${F.x} ${F.y}`,g=F}else if(g!==null){const F=s.data.findIndex((B,Q)=>Q>D&&B!==null&&B!==void 0);if(F!==-1){const B={x:ul.value?en(s.data[F]):Qt(F),y:ul.value?Hl(F):dl(s.data[F])};f+=` L ${B.x} ${B.y}`,g=B}}});const E=s.data.map((H,D)=>H==null?null:{x:ul.value?en(H):Qt(D),y:ul.value?Hl(D):dl(H)}).filter(H=>H!==null),w=En(E);return{path:f,pathLength:w,color:Pt(i),animationDelay:l*Be.value,seriesIndex:i}}):[]),co=e.computed(()=>{if(Pe.value!=="line")return[];const t=[];return Ol.value.forEach((s,l)=>{const i=ye.value===l,f=ye.value!==null&&ye.value!==l,g=bt.value.has(l);s.data.forEach((E,w)=>{E!=null&&t.push({x:Qt(w),y:dl(E),color:Pt(l),value:E,label:A.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(l*s.data.length+w)*(Be.value/8),isHighlighted:i,isDimmed:f,isHidden:g})})}),t}),Io=e.computed(()=>{if(!Dl.value)return[];const t=[];return A.series.filter(l=>(l.type||Pe.value)==="line").forEach((l,i)=>{const f=A.series.findIndex(H=>H===l),g=ye.value===f,E=ye.value!==null&&ye.value!==f,w=bt.value.has(f);l.data.forEach((H,D)=>{H!=null&&t.push({x:Qt(D),y:dl(H),color:Pt(f),value:H,label:A.categories[D]||D.toString(),seriesName:l.name,categoryIndex:D,dataIndex:D,animationDelay:(i*l.data.length+D)*(Be.value/8),isHighlighted:g,isDimmed:E,isHidden:w})})}),t}),Dn=e.computed(()=>{if(!Gt.value)return[];const t=[];return Ol.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=ye.value,f=i!==null&&i===l,g=i!==null&&i!==l,E=bt.value.has(l);s.data.forEach((w,H)=>{let D,F,B,Q,ke;if(typeof w=="object"&&w!==null&&!Array.isArray(w))D=typeof w.x=="number"?w.x:H,F=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,Q=w.label||A.categories?.[H]||`Point ${H+1}`,ke=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)D=typeof w[0]=="number"?w[0]:H,F=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,Q=w[3]||A.categories?.[H]||`Point ${H+1}`,ke=w[4];else if(typeof w=="number")D=H,F=w,B=ko(l,H),Q=A.categories?.[H]||`Point ${H+1}`;else return;!isFinite(D)||!isFinite(F)||!isFinite(B)||t.push({x:Qt(D),y:dl(F),radius:wo(B),originalX:D,originalY:F,originalSize:B,color:Pt(l),seriesName:s.name||`Series ${l+1}`,label:Q,imageUrl:ke,seriesIndex:l,dataIndex:H,categoryIndex:Math.round(D),isHighlighted:f,isDimmed:g,isHidden:E,opacity:Co.value})})}),t}),Xn=e.computed(()=>Pe.value!=="area"?[]:Ol.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:dl(B),index:Q})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Pt(s),isHidden:bt.value.has(s)};const f=P.value.bottom+1;let g="",E="";l.forEach((B,Q)=>{if(B.length===0)return;let ke=`M ${B[0].x} ${B[0].y}`;oe.value&&B.length>1?ke=Wn(B):B.slice(1).forEach(ae=>{ke+=` L ${ae.x} ${ae.y}`}),g+=(g?" ":"")+ke;let Oe=`M ${B[0].x} ${f}`;if(Oe+=` L ${B[0].x} ${B[0].y}`,oe.value&&B.length>1){const ae=Wn(B),me=ae.substring(ae.indexOf("C")||ae.indexOf("Q")||ae.indexOf("L"));me?Oe+=" "+me:B.slice(1).forEach(we=>{Oe+=` L ${we.x} ${we.y}`})}else B.slice(1).forEach(ae=>{Oe+=` L ${ae.x} ${ae.y}`});Oe+=` L ${B[B.length-1].x} ${f} Z`,E+=(E?" ":"")+Oe});const w=ye.value===s,H=ye.value!==null&&ye.value!==s,D=bt.value.has(s),F=l.reduce((B,Q)=>B+En(Q),0);return{linePath:g,areaPath:E,color:Pt(s),pathLength:F,isHighlighted:w,isDimmed:H,isHidden:D}})),o=e.computed(()=>{if(!(["bar"].includes(Pe.value)||Dl.value))return[];const t=[],{maxX:s}=Wt.value,l=Dl.value?A.series.filter(f=>(f.type||Pe.value)==="bar"):Ol.value,i=l.length;if(ul.value){const f=s+1,E=P.value.height/f,w=E*(2/3),H=Math.min(4,w/i*.15),D=w-(i-1)*H,F=Math.max(4,D/i);l.forEach((B,Q)=>{const ke=A.series.findIndex(we=>we===B),Oe=ye.value===ke,ae=ye.value!==null&&ye.value!==ke,me=bt.value.has(ke);B.data.forEach((we,ce)=>{if(we==null||typeof we!="number"||!isFinite(we))return;const $e=P.value.top+(ce+.5)*E-w/2+Q*(F+H),Me=P.value.left,Fe=Math.abs(en(we)-P.value.left);let St="";if(oe.value&&Fe>0){const _t=Math.min(N.value,F/2,Fe/2);St=[`M ${Me} ${$e}`,`L ${Me+Fe-_t} ${$e}`,`Q ${Me+Fe} ${$e} ${Me+Fe} ${$e+_t}`,`L ${Me+Fe} ${$e+F-_t}`,`Q ${Me+Fe} ${$e+F} ${Me+Fe-_t} ${$e+F}`,`L ${Me} ${$e+F}`,"Z"].join(" ")}t.push({x:Me,y:$e,width:Fe,height:F,color:Pt(i===1?ce:ke),value:we,label:A.categories[ce]||ce.toString(),seriesName:B.name,animationDelay:(Q*l.length+ce)*(Be.value/4),isHighlighted:Oe,isDimmed:ae,isHidden:me,barPath:St,isSmooth:oe.value&&Fe>0})})})}else{const f=s+1,E=P.value.width/f,w=E*.8,H=w/i,D=H*.05,F=H-D;l.forEach((B,Q)=>{const ke=A.series.findIndex(we=>we===B),Oe=ye.value===ke,ae=ye.value!==null&&ye.value!==ke,me=bt.value.has(ke);B.data.forEach((we,ce)=>{if(we==null||typeof we!="number"||!isFinite(we))return;const $e=P.value.left+(ce+.5)*E-w/2+Q*H+D/2,Me=dl(Math.max(0,we)),Fe=Math.abs(dl(0)-dl(we));let St="";if(oe.value&&Fe>0){const _t=Math.min(N.value,F/2,Fe/2);St=[`M ${$e} ${Me+Fe}`,`L ${$e} ${Me+_t}`,`Q ${$e} ${Me} ${$e+_t} ${Me}`,`L ${$e+F-_t} ${Me}`,`Q ${$e+F} ${Me} ${$e+F} ${Me+_t}`,`L ${$e+F} ${Me+Fe}`,"Z"].join(" ")}t.push({x:$e,y:Me,width:F,height:Fe,color:Pt(i===1?ce:ke),value:we,label:A.categories[ce]||ce.toString(),seriesName:B.name,animationDelay:(Q*l.length+ce)*(Be.value/4),isHighlighted:Oe,isDimmed:ae,isHidden:me,barPath:St,isSmooth:oe.value&&Fe>0})})})}return t}),n=e.computed(()=>{if(!cl.value)return[];const t=Ol.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!bt.value.has(g));if(t.length===0)return[];let s=Pe.value==="semi-radial"?Math.PI:-Math.PI/2;const l=Pe.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,H=s,D=s+l-.001,F=H+l/2,B=Bt.value+Math.cos(H)*ll.value,Q=Mt.value+Math.sin(H)*ll.value,ke=Bt.value+Math.cos(D)*ll.value,Oe=Mt.value+Math.sin(D)*ll.value,ae=Bt.value+Math.cos(D)*wt.value,me=Mt.value+Math.sin(D)*wt.value,we=Bt.value+Math.cos(H)*wt.value,ce=Mt.value+Math.sin(H)*wt.value,je=1,ze=[`M ${B} ${Q}`,`A ${ll.value} ${ll.value} 0 ${je} 1 ${ke} ${Oe}`,`L ${ae} ${me}`,`A ${wt.value} ${wt.value} 0 ${je} 0 ${we} ${ce}`,"Z"].join(" "),$e=Pt(E);return i.push({path:ze,color:$e,strokeWidth:et.value,strokeColor:io(0,$e),value:w,seriesName:g.name,opacity:.8,isHighlighted:ye.value===E,isDimmed:!1,isHidden:!1,startAngle:H,endAngle:D,midAngle:F}),i}if(An.value&&t.length===2){const g=t[0],E=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),H=w/100*l,D=(F,B,Q,ke,Oe)=>{const ae=F+(B-F)/2,me=B-F,we=Bt.value+Math.cos(F)*ll.value,ce=Mt.value+Math.sin(F)*ll.value,je=Bt.value+Math.cos(B)*ll.value,ze=Mt.value+Math.sin(B)*ll.value,$e=Bt.value+Math.cos(B)*wt.value,Me=Mt.value+Math.sin(B)*wt.value,Fe=Bt.value+Math.cos(F)*wt.value,St=Mt.value+Math.sin(F)*wt.value,_t=me>Math.PI?1:0,$l=[`M ${we} ${ce}`,`A ${ll.value} ${ll.value} 0 ${_t} 1 ${je} ${ze}`,`L ${$e} ${Me}`,`A ${wt.value} ${wt.value} 0 ${_t} 0 ${Fe} ${St}`,"Z"].join(" "),Yt=Pt(ke);return{path:$l,color:Yt,strokeWidth:et.value,strokeColor:io(i.length,Yt),value:Oe,seriesName:Q.name,opacity:.8,isHighlighted:ye.value===ke,isDimmed:ye.value!==null&&ye.value!==ke,isHidden:!1,startAngle:F,endAngle:B,midAngle:ae}};return i.push(D(s,s+H,g.series,g.originalIndex,w)),i.push(D(s,s+l,E.series,E.originalIndex,100)),i}const f=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return f===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const w=g.data[0]||0,H=w/f*l,D=s,F=s+H,B=D+H/2,Q=Bt.value+Math.cos(D)*ll.value,ke=Mt.value+Math.sin(D)*ll.value,Oe=Bt.value+Math.cos(F)*ll.value,ae=Mt.value+Math.sin(F)*ll.value,me=Bt.value+Math.cos(F)*wt.value,we=Mt.value+Math.sin(F)*wt.value,ce=Bt.value+Math.cos(D)*wt.value,je=Mt.value+Math.sin(D)*wt.value,ze=H>Math.PI?1:0,$e=[`M ${Q} ${ke}`,`A ${ll.value} ${ll.value} 0 ${ze} 1 ${Oe} ${ae}`,`L ${me} ${we}`,`A ${wt.value} ${wt.value} 0 ${ze} 0 ${ce} ${je}`,"Z"].join(" "),Me=Pt(E);i.push({path:$e,color:Me,strokeWidth:et.value,strokeColor:io(i.length,Me),value:w,seriesName:g.name,opacity:.8,isHighlighted:ye.value===E,isDimmed:ye.value!==null&&ye.value!==E,isHidden:!1,startAngle:D,endAngle:F,midAngle:B}),s=F}),i)}),a=e.computed(()=>{const t=n.value;return An.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(!ql.value||!cl.value)return[];const t=vn.value,s=rn.value,l=Nn.value,i=eo.value,f=15,g=t*1.3,E=.55,w=(B,Q)=>{const ke=Bt.value+Math.cos(B.midAngle)*wt.value,Oe=Mt.value+Math.sin(B.midAngle)*wt.value,ae=Bt.value+Math.cos(B.midAngle)*(wt.value+s),me=Mt.value+Math.sin(B.midAngle)*(wt.value+s),ce=ae+l*(Q?1:-1),je=Q?ae+f:ae-f,ze=me-i,$e=`${B.seriesName}: ${bl(B.value)}`,Me=$e.length*t*E;return{pointerStartX:ke,pointerStartY:Oe,pointerEndX:ae,pointerEndY:me,horizontalEndX:ce,horizontalEndY:me,textX:je,textY:ze,text:$e,textWidth:Me,textAnchor:Q?"start":"end",isRightSide:Q,pointerLineLength:Math.hypot(ae-ke,me-Oe),horizontalLineLength:Math.hypot(ce-ae,0)}},H=(B,Q)=>{const ke=Math.abs(B.textY-Q.textY)<g,Oe=B.isRightSide?B.textX:B.textX-B.textWidth,ae=B.isRightSide?B.textX+B.textWidth:B.textX,me=Q.isRightSide?Q.textX:Q.textX-Q.textWidth,we=Q.isRightSide?Q.textX+Q.textWidth:Q.textX,ce=Oe<we&&me<ae;return ke&&ce},D=n.value.filter(B=>!B.isHidden),F=[];for(let B=0;B<D.length;B++){const Q=D[B];let ke=Math.cos(Q.midAngle)>=0;if(B>0){const ae=F[B-1],me=w(Q,ke);H(ae,me)&&(ke=!ke)}const Oe=w(Q,ke);F.push({...Oe,color:Q.color,isHighlighted:Q.isHighlighted,isDimmed:Q.isDimmed})}return F}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||Co.value||.7;return ye.value===null||ye.value===void 0?s:ye.value!==null?t.seriesIndex===ye.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 ye.value!==null?t.seriesIndex===ye.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(ye.value===t.seriesIndex?ye.value=null:ye.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:A.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(),Hn.value=!0,ye.value=t.seriesIndex,Je.value.show=!1,!rl.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120;f+E>fe.value&&(f=s.clientX-i.left-E-10),g+w>i.height&&(g=s.clientY-i.top-w-10),f<0&&(f=10),g<0&&(g=10);const H=Mn.value,D=gn.value,F=H.map(B=>{const Q=D[B]||B,ke=h(B,t);return ke?{seriesName:t.seriesName,label:t.label,value:`${Q}: ${ke}`,color:t.color}:null}).filter(Boolean);Ae.value={show:!0,x:f,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:F,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=zn.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const f=l.toFixed(1);return Ll.value?f+Ll.value:f}return l?.toString()||""},_=()=>{if(!Gt.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=(t,s)=>{t&&(Hn.value=!1,ye.value=null,Ae.value.show=!1,Ae.value.bubbleData=[])},S=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),f=Al(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,w=s.clientY-i.top-10;const H=200,D=g?80:50;E+H>fe.value&&(E=s.clientX-i.left-H-15),w+D>Ue.value&&(w=s.clientY-i.top-D-10),E<0&&(E=10),w<0&&(w=10),ct.value={show:!0,x:E,y:w,categoryValue:f,description:g}},te=()=>{ct.value.show=!1},U=e.computed(()=>A.categories.length||Math.max(...Cn.value.map(t=>t.data.length))),Re=e.computed(()=>{let t=0;return Cn.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),be=e.computed(()=>{const t=[],s=U.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,f=Bt.value+Math.cos(i)*wt.value,g=Mt.value+Math.sin(i)*wt.value;t.push({x:f,y:g,angle:i,index:l})}return t}),mt=e.computed(()=>{const t=[],s=U.value;return be.value.forEach((l,i)=>{const f=wt.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Bt.value+Math.cos(g)*f,w=Mt.value+Math.sin(g)*f+5;let H="middle",D="middle";Math.abs(Math.cos(g))>.5&&(H=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(D=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:w,text:A.categories[i]||`Axis ${i+1}`,anchor:H,baseline:D})}),t}),ml=e.ref(new Set),nl=(t,s,l)=>{const i=`current-${l}`,f=ml.value.has(i);return!f&&ye.value===null?s.fillOpacity||at.value:s.isHighlighted||f?(s.fillOpacity||at.value)+.15:s.isDimmed?(s.fillOpacity||at.value)*.3:s.fillOpacity||at.value},Xt=e.computed(()=>{if(!Jl.value)return[];const t=[],s=U.value;return Ol.value.forEach((l,i)=>{const f=[],g=[],E=[],w=ye.value===i,H=ye.value!==null&&ye.value!==i,D=bt.value.has(i);for(let F=0;F<s;F++){const B=l.data[F]||0,ke=B/Re.value*wt.value,Oe=F*2*Math.PI/s-Math.PI/2,ae=Bt.value+Math.cos(Oe)*ke,me=Mt.value+Math.sin(Oe)*ke;f.push(`${ae},${me}`),g.push({x:ae,y:me}),E.push({x:ae,y:me,value:B,label:A.categories[F]||`Axis ${F+1}`,seriesName:l.name})}t.push({points:f.join(" "),polygonPoints:g,dataPoints:E,color:Pt(i),fillOpacity:at.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:w,isDimmed:H,isHidden:D,seriesIndex:i})}),t}),ol=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,f=s.length-1;i<s.length;f=i++){const g=s[i].x,E=s[i].y,w=s[f].x,H=s[f].y;E>t.y!=H>t.y&&t.x<(w-g)*(t.y-E)/(H-E)+g&&(l=!l)}return l},al=t=>{if(!Jl.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=Ee.value?.getBoundingClientRect();if(!i)return;const f=t.clientX-i.left,g=t.clientY-i.top,E=Xt.value.filter(w=>w.isHidden?!1:ol({x:f,y:g},w.polygonPoints));if(E.length>0){E.length,ye.value=E[0].seriesIndex;const w=t.clientX-l.left+10,H=t.clientY-l.top-10,D=200,F=50+E.length*25;let B=w,Q=H;B+D>fe.value&&(B=t.clientX-l.left-D-10),Q+F>Ue.value&&(Q=t.clientY-l.top-F-10),B<0&&(B=10),Q<0&&(Q=10);const ke=E.map(Oe=>{let ae=Oe.dataPoints[0],me=1/0;return Oe.dataPoints.forEach(we=>{const ce=Math.sqrt(Math.pow(we.x-f,2)+Math.pow(we.y-g,2));ce<me&&(me=ce,ae=we)}),{seriesName:Oe.seriesName,color:Oe.color,value:bl(ae.value!==void 0?ae.value:Oe.value)}});Ae.value={show:!0,x:B,y:Q,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ke}}else sn()},qt=e.computed(()=>{const t=R.value;return t.logos.map((s,l)=>{const i=A.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||bt.value.has(s.seriesIndex))return null;let f,g;if(hl.value){let w=-1,H=null;for(let F=i.data.length-1;F>=0;F--)if(i.data[F]!==null&&i.data[F]!==void 0){w=F,H=i.data[F];break}if(w===-1||H===null)return null;const D=i.data.map((F,B)=>F==null?null:{x:Qt(B),y:dl(F),index:B}).filter(F=>F!==null);if(t.animations.enabled&&!sl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(dt.value.isAnimating||!dt.value.hasAnimated))if(dt.value.isAnimating){const F=dt.value.currentFrame/dt.value.totalFrames,B=Zl(t.animations.easing,Math.min(F,1)),Q=aa(D,B);f=Q.x+(s.offsetX||0),g=Q.y+(s.offsetY||0)}else f=D[0].x+(s.offsetX||0),g=D[0].y+(s.offsetY||0);else f=Qt(w)+(s.offsetX||0),g=dl(H)+(s.offsetY||0)}else if(cl.value||Jl.value){const w=Math.PI*2/t.logos.length*l;f=Bt.value+Math.cos(w)*(wt.value+30)+(s.offsetX||0),g=Mt.value+Math.sin(w)*(wt.value+30)+(s.offsetY||0)}return{...s,x:f,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),jl=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")},pn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Kl=t=>{bt.value.has(t)?bt.value.delete(t):bt.value.add(t)},Eo=e.computed(()=>{if(!Ae.value.show&&!(G.value&&Je.value.show&&!K.value.isZooming))return{display:"none"};let t,s;if(G.value&&Je.value.show&&!K.value.isZooming){t=Je.value.x+15,s=P.value.top;const l=Gt.value?200:150;t+l>fe.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"}}),an=(t,s)=>{if(!rl.value||Vn.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120,H=fe.value,D=Ue.value;f+E>H&&(f=s.clientX-i.left-E-10),g+w>D&&(g=s.clientY-i.top-w-10),f<0&&(f=10),g<0&&(g=10);let F;typeof t.categoryIndex=="number"?F=t.categoryIndex:typeof t.dataIndex=="number"?F=t.dataIndex:t.label&&A.categories.includes(t.label)&&(F=A.categories.indexOf(t.label));const B=(ul.value||Pe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Ae.value={show:!0,x:f,y:g,title:B,value:bl(t.value)||"",categoryIndex:F,spiderSeries:[]}},uo=e.ref(!1),Hn=e.ref(!1),sn=()=>{Ae.value.show=!1,Ae.value.spiderSeries=[],Ae.value.bubbleData=[],Je.value.show=!1,uo.value||(ye.value=null)},Vn=e.ref(!1),fn=(t,s)=>{Vn.value=!0,Ae.value.show=!1,Je.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let f=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;f+E>fe.value&&(f=s.clientX-i.left-E-15),f<0&&(f=10),g<0&&(g=10),cn.value={show:!0,x:f,y:g,content:t.texts,count:t.totalCount}},Sn=()=>{Vn.value=!1,cn.value.show=!1},dt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Zl=(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}},sl=e.computed(()=>Xe.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),zo=()=>{if(!V.value||sl.value){dt.value.hasAnimated=!0,Sl.value&&(Fl.value=1);return}Sl.value&&(Fl.value=0),dt.value.isAnimating=!0,dt.value.currentFrame=0,dt.value.totalFrames=Math.ceil(J.value/16.67);const t=()=>{const s=dt.value.currentFrame/dt.value.totalFrames,l=Zl(ot.value,Math.min(s,1));ea(l),Sl.value&&(Fl.value=l),s<1?(dt.value.currentFrame++,dt.value.animationId=requestAnimationFrame(t)):ta()};dt.value.animationId=requestAnimationFrame(t)},ea=t=>{const s=C.value;s&&s.style.setProperty("--dss-animation-progress",t)},ta=()=>{dt.value.isAnimating=!1,dt.value.hasAnimated=!0,Sl.value&&(Fl.value=1),dt.value.animationId&&(cancelAnimationFrame(dt.value.animationId),dt.value.animationId=null)},Po=e.computed(()=>!cl.value||dt.value.hasAnimated?!0:Sl.value?Fl.value>=1:Pl.value?Rl.value>=1:!0),Wo=e.computed(()=>ql.value&&Po.value),Vo=e.ref(!1);e.watch(Wo,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const la=e.computed(()=>{if(!V.value||sl.value||dt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${J.value}ms`,t["--dss-animation-easing"]=na(ot.value),t["--dss-stagger-delay"]=`${Be.value}ms`,t}),na=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",oa=()=>{if(!V.value||sl.value)return"";const t=["dss-chart-animated"];return dt.value.hasAnimated||t.push(`dss-animate-${ee.value}`),dt.value.hasAnimated||(cl.value&&Pe.value!=="semi-radial"?t.push("dss-animate-fill"):cl.value||t.push(`dss-animate-${ee.value}`)),dt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>A.series,(t,s)=>{We.value&&s&&dt.value.hasAnimated&&(dt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>zo(),Se.value)}))},{deep:!0}),e.watch(()=>K.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[K.value.scale,K.value.offsetX],()=>{!K.value.isZooming&&!K.value.isDragging&&k()},{flush:"post"}),e.watch([Ie,ut],([t,s])=>{K.value.minScale=t,K.value.maxScale=s,(K.value.scale<t||K.value.scale>s)&&oo()},{immediate:!0}),e.watch(()=>A.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>ht.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",lo)}):document.removeEventListener("click",lo)}),e.onMounted(()=>{ye.value=null,Sl.value&&(!V.value||sl.value)&&(Fl.value=1),Jt(),C.value&&typeof ResizeObserver<"u"&&(ve=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(xe&&cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{xe=null;const{width:l,height:i}=s.contentRect;Ge.value=Math.round(l),p.value=Math.round(i),le.value&&(st.value=le.value.offsetHeight||de)}))}),ve.observe(C.value)),V.value&&!sl.value?Pe.value==="semi-radial"?setTimeout(()=>ho(),Se.value):setTimeout(()=>zo(),Se.value):(dt.value.hasAnimated=!0,Pe.value==="semi-radial"&&(Rl.value=1)),document.addEventListener("mousemove",qo),document.addEventListener("mouseup",Uo),document.addEventListener("click",fo)}),e.onUnmounted(()=>{xe&&cancelAnimationFrame(xe),ve&&C.value&&(ve.unobserve(C.value),ve.disconnect(),ve=null),dt.value.animationId&&cancelAnimationFrame(dt.value.animationId),nn&&(cancelAnimationFrame(nn),nn=null),K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout),document.removeEventListener("mousemove",qo),document.removeEventListener("mouseup",Uo),document.removeEventListener("click",fo),document.removeEventListener("click",lo)});const qo=t=>{if(K.value.isDragging&&K.value.scale>1&&hl.value){Je.value.show=!1;const s=t.clientX-K.value.lastMouseX,{minX:l,maxX:i}=Wt.value,f=i-l||1,E=s*.8;K.value.offsetX+=E;const w=f/K.value.scale,H=f-w,D=0,F=-H/f*P.value.width,B=D;K.value.offsetX=Math.max(F,Math.min(B,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY}},Uo=()=>{K.value.isDragging&&(K.value.isDragging=!1,setTimeout(()=>{!K.value.isDragging&&K.value.isZooming},100))},aa=(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 f=[];for(let w=1;w<l.length;w++){const H=l[w].x-l[w-1].x,D=l[w].y-l[w-1].y,F=Math.sqrt(H*H+D*D);f.push(F),i+=F}const g=i*s;let E=0;for(let w=0;w<f.length;w++){const H=E+f[w];if(g<=H){const D=(g-E)/f[w],F=l[w],B=l[w+1];return{x:F.x+(B.x-F.x)*D,y:F.y+(B.y-F.y)*D}}E=H}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",[oa(),{"dss-chart-fill-width":Y.value,"dss-chart-fill-height":_e.value,"dss-chart-compact":cl.value&&!Tt.value}]]),style:e.normalizeStyle({width:Y.value?"100%":fe.value+"px",height:Lt.value,...Y.value||_e.value?{overflow:cl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...la.value,cursor:ao()}),"data-chart-type":Pe.value,ref_key:"containerEl",ref:C,onWheel:no,onMousedown:To,onMousemove:Cl,onMouseup:Ao,onMouseleave:Pn,onDblclick:oo,onContextmenu:e.withModifiers(Ot,["prevent"]),onClick:e.withModifiers(gl,["left"]),onWheelCapture:no},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:le},[e.createElementVNode("div",Qa,[pt.value?(e.openBlock(),e.createElementBlock("div",Ja,e.toDisplayString(pt.value),1)):e.createCommentVNode("",!0),Ct.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(Ct.value),1)):e.createCommentVNode("",!0)]),Tt.value&&lt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Nt.value==="horizontal","dss-legend-vertical":Nt.value==="vertical","dss-legend-top":lt.value==="top","dss-legend-bottom":lt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",ls,e.toDisplayString(l.name),1)],46,ts))),128))],2)):e.createCommentVNode("",!0),Tt.value&&(lt.value==="left"||lt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":lt.value==="left","dss-legend-right":lt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",os,e.toDisplayString(l.name),1)],46,ns))),128))],2)):e.createCommentVNode("",!0)],512),L.showAddMarkerButton&&kt.value&&Ht.value.addMarker&&(hl.value||Gt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:po,title:e.unref(M)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:fl.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,ss),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,as)):e.createCommentVNode("",!0),e.createElementVNode("div",rs,[Gt.value&&pl.value?(e.openBlock(),e.createElementBlock("div",is,"Bubble size: "+e.toDisplayString(pl.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:fe.value,height:Ue.value,class:"dss-chart-svg","data-smooth":oe.value,"data-animated":V.value,ref_key:"svgEl",ref:Ee},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:X.value},[e.createElementVNode("rect",{x:0,y:P.value.top,width:fe.value,height:P.value.height*4},null,8,ds)],8,us),Pl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:ln.value},[e.createElementVNode("path",{d:go.value},null,8,ps)],8,ms)):e.createCommentVNode("",!0),Sl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:dn.value},[e.createElementVNode("path",{d:Do.value},null,8,vs)],8,fs)):e.createCommentVNode("",!0)]),hl.value||Gt.value?(e.openBlock(),e.createElementBlock("g",gs,[ft.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":pe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ro.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,ys))),128))],8,hs)):e.createCommentVNode("",!0),e.createElementVNode("g",Cs,[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,ks),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,bs)]),e.createElementVNode("g",ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kn.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,xs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Un.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,Es))),128)),Dt.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(Dt.value),9,Vs)):e.createCommentVNode("",!0),$t.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($t.value),9,Ss)):e.createCommentVNode("",!0)]),wl.value.length>0?(e.openBlock(),e.createElementBlock("g",Ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":pe.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=>fn(l,i),onMouseleave:Sn},null,40,Ms)):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=>fn(l,i),onMouseleave:Sn},null,40,_s)):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=>fn(l,i),onMouseleave:Sn},null,40,$s)):e.createCommentVNode("",!0)],8,Bs),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=>fn(l,i),onMouseleave:Sn},null,40,Ls)):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=>fn(l,i),onMouseleave:Sn},null,40,Ts),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,As)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":pe.value},[Dl.value?(e.openBlock(),e.createElementBlock("g",Hs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ul.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:f=>an(l,f),onMouseleave:sn},null,46,Rs)):(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:f=>an(l,f),onMouseleave:sn},null,46,Fs))],64))),128))],2),e.createElementVNode("g",Is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,zs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,Ps))),128)),he.value>0||Ke.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Io.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?W(l,he.value)+2:W(l,he.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:f=>an(l,f),onMouseleave:sn},null,46,Os))),128)):e.createCommentVNode("",!0)])])):Pe.value==="line"?(e.openBlock(),e.createElementBlock("g",Zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Ze.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":dt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ws))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Il.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+2:Ze.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,Us))),128)),he.value>0||Ke.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(co.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:Z(l.isHighlighted?W(l,he.value)+2:W(l,he.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:f=>an(l,f),onMouseleave:sn},null,46,Xs))),128)):e.createCommentVNode("",!0)])):Pe.value==="area"?(e.openBlock(),e.createElementBlock("g",Ys,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${L.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,Ks)],8,js))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?j.value+.2:j.value,mask:`url(#area-mask-${i}-${L.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,Gs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.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":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,Qs))),128))])):Pe.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ul.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(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:f=>an(l,f),onMouseleave:sn},null,46,Js)):(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:f=>an(l,f),onMouseleave:sn},null,46,er))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ds),G.value&&Je.value.show&&!K.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":pe.value},[e.createElementVNode("line",{x1:Je.value.x,x2:Je.value.x,y1:P.value.top,y2:P.value.bottom,stroke:Ve.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,lr),(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(he.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,nr))),128))],8,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Gt.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",ar,[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:f=>v(l,f),onMouseleave:f=>T(l),onClick:f=>u(l,f)},null,42,sr),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:f=>qn(i),onError:f=>so(i),onMouseenter:f=>v(l,f),onMouseleave:f=>T(l),onClick:f=>u(l,f)},null,46,rr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:tn.value},[Pe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Bt.value,cy:Mt.value,r:wt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Pe.value,"clip-path":Ho.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":yn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:f=>an(l.segment,f),onMouseleave:sn},null,42,dr))),128))],8,ur),Rn.value&&Po.value?(e.openBlock(),e.createElementBlock("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.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,pr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),Bn.value&&(Po.value||Pl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Ul.value.x,y:Ul.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":In.value,fill:il.value,class:"dss-radial-data-center"},e.toDisplayString(Bl.value),9,fr)):e.createCommentVNode("",!0),Wo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vo.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,vr),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,gr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":vn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,hr)],6))),128))],2)):e.createCommentVNode("",!0)],8,ir)):e.createCommentVNode("",!0),Jl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:tn.value},[ft.value?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Bt.value,cy:Mt.value,r:Z(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,kr))),128)),e.createElementVNode("g",br,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Bt.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,wr),e.createElementVNode("text",{x:Bt.value,y:Mt.value-l+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,xr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Bt.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Er))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vr,[(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,Sr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:al,onMouseleave:sn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":nl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Ze.value+1:Ze.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,Nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(f,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:f.x,cy:f.y,r:Z(l.isHighlighted?he.value+1:he.value>0?he.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:E=>an(f,E),onMouseleave:sn},null,46,Br))),128))]))),128))],32)],8,yr)):e.createCommentVNode("",!0),e.createElementVNode("g",Mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:Z(l.width/2),fill:Pt(l.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,_r))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.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:f=>jl(i),onError:f=>pn(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,$r))),128))])],8,cs))]),ie.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:fe.value+"px",height:Ue.value+"px",backgroundImage:`url('${zl.value}')`,backgroundRepeat:"no-repeat",...nt.value,opacity:Te.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:Rt.value+"px",height:Rt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(f=>Qe(l),["stop"]),onMouseenter:f=>S(l,f),onMouseleave:te},[e.createElementVNode("img",{src:Kt(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Tr)],44,Lr)),[[e.vShow,I.value]])),128)),ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:ct.value.x+"px",top:ct.value.y+"px"})},[e.createElementVNode("div",Ar,e.toDisplayString(ct.value.categoryValue),1),ct.value.description?(e.openBlock(),e.createElementBlock("div",Dr,e.toDisplayString(ct.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),rl.value&&(Ae.value.show||G.value&&Je.value.show&&!K.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":G.value&&Je.value.show&&!K.value.isZooming}]),style:e.normalizeStyle(Eo.value)},[!G.value||!Je.value.show||K.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Jl.value&&Ae.value.spiderSeries&&Ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Rr,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",Fr,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",Ir,e.toDisplayString(l.value),1)]))),128))])):Gt.value&&Ae.value.bubbleData&&Ae.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",zr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Pr,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Or,[(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",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(Ae.value.title),1),e.createElementVNode("div",qr,e.toDisplayString(Ae.value.value),1)])),Ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[vl(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ur,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Xr,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl(Ae.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Yr,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",jr,[e.createElementVNode("div",Kr,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),vl(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Gr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Qr,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl(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",Jr,[e.createElementVNode("div",ei,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",ti,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",li,[e.createElementVNode("div",ni,e.toDisplayString(Gt.value?_():L.categories[Je.value.categoryIndex]||`Category ${Je.value.categoryIndex+1}`),1),Gt.value?(e.openBlock(),e.createElementBlock("div",oi,[(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",ai,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",si,e.toDisplayString(bl(l.value)),1)]))),128))]),vl(Je.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ri,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ii,e.toDisplayString(e.unref(M)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl(Je.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ci,[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,(f,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",ui,[e.createElementVNode("div",di,e.toDisplayString(f.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),vl(Je.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",mi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(M)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vl(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",fi,[e.createElementVNode("div",vi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",gi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),hl.value&&Ne.value&&K.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(K.value.scale*100))+"% "+e.toDisplayString(e.unref(M)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Ga),Tt.value&&lt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Nt.value==="horizontal","dss-legend-vertical":Nt.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,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":bt.value.has(i),"dss-legend-hovered":ye.value===i,"dss-legend-dimmed":ye.value!==null&&ye.value!==i}]),onClick:f=>Kl(i),onMouseenter:f=>wn(i),onMouseleave:xl,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Pt(i)})},null,4),e.createElementVNode("span",yi,e.toDisplayString(l.name),1)],46,hi))),128))],2)):e.createCommentVNode("",!0),ht.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ht.value.x+"px",top:ht.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ht.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:mo},e.toDisplayString(e.unref(M)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ht.value.addMarker&&(Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv||Gl.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),Ht.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ht.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:to},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Tn},e.toDisplayString(e.unref(M)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Gl.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ht.value.downloadSvg||Ht.value.downloadPng||Ht.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ki)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gl.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(On(l)),style:e.normalizeStyle(Zn(l)),onClick:f=>Lo(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:hn(l),class:"dss-custom-menu-content"},null,8,xi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Ei,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,wi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),De.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:x},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Vi,[e.createElementVNode("h3",null,e.toDisplayString(Xl.value?e.unref(M)("chart.modalMarker.viewMarker"):El.value?e.unref(M)("chart.modalMarker.editMarker"):e.unref(M)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Si,[e.createElementVNode("div",Ni,[e.createVNode(Zo,{id:"dss-marker-date",mode:"single",modelValue:De.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>De.value.date=l),"min-date":_n.value,"max-date":Ml.value,disabled:Xl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Bi,[e.createElementVNode("label",Mi,e.toDisplayString(e.unref(M)("chart.modalMarker.description")),1),Xl.value?(e.openBlock(),e.createElementBlock("div",_i,e.toDisplayString(De.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>De.value.description=l),placeholder:e.unref(M)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,$i)),[[e.vModelText,De.value.description]])])]),e.createElementVNode("div",Li,[e.createElementVNode("div",Ti,[El.value&&!Xl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:q},e.toDisplayString(e.unref(M)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ai,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(Xl.value?e.unref(M)("chart.modalMarker.close"):e.unref(M)("chart.modalMarker.cancel")),1),Xl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(De.value.description&&De.value.description.length)},e.toDisplayString(El.value?e.unref(M)("chart.modalMarker.save"):e.unref(M)("chart.contextMenu.addMarker")),9,Di))])])])])):e.createCommentVNode("",!0)],64))}}),Fi={class:"dss-modal-title"},Ii={class:"dss-modal-actions"},Oo={__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(L,{emit:re}){const M=L,$=re,se=e.ref(null),C=e.ref(null),Ee=e.computed(()=>{const X={"max-width":M.width};return M.height!=="auto"&&(X.height=M.height,X["min-height"]="0"),X}),le=e.computed(()=>({}));function Ge(){$("close-modal")}function p(){M.backDrop&&!se.value&&$("close-modal")}function ve(X){X.target.tagName==="INPUT"&&(se.value=X.target.tagName)}function xe(){setTimeout(()=>{se.value=null},300)}function de(){const X=document.body,pe=document.documentElement;C.value={bodyOverflow:X.style.overflow,bodyPosition:X.style.position,bodyTop:X.style.top,bodyWidth:X.style.width,htmlOverflow:pe.style.overflow,scrollY:window.scrollY},X.style.overflow="hidden",X.style.position="fixed",X.style.top=`-${C.value.scrollY}px`,X.style.width="100%",X.style.left="0",pe.style.overflow="hidden"}function ne(){if(!C.value)return;const X=document.body,pe=document.documentElement,{bodyOverflow:A,bodyPosition:ge,bodyTop:Le,bodyWidth:qe,htmlOverflow:vt,scrollY:R}=C.value;X.style.overflow=A||"",X.style.position=ge||"",X.style.top=Le||"",X.style.width=qe||"",X.style.left="",pe.style.overflow=vt||"",window.scrollTo(0,R||0)}return e.watch(()=>M.showModal,X=>{if(X)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.addEventListener("focusin",ve),pe.addEventListener("focusout",xe))},100);else{ne(),document.body.classList.remove("dss-modal-open");const pe=document.getElementById("dss-modal-backdrop");pe&&(pe.removeEventListener("focusin",ve),pe.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{M.showModal&&ne()}),(X,pe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Ee.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:pe[0]||(pe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":L.headerType,"font-size":L.titleSize})},[e.createElementVNode("h1",Fi,[e.renderSlot(X.$slots,"title",{},()=>[pe[1]||(pe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(X.$slots,"title-data"),L.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ge,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(le.value)},[e.renderSlot(X.$slots,"content",{},()=>[pe[2]||(pe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Ii,[e.renderSlot(X.$slots,"actions")])])],4),[[e.vShow,L.showModal]])])):e.createCommentVNode("",!0)]))}},zi={key:0,class:"dss-table-toolbar"},Pi={class:"dss-table-toolbar-left"},Oi=["aria-expanded"],Zi={class:"dss-pagination-select-dropdown",role:"listbox"},Wi={class:"dss-table-column-visibility-label"},qi={class:"dss-table-checkbox-wrapper"},Ui=["checked","onChange"],Xi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={class:"dss-table-column-visibility-text"},ji={class:"dss-table-toolbar-right"},Ki=["placeholder","aria-label"],Gi=["aria-label"],Qi=["aria-label","aria-expanded"],Ji={key:1,class:"dss-table-toolbar-extra"},ec={class:"dss-table-thead"},tc={key:0,class:"dss-table-th dss-table-selection-column"},lc={key:0,class:"dss-table-checkbox-wrapper"},nc=["checked","indeterminate"],oc={key:0,class:"dss-table-checkbox__indeterminate"},ac={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},sc=["aria-label"],rc=["onClick"],ic={class:"dss-table-th-content"},cc={class:"dss-table-th-text"},uc={key:0},dc={key:1},mc={key:2},pc=["data-filter-column-key","aria-expanded","aria-label","onClick"],fc={class:"dss-table-tbody"},vc=["onClick"],gc={class:"dss-table-checkbox-wrapper"},hc=["type","name","checked","onChange"],yc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={key:1,class:"dss-table-checkbox__dot"},kc=["onClick"],bc=["aria-expanded","aria-label"],wc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},xc={key:0,class:"dss-table-expansion-row"},Ec=["colspan"],Vc=["colspan"],Sc={key:1,class:"dss-table-pagination"},Nc={class:"dss-table-pagination-left"},Bc={key:0},Mc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},_c={class:"dss-table-pagination-center"},$c={key:0,class:"dss-pagination-controls"},Lc=["disabled","title"],Tc=["disabled","title"],Ac=["aria-label","onKeydown"],Dc={class:"dss-pagination-of"},Hc=["disabled","title"],Rc=["disabled","title"],Fc={class:"dss-table-pagination-right"},Ic={class:"dss-pagination-rows-label"},zc=["aria-expanded"],Pc=["aria-selected","onClick"],Oc={key:0,class:"dss-table-filter-row"},Zc=["value","placeholder"],Wc=["min","max","value"],qc=["min","max","value"],Uc={class:"dss-table-filter-double-range-values"},Xc={key:2,class:"dss-table-filter-daterange"},Yc={class:"dss-table-filter-daterange-row"},jc={class:"dss-table-filter-daterange-label"},Kc=["value"],Gc={class:"dss-table-filter-daterange-row"},Qc={class:"dss-table-filter-daterange-label"},Jc=["value"],eu=["value","placeholder"],tu={class:"dss-table-filter-list"},lu=["checked","onChange"],nu={class:"dss-table-filter-actions"},ou={name:"DSSTable"},au=Object.assign(ou,{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:L=>typeof L=="object"&&L!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(L,{emit:re}){const{t:M,locale:$}=Kn.useI18n(),se=L,C=re,Ee={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],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function le(k,y){const x=Object.assign({},k);return Ge(k)&&Ge(y)&&Object.keys(y).forEach(q=>{Ge(y[q])?q in k?x[q]=le(k[q],y[q]):Object.assign(x,{[q]:y[q]}):Object.assign(x,{[q]:y[q]})}),x}function Ge(k){return k&&typeof k=="object"&&!Array.isArray(k)}const p=e.computed(()=>le(Ee,se.options)),ve=e.computed(()=>{const k=p.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),xe=e.computed(()=>p.value.table.height),de=e.computed(()=>p.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:de.value})),X=e.computed(()=>p.value.table.expandable===!0),pe=e.computed(()=>p.value.table.expandableRowData??null),A=e.computed(()=>p.value.table.expandableRowCondition??null),ge=e.computed(()=>p.value.table.truncated===!0),Le=e.computed(()=>p.value.table.striped),qe=e.computed(()=>p.value.table.bordered),vt=e.computed(()=>p.value.table.hoverable),R=e.computed(()=>p.value.table.size),Y=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const _e=e.computed(()=>p.value.selection.enabled),fe=e.computed(()=>p.value.selection.mode),st=e.computed(()=>p.value.sorting.enabled),Ce=e.computed(()=>p.value.sorting.mode),Ue=e.computed(()=>p.value.pagination.enabled),Lt=e.computed(()=>p.value.pagination.rows),Pe=e.computed(()=>p.value.pagination.rowsPerPageOptions),At=e.computed(()=>p.value.pagination.showCounter!==!1),pt=e.computed(()=>p.value.pagination.showControlsGroup),Ct=e.computed(()=>pt.value===!1?!1:p.value.pagination.showControls!==!1),pl=e.computed(()=>pt.value===!1?!1:p.value.pagination.showRowsPerPage!==!1),Dt=e.computed(()=>Ue.value&&(At.value||Ct.value||pl.value)),$t=e.computed(()=>p.value.scrollable),tt=e.computed(()=>p.value.emptyMessage||M("table.emptyMessage")),It=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),Ft=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Ut=e.computed(()=>p.value.toolbar?.search!==!1),ft=e.computed(()=>It.value||Ft.value||Ut.value||Tt.value),Tt=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),Nt=e.ref(!1),rl=e.ref(null);let G=null;function Ve(){Nt.value?(G&&(clearTimeout(G),G=null),Nt.value=!1,lt.value="",C("search",""),rl.value?.blur()):(Nt.value=!0,G=setTimeout(()=>{G=null,rl.value?.focus()},80))}function Ne(){lt.value||(Nt.value=!1)}function Ie(){lt.value="",C("search",""),rl.value?.focus()}const ut=e.computed(()=>({"dss-table-striped":Le.value,"dss-table-bordered":qe.value,"dss-table-hoverable":vt.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":ge.value})),Ze=(k,y)=>k?.field??k?.key??y,et=e.ref(new Set);function he(){const k=new Set;se.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Ze(y,x))}),et.value=k}const Ke=e.computed(()=>se.columns.filter((k,y)=>et.value.has(Ze(k,y)))),W=k=>{const y=se.columns.findIndex(x=>x===k);return Ze(k,y>=0?y:0)},Z=(k,y)=>et.value.has(Ze(k,y));function j(k,y){const x=Ze(k,y),q=new Set(et.value);q.has(x)?q.delete(x):q.add(x),et.value=q}const oe=e.ref(null),He=e.ref(!1);function N(k){oe.value&&!oe.value.contains(k.target)&&(He.value=!1)}const b=e.computed(()=>Ke.value.length+(_e.value?1:0)+(X.value?1:0)),V=(k,y)=>k?.id??k?.key??y,ee=e.ref(new Set),J=e.ref(null),Se=(k,y)=>ee.value.has(V(k,y)),ot=(k,y)=>{if(!X.value)return!1;if(typeof A.value=="function")return!!A.value(k,y);if(typeof pe.value=="string"&&pe.value.trim()){const x=Al(k,pe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Be=(k,y,x)=>{if(x&&x.stopPropagation(),!ot(k,y))return;const q=V(k,y),ue=new Set(ee.value);ue.has(q)?(ue.delete(q),C("row-collapse",{data:k,index:y})):(ue.add(q),C("row-expand",{data:k,index:y})),ee.value=ue},We=(k,y)=>{if(!ge.value)return;const x=V(k,y);J.value!==x&&(J.value=x)},Xe=e.ref(null),at=e.ref(0),gt=e.ref([]),Et=k=>{if(Ce.value==="single")return Xe.value===k.field?at.value:0;{const y=gt.value.find(x=>x.field===k.field);return y?y.order:0}},Vt=k=>{const y=Et(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},kl=e.ref({}),kt=e.ref(null),Ht=e.ref(null),Gl=220,fl=e.ref(null),jt=e.computed(()=>Ke.value.find(k=>W(k)===kt.value)??null),Rt=e.computed(()=>{if(!jt.value||jt.value.filter!=="range")return null;const k=jt.value,y=kt.value,{min:x,max:q}=zl(k),ue=k.filterMin??x,Qe=k.filterMax??q,xt=O(y),Jt=xt.min??ue,zt=xt.max??Qe,el=Qe-ue,tl=el===0?0:(Jt-ue)/el*100,Yl=el===0?100:(zt-ue)/el*100;return{rangeMin:ue,rangeMax:Qe,currentMin:Jt,currentMax:zt,minPct:tl,maxPct:Yl}}),Ll=e.ref(null),bl=e.ref("max");function I(k){const y=Ll.value,x=Rt.value;if(!y||!x)return;const q=y.getBoundingClientRect(),Qe=(k.clientX-q.left)/q.width*100,xt=(x.minPct+x.maxPct)/2;bl.value=Qe<xt?"min":"max"}function O(k){return kl.value[k]??{}}function z(k,y){kl.value={...kl.value,[k]:y}}function ie(k){const y=kl.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 Te(k){const y={...kl.value};delete y[k],kl.value=y,kt.value=null,Ht.value=null}function rt(){if(!kt.value){Ht.value=null;return}const k=fl.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${kt.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ht.value={top:x.bottom+6,left:Math.max(8,x.right-Gl)}}const it=e.computed(()=>{const k=String(lt.value??"").trim().toLowerCase();return k?se.data.filter(y=>Ke.value.some(x=>nt(Kt(y,x)).some(ue=>String(ue).toLowerCase().includes(k)))):se.data}),Ye=e.computed(()=>{let k=[...it.value];const y=(lt.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>se.columns.some(q=>{if(!q||!q.field)return!1;const ue=Kt(x,q);return String(ue??"").toLowerCase().includes(y)}))),Ke.value.forEach(x=>{const q=W(x),ue=kl.value[q];if(!ue)return;const Qe=x.field;if(Qe){if(ue.type==="string"&&ue.value?.trim()){const xt=ue.value.trim().toLowerCase();k=k.filter(Jt=>{const zt=Kt(Jt,x);return String(zt??"").toLowerCase().includes(xt)})}else if(ue.type==="range")k=k.filter(xt=>{const Jt=Al(xt,Qe),zt=Number(Jt);return!(Number.isNaN(zt)||ue.min!=null&&zt<ue.min||ue.max!=null&&zt>ue.max)});else if(ue.type==="dateRange"){const xt=ue.from?new Date(ue.from).getTime():null,Jt=ue.to?new Date(ue.to).getTime():null;k=k.filter(zt=>{const el=Al(zt,Qe),tl=el?new Date(el).getTime():NaN;return!(Number.isNaN(tl)||xt!=null&&tl<xt||Jt!=null&&tl>Jt)})}else if(ue.type==="list"&&ue.selected?.length){const xt=new Set(ue.selected);k=k.filter(Jt=>nt(Kt(Jt,x)).some(el=>xt.has(el)))}}}),k});function nt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(nt);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 yl(k){const y=new Set;return se.data.forEach(x=>{nt(Kt(x,k)).forEach(ue=>y.add(ue))}),Array.from(y).sort((x,q)=>String(x).localeCompare(String(q)))}function vl(k,y){if(kt.value===k){kt.value=null,Ht.value=null;return}if(kt.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ht.value={top:x.bottom+6,left:Math.max(8,x.right-Gl)}}else rt()}function Nl(k,y){z(k,{type:"string",value:y})}function zl(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,q=-1/0;return se.data.forEach(ue=>{const Qe=Al(ue,y),xt=Number(Qe);Number.isNaN(xt)||(x=Math.min(x,xt),q=Math.max(q,xt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function ql(k,y,x){const q={...O(k),type:"range"},ue=x===""?null:Number(x),Qe=ue===null||Number.isNaN(ue)?null:ue;q[y]=Qe,Qe!=null&&(y==="min"&&q.max!=null&&Qe>q.max&&(q.max=Qe),y==="max"&&q.min!=null&&Qe<q.min&&(q.min=Qe)),z(k,q)}function vn(k,y,x){const q={...O(k),type:"dateRange"};q[y]=x||"",z(k,q)}const rn=e.reactive({});function Nn(k,y){rn[k]=y}function eo(k){const y=W(k),x=(rn[y]??"").trim().toLowerCase(),q=yl(k);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function Rn(k,y){return(O(k).selected??[]).includes(y!=null?String(y):"")}function Fn(k,y){const q=[...O(k).selected??[]],ue=y!=null?String(y):"",Qe=q.indexOf(ue);Qe>=0?q.splice(Qe,1):q.push(ue),z(k,{type:"list",selected:q})}function Bn(k){kt.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(kt.value=null,Ht.value=null)}function Bl(){rt(),wl.value&&Ql()}const In=k=>{if(!(k.sortable===!1||!st.value))if(Ce.value==="single")Xe.value===k.field?at.value=at.value===1?-1:at.value===-1?0:1:(Xe.value=k.field,at.value=1),at.value===0&&(Xe.value=null),C("sort",{field:Xe.value,order:at.value});else{const y=gt.value.findIndex(x=>x.field===k.field);y>=0?gt.value[y].order===1?gt.value[y].order=-1:gt.value.splice(y,1):gt.value.push({field:k.field,order:1}),C("sort",{multiSortMeta:gt.value})}},Ul=e.computed(()=>{if(!st.value)return Ye.value;let k=[...Ye.value];return Ce.value==="single"&&Xe.value&&at.value!==0?k.sort((y,x)=>{const q=Al(y,Xe.value),ue=Al(x,Xe.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*at.value}):Ce.value==="multiple"&&gt.value.length>0&&k.sort((y,x)=>{for(const q of gt.value){const ue=Al(y,q.field),Qe=Al(x,q.field);if(ue===Qe)continue;if(ue==null)return 1;if(Qe==null)return-1;const xt=ue<Qe?-1:ue>Qe?1:0;if(xt!==0)return xt*q.order}return 0}),k}),il=e.ref(0),Tl=e.ref(Lt.value),wl=e.ref(!1),cn=e.ref(null),Mn=e.ref(null),gn=e.ref("bottom"),zn=e.ref(null),bt=k=>{Tl.value=k,wl.value=!1,il.value=0,C("page",{page:0,rows:Tl.value})};function ye(k){cn.value&&!cn.value.contains(k.target)&&(wl.value=!1)}function Ql(){const k=cn.value,y=Mn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=y.getBoundingClientRect(),ue=x.offsetHeight||0,xt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Jt=q.top;gn.value=xt<ue+8&&Jt>xt?"top":"bottom",zn.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const Ae=e.computed(()=>Ul.value.length),ct=e.computed(()=>Math.ceil(Ae.value/Tl.value)),Je=e.computed(()=>Math.max(ct.value,1)),ht=e.computed(()=>Ae.value===0?0:yt.value+1),K=e.computed(()=>De.value),yt=e.computed(()=>Ue.value?il.value*Tl.value:0),De=e.computed(()=>Ue.value?Math.min((il.value+1)*Tl.value,Ae.value):Ae.value),_n=e.computed(()=>{if(!Ue.value)return Ul.value;const k=yt.value,y=De.value;return Ul.value.slice(k,y)}),Ml=e.ref(new Set),El=e.computed(()=>Ul.value.filter((k,y)=>Ml.value.has(V(k,y)))),Xl=e.computed(()=>{const k=Ul.value.length;return k>0&&Ml.value.size===k}),wn=e.computed(()=>{const k=Ul.value.length,y=Ml.value.size;return y>0&&y<k}),xl=(k,y)=>Ml.value.has(V(k,y)),Cl=()=>{if(Xl.value)Ml.value=new Set,C("unselect-all");else{const k=new Set;Ul.value.forEach((y,x)=>k.add(V(y,x))),Ml.value=k,C("select-all",El.value)}},Pn=(k,y)=>{const x=V(k,y),q=new Set(Ml.value),ue=q.has(x);fe.value==="single"?ue?(q.delete(x),C("row-unselect",k)):(q.clear(),q.add(x),C("row-select",k)):ue?(q.delete(x),C("row-unselect",k)):(q.add(x),C("row-select",k)),Ml.value=q},Ot=e.ref("1"),gl=()=>{const k=Number.parseInt(String(Ot.value),10);if(!Number.isFinite(k)){Ot.value=String(il.value+1);return}const y=Math.min(Je.value,Math.max(1,k));y!==il.value+1?hn(y-1):Ot.value=String(y)},hn=k=>{k<0||k>=ct.value||(il.value=k,C("page",{page:k,rows:Tl.value}))},On=(k,y,x)=>{C("row-click",{data:k,index:y,originalEvent:x}),We(k,yt.value+y)},Zn=(k,y)=>{const x=yt.value+y;return{"dss-table-row-selected":xl(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ge.value,"dss-table-row-truncated-expanded":J.value===V(k,x)}},Kt=(k,y)=>y.field?Al(k,y.field):"",Al=(k,y)=>y.split(".").reduce((x,q)=>x&&x[q],k),$n=k=>{const y=k.align??Y.value;return{"dss-table-sortable":k.sortable!==!1&&st.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ln=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(()=>se.locale,k=>{k&&k!==$.value&&($.value=k)},{immediate:!0}),e.watch(Lt,k=>{Tl.value=k,il.value=0}),e.watch(wl,async k=>{k&&(await e.nextTick(),Ql())}),e.watch(il,k=>{Ot.value=String(k+1)},{immediate:!0}),e.watch(lt,k=>{C("search",k??"")}),e.watch(()=>se.columns,()=>{he()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ye),document.addEventListener("click",N),document.addEventListener("click",Bn),window.addEventListener("resize",Bl),window.addEventListener("scroll",Bl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",ye),document.removeEventListener("click",N),document.removeEventListener("click",Bn),window.removeEventListener("resize",Bl),window.removeEventListener("scroll",Bl,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:fl,style:e.normalizeStyle({width:ve.value+"px",height:xe.value?xe.value+"px":"auto"})},[ft.value?(e.openBlock(),e.createElementBlock("div",zi,[e.createElementVNode("div",Pi,[It.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>C("download-pdf"))},[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)"><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(M)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>C("download-excel"))},[y[23]||(y[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(M)("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:oe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":He.value}]),onClick:y[2]||(y[2]=x=>He.value=!He.value),"aria-expanded":He.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(M)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Oi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Zi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Ze(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Wi,[e.createElementVNode("span",qi,[e.createElementVNode("input",{type:"checkbox",checked:Z(x,q),onChange:ue=>j(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ui),Z(x,q)?(e.openBlock(),e.createElementBlock("span",Xi,[...y[25]||(y[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Yi,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,He.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ji,[Ut.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Nt.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:rl,"onUpdate:modelValue":y[4]||(y[4]=x=>lt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(M)("table.searchPlaceholder"),"aria-label":e.unref(M)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>Nt.value=!0),onBlur:Ne},null,40,Ki),[[e.vModelText,lt.value]]),lt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(M)("table.clearSearchAriaLabel"),onClick:Ie},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Gi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(M)("table.searchAriaLabel"),"aria-expanded":Nt.value||!!lt.value,onMousedown:e.withModifiers(Ve,["prevent"])},[...y[27]||(y[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,Qi)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ji,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":$t.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",ut.value])},[e.createElementVNode("thead",ec,[e.createElementVNode("tr",null,[_e.value?(e.openBlock(),e.createElementBlock("th",tc,[fe.value==="multiple"?(e.openBlock(),e.createElementBlock("span",lc,[e.createElementVNode("input",{type:"checkbox",checked:Xl.value,indeterminate:wn.value,onChange:Cl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,nc),wn.value?(e.openBlock(),e.createElementBlock("span",oc)):Xl.value?(e.openBlock(),e.createElementBlock("span",ac,[...y[28]||(y[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(M)("table.expandRowAriaLabel")},null,8,sc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:W(x),class:e.normalizeClass(["dss-table-th",$n(x)]),style:e.normalizeStyle(Ln(x)),onClick:ue=>In(x)},[e.createElementVNode("div",ic,[e.createElementVNode("span",cc,e.toDisplayString(x.header),1),x.sortable!==!1&&st.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Vt(x)])},[Et(x)===0?(e.openBlock(),e.createElementBlock("span",uc,[...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:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Et(x)===1?(e.openBlock(),e.createElementBlock("span",dc,[...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 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Et(x)===-1?(e.openBlock(),e.createElementBlock("span",mc,[...y[31]||(y[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":kt.value===W(x)}]),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":ie(W(x))}]),"data-filter-column-key":W(x),"aria-expanded":kt.value===W(x),"aria-label":e.unref(M)("table.filterColumnAriaLabel"),onClick:ue=>vl(W(x),ue)},[...y[32]||(y[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,pc)],2)):e.createCommentVNode("",!0)])],14,rc))),128))])]),e.createElementVNode("tbody",fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:V(x,yt.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Zn(x,q)]),style:e.normalizeStyle(ne.value),onClick:ue=>On(x,q,ue)},[_e.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",gc,[e.createElementVNode("input",{type:fe.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${L.tableId}`,checked:xl(x,yt.value+q),onChange:ue=>Pn(x,yt.value+q),class:e.normalizeClass(["dss-table-checkbox",fe.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,hc),fe.value==="multiple"&&xl(x,yt.value+q)?(e.openBlock(),e.createElementBlock("span",yc,[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):fe.value==="single"&&xl(x,yt.value+q)?(e.openBlock(),e.createElementBlock("span",Cc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),X.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>Be(x,yt.value+q,ue),["stop"])},[ot(x,yt.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Se(x,yt.value+q),"aria-label":Se(x,yt.value+q)?e.unref(M)("table.collapseRowAriaLabel"):e.unref(M)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Se(x,yt.value+q)}]),"aria-hidden":"true"},[...y[34]||(y[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,bc)):(e.openBlock(),e.createElementBlock("span",wc))],8,kc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ke.value,(ue,Qe)=>(e.openBlock(),e.createElementBlock("td",{key:W(ue),class:e.normalizeClass(["dss-table-td",$n(ue)]),style:e.normalizeStyle(Ln(ue))},[e.renderSlot(k.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:J.value===V(x,yt.value+q)},()=>[e.createTextVNode(e.toDisplayString(Kt(x,ue)),1)])],6))),128))],14,vc),X.value&&ot(x,yt.value+q)&&Se(x,yt.value+q)?(e.openBlock(),e.createElementBlock("tr",xc,[e.createElementVNode("td",{colspan:b.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:q})],8,Ec)])):e.createCommentVNode("",!0)],64))),128)),_n.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:b.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(tt.value),1)])],8,Vc)],4))])],2)],2),Dt.value?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("div",Nc,[At.value?(e.openBlock(),e.createElementBlock("span",Bc,e.toDisplayString(e.unref(M)("table.showingRange",{start:ht.value,end:K.value,total:Ae.value})),1)):(e.openBlock(),e.createElementBlock("span",Mc," "))]),e.createElementVNode("div",_c,[Ct.value?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value===0,onClick:y[8]||(y[8]=x=>hn(0)),title:e.unref(M)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Lc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value===0,onClick:y[9]||(y[9]=x=>hn(il.value-1)),title:e.unref(M)("table.previousPage")}," ‹ ",8,Tc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>Ot.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(M)("table.currentPageAriaLabel"),onBlur:gl,onKeydown:e.withKeys(e.withModifiers(gl,["prevent"]),["enter"])},null,40,Ac),[[e.vModelText,Ot.value]]),e.createElementVNode("span",Dc,e.toDisplayString(e.unref(M)("table.ofPages",{total:Je.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value>=ct.value-1,onClick:y[11]||(y[11]=x=>hn(il.value+1)),title:e.unref(M)("table.nextPage")}," › ",8,Hc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:il.value>=ct.value-1,onClick:y[12]||(y[12]=x=>hn(ct.value-1)),title:e.unref(M)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Rc)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fc,[pl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:cn},[e.createElementVNode("span",Ic,e.toDisplayString(e.unref(M)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":wl.value}]),onClick:y[13]||(y[13]=x=>wl.value=!wl.value),"aria-expanded":wl.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Mn},[e.createTextVNode(e.toDisplayString(Tl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,zc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":gn.value==="top"}]),style:e.normalizeStyle(zn.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Tl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Tl.value}]),onClick:q=>bt(x)},e.toDisplayString(x),11,Pc))),128))],6),[[e.vShow,wl.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Ht.value?{top:Ht.value.top+"px",left:Ht.value.left+"px",width:Gl+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[jt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[jt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Oc,[e.createElementVNode("input",{type:"text",value:O(kt.value).value??"",onInput:y[14]||(y[14]=x=>Nl(kt.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(M)("table.search")},null,40,Zc)])):jt.value.filter==="range"&&Rt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Rt.value.minPct+"%","--range-max-pct":Rt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Ll,class:"dss-table-filter-double-range-track",onMousemove:I,onMouseenter:I},[e.createElementVNode("input",{type:"range",min:Rt.value.rangeMin,max:Rt.value.rangeMax,value:Rt.value.currentMin,onInput:y[15]||(y[15]=x=>ql(kt.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:bl.value==="min"?2:1})},null,44,Wc),e.createElementVNode("input",{type:"range",min:Rt.value.rangeMin,max:Rt.value.rangeMax,value:Rt.value.currentMax,onInput:y[16]||(y[16]=x=>ql(kt.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:bl.value==="max"?2:1})},null,44,qc)],544),e.createElementVNode("div",Uc,e.toDisplayString(Rt.value.currentMin)+" – "+e.toDisplayString(Rt.value.currentMax),1)],4)):jt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Xc,[e.createElementVNode("div",Yc,[e.createElementVNode("label",jc,e.toDisplayString(e.unref(M)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:O(kt.value).from??"",onInput:y[17]||(y[17]=x=>vn(kt.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Kc)]),e.createElementVNode("div",Gc,[e.createElementVNode("label",Qc,e.toDisplayString(e.unref(M)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:O(kt.value).to??"",onInput:y[18]||(y[18]=x=>vn(kt.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Jc)])])):jt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:rn[kt.value]??"",onInput:y[19]||(y[19]=x=>Nn(kt.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(M)("table.search")},null,40,eu),e.createElementVNode("div",tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(eo(jt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Rn(kt.value,x),onChange:q=>Fn(kt.value,x)},null,40,lu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",nu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>Te(kt.value))},e.toDisplayString(e.unref(M)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,kt.value&&jt.value&&Ht.value]])]),_:1})]))],64))}}),su={class:"dss-toolbar-left"},ru=["title"],iu=["title"],cu={class:"dss-toolbar-dropdown-wrapper"},uu=["title"],du={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"},mu={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"},pu={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"},fu={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"},vu={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"},gu={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"},hu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},yu=["title"],Cu=["title"],ku=["title"],bu=["title"],wu=["title"],xu=["title"],Eu=["title"],Vu=["title"],Su=["title"],Nu={key:2,class:"dss-toolbar-separator"},Bu=["title"],Mu={key:4,class:"dss-toolbar-separator"},_u={key:5,class:"dss-toolbar-dropdown-wrapper"},$u=["title"],Lu={class:"dss-toolbar-dropdown-ai"},Tu={class:"dss-toolbar-right"},Au={key:0,class:"dss-toolbar-custom-group"},Du={key:1,class:"dss-toolbar-separator"},Hu={class:"dss-link-modal-content"},Ru={class:"dss-link-modal-field"},Fu={class:"dss-link-modal-label"},Iu=["placeholder"],zu={class:"dss-link-modal-field"},Pu={class:"dss-link-modal-label"},Ou=["placeholder"],Zu={class:"dss-image-modal-tabs"},Wu={key:0,class:"dss-image-tab-content"},qu={class:"dss-link-modal-content"},Uu={class:"dss-link-modal-field"},Xu={key:0,class:"dss-link-modal-label"},Yu=["src"],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"},ld={class:"dss-link-modal-label"},nd=["placeholder"],od={key:1,class:"dss-image-tab-content"},ad={class:"dss-link-modal-content"},sd={class:"dss-link-modal-field"},rd={class:"dss-link-modal-label"},id=["placeholder"],cd={class:"dss-link-modal-field"},ud={class:"dss-link-modal-label"},dd=["placeholder"],md={class:"dss-link-modal-field"},pd={class:"dss-link-modal-label"},fd=["placeholder"],vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-text-editor-title-input-container"},Cd={key:0,class:"dss-text-editor-title-preview"},kd={key:0},bd={key:1,class:"dss-text-editor-preview-placeholder"},wd=["value","placeholder","disabled"],xd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Ed={class:"dss-text-editor-description-input-container"},Vd={key:0,class:"dss-text-editor-description-preview"},Sd={key:0},Nd={key:1,class:"dss-text-editor-preview-placeholder"},Bd=["value","placeholder","disabled"],Md={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},_d=["data-comment-id","onMouseenter"],$d=["onClick"],Ld=["src","alt"],Td={key:1},Ad=["onClick"],Dd=["src","alt"],Hd={key:1},Rd=["data-has-second-user","onClick"],Fd={class:"editor-comment-marker-count"},Id={key:4,class:"dss-text-editor-textarea-wrapper"},zd=["value","placeholder","rows","disabled"],Pd={class:"dss-text-editor-footer"},Od={class:"dss-text-editor-footer-content"},Zd={class:"dss-text-editor-footer-stat"},Wd={class:"dss-text-editor-footer-stat"},qd={key:5,class:"dss-text-editor-content-wrapper"},Ud={key:0,class:"dss-comment-overlay-body"},Xd={class:"dss-comment-selection-wrapper"},Yd=["innerHTML"],jd={class:"dss-comment-messages-wrapper"},Kd={key:0,class:"dss-comment-avatar-wrapper"},Gd={class:"dss-comment-avatar"},Qd=["src","alt"],Jd={key:1},e1={class:"dss-comment-header"},t1={class:"dss-comment-header-text"},l1={class:"dss-comment-author"},n1={key:0,class:"dss-comment-date"},o1=["onClick","title"],a1={class:"dss-comment-overlay-inner"},s1=["placeholder","onKeydown"],r1={class:"dss-text-editor-footer"},i1={class:"dss-text-editor-footer-content"},c1={class:"dss-text-editor-footer-stat"},u1={class:"dss-text-editor-footer-stat"},d1=["title"],m1=["title"],p1={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:""},f1={class:"dss-image-popup-content"},v1={key:0,class:"dss-image-popup-no-alt-icon"},g1=["title"],h1=["title"],y1={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"},k1=["title"],b1=["title"],w1={class:"dss-toolbar-dropdown-wrapper"},x1=["title"],E1={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"},S1={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"},N1={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"},B1={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"},M1={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"},_1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},$1=["title"],L1=["title"],T1=["title"],A1=["title"],D1=["title"],H1=["title"],R1=["title"],F1=["title"],I1=["title"],z1=["title"],P1={key:2,class:"dss-toolbar-separator"},O1={key:3,class:"dss-toolbar-dropdown-wrapper"},Z1=["title"],W1={class:"dss-toolbar-dropdown-ai"},q1={key:0,class:"dss-toolbar-right"},U1={key:0,class:"dss-toolbar-separator"},X1={key:0,class:"dss-toolbar-custom-group"},Y1={key:1,class:"dss-toolbar-separator"},j1={name:"DSSTextEditor"},K1=Object.assign(j1,{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:L=>typeof L=="object"&&L!==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:L=>typeof L=="object"&&L!==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(L,{expose:re,emit:M}){const{t:$,locale:se}=Kn.useI18n(),C=L,Ee=M,le=e.useSlots(),Ge=`<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>`,p=e.ref(null),ve=e.ref(null),xe=e.ref(!1),de=e.ref(!1),ne=e.ref(!1),X=e.ref(""),pe=e.ref({}),A=e.ref(!1),ge=e.ref(!1),Le=e.ref(""),qe=e.ref(""),vt=e.ref(null),R=e.ref(null),Y=e.ref(null),_e=e.ref(null),fe=e.ref(""),st=e.ref(!1),Ce=e.ref({}),Ue=e.ref(!1),Lt=e.ref({}),Pe=e.ref(null),At=e.ref(null),pt=e.ref(!1),Ct=e.ref(""),ml=e.ref(null),Dt=e.ref(""),$t=e.ref(""),tt=e.ref(""),It=e.ref(null),Ft=e.ref(null),Ut=e.ref(null),ft=e.ref(null),Tt=e.ref(null),lt=e.ref(!1),Nt=e.ref(""),rl=e.ref({}),G=e.ref(!1),Ve=e.ref("upload"),Ne=e.ref(""),Ie=e.ref(null),ut=e.ref(null),Ze=e.ref([]),et=e.ref([]),he=e.ref(null),Ke=e.ref(!1),W=e.ref(""),Z=e.ref(""),j=e.ref(""),oe=e.ref(""),He=e.ref(""),N=e.ref(""),b=e.ref(null),V=e.ref(null),ee=e.ref(null),J=e.ref(!1),Se=e.ref(null),ot=e.ref(!1),Be=e.ref(!1),We=e.ref(null),Xe=e.ref("p"),at=e.ref(!1),gt=e.ref([]),Et=e.ref(null),Vt=e.ref(null),kl=e.ref(null),kt=e.ref(!1),Ht=e.ref(0),Gl=100,pl=e.ref(null),jt=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":Qe.value!==null})),Rt=e.computed(()=>({})),Ll=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),bl=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),I=e.computed(()=>C.richText&&et.value.length>0),O=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=O.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),ie=e.computed(()=>O.value.length),Te=e.computed(()=>ft.value!==null&&Ve.value==="upload"&&Dt.value&&Dt.value.startsWith("data:")),rt=e.computed(()=>C.titlePlaceholder||$("textEditor.placeholders.title")),it=e.computed(()=>C.descriptionPlaceholder||$("textEditor.placeholders.description")),Ye=e.computed(()=>C.placeholder||$("textEditor.placeholders.startTyping")),nt=o=>le&&le[o]!==void 0,yl=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++)if(nt(C.customToolbarSlots[n]))return!0;return!1},fl=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++){const a=C.customToolbarSlots[n];if(nt(a)&&Nl(a))return!0}return!1},Nl=o=>C.customToolbarFloatingMap.hasOwnProperty(o)?C.customToolbarFloatingMap[o]===!0:!0,zl=e.computed(()=>C.customToolbarSlots.some(o=>nt(o)&&Nl(o))),ql=e.computed(()=>nt("title-slot")),vn=e.computed(()=>nt("description-slot")),rn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},Nn=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},eo=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())},Rn=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""}},Fn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=$("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Bn=o=>{const n=o.target.value;Ee("update:modelValue",n),Ee("change",n)},Bl=()=>{if(!b.value)return;const o=b.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")},In=()=>{ot.value=!0,Bl()},Ul=()=>{ot.value=!1,il()},il=()=>{if(!b.value)return;const o=b.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")},Tl=o=>{const a=o.target.value;ot.value&&Bl(),Ee("update:title",a),Ee("title-change",a),ee.value="title",C.richText&&(Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae()},500))},wl=()=>{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")},cn=()=>{Be.value=!0,wl()},Mn=()=>{Be.value=!1,gn()},gn=()=>{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 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")},zn=o=>{const a=o.target.value;Be.value&&wl(),Ee("update:description",a),Ee("description-change",a),ee.value="description",C.richText&&(Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae()},500))},bt=()=>{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(p.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},ye=o=>{if(!(!o||!p.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.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{p.value.focus()}},Ql=()=>{if(!p.value)return;p.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(p.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(!p.value)return;const n=p.value.innerHTML,a=C.title||"",r=C.description||"";if(!o&&n===W.value&&a===j.value&&r===oe.value)return;const c={content:Z.value||W.value,title:He.value!==void 0?He.value:j.value,description:N.value!==void 0?N.value:oe.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(),et.value=[]),W.value=n,j.value=a,oe.value=r,Z.value=n,He.value=a,N.value=r},ct=o=>{if(!p.value)return;Je(),p.value&&eo(p.value);let n=null;p.value&&(p.value.querySelector("p")||(n=bt(),ht()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&We.value&&(We.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=rn(r);Ee("update:modelValue",c),Ee("change",c),ee.value="editor",Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae(),Ol(),on()},500),e.nextTick(()=>{n&&ye(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&&We.value?.command===h){Ce.value[h]=We.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,T=_.nodeType===3?_.parentElement:_;let S=!1;if(T&&((T.tagName==="STRONG"||T.tagName==="B"||T.closest&&T.closest("strong, b"))&&(S=!0),!S&&T.style&&parseInt(T.style.fontWeight)>=600&&(S=!0),!S))try{const te=window.getComputedStyle(T);parseInt(te.fontWeight)>=600&&(S=!0)}catch{}Ce.value[h]=S}else Ce.value.hasOwnProperty(h)||(Ce.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,T=_.nodeType===3?_.parentElement:_,S=T&&(T.tagName==="EM"||T.tagName==="I"||T.closest&&T.closest("em, i"));Ce.value[h]=!!S}else{const _=document.queryCommandState(h);Ce.value[h]=_}else{const _=document.queryCommandState(h);Ce.value[h]=_}}catch{}}),x(),K(),El(),Zt(),tn(),Il("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>on(h),0),(h===" "||h===`
101
- `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Ol()},100)}de.value=!1})},Je=()=>{if(!p.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)}}}},ht=()=>{if(!p.value)return;const o=p.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)}})},K=()=>{if(p.value&&!J.value){J.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.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()}),p.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:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(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=Ge,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{J.value=!1}}},yt=o=>{Ol(),Ee("blur",o),Pl()},De=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),he.value&&(clearTimeout(he.value),he.value=null),Ke.value&&(Ae(),Ke.value=!1);const o=ee.value==="title",n=ee.value==="description",a=ee.value==="editor";if(Ze.value.length===0){o&&b.value?b.value.focus():n&&V.value?V.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ct()});return}const r={content:p.value.innerHTML,title:C.title||"",description:C.description||""};et.value.push(r);const c=Ze.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,W.value=d,j.value=u,oe.value=m,Z.value=d,He.value=u,N.value=m,e.nextTick(()=>{x(),Kt(),Rl(),Zt();const v=rn(d);Ee("update:modelValue",v),Ee("update:title",u),Ee("update:description",m),Ee("change",v),Ee("title-change",u),Ee("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(b.value){b.value.focus();const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}}else if(n){if(V.value){V.value.focus();const h=m.length;V.value.setSelectionRange(h,h)}}else if(a)Ql();else if(b.value&&document.activeElement===b.value){const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}else if(V.value&&document.activeElement===V.value){const h=m.length;V.value.setSelectionRange(h,h)}else p.value&&Ql()},10)})})}},_n=()=>{if(C.disabled||!C.richText||!p.value)return;Ot();const o=ee.value==="title",n=ee.value==="description",a=ee.value==="editor";if(et.value.length===0){o&&b.value?b.value.focus():n&&V.value?V.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ct()});return}const r={content:p.value.innerHTML,title:C.title||"",description:C.description||""};Ze.value.push(r);const c=et.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,W.value=d,j.value=u,oe.value=m,Z.value=d,He.value=u,N.value=m,e.nextTick(()=>{x(),Kt(),Rl(),Zt();const v=rn(d);Ee("update:modelValue",v),Ee("update:title",u),Ee("update:description",m),Ee("change",v),Ee("title-change",u),Ee("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(b.value){b.value.focus();const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}}else if(n){if(V.value){V.value.focus();const h=m.length;V.value.setSelectionRange(h,h)}}else if(a)Ql();else if(b.value&&document.activeElement===b.value){const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}else if(V.value&&document.activeElement===V.value){const h=m.length;V.value.setSelectionRange(h,h)}else p.value&&Ql()},10)})})}},Ml=()=>{if(!p.value)return;p.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)}}),p.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)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},El=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Xl=()=>{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!==p.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!==p.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(()=>{El()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{El()});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(()=>{El()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{El()})}return!0},wn=()=>{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!==p.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!==p.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(()=>{Ml()}),!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!==p.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===p.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)}}Ml()});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(()=>{Ml()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ml()})}return!0},xl=(o,n=null)=>{if(C.disabled||!C.richText||!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&ln(d)&&(r=bt())}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=wn();Ce.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(We.value={command:"bold",state:d}),e.nextTick(()=>{r&&(ye(r),e.nextTick(()=>{const m=Cl("bold");Ce.value.bold=m})),ct(),Kt(),Zt()});return}if(o==="italic"){const d=Xl();Ce.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(We.value={command:"italic",state:d}),e.nextTick(()=>{r&&(ye(r),e.nextTick(()=>{const m=Cl("italic");Ce.value.italic=m})),ct(),El(),Kt(),Zt()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&ye(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Cl("bold");Ce.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Cl("italic");Ce.value.italic=u});else{const u=document.queryCommandState(o);Ce.value[o]=u}else{const u=document.queryCommandState(o);Ce.value[o]=u}}catch{Ce.value.hasOwnProperty(o)?Ce.value[o]=!Ce.value[o]:Ce.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const 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)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}ct(),Kt(),Zt()})},Cl=(o,n=null)=>{if(C.disabled||!p.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 Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let S=_.parentElement;for(;S&&S!==p.value;){if(S.tagName==="STRONG"||S.tagName==="B"){u=!0;break}if(S.style&&parseInt(S.style.fontWeight)>=600){u=!0;break}S=S.parentElement}}else if(_.nodeType===1){const T=_;if(T.tagName==="STRONG"||T.tagName==="B"){u=!0;break}if(T.style&&parseInt(T.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ce.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 Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let S=_.parentElement;for(;S&&S!==p.value;){if(S.tagName==="EM"||S.tagName==="I"){u=!0;break}if(S.style&&S.style.fontStyle==="italic"){u=!0;break}S=S.parentElement}}else if(_.nodeType===1){const T=_;if(T.tagName==="EM"||T.tagName==="I"){u=!0;break}if(T.style&&T.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ce.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.value[o]=d,d)}return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}catch{return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Pn=o=>{C.disabled||!C.richText||(ve.value=ve.value===o?null:o,o==="askAi"&&(At.value=null))},Ot=()=>{ve.value=null,Ie.value=null},vl=o=>{xl("formatBlock",o),Ot()},hn=o=>{if(!o||!p.value)return o;const n=Re=>{let be=Re.nodeType===Node.TEXT_NODE?Re.parentElement:Re;for(;be&&be!==p.value;){const mt=be.tagName;if(mt==="P"){const dl=be.parentElement;if(dl===p.value||dl.tagName==="BLOCKQUOTE")return be}if(mt==="BLOCKQUOTE")break;be=be.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Re=>{const be=Re.tagName;if(be==="P"){const mt=Re.parentElement;if(mt===p.value||mt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return be==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),T=c.slice(h,_+1);if(T.length===0)return o;const S=T[0],te=T[T.length-1],U=document.createRange();return U.setStartBefore(S),U.setEndAfter(te),U},On=()=>{if(C.disabled||!C.richText||!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&ln(n)&&(n=hn(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&ln(n)&&(a=bt());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.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:S=>S.parentNode===u&&S.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(S=>{const te=document.createElement("p");S.parentNode.insertBefore(te,S),te.appendChild(S)}),u.querySelectorAll("p, div").forEach(S=>{S.textContent.trim()===""&&!S.querySelector("img")&&(S.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const S=document.createElement("p");S.innerHTML="<br>",u.appendChild(S)}}e.nextTick(()=>{a&&ye(a),Rl(),ct(),Zt()})},Zn=()=>{if(!p.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||!p.value.contains(r))return;const c=_=>{if(!_)return!1;const T=_.textContent||"",te=(_.innerHTML||"").trim();return T.trim()===""||te===""||te==="<br>"||te==="<br/>"||te==="<p></p>"||te==="<p><br></p>"||te==="<p><br/></p>"||te==="<p> </p>"||te==="<p><br> </p>"||te==="<div></div>"||te==="<div><br></div>"||te==="<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 _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const T=r.children[_];if((T.tagName==="P"||T.tagName==="DIV")&&c(T))T.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):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Rl(),ct()})},Kt=()=>{if(!p.value){xe.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");xe.value=!!r}else xe.value=!1}catch{xe.value=!1}},Al=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),_e.value=bt();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),Le.value="",qe.value=a,fe.value="",Y.value=null,ge.value=!0,Ot(),e.nextTick(()=>{vt.value&&vt.value.focus()})},$n=()=>{if(!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.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&&Y.value&&(n=Y.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)}Y.value=null}else xl("unlink");xe.value=!1,Ot(),e.nextTick(()=>{ct(),Kt()})},Ln=()=>{C.disabled||!C.richText||p.value&&(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{x(),ct(),Zt()}))},k=()=>{C.disabled||!C.richText||p.value&&(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{x(),ct(),Zt()}))},y=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},x=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=y(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},q=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),p.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(()=>{x(),ct()});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=y(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),x();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ct(),Zt()})}else document.execCommand("indent",!1),e.nextTick(()=>{x(),ct(),Zt()})},ue=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),p.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(()=>{x(),ct()});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(),x();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ct(),Zt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{x(),ct(),Zt()})},Qe=e.ref(null),xt=e.ref(null),Jt=e.ref({}),zt=e.ref(""),el=e.ref(null),tl=e.ref("");e.ref("");const Yl=e.ref(null);e.ref("");const _l=e.ref([]),to=e.ref(!1),Tn=e.ref(!1),Lo=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},mo=()=>{if(C.disabled||!C.richText||!p.value)return;if(Qe.value!==null){Qe.value=null,zt.value="",tl.value="",Yl.value=null,_l.value=[],bn(!0);return}Ot(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!ln(n))return;tl.value=Lo(n)||"",Yl.value=bt();const a=n.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);Jt.value={top:`${m}px`,bottom:"auto"},Qe.value=Date.now(),e.nextTick(()=>{if(zt.value="",el.value){const h=el.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 _=r.getBoundingClientRect(),T=v.getBoundingClientRect(),S=h.getBoundingClientRect(),te=T.bottom-_.top,U=S.top-_.top,Re=8;if(te>U-Re){const be=S.height;Jt.value={bottom:`${be+Re}px`,top:"auto"}}else Jt.value={top:`${m}px`,bottom:"auto"}}}})},po=()=>{if(!zt.value.trim())return;const o=zt.value.trim(),n=new Date,a={text:o,selectionText:tl.value,selectionRange:Yl.value,commentId:Qe.value,user:C.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],Ee("comment-submitted",a),Ao(a),Yl.value&&!lo(Yl.value)&&To(Qe.value,Yl.value),zt.value="",e.nextTick(()=>{if(el.value){const r=el.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Il("sendComment")})},fo=(o,n)=>{if(!(!C.commentUser||!o.user||o.user.id!==C.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),Qe.value!==null&&p.value){const a=String(Qe.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_l.value.length>0){const c=[],d=new Set;_l.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(_l.value.length))}else r&&_l.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ee("comment-deleted",{comment:o,index:n,commentId:Qe.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));Ee("update:comments",a)}e.nextTick(()=>{Il("deleteComment")})}},lo=o=>{if(!o||!p.value)return!1;try{const n=no(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},no=o=>{if(!o||!p.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[p.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}},To=(o,n)=>{if(!(!o||!n||!p.value))try{const a=no(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,_=a.endOffset,T=m.nodeType===3?m.parentNode:m,S=v.nodeType===3?v.parentNode:v;if(T===S&&h===0&&_===(v.nodeType===3?v.length:S.childNodes.length)&&(T.tagName==="P"||T.tagName==="DIV"||T.tagName==="H1"||T.tagName==="H2"||T.tagName==="H3"||T.tagName==="H4"||T.tagName==="H5"||T.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=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Il("wrapSelectionWithCommentMarker"),ct()})}catch{}},Ao=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)}to.value=!0,Ee("update:comments",n)},oo=(o,n=[])=>{if(C.disabled||!C.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Ot(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),tl.value=r.innerHTML||"",Yl.value=bt();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),T=u.bottom-_.top,te=Math.max(T+8,0);Jt.value={top:`${te}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 _=C.comments.find(T=>String(T.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const T=_.conversation.map(S=>({id:S.id||S.commentary_id,commentary_id:S.id||S.commentary_id,conversation_id:_.id||_.conversation_id,text:S.text,user:S.user,createdAt:S.created_at||S.createdAt,updated_at:S.updated_at||S.updatedAt}));h.push(...T)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((_,T)=>{const S=Re=>{if(!Re)return 0;const be=new Date(Re).getTime();return isNaN(be)?0:be},te=S(_.createdAt),U=S(T.createdAt);return te===U?0:te-U}),_l.value=h,bn(!0),Qe.value=v||null,r&&(xt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(zt.value="",el.value){const _=el.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const T=m.querySelector(".dss-text-editor-footer");if(T){const S=m.getBoundingClientRect(),te=_.getBoundingClientRect(),U=T.getBoundingClientRect(),Re=te.bottom-S.top,be=U.top-S.top,mt=8;if(Re>be-mt){const dl=U.height;Jt.value={bottom:`${dl+mt}px`,top:"auto"}}}}}Il("openCommentOverlayForSelector")})},ao=e.ref(null),Wn=e.ref(0),Vl=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&&p.value&&p.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(()=>{Zn()},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,T=a.cloneContents().textContent?.trim()||"",S=c.textContent?.trim()||"";(!v||!h||T.length>S.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(()=>{ct()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?ue():q();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 _=v.parentElement;return _&&_!==p.value?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!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const T=a.startOffset;T<u.length&&(_=u.splitText(T));const S=document.createElement("p");if(_?S.appendChild(_):S.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(S,h.nextSibling):h.parentNode.appendChild(S);const te=document.createRange();_?te.setStart(_,0):te.setStart(S,0),te.collapse(!0),n.removeAllRanges(),n.addRange(te),e.nextTick(()=>{ct()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.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 Re=U.textContent||"",mt=(U.innerHTML||"").trim(),dl=mt.replace(/<br\s*\/?>/gi,"").trim();return Re.trim()===""||mt===""||dl===""||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",_=a.startContainer,T=_.nodeType===3?_.parentElement:_,S=T===c||T&&T.parentElement===c;if(u&&m(u)||h&&S){o.preventDefault(),setTimeout(()=>{Zn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Wn.value;if(ao.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(),q();return}}}}ao.value=" ",Wn.value=n}else ao.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=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(T=>{if(h>0){const S=v.createElement("p");S.innerHTML=T.innerHTML,T.parentNode.replaceChild(S,T)}else h++}),c){const T=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],S=Array.from(v.body.children).filter(te=>T.includes(te.tagName));if(S.length===1){const te=S[0].tagName,U=c.tagName,Re=c.textContent.trim()===""&&!c.querySelector("img");let be=!1;if(["H1","H2","H3","H4","H5","H6"].includes(U)?be=!0:Re||(te===U||te==="P")&&(be=!0),be)return S[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);ct()},gl=o=>{if(ve.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ot()}if(Ue.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&Pl()}if(At.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&go()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ie.value=null),!p.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);at.value=!r.collapsed&&ln(r)}else at.value=!1}if(Qe.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&&(Qe.value=null,zt.value="",tl.value="",Yl.value=null,_l.value=[],bn(!0))}},Dl=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),ut.value&&(clearTimeout(ut.value),ut.value=null),Ie.value=n},hl=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}ut.value&&clearTimeout(ut.value),ut.value=setTimeout(()=>{Ie.value=null,ut.value=null},150)},Jl=o=>{Ie.value=null};let Gt=0;const cl=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-${++Gt}`;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(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},en=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{cl(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&&Dl(v,h)},m=hl;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 _=c.getAttribute("data-submenu-id");_&&Dl(h,_)},m=hl;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",Jl)})})})};let Hl=null;const Bt=()=>{if(Ie.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ie.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ie.value}"]`);o&&n&&Xn(o,n)}if(Ue.value&&Zt(),C.richText){if(Hl!==null)return;Hl=setTimeout(()=>{Hl=null,Il("handleWindowResize")},150)}},Mt=()=>{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")})})},wt=()=>{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(()=>{ot.value?Bl():il(),Be.value?wl():gn()})}),e.nextTick(()=>{wt()}),C.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",gl),window.addEventListener("resize",Bt);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,Bt()},150))};window.addEventListener("scroll",n,!0),p.value._windowScrollHandler=n,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Bt()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{en(),Mt()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!C.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),T=v.closest(".dss-image-wrapper");if(_||T&&v===T){m.preventDefault(),m.stopPropagation();const S=window.getSelection(),te=document.createRange();te.setStartAfter(T),te.collapse(!0),S.removeAllRanges(),S.addRange(te)}else T&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const S=window.getSelection();if(S.rangeCount>0){const U=S.getRangeAt(0).commonAncestorContainer,Re=U.nodeType===3?U.parentElement:U;if(T.contains(Re)&&Re!==T.querySelector("img")){const be=document.createRange();be.setStartAfter(T),be.collapse(!0),S.removeAllRanges(),S.addRange(be)}}else{const te=document.createRange();te.setStartAfter(T),te.collapse(!0),S.addRange(te)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const T=window.getSelection(),S=document.createRange();_&&(S.setStartAfter(_),S.collapse(!0),T.removeAllRanges(),T.addRange(S))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.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 T=h.getAttribute("alt")||h.alt||"";if(T){const S=h.getAttribute("src")||h.src||"",te=S.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),U=T===S||T===te;(T.startsWith("http://")||T.startsWith("https://")||T.startsWith("data:")||U||U)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),K()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Se.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Se.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Se.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Se.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Se.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,T=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Se.value=null;return}let S=null;const te=m.clientX,U=m.clientY;if(document.caretRangeFromPoint)S=document.caretRangeFromPoint(te,U);else{const Xt=window.getSelection();Xt.rangeCount>0?S=Xt.getRangeAt(0).cloneRange():(S=document.createRange(),S.selectNodeContents(p.value),S.collapse(!1))}if(!S){Se.value=null;return}const Re=S.commonAncestorContainer,be=Re.nodeType===3?Re.parentElement:Re;if(be?.closest(".dss-image-wrapper")===T||T&&T.contains(be)){Se.value=null;return}if(T&&(be===T||T.contains(be))){Se.value=null;return}const dl=_.getAttribute("src");let nl=null;T?nl=T.cloneNode(!0):nl=_.cloneNode(!0);try{let Xt=S.startContainer;if(Xt.nodeType===3&&(Xt=Xt.parentElement),T&&(Xt===T||T.contains(Xt))){const qt=document.createRange();qt.setStartAfter(T),qt.collapse(!0),S=qt}S.insertNode(nl);const ol=document.createRange();ol.setStartAfter(nl),ol.collapse(!0);const al=window.getSelection();al.removeAllRanges(),al.addRange(ol)}catch{if(p.value.childNodes.length===0){const ol=document.createElement("p");ol.appendChild(nl),p.value.appendChild(ol)}else{const ol=p.value.lastChild;if(ol&&ol.nodeType===1)ol.appendChild(nl);else{const al=document.createElement("p");al.appendChild(nl),p.value.appendChild(al)}}}T?T.remove():_.remove(),Se.value=null,e.nextTick(()=>{const Xt=p.value.querySelectorAll("img");let ol=!1;Xt.forEach(al=>{if(al.getAttribute("src")===dl)if(!ol)ol=!0;else{const qt=al.closest(".dss-image-wrapper");qt?qt.remove():al.remove()}}),K(),ct()})}),p.value.addEventListener("dragend",m=>{Se.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 _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach(T=>{T.removeAttribute("alt"),T.removeAttribute("data-alt"),T.setAttribute("alt",""),T.setAttribute("data-alt",""),T.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{K(),Mt(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Mt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),C.modelValue){const m=Nn(C.modelValue);p.value.innerHTML=m,ht()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=C.title||"",h=C.description||"";W.value=m,j.value=v,oe.value=h,He.value=v,N.value=h,x(),K(),El(),tn(),Dn(),Un()}),Kt(),Rl(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",gl),window.removeEventListener("resize",Bt),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),Hl!==null&&(clearTimeout(Hl),Hl=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),he.value&&clearTimeout(he.value),ut.value&&clearTimeout(ut.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Et.value&&Et.value.disconnect(),Vt.value!==null&&(cancelAnimationFrame(Vt.value),Vt.value=null),kl.value!==null&&(clearTimeout(kl.value),kl.value=null),pl.value!==null&&(clearTimeout(pl.value),pl.value=null),bn(!0),p.value&&p.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=p.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 ll=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)}}K(),Kt(),Rl(),Zt(),tn()}):e.nextTick(()=>{K(),Kt(),Rl(),Zt(),tn()})},vo=()=>{Je();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);at.value=!a.collapsed&&ln(a),!a.collapsed&&We.value&&(We.value=null)}else at.value=!1;if(K(),Kt(),Rl(),Zt(),tn(),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(),at.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{}Ce.value[a]=m}else{const d=document.queryCommandState(a);Ce.value[a]=d}}}catch{}})},tn=()=>{if(!C.richText||C.disabled||!p.value){Xe.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){Xe.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){Xe.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){Xe.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Xe.value=d:Xe.value="p"}catch{Xe.value="p"}},Rl=()=>{if(!p.value){st.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&&p.value.contains(c))}st.value=n}catch{st.value=!1}},ln=o=>{if(!o||!p.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?p.value.contains(a):!1},Pl=()=>{Ue.value=!1},Zt=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){Ue.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Ue.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!ln(n)){Ue.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ue.value=!1;return}const r=p.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 v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;Pe.value&&(_=Pe.value.getBoundingClientRect().width);const T=(_||320)/2;let S=c.left+T,te=c.right-T;if(te<S){const U=c.left+c.width/2;S=U,te=U}if(h>0){const U=T+u,Re=h-T-u;if(S=Math.max(S,U),te=Math.min(te,Re),te<S){const be=h/2;S=be,te=be}}v<S?v=S:v>te&&(v=te),Lt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ue.value=!0},An=o=>{C.disabled||!C.richText||(At.value=At.value===o?null:o,o==="askAi"&&(ve.value=null))},go=()=>{At.value=null,Ie.value=null},un=o=>{vl(o),go()};let yn=null,Fl=null,dn=null,Sl=null;const Do=o=>{if(C.disabled||!C.richText){nn(),xn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(yn&&(clearTimeout(yn),yn=null),dn&&(clearTimeout(dn),dn=null),a&&a!==Fl){xn(),Fl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Y.value=a,X.value=c,ne.value=!0,A.value=!0,ho(a)}else!a&&Fl?(Fl=null,yn=setTimeout(()=>{A.value||nn()},150)):a&&a===Fl&&ho(a);if(r&&r!==Sl){nn(),Sl=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),ft.value=r,Nt.value=c.trim()||$("textEditor.image.noAlt"),lt.value=!0,G.value=!0,yo(r)}else!r&&Sl?(Sl=null,dn=setTimeout(()=>{G.value||xn()},150)):r&&r===Sl&&yo(r)},Ho=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Fl=null,Sl=null,yn&&(clearTimeout(yn),yn=null),dn&&(clearTimeout(dn),dn=null),nn(),xn())},nn=()=>{A.value=!1,setTimeout(()=>{A.value||(ne.value=!1,X.value="",ge.value||(Y.value=null))},100)},ho=o=>{if(!o||!p.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xn=()=>{G.value=!1,setTimeout(()=>{G.value||(lt.value=!1,Nt.value="",pt.value||(ft.value=null))},100)},yo=o=>{if(!o||!p.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;rl.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Co=()=>{if(!X.value||!Y.value)return;let n=Y.value.getAttribute("href")||X.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},ko=()=>{if(Y.value){const o=Y.value.textContent||"",n=Y.value.getAttribute("href")||"",a=Y.value;Le.value=n,qe.value=o,fe.value=o,A.value=!1,ne.value=!1,X.value="",Y.value=a,ge.value=!0}else if(xe.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")||"";Le.value=d,qe.value=c,fe.value=c,Y.value=r,ge.value=!0}}}else{_e.value=bt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),Le.value="",qe.value=n,fe.value="",Y.value=null,ge.value=!0}e.nextTick(()=>{vt.value&&(vt.value.focus(),vt.value.select())})},qn=()=>{ge.value=!1,Le.value="",qe.value="",fe.value="",Y.value=null,_e.value=null},so=()=>{if(!Le.value.trim()){qn();return}if(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),qe.value.trim()||(qe.value=Le.value.trim()),Y.value&&p.value&&p.value.contains(Y.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Y.value;if(n.setAttribute("href",Le.value.trim()),qe.value.trim()!==fe.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),ct()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),_e.value&&ye(_e.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=Le.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(p.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=Le.value.trim(),d.textContent=qe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.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),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
100
+ </svg>`,p=e.ref(null),ve=e.ref(null),xe=e.ref(!1),de=e.ref(!1),ne=e.ref(!1),X=e.ref(""),pe=e.ref({}),A=e.ref(!1),ge=e.ref(!1),Le=e.ref(""),qe=e.ref(""),vt=e.ref(null),R=e.ref(null),Y=e.ref(null),_e=e.ref(null),fe=e.ref(""),st=e.ref(!1),Ce=e.ref({}),Ue=e.ref(!1),Lt=e.ref({}),Pe=e.ref(null),At=e.ref(null),pt=e.ref(!1),Ct=e.ref(""),pl=e.ref(null),Dt=e.ref(""),$t=e.ref(""),tt=e.ref(""),It=e.ref(null),Ft=e.ref(null),Ut=e.ref(null),ft=e.ref(null),Tt=e.ref(null),lt=e.ref(!1),Nt=e.ref(""),rl=e.ref({}),G=e.ref(!1),Ve=e.ref("upload"),Ne=e.ref(""),Ie=e.ref(null),ut=e.ref(null),Ze=e.ref([]),et=e.ref([]),he=e.ref(null),Ke=e.ref(!1),W=e.ref(""),Z=e.ref(""),j=e.ref(""),oe=e.ref(""),He=e.ref(""),N=e.ref(""),b=e.ref(null),V=e.ref(null),ee=e.ref(null),J=e.ref(!1),Se=e.ref(null),ot=e.ref(!1),Be=e.ref(!1),We=e.ref(null),Xe=e.ref("p"),at=e.ref(!1),gt=e.ref([]),Et=e.ref(null),Vt=e.ref(null),kl=e.ref(null),kt=e.ref(!1),Ht=e.ref(0),Gl=100,fl=e.ref(null),jt=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":Qe.value!==null})),Rt=e.computed(()=>({})),Ll=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),bl=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),I=e.computed(()=>C.richText&&et.value.length>0),O=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=O.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),ie=e.computed(()=>O.value.length),Te=e.computed(()=>ft.value!==null&&Ve.value==="upload"&&Dt.value&&Dt.value.startsWith("data:")),rt=e.computed(()=>C.titlePlaceholder||$("textEditor.placeholders.title")),it=e.computed(()=>C.descriptionPlaceholder||$("textEditor.placeholders.description")),Ye=e.computed(()=>C.placeholder||$("textEditor.placeholders.startTyping")),nt=o=>le&&le[o]!==void 0,yl=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++)if(nt(C.customToolbarSlots[n]))return!0;return!1},vl=o=>{for(let n=o+1;n<C.customToolbarSlots.length;n++){const a=C.customToolbarSlots[n];if(nt(a)&&Nl(a))return!0}return!1},Nl=o=>C.customToolbarFloatingMap.hasOwnProperty(o)?C.customToolbarFloatingMap[o]===!0:!0,zl=e.computed(()=>C.customToolbarSlots.some(o=>nt(o)&&Nl(o))),ql=e.computed(()=>nt("title-slot")),vn=e.computed(()=>nt("description-slot")),rn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},Nn=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},eo=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())},Rn=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""}},Fn=o=>{if(!o||typeof o!="string")return!1;const n=o.trim();if(!n)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(n))return!0;try{const c=$("textEditor.started_conversation");if(c&&n===c)return!0}catch{}const r=n.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},Bn=o=>{const n=o.target.value;Ee("update:modelValue",n),Ee("change",n)},Bl=()=>{if(!b.value)return;const o=b.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")},In=()=>{ot.value=!0,Bl()},Ul=()=>{ot.value=!1,il()},il=()=>{if(!b.value)return;const o=b.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")},Tl=o=>{const a=o.target.value;ot.value&&Bl(),Ee("update:title",a),Ee("title-change",a),ee.value="title",C.richText&&(Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae()},500))},wl=()=>{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")},cn=()=>{Be.value=!0,wl()},Mn=()=>{Be.value=!1,gn()},gn=()=>{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 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")},zn=o=>{const a=o.target.value;Be.value&&wl(),Ee("update:description",a),Ee("description-change",a),ee.value="description",C.richText&&(Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae()},500))},bt=()=>{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(p.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},ye=o=>{if(!(!o||!p.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.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{p.value.focus()}},Ql=()=>{if(!p.value)return;p.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(p.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(!p.value)return;const n=p.value.innerHTML,a=C.title||"",r=C.description||"";if(!o&&n===W.value&&a===j.value&&r===oe.value)return;const c={content:Z.value||W.value,title:He.value!==void 0?He.value:j.value,description:N.value!==void 0?N.value:oe.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(),et.value=[]),W.value=n,j.value=a,oe.value=r,Z.value=n,He.value=a,N.value=r},ct=o=>{if(!p.value)return;Je(),p.value&&eo(p.value);let n=null;p.value&&(p.value.querySelector("p")||(n=bt(),ht()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&We.value&&(We.value=null),de.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;|\u00A0/g," "),c=rn(r);Ee("update:modelValue",c),Ee("change",c),ee.value="editor",Ke.value||(Z.value=W.value,He.value=j.value,N.value=oe.value),he.value&&clearTimeout(he.value),Ke.value=!0,he.value=setTimeout(()=>{Ke.value=!1,Ae(),Ol(),on()},500),e.nextTick(()=>{n&&ye(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&&We.value?.command===h){Ce.value[h]=We.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,T=_.nodeType===3?_.parentElement:_;let S=!1;if(T&&((T.tagName==="STRONG"||T.tagName==="B"||T.closest&&T.closest("strong, b"))&&(S=!0),!S&&T.style&&parseInt(T.style.fontWeight)>=600&&(S=!0),!S))try{const te=window.getComputedStyle(T);parseInt(te.fontWeight)>=600&&(S=!0)}catch{}Ce.value[h]=S}else Ce.value.hasOwnProperty(h)||(Ce.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,T=_.nodeType===3?_.parentElement:_,S=T&&(T.tagName==="EM"||T.tagName==="I"||T.closest&&T.closest("em, i"));Ce.value[h]=!!S}else{const _=document.queryCommandState(h);Ce.value[h]=_}else{const _=document.queryCommandState(h);Ce.value[h]=_}}catch{}}),x(),K(),El(),Zt(),tn(),Il("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>on(h),0),(h===" "||h===`
101
+ `||/[.,;:!?]/.test(h))&&setTimeout(()=>{Ol()},100)}de.value=!1})},Je=()=>{if(!p.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)}}}},ht=()=>{if(!p.value)return;const o=p.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)}})},K=()=>{if(p.value&&!J.value){J.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.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()}),p.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:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(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=Ge,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{J.value=!1}}},yt=o=>{Ol(),Ee("blur",o),Pl()},De=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),he.value&&(clearTimeout(he.value),he.value=null),Ke.value&&(Ae(),Ke.value=!1);const o=ee.value==="title",n=ee.value==="description",a=ee.value==="editor";if(Ze.value.length===0){o&&b.value?b.value.focus():n&&V.value?V.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{ct()});return}const r={content:p.value.innerHTML,title:C.title||"",description:C.description||""};et.value.push(r);const c=Ze.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,W.value=d,j.value=u,oe.value=m,Z.value=d,He.value=u,N.value=m,e.nextTick(()=>{x(),Kt(),Rl(),Zt();const v=rn(d);Ee("update:modelValue",v),Ee("update:title",u),Ee("update:description",m),Ee("change",v),Ee("title-change",u),Ee("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(b.value){b.value.focus();const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}}else if(n){if(V.value){V.value.focus();const h=m.length;V.value.setSelectionRange(h,h)}}else if(a)Ql();else if(b.value&&document.activeElement===b.value){const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}else if(V.value&&document.activeElement===V.value){const h=m.length;V.value.setSelectionRange(h,h)}else p.value&&Ql()},10)})})}},_n=()=>{if(C.disabled||!C.richText||!p.value)return;Ot();const o=ee.value==="title",n=ee.value==="description",a=ee.value==="editor";if(et.value.length===0){o&&b.value?b.value.focus():n&&V.value?V.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{ct()});return}const r={content:p.value.innerHTML,title:C.title||"",description:C.description||""};Ze.value.push(r);const c=et.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,W.value=d,j.value=u,oe.value=m,Z.value=d,He.value=u,N.value=m,e.nextTick(()=>{x(),Kt(),Rl(),Zt();const v=rn(d);Ee("update:modelValue",v),Ee("update:title",u),Ee("update:description",m),Ee("change",v),Ee("title-change",u),Ee("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(b.value){b.value.focus();const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}}else if(n){if(V.value){V.value.focus();const h=m.length;V.value.setSelectionRange(h,h)}}else if(a)Ql();else if(b.value&&document.activeElement===b.value){const h=u.length;b.value.setSelectionRange&&b.value.setSelectionRange(h,h),Bl()}else if(V.value&&document.activeElement===V.value){const h=m.length;V.value.setSelectionRange(h,h)}else p.value&&Ql()},10)})})}},Ml=()=>{if(!p.value)return;p.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)}}),p.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)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},El=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Xl=()=>{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!==p.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!==p.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(()=>{El()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{El()});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(()=>{El()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{El()})}return!0},wn=()=>{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!==p.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!==p.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(()=>{Ml()}),!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!==p.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===p.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)}}Ml()});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(()=>{Ml()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Ml()})}return!0},xl=(o,n=null)=>{if(C.disabled||!C.richText||!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&ln(d)&&(r=bt())}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=wn();Ce.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(We.value={command:"bold",state:d}),e.nextTick(()=>{r&&(ye(r),e.nextTick(()=>{const m=Cl("bold");Ce.value.bold=m})),ct(),Kt(),Zt()});return}if(o==="italic"){const d=Xl();Ce.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(We.value={command:"italic",state:d}),e.nextTick(()=>{r&&(ye(r),e.nextTick(()=>{const m=Cl("italic");Ce.value.italic=m})),ct(),El(),Kt(),Zt()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&ye(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Cl("bold");Ce.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Cl("italic");Ce.value.italic=u});else{const u=document.queryCommandState(o);Ce.value[o]=u}else{const u=document.queryCommandState(o);Ce.value[o]=u}}catch{Ce.value.hasOwnProperty(o)?Ce.value[o]=!Ce.value[o]:Ce.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const 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)}p.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}ct(),Kt(),Zt()})},Cl=(o,n=null)=>{if(C.disabled||!p.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 Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let S=_.parentElement;for(;S&&S!==p.value;){if(S.tagName==="STRONG"||S.tagName==="B"){u=!0;break}if(S.style&&parseInt(S.style.fontWeight)>=600){u=!0;break}S=S.parentElement}}else if(_.nodeType===1){const T=_;if(T.tagName==="STRONG"||T.tagName==="B"){u=!0;break}if(T.style&&parseInt(T.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Ce.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 Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.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 _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let S=_.parentElement;for(;S&&S!==p.value;){if(S.tagName==="EM"||S.tagName==="I"){u=!0;break}if(S.style&&S.style.fontStyle==="italic"){u=!0;break}S=S.parentElement}}else if(_.nodeType===1){const T=_;if(T.tagName==="EM"||T.tagName==="I"){u=!0;break}if(T.style&&T.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Ce.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Ce.value.hasOwnProperty(o)?Ce.value[o]:(Ce.value[o]=d,d)}return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}catch{return Ce.value.hasOwnProperty(o)?Ce.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Pn=o=>{C.disabled||!C.richText||(ve.value=ve.value===o?null:o,o==="askAi"&&(At.value=null))},Ot=()=>{ve.value=null,Ie.value=null},gl=o=>{xl("formatBlock",o),Ot()},hn=o=>{if(!o||!p.value)return o;const n=Re=>{let be=Re.nodeType===Node.TEXT_NODE?Re.parentElement:Re;for(;be&&be!==p.value;){const mt=be.tagName;if(mt==="P"){const ml=be.parentElement;if(ml===p.value||ml.tagName==="BLOCKQUOTE")return be}if(mt==="BLOCKQUOTE")break;be=be.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Re=>{const be=Re.tagName;if(be==="P"){const mt=Re.parentElement;if(mt===p.value||mt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return be==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),T=c.slice(h,_+1);if(T.length===0)return o;const S=T[0],te=T[T.length-1],U=document.createRange();return U.setStartBefore(S),U.setEndAfter(te),U},On=()=>{if(C.disabled||!C.richText||!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&ln(n)&&(n=hn(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&ln(n)&&(a=bt());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.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:S=>S.parentNode===u&&S.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.forEach(S=>{const te=document.createElement("p");S.parentNode.insertBefore(te,S),te.appendChild(S)}),u.querySelectorAll("p, div").forEach(S=>{S.textContent.trim()===""&&!S.querySelector("img")&&(S.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const S=document.createElement("p");S.innerHTML="<br>",u.appendChild(S)}}e.nextTick(()=>{a&&ye(a),Rl(),ct(),Zt()})},Zn=()=>{if(!p.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||!p.value.contains(r))return;const c=_=>{if(!_)return!1;const T=_.textContent||"",te=(_.innerHTML||"").trim();return T.trim()===""||te===""||te==="<br>"||te==="<br/>"||te==="<p></p>"||te==="<p><br></p>"||te==="<p><br/></p>"||te==="<p> </p>"||te==="<p><br> </p>"||te==="<div></div>"||te==="<div><br></div>"||te==="<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 _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const T=r.children[_];if((T.tagName==="P"||T.tagName==="DIV")&&c(T))T.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):p.value&&p.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Rl(),ct()})},Kt=()=>{if(!p.value){xe.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");xe.value=!!r}else xe.value=!1}catch{xe.value=!1}},Al=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),_e.value=bt();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),Le.value="",qe.value=a,fe.value="",Y.value=null,ge.value=!0,Ot(),e.nextTick(()=>{vt.value&&vt.value.focus()})},$n=()=>{if(!p.value)return;Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.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&&Y.value&&(n=Y.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)}Y.value=null}else xl("unlink");xe.value=!1,Ot(),e.nextTick(()=>{ct(),Kt()})},Ln=()=>{C.disabled||!C.richText||p.value&&(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{x(),ct(),Zt()}))},k=()=>{C.disabled||!C.richText||p.value&&(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),Ot(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{x(),ct(),Zt()}))},y=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},x=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=y(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},q=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),p.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(()=>{x(),ct()});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=y(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),x();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{ct(),Zt()})}else document.execCommand("indent",!1),e.nextTick(()=>{x(),ct(),Zt()})},ue=()=>{if(C.disabled||!C.richText||!p.value)return;Ot(),p.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(()=>{x(),ct()});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(),x();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{ct(),Zt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{x(),ct(),Zt()})},Qe=e.ref(null),xt=e.ref(null),Jt=e.ref({}),zt=e.ref(""),el=e.ref(null),tl=e.ref("");e.ref("");const Yl=e.ref(null);e.ref("");const _l=e.ref([]),to=e.ref(!1),Tn=e.ref(!1),Lo=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},mo=()=>{if(C.disabled||!C.richText||!p.value)return;if(Qe.value!==null){Qe.value=null,zt.value="",tl.value="",Yl.value=null,_l.value=[],bn(!0);return}Ot(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!ln(n))return;tl.value=Lo(n)||"",Yl.value=bt();const a=n.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);Jt.value={top:`${m}px`,bottom:"auto"},Qe.value=Date.now(),e.nextTick(()=>{if(zt.value="",el.value){const h=el.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 _=r.getBoundingClientRect(),T=v.getBoundingClientRect(),S=h.getBoundingClientRect(),te=T.bottom-_.top,U=S.top-_.top,Re=8;if(te>U-Re){const be=S.height;Jt.value={bottom:`${be+Re}px`,top:"auto"}}else Jt.value={top:`${m}px`,bottom:"auto"}}}})},po=()=>{if(!zt.value.trim())return;const o=zt.value.trim(),n=new Date,a={text:o,selectionText:tl.value,selectionRange:Yl.value,commentId:Qe.value,user:C.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],Ee("comment-submitted",a),Ao(a),Yl.value&&!lo(Yl.value)&&To(Qe.value,Yl.value),zt.value="",e.nextTick(()=>{if(el.value){const r=el.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Il("sendComment")})},fo=(o,n)=>{if(!(!C.commentUser||!o.user||o.user.id!==C.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),Qe.value!==null&&p.value){const a=String(Qe.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&_l.value.length>0){const c=[],d=new Set;_l.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(_l.value.length))}else r&&_l.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Ee("comment-deleted",{comment:o,index:n,commentId:Qe.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));Ee("update:comments",a)}e.nextTick(()=>{Il("deleteComment")})}},lo=o=>{if(!o||!p.value)return!1;try{const n=no(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},no=o=>{if(!o||!p.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[p.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}},To=(o,n)=>{if(!(!o||!n||!p.value))try{const a=no(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,_=a.endOffset,T=m.nodeType===3?m.parentNode:m,S=v.nodeType===3?v.parentNode:v;if(T===S&&h===0&&_===(v.nodeType===3?v.length:S.childNodes.length)&&(T.tagName==="P"||T.tagName==="DIV"||T.tagName==="H1"||T.tagName==="H2"||T.tagName==="H3"||T.tagName==="H4"||T.tagName==="H5"||T.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=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Il("wrapSelectionWithCommentMarker"),ct()})}catch{}},Ao=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)}to.value=!0,Ee("update:comments",n)},oo=(o,n=[])=>{if(C.disabled||!C.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Ot(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),tl.value=r.innerHTML||"",Yl.value=bt();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),T=u.bottom-_.top,te=Math.max(T+8,0);Jt.value={top:`${te}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 _=C.comments.find(T=>String(T.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const T=_.conversation.map(S=>({id:S.id||S.commentary_id,commentary_id:S.id||S.commentary_id,conversation_id:_.id||_.conversation_id,text:S.text,user:S.user,createdAt:S.created_at||S.createdAt,updated_at:S.updated_at||S.updatedAt}));h.push(...T)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((_,T)=>{const S=Re=>{if(!Re)return 0;const be=new Date(Re).getTime();return isNaN(be)?0:be},te=S(_.createdAt),U=S(T.createdAt);return te===U?0:te-U}),_l.value=h,bn(!0),Qe.value=v||null,r&&(xt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(zt.value="",el.value){const _=el.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const T=m.querySelector(".dss-text-editor-footer");if(T){const S=m.getBoundingClientRect(),te=_.getBoundingClientRect(),U=T.getBoundingClientRect(),Re=te.bottom-S.top,be=U.top-S.top,mt=8;if(Re>be-mt){const ml=U.height;Jt.value={bottom:`${ml+mt}px`,top:"auto"}}}}}Il("openCommentOverlayForSelector")})},ao=e.ref(null),Wn=e.ref(0),Vl=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&&p.value&&p.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(()=>{Zn()},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,T=a.cloneContents().textContent?.trim()||"",S=c.textContent?.trim()||"";(!v||!h||T.length>S.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(()=>{ct()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?ue():q();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 _=v.parentElement;return _&&_!==p.value?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!==p.value){o.preventDefault(),o.stopPropagation();let _=null;const T=a.startOffset;T<u.length&&(_=u.splitText(T));const S=document.createElement("p");if(_?S.appendChild(_):S.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(S,h.nextSibling):h.parentNode.appendChild(S);const te=document.createRange();_?te.setStart(_,0):te.setStart(S,0),te.collapse(!0),n.removeAllRanges(),n.addRange(te),e.nextTick(()=>{ct()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.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 Re=U.textContent||"",mt=(U.innerHTML||"").trim(),ml=mt.replace(/<br\s*\/?>/gi,"").trim();return Re.trim()===""||mt===""||ml===""||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",_=a.startContainer,T=_.nodeType===3?_.parentElement:_,S=T===c||T&&T.parentElement===c;if(u&&m(u)||h&&S){o.preventDefault(),setTimeout(()=>{Zn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Wn.value;if(ao.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(),q();return}}}}ao.value=" ",Wn.value=n}else ao.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=p.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(T=>{if(h>0){const S=v.createElement("p");S.innerHTML=T.innerHTML,T.parentNode.replaceChild(S,T)}else h++}),c){const T=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],S=Array.from(v.body.children).filter(te=>T.includes(te.tagName));if(S.length===1){const te=S[0].tagName,U=c.tagName,Re=c.textContent.trim()===""&&!c.querySelector("img");let be=!1;if(["H1","H2","H3","H4","H5","H6"].includes(U)?be=!0:Re||(te===U||te==="P")&&(be=!0),be)return S[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);ct()},hl=o=>{if(ve.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ot()}if(Ue.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&Pl()}if(At.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&go()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(Ie.value=null),!p.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);at.value=!r.collapsed&&ln(r)}else at.value=!1}if(Qe.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&&(Qe.value=null,zt.value="",tl.value="",Yl.value=null,_l.value=[],bn(!0))}},Dl=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),ut.value&&(clearTimeout(ut.value),ut.value=null),Ie.value=n},cl=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}ut.value&&clearTimeout(ut.value),ut.value=setTimeout(()=>{Ie.value=null,ut.value=null},150)},Jl=o=>{Ie.value=null};let Gt=0;const ul=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-${++Gt}`;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(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},en=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{ul(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&&Dl(v,h)},m=cl;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 _=c.getAttribute("data-submenu-id");_&&Dl(h,_)},m=cl;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",Jl)})})})};let Hl=null;const Bt=()=>{if(Ie.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${Ie.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${Ie.value}"]`);o&&n&&Xn(o,n)}if(Ue.value&&Zt(),C.richText){if(Hl!==null)return;Hl=setTimeout(()=>{Hl=null,Il("handleWindowResize")},150)}},Mt=()=>{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")})})},wt=()=>{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(()=>{ot.value?Bl():il(),Be.value?wl():gn()})}),e.nextTick(()=>{wt()}),C.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",hl),window.addEventListener("resize",Bt);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,Bt()},150))};window.addEventListener("scroll",n,!0),p.value._windowScrollHandler=n,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Bt()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{en(),Mt()}),p.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!C.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),T=v.closest(".dss-image-wrapper");if(_||T&&v===T){m.preventDefault(),m.stopPropagation();const S=window.getSelection(),te=document.createRange();te.setStartAfter(T),te.collapse(!0),S.removeAllRanges(),S.addRange(te)}else T&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const S=window.getSelection();if(S.rangeCount>0){const U=S.getRangeAt(0).commonAncestorContainer,Re=U.nodeType===3?U.parentElement:U;if(T.contains(Re)&&Re!==T.querySelector("img")){const be=document.createRange();be.setStartAfter(T),be.collapse(!0),S.removeAllRanges(),S.addRange(be)}}else{const te=document.createRange();te.setStartAfter(T),te.collapse(!0),S.addRange(te)}}))},!0),p.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const T=window.getSelection(),S=document.createRange();_&&(S.setStartAfter(_),S.collapse(!0),T.removeAllRanges(),T.addRange(S))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.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 T=h.getAttribute("alt")||h.alt||"";if(T){const S=h.getAttribute("src")||h.src||"",te=S.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),U=T===S||T===te;(T.startsWith("http://")||T.startsWith("https://")||T.startsWith("data:")||U||U)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),K()})}),p.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&p.value.contains(h)&&(Se.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Se.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Se.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Se.value||!p.value)return;m.preventDefault(),m.stopPropagation();const v=Se.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,T=h?v:_?.closest(".dss-image-wrapper");if(!_||!p.value.contains(_)){Se.value=null;return}let S=null;const te=m.clientX,U=m.clientY;if(document.caretRangeFromPoint)S=document.caretRangeFromPoint(te,U);else{const Xt=window.getSelection();Xt.rangeCount>0?S=Xt.getRangeAt(0).cloneRange():(S=document.createRange(),S.selectNodeContents(p.value),S.collapse(!1))}if(!S){Se.value=null;return}const Re=S.commonAncestorContainer,be=Re.nodeType===3?Re.parentElement:Re;if(be?.closest(".dss-image-wrapper")===T||T&&T.contains(be)){Se.value=null;return}if(T&&(be===T||T.contains(be))){Se.value=null;return}const ml=_.getAttribute("src");let nl=null;T?nl=T.cloneNode(!0):nl=_.cloneNode(!0);try{let Xt=S.startContainer;if(Xt.nodeType===3&&(Xt=Xt.parentElement),T&&(Xt===T||T.contains(Xt))){const qt=document.createRange();qt.setStartAfter(T),qt.collapse(!0),S=qt}S.insertNode(nl);const ol=document.createRange();ol.setStartAfter(nl),ol.collapse(!0);const al=window.getSelection();al.removeAllRanges(),al.addRange(ol)}catch{if(p.value.childNodes.length===0){const ol=document.createElement("p");ol.appendChild(nl),p.value.appendChild(ol)}else{const ol=p.value.lastChild;if(ol&&ol.nodeType===1)ol.appendChild(nl);else{const al=document.createElement("p");al.appendChild(nl),p.value.appendChild(al)}}}T?T.remove():_.remove(),Se.value=null,e.nextTick(()=>{const Xt=p.value.querySelectorAll("img");let ol=!1;Xt.forEach(al=>{if(al.getAttribute("src")===ml)if(!ol)ol=!0;else{const qt=al.closest(".dss-image-wrapper");qt?qt.remove():al.remove()}}),K(),ct()})}),p.value.addEventListener("dragend",m=>{Se.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 _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach(T=>{T.removeAttribute("alt"),T.removeAttribute("data-alt"),T.setAttribute("alt",""),T.setAttribute("data-alt",""),T.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{K(),Mt(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Mt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),C.modelValue){const m=Nn(C.modelValue);p.value.innerHTML=m,ht()}e.nextTick(()=>{const m=p.value.innerHTML||"",v=C.title||"",h=C.description||"";W.value=m,j.value=v,oe.value=h,He.value=v,N.value=h,x(),K(),El(),tn(),Dn(),Un()}),Kt(),Rl(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",hl),window.removeEventListener("resize",Bt),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),Hl!==null&&(clearTimeout(Hl),Hl=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),he.value&&clearTimeout(he.value),ut.value&&clearTimeout(ut.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Et.value&&Et.value.disconnect(),Vt.value!==null&&(cancelAnimationFrame(Vt.value),Vt.value=null),kl.value!==null&&(clearTimeout(kl.value),kl.value=null),fl.value!==null&&(clearTimeout(fl.value),fl.value=null),bn(!0),p.value&&p.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=p.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 ll=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)}}K(),Kt(),Rl(),Zt(),tn()}):e.nextTick(()=>{K(),Kt(),Rl(),Zt(),tn()})},vo=()=>{Je();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);at.value=!a.collapsed&&ln(a),!a.collapsed&&We.value&&(We.value=null)}else at.value=!1;if(K(),Kt(),Rl(),Zt(),tn(),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(),at.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{}Ce.value[a]=m}else{const d=document.queryCommandState(a);Ce.value[a]=d}}}catch{}})},tn=()=>{if(!C.richText||C.disabled||!p.value){Xe.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){Xe.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){Xe.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){Xe.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Xe.value=d:Xe.value="p"}catch{Xe.value="p"}},Rl=()=>{if(!p.value){st.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&&p.value.contains(c))}st.value=n}catch{st.value=!1}},ln=o=>{if(!o||!p.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?p.value.contains(a):!1},Pl=()=>{Ue.value=!1},Zt=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){Ue.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Ue.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!ln(n)){Ue.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ue.value=!1;return}const r=p.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 v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;Pe.value&&(_=Pe.value.getBoundingClientRect().width);const T=(_||320)/2;let S=c.left+T,te=c.right-T;if(te<S){const U=c.left+c.width/2;S=U,te=U}if(h>0){const U=T+u,Re=h-T-u;if(S=Math.max(S,U),te=Math.min(te,Re),te<S){const be=h/2;S=be,te=be}}v<S?v=S:v>te&&(v=te),Lt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ue.value=!0},An=o=>{C.disabled||!C.richText||(At.value=At.value===o?null:o,o==="askAi"&&(ve.value=null))},go=()=>{At.value=null,Ie.value=null},un=o=>{gl(o),go()};let yn=null,Fl=null,dn=null,Sl=null;const Do=o=>{if(C.disabled||!C.richText){nn(),xn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(yn&&(clearTimeout(yn),yn=null),dn&&(clearTimeout(dn),dn=null),a&&a!==Fl){xn(),Fl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Y.value=a,X.value=c,ne.value=!0,A.value=!0,ho(a)}else!a&&Fl?(Fl=null,yn=setTimeout(()=>{A.value||nn()},150)):a&&a===Fl&&ho(a);if(r&&r!==Sl){nn(),Sl=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),ft.value=r,Nt.value=c.trim()||$("textEditor.image.noAlt"),lt.value=!0,G.value=!0,yo(r)}else!r&&Sl?(Sl=null,dn=setTimeout(()=>{G.value||xn()},150)):r&&r===Sl&&yo(r)},Ho=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Fl=null,Sl=null,yn&&(clearTimeout(yn),yn=null),dn&&(clearTimeout(dn),dn=null),nn(),xn())},nn=()=>{A.value=!1,setTimeout(()=>{A.value||(ne.value=!1,X.value="",ge.value||(Y.value=null))},100)},ho=o=>{if(!o||!p.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;pe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},xn=()=>{G.value=!1,setTimeout(()=>{G.value||(lt.value=!1,Nt.value="",pt.value||(ft.value=null))},100)},yo=o=>{if(!o||!p.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;rl.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Co=()=>{if(!X.value||!Y.value)return;let n=Y.value.getAttribute("href")||X.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},ko=()=>{if(Y.value){const o=Y.value.textContent||"",n=Y.value.getAttribute("href")||"",a=Y.value;Le.value=n,qe.value=o,fe.value=o,A.value=!1,ne.value=!1,X.value="",Y.value=a,ge.value=!0}else if(xe.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")||"";Le.value=d,qe.value=c,fe.value=c,Y.value=r,ge.value=!0}}}else{_e.value=bt();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),Le.value="",qe.value=n,fe.value="",Y.value=null,ge.value=!0}e.nextTick(()=>{vt.value&&(vt.value.focus(),vt.value.select())})},qn=()=>{ge.value=!1,Le.value="",qe.value="",fe.value="",Y.value=null,_e.value=null},so=()=>{if(!Le.value.trim()){qn();return}if(Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae(),qe.value.trim()||(qe.value=Le.value.trim()),Y.value&&p.value&&p.value.contains(Y.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Y.value;if(n.setAttribute("href",Le.value.trim()),qe.value.trim()!==fe.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),ct()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),_e.value&&ye(_e.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=Le.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(p.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=Le.value.trim(),d.textContent=qe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.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),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
102
102
  `){const T=document.createTextNode(" ");n.insertNode(T),n.setStartAfter(T)}}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)}}ct()}e.nextTick(()=>{Kt(),qn()})},Ol=()=>{if(!p.value||de.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=bt());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(p.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 _=[...h.matchAll(a)];if(_.length===0)continue;const T=_.filter(U=>{const Re=U[0],be=U.index;if(be>0&&h[be-1]==="@"||be+Re.length<h.length&&h[be+Re.length]==="@")return!1;const mt=v.parentElement;return!(mt&&mt.closest("a"))});if(T.length===0)continue;if(T.length===1&&T[0][0]===h.trim()){const U=T[0][0],Re=U.startsWith("http://")||U.startsWith("https://")?U:`https://${U}`,be=document.createElement("a");be.href=Re,be.textContent=U,be.style.color="#60afdf",be.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(be,v),u=!0);continue}let S=0;const te=document.createDocumentFragment();if(T.forEach(U=>{const Re=U.index,be=U[0];if(Re>S){const nl=h.substring(S,Re);nl&&te.appendChild(document.createTextNode(nl))}const mt=be.startsWith("http://")||be.startsWith("https://")?be:`https://${be}`,dl=document.createElement("a");dl.href=mt,dl.textContent=be,dl.style.color="#60afdf",dl.style.textDecoration="underline",te.appendChild(dl),S=Re+be.length}),S<h.length){const U=h.substring(S);U&&te.appendChild(document.createTextNode(U))}v.parentNode&&te.childNodes.length>0&&(v.parentNode.replaceChild(te,v),u=!0)}u&&n&&e.nextTick(()=>{ye(n),Kt()})},Cn=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(p.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(_=>{const T=_.index,S=_[0].startsWith("<u>")?"u":"ins",te=_[1]||_[2]||"";T>v&&h.appendChild(document.createTextNode(u.substring(v,T)));const U=document.createElement(S);U.textContent=te,h.appendChild(U),v=T+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},on=o=>{if(!p.value||de.value)return;if(!o){Cn();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===p.value||!p.value.contains(c))return;const d=()=>{let nl="",Xt=0,ol=!1;const al=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jl=>jl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let qt=0;for(;al.nextNode();){const jl=al.currentNode,pn=jl.textContent||"",Kl=qt;if(qt+=pn.length,jl===r.startContainer){nl+=pn.substring(0,r.startOffset),Xt=Kl+r.startOffset,ol=!0;break}nl+=pn}return ol||(Xt=nl.length),{textBeforeCursor:nl,cursorCharOffset:Xt}},{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[1],T=u.length-h.length,te=(nl=>{let Xt=0;const ol=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:qt=>qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let al;for(;al=ol.nextNode();){const qt=(al.textContent||"").length;if(Xt+qt>=nl)return{node:al,offset:nl-Xt};Xt+=qt}return null})(T);if(!te)return;const U=document.createRange();U.setStart(te.node,te.offset),U.setEnd(r.endContainer,r.endOffset);const Re=document.createElement(v);Re.textContent=_,U.deleteContents(),U.insertNode(Re);const be=window.getSelection(),mt=document.createRange();mt.setStartAfter(Re),mt.collapse(!0),be.removeAllRanges(),be.addRange(mt);const dl=bt();e.nextTick(()=>{ct(),dl&&ye(dl)})},Wt=()=>{p.value&&(Tt.value=bt(),Ct.value="",Dt.value="",Ne.value="",$t.value="",tt.value="",ml.value=null,ft.value=null,Ve.value="upload",pt.value=!0,Ot(),e.nextTick(()=>{It.value&&It.value.focus(),Ft.value&&(Ft.value.value="")}))},bo=o=>{const n=o.target?.files?.[0];if(!n){ml.value=null,Dt.value="";return}ml.value=n;const a=new FileReader;a.onload=r=>{Dt.value=r.target?.result||""},a.readAsDataURL(n)},Qt=()=>{Ft.value&&Ft.value.click()},ul=()=>{$t.value&&(tt.value="")},wo=()=>{tt.value&&($t.value="")},Ro=()=>{let o=ft.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")||"";ft.value=o,Ct.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ne.value=a,Dt.value="",Ve.value="url"):(Dt.value=a,Ne.value="",Ve.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";$t.value=c.endsWith("px")?c.replace("px",""):c,tt.value=d.endsWith("px")?d.replace("px",""):d,Tt.value=null}else{Wt();return}pt.value=!0,G.value=!1,lt.value=!1,e.nextTick(()=>{Ve.value==="url"&&Ut.value?(Ut.value.focus(),Ut.value.select()):It.value&&(It.value.focus(),It.value.select()),Ft.value&&(Ft.value.value="")})},kn=()=>{pt.value=!1,Ct.value="",Dt.value="",Ne.value="",$t.value="",tt.value="",ml.value=null,ft.value=null,Tt.value=null,Ve.value="upload"},mn=()=>{const o=(Ct.value||"").trim(),n=p.value?._mutationObserver;n&&n.disconnect(),Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae();const a=Ve.value==="url"?Ne.value.trim():Dt.value;if(ft.value&&p.value&&p.value.contains(ft.value)){a&&(ft.value.src=a),ft.value.setAttribute("alt",o),ft.value.setAttribute("data-alt",o),$t.value?(ft.value.style.width=`${$t.value}px`,ft.value.setAttribute("width",$t.value)):(ft.value.style.removeProperty("width"),ft.value.removeAttribute("width")),tt.value?(ft.value.style.height=`${tt.value}px`,ft.value.setAttribute("height",tt.value)):(ft.value.style.removeProperty("height"),ft.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(ft.value),c.collapse(!0),r.addRange(c)}ct()}else{if(!a){n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),kn();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Tt.value&&(ye(Tt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){kn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.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),$t.value&&(v.style.width=`${$t.value}px`,v.setAttribute("width",$t.value)),tt.value&&(v.style.height=`${tt.value}px`,v.setAttribute("height",tt.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const T=document.createElement("p");p.value.appendChild(T),T.appendChild(v)}else{const T=p.value.lastChild;if(T&&T.nodeType===1)T.appendChild(v);else{const S=document.createElement("p");p.value.appendChild(S),S.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}ft.value=v,ct()}}e.nextTick(()=>{n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),Kt(),Zt(),kn()})};e.watch(()=>C.modelValue,o=>{if(C.richText&&p.value&&!de.value){const n=Nn(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=bt();p.value.innerHTML=n,e.nextTick(()=>{ht();const u=p.value.innerHTML||"",m=C.title||"",v=C.description||"";W.value=u,j.value=m,oe.value=v,Z.value=u,He.value=m,N.value=v,Ze.value=[],et.value=[],he.value&&(clearTimeout(he.value),he.value=null),Ke.value=!1,d&&ye(d),x(),K(),El(),Kt(),Zt(),tn(),Il("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,o=>{o?(Zt(),e.nextTick(()=>{Dn()})):(Pl(),gt.value=[],Et.value&&(Et.value.disconnect(),Et.value=null)),tn()}),e.watch(()=>C.floatingToolbar,o=>{o?Zt():Pl()}),e.watch(()=>C.disabled,o=>{o&&Pl(),tn()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{Be.value?wl():gn()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{ot.value?Bl():il()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{Mt()})},{deep:!0}),e.watch(()=>C.comments,(o,n)=>{if(to.value){to.value=!1;return}Tn.value||C.richText&&p.value&&e.nextTick(()=>{Un()})},{deep:!0,immediate:!1});const Un=()=>{if(!Tn.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!p.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=p.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=p.value.querySelector(`[data-comment="${v}"]`);if(h){En(h,u),d.add(v);return}try{const _=io(u.selection_range,u.selection_text);if(_&&!_.collapsed){const T=_.commonAncestorContainer,S=T.nodeType===3?T.parentElement:T;if(S){const Re=S.closest("[data-comment], [data-fake-comment]");if(Re){const be=Re.getAttribute("data-comment")||Re.getAttribute("data-fake-comment");if(String(be)===String(m)){Re.setAttribute("data-comment",v),Re.removeAttribute("data-fake-comment"),En(Re,u),d.add(v);return}else return}}const te=p.value.querySelector(`[data-comment="${v}"]`);if(te){En(te,u),d.add(v);return}const U=document.createElement("span");U.setAttribute("data-comment",v),En(U,u);try{_.surroundContents(U),c++,d.add(v)}catch{try{const be=document.createRange();be.setStart(_.startContainer,_.startOffset),be.setEnd(_.endContainer,_.endOffset),Pt(be),be.surroundContents(U),c++,d.add(v)}catch{try{const mt=_.extractContents();U.appendChild(mt),_.insertNode(U),c++,d.add(v)}catch(mt){console.warn("Failed to create comment marker:",mt)}}}}}catch{}}),e.nextTick(()=>{Il("restoreCommentsFromModel"),ct(),Tn.value=!1})}catch{Tn.value=!1}}},Pt=o=>{if(!o||!p.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&&!Fo(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&&!ro(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Fo=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},ro=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},io=(o,n)=>{if(!o||!p.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=[p.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?Pt(a):null}}catch{return null}return null},En=(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")},Il=(o="unknown")=>{if(!C.richText||!p.value){gt.value=[];return}Date.now()-Ht.value<Gl&&Vt.value!==null||Vt.value===null&&(Vt.value=requestAnimationFrame(()=>{if(Vt.value=null,Ht.value=Date.now(),kt.value)return;kt.value=!0;const a={},r=p.value;if(!r){kt.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){kt.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(S=>{const te=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");te&&S.tagName==="SPAN"&&(m.has(te)||(u.push(S),m.add(te)))}),d.forEach(S=>{const te=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");!te||m.has(te)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(S.tagName)?S.querySelector(`span[data-comment="${te}"], span[data-fake-comment="${te}"]`)||(u.push(S),m.add(te)):S.tagName!=="SPAN"&&(u.push(S),m.add(te)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((S,te)=>{let U=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");if(!U)return;if(typeof U=="string"&&U.startsWith("comment-")){const dt=S.textContent?.trim(),Zl=C.comments?.find(sl=>(typeof sl.conversation_id=="string"&&sl.conversation_id.startsWith("comment-")?null:sl.conversation_id)&&sl.selection_text?.trim()===dt);Zl?(U=String(Zl.conversation_id),S.setAttribute("data-comment",U),S.removeAttribute("data-fake-comment")):(U=String(Date.now()),S.setAttribute("data-comment",U),S.removeAttribute("data-fake-comment"))}const Re=S.getBoundingClientRect(),be=window.getComputedStyle(S),mt=parseFloat(be.lineHeight)||parseFloat(be.fontSize)*1.2,Xt=Re.top-h.top+mt/2-15,al=h.top-v.top+Xt;let qt=null,jl=null,pn=0;const Kl=[],Eo=new Set;if(U&&C.comments){const dt=C.comments.find(Zl=>String(Zl.conversation_id||Zl.id)===String(U));if(dt){const Zl=dt.conversation||[];Zl.length>0?(Zl.forEach(sl=>{sl.user&&sl.user.id&&!Eo.has(sl.user.id)&&(Eo.add(sl.user.id),Kl.push(sl.user))}),pn=Zl.length):(pn=0,qt=null,jl=null),Kl.length>0?qt=Kl[0]:qt=null,Kl.length>1?jl=Kl[1]:jl=null}}const an=Re.top+mt/2-15,uo=an+30,Hn=5,Vn=uo>h.top+Hn&&an<h.bottom-Hn?1:0;gt.value.find(dt=>dt.id===U);let fn=S;if(!fn&&U&&p.value){const dt=String(U);fn=p.value.querySelector(`[data-comment="${dt}"], [data-fake-comment="${dt}"]`)}const Sn=Kl.length;a[U]?(a[U].top=al,a[U].opacity=Vn,a[U].element=fn,a[U].firstUser=qt,a[U].secondUser=jl,a[U].totalCount=pn,a[U].uniqueUserCount=Sn):a[U]={id:U,top:al,opacity:Vn,element:fn,firstUser:qt,secondUser:jl,totalCount:pn,uniqueUserCount:Sn}});const _=Object.values(a).map(S=>{const te=Math.max(0,(S.uniqueUserCount??0)-2);if(!S.element&&S.id&&p.value){const Re=String(S.id);S.element=p.value.querySelector(`[data-comment="${Re}"], [data-fake-comment="${Re}"]`)}return{...S,firstUser:S.firstUser||null,secondUser:S.secondUser||null,totalCount:S.totalCount,additionalCount:te}});(gt.value.length!==_.length||_.some((S,te)=>{const U=gt.value[te];if(!U)return!0;const Re=(U.firstUser?.id||null)!==(S.firstUser?.id||null),be=(U.secondUser?.id||null)!==(S.secondUser?.id||null);return U.id!==S.id||Math.abs(U.top-S.top)>1||U.opacity!==S.opacity||U.totalCount!==S.totalCount||U.additionalCount!==S.additionalCount||Re||be||U.element!==S.element}))&&(gt.value=_),kt.value=!1}))},xo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&p.value){const a=String(o.id);n=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(bn(),xt.value=n,n.classList.add("editor-comment-highlighted"))},bn=(o=!1)=>{!o&&Qe.value!==null&&xt.value&&(xt.value.getAttribute("data-comment")||xt.value.getAttribute("data-fake-comment"))===Qe.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),xt.value&&(xt.value.classList.remove("editor-comment-highlighted"),xt.value=null))},co=o=>{if(!o||!o.element)return;bn(!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}"]`;Ee("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},Io=()=>{bn()},Dn=()=>{!C.richText||!p.value||(Et.value&&Et.value.disconnect(),pl.value!==null&&(clearTimeout(pl.value),pl.value=null),Et.value=new MutationObserver(()=>{pl.value===null&&(pl.value=setTimeout(()=>{pl.value=null,e.nextTick(()=>{Il("MutationObserver")})},200))}),Et.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Il("setupCommentMarkersObserver-initial"))},Xn=(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(()=>Ie.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(()=>{Xn(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(()=>[ve.value,At.value],()=>{ve.value==="askAi"||At.value==="askAi"?e.nextTick(()=>{en()}):(Ie.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!==se.value&&(se.value=o)},{immediate:!0}),re({openCommentOverlayForSelector:oo,updateCommentMarkers:Il,restoreCommentsFromModel:Un}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",jt.value]),style:e.normalizeStyle(Rt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",su,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:De,title:e.unref($)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:_n,title:e.unref($)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,iu),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",cu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>Pn("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[Xe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",du,[...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)])])):Xe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",mu,[...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)])])):Xe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",pu,[...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)])])):Xe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",fu,[...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)])])):Xe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",vu,[...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)])])):Xe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",gu,[...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",hu,[...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,uu),ve.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=>vl("<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($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>vl("<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($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>vl("<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($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>vl("<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($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>vl("<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($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>vl("<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($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>vl("<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($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("bold")}]),onClick:n[9]||(n[9]=a=>xl("bold")),title:e.unref($)("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,yu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("italic")}]),onClick:n[10]||(n[10]=a=>xl("italic")),title:e.unref($)("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":Cl("underline")}]),onClick:n[11]||(n[11]=a=>xl("underline")),title:e.unref($)("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,ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st.value}]),onClick:On,title:e.unref($)("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,bu),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),xe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:$n,title:e.unref($)("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,xu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Al,title:e.unref($)("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,wu)),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":Cl("insertUnorderedList")}]),onClick:Ln,title:e.unref($)("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,Eu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("insertOrderedList")}]),onClick:k,title:e.unref($)("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:Wt,title:e.unref($)("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,Su),at.value?(e.openBlock(),e.createElementBlock("div",Nu)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:mo},[...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,Bu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Mu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",_u,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>Pn("askAi")),title:e.unref($)("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",Lu,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,$u),ve.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",Tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[nt(a)?(e.openBlock(),e.createElementBlock("div",Au,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),nt(a)&&r<L.customToolbarSlots.length-1&&yl(r)?(e.openBlock(),e.createElementBlock("div",Du)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ve.value==="paragraph"||ve.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ot})):e.createCommentVNode("",!0),e.createVNode(Oo,{showModal:ge.value,width:"500px",height:"55vh",onCloseModal:qn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Hu,[e.createElementVNode("div",Ru,[e.createElementVNode("label",Fu,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:R,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(so,["enter"])},null,40,Iu),[[e.vModelText,qe.value]])]),e.createElementVNode("div",zu,[e.createElementVNode("label",Pu,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:vt,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>Le.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(so,["enter"])},null,40,Ou),[[e.vModelText,Le.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:qn},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:so},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Oo,{showModal:pt.value,width:"500px",height:"80vh",onCloseModal:kn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ft.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Zu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ve.value==="upload"}]),onClick:n[17]||(n[17]=a=>Ve.value="upload")},e.toDisplayString(e.unref($)("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":Ve.value==="url"}]),onClick:n[18]||(n[18]=a=>Ve.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Ve.value==="upload"?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("div",qu,[e.createElementVNode("div",Uu,[Te.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Xu,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qt},[e.createElementVNode("img",{src:Dt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Yu),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:Ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:bo},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:bo},null,544))]),e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:It,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mn,["enter"])},null,40,Gu),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>$t.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:ul},null,40,ed),[[e.vModelText,$t.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",ld,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:wo},null,40,nd),[[e.vModelText,tt.value]])])])])):e.createCommentVNode("",!0),Ve.value==="url"?(e.openBlock(),e.createElementBlock("div",od,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Ut,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Ne.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(mn,["enter"])},null,40,id),[[e.vModelText,Ne.value]])]),e.createElementVNode("div",cd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mn,["enter"])},null,40,dd),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",md,[e.createElementVNode("label",pd,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>$t.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:ul},null,40,fd),[[e.vModelText,$t.value]])]),e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:wo},null,40,hd),[[e.vModelText,tt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:kn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:mn},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ql.value&&ot.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",yd,[ot.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cd,[L.title?(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:b,value:L.title,onInput:Tl,onFocus:In,onBlur:Ul,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ot.value}]),placeholder:rt.value,disabled:L.disabled,rows:"1"},null,42,wd)])],2),ql.value&&ot.value?(e.openBlock(),e.createElementBlock("div",xd,[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":vn.value&&Be.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",Ed,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vd,[L.description?(e.openBlock(),e.createElementBlock("span",Sd,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(it.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:V,value:L.description,onInput:zn,onFocus:cn,onBlur:Mn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Be.value}]),placeholder:it.value,disabled:L.disabled,rows:"1"},null,42,Bd)])],2),vn.value&&Be.value?(e.openBlock(),e.createElementBlock("div",Md,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Qe.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=>xo(a),onMouseleave:Io},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ld)):(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,$d)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Dd)):(e.openBlock(),e.createElementBlock("span",Hd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ad)):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=>co(a),["stop"])},[e.createElementVNode("span",Fd,"+"+e.toDisplayString(a.additionalCount),1)],12,Rd)):e.createCommentVNode("",!0)],46,_d))),128)),L.richText?(e.openBlock(),e.createElementBlock("div",qd,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(bl.value),onInput:ct,onBlur:yt,onClick:ll,onMouseup:vo,onKeyup:vo,onKeydown:Vl,onPaste:P,onMousemove:Do,onMouseleave:Ho},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Qe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Jt.value)},[tl.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",Xd,[tl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:tl.value},null,8,Yd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.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",Kd,[e.createElementVNode("div",Gd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Qd)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",e1,[e.createElementVNode("div",t1,[e.createElementVNode("div",l1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",n1,e.toDisplayString(Rn(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Fn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),C.commentUser&&a.user&&a.user.id===C.commentUser.id&&!Fn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(a,r),["stop"]),title:e.unref($)("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,o1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",a1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:el,"onUpdate:modelValue":n[26]||(n[26]=a=>zt.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(po,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(el.value){const a=el.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,s1),[[e.vModelText,zt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(po,["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",r1,[e.createElementVNode("div",i1,[e.createElementVNode("span",c1,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",u1,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("textarea",{value:L.modelValue,onInput:Bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:Ye.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(Ll.value)},null,46,zd),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("span",Zd,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Wd,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ne.value&&X.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[28]||(n[28]=a=>A.value=!0),onMouseleave:nn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Co,["stop"]),title:X.value},e.toDisplayString(X.value),9,d1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ko,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",p1,[...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,m1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[lt.value&&Nt.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(rl.value),onMouseenter:n[29]||(n[29]=a=>G.value=!0),onMouseleave:xn},[e.createElementVNode("div",f1,[Nt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",v1,[...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:Nt.value},e.toDisplayString(Nt.value),9,g1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",y1,[...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,h1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&Ue.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Pe,class:"dss-floating-toolbar",style:e.normalizeStyle(Lt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",C1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(De,["stop"]),title:e.unref($)("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,k1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:e.withModifiers(_n,["stop"]),title:e.unref($)("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,b1),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",w1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>An("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[Xe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",E1,[...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)])])):Xe.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)])])):Xe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",S1,[...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)])])):Xe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",N1,[...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)])])):Xe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",B1,[...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)])])):Xe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",M1,[...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",_1,[...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,x1),At.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=>un("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>un("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>un("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>un("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>un("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>un("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>un("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("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":Cl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>xl("bold"),["stop"])),title:e.unref($)("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,$1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>xl("italic"),["stop"])),title:e.unref($)("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,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>xl("underline"),["stop"])),title:e.unref($)("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,T1),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":st.value}]),onClick:e.withModifiers(On,["stop"]),title:e.unref($)("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,A1),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),xe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers($n,["stop"]),title:e.unref($)("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,H1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Al,["stop"]),title:e.unref($)("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,D1)),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":Cl("insertUnorderedList")}]),onClick:e.withModifiers(Ln,["stop"]),title:e.unref($)("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,R1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("insertOrderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref($)("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,F1),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Wt,["stop"]),title:e.unref($)("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,I1),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:e.withModifiers(mo,["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,z1),L.askAi?(e.openBlock(),e.createElementBlock("div",P1)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",O1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>An("askAi"),["stop"])),title:e.unref($)("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",W1,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,Z1),At.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)]),zl.value?(e.openBlock(),e.createElementBlock("div",q1,[L.askAi&&zl.value?(e.openBlock(),e.createElementBlock("div",U1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[nt(a)&&Nl(a)?(e.openBlock(),e.createElementBlock("div",X1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),nt(a)&&Nl(a)&&r<L.customToolbarSlots.length-1&&fl(r)?(e.openBlock(),e.createElementBlock("div",Y1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),G1={class:"dss-color-picker__section-title"},Q1={class:"dss-color-picker__presets-row"},J1=["title","onClick"],em={key:1,class:"dss-color-picker__section"},tm={class:"dss-color-picker__presets-row"},lm=["title","onClick"],nm={class:"dss-color-picker__section"},om={class:"dss-color-picker__section-header"},am={class:"dss-color-picker__presets-row"},sm=["title","onClick"],rm=["onClick"],im={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},cm=["title","onClick"],um={class:"dss-color-picker__input-row"},dm=["value"],mm={__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(L,{emit:re}){function M(W){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(W);if(!Z)return{h:0,s:0,l:50};const j=parseInt(Z[1],16)/255,oe=parseInt(Z[2],16)/255,He=parseInt(Z[3],16)/255,N=Math.max(j,oe,He),b=Math.min(j,oe,He);let V=0,ee=0;const J=(N+b)/2;if(N!==b){const Se=N-b;switch(ee=J>.5?Se/(2-N-b):Se/(N+b),N){case j:V=((oe-He)/Se+(oe<He?6:0))/6;break;case oe:V=((He-j)/Se+2)/6;break;case He:V=((j-oe)/Se+4)/6;break}}return{h:V*360,s:ee*100,l:J*100}}function $(W,Z,j){Z/=100,j/=100;const oe=Z*Math.min(j,1-j),He=N=>{const b=(N+W/30)%12,V=j-oe*Math.max(Math.min(b-3,9-b,1),-1);return Math.round(255*V).toString(16).padStart(2,"0")};return`#${He(0)}${He(8)}${He(4)}`}function se(W){const Z=W.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let j=Z[1];return j.length===3&&(j=j.split("").map(oe=>oe+oe).join("")),"#"+j}function C(W,Z,j){Z/=100,j/=100;const oe=j+Z*Math.min(j,1-j),He=oe===0?0:2-2*j/oe;return{h:W,s:He*100,v:oe*100}}function Ee(W,Z,j){Z/=100,j/=100;const oe=j*(1-Z/2),He=oe===0||oe===1?0:(j-oe)/Math.min(oe,1-oe);return{h:W,s:He*100,l:oe*100}}const le=L,Ge=re,p=e.ref(!1),ve=e.ref(!1),xe=e.ref(!1),de=e.ref(-1),ne=e.ref(-1),X=e.ref(null),pe=e.ref(null),A=e.ref(null),ge=e.ref(null),Le=e.ref({top:0,left:0}),qe=e.ref(M(le.modelValue||"#b8a5de")),vt=e.computed(()=>Array.isArray(le.presetGroups)&&le.presetGroups.length>0),R=e.computed(()=>vt.value?0:le.initialPresetCount!=null?le.initialPresetCount:ne.value<0?null:ne.value),Y=e.computed(()=>{const W=R.value;return W==null?!0:Math.max(0,le.presetColors.length-W)<le.max}),_e=e.computed(()=>!!(ve.value||de.value>=0||!fe.value&&le.presetColors.length===0));e.computed(()=>{const W=R.value;return W!=null&&le.presetColors.length>W});const fe=e.computed(()=>vt.value||R.value!=null),st=e.computed(()=>{const W=R.value;return W==null?[]:le.presetColors.slice(0,W)}),Ce=e.computed(()=>{const W=R.value;return W==null?[]:le.presetColors.slice(W)});function Ue(W){const Z=R.value;return Z!=null?Z+W:-1}function Lt(W){const Z=R.value;return Z!=null&&W>=Z}function Pe(W){Lt(W)&&(de.value=W,qe.value=M(le.presetColors[W]),ve.value=!0,e.nextTick(()=>ge.value?.focus()))}function At(W){if(!Lt(W))return;const Z=le.presetColors.filter((He,N)=>N!==W);Ge("update:presetColors",Z);const j=se(le.modelValue),oe=se(le.presetColors[W]);if(j&&oe&&j.toLowerCase()===oe.toLowerCase()){const He=Z[Math.max(0,W-1)]||Z[0];He&&Ge("update:modelValue",He)}}function pt(){xe.value=!xe.value,xe.value||(de.value=-1,ve.value=!1)}function Ct(){if(de.value<0)return;const W=tt.value,Z=se(W);if(Z){const j=[...le.presetColors];j[de.value]=Z,Ge("update:presetColors",j),Ge("update:modelValue",Z),de.value=-1,ve.value=!1}}function ml(){le.disabled||(de.value=-1,ve.value=!ve.value,ve.value&&(Nt(),e.nextTick(()=>ge.value?.focus())))}function Dt(W){const Z=se(W),j=se(le.modelValue);return Z&&j&&Z.toLowerCase()===j.toLowerCase()}function $t(){if(le.disabled||!Y.value)return;const W=tt.value,Z=se(W);if(Z){const j=[...le.presetColors,Z];Ge("update:presetColors",j),Ge("update:modelValue",Z);const oe=R.value??ne.value;oe>=0&&j.length-oe>=le.max&&(ve.value=!1)}}const tt=e.computed(()=>{const{h:W,s:Z,l:j}=qe.value;return $(W,Z,j)}),It=e.computed(()=>tt.value.toLowerCase()),Ft=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),Ut=e.computed(()=>{const W=C(qe.value.h,qe.value.s,qe.value.l);return{left:`${W.s}%`,bottom:`${W.v}%`,transform:"translate(-50%, 50%)"}}),ft=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),Tt=e.computed(()=>({position:"fixed",left:`${Le.value.left}px`,top:`${Le.value.top}px`,zIndex:1002}));function lt(){if(!X.value||!p.value)return;const W=X.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let j=W.bottom+4;const oe=pe.value;oe&&j+oe.offsetHeight>Z-8&&(j=W.top-4-oe.offsetHeight),Le.value={top:j,left:W.left}}function Nt(){const W=le.modelValue||"#b8a5de";se(W)&&(qe.value=M(W))}function rl(){Ge("update:modelValue",tt.value)}function G(){le.disabled||(p.value=!p.value,p.value&&(Nt(),e.nextTick(()=>{lt(),ge.value?.focus()})))}function Ve(){const W=tt.value,Z=se(W);if(Z){if(de.value>=0){const j=[...le.presetColors];j[de.value]=Z,Ge("update:presetColors",j),Ge("update:modelValue",Z)}else if((le.presetColors.length>0||vt.value)&&ve.value&&Y.value&&!le.presetColors.some(oe=>se(oe)?.toLowerCase()===Z.toLowerCase())){const oe=[...le.presetColors,Z];Ge("update:presetColors",oe),Ge("update:modelValue",Z)}}p.value=!1,ve.value=!1,xe.value=!1,de.value=-1}function Ne(W){if(!A.value)return;const Z=A.value.getBoundingClientRect(),j=oe=>{const He=Math.max(0,Math.min(1,(oe.clientX-Z.left)/Z.width)),N=Math.max(0,Math.min(1,1-(oe.clientY-Z.top)/Z.height)),b={h:qe.value.h,s:He*100,v:N*100};qe.value=Ee(b.h,b.s,b.v)};j(W),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),rl()},{once:!0})}function Ie(W){if(!W.currentTarget)return;const j=W.currentTarget.getBoundingClientRect(),oe=He=>{const N=Math.max(0,Math.min(1,(He.clientX-j.left)/j.width));qe.value={...qe.value,h:N*360}};oe(W),document.addEventListener("mousemove",oe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",oe),rl()},{once:!0})}function ut(W){const Z=W.target.value,j=se(Z);j&&(qe.value=M(j),Ge("update:modelValue",j))}function Ze(W){if(le.disabled)return;const Z=se(W);Z&&(qe.value=M(Z),Ge("update:modelValue",Z))}let et=null,he=null;function Ke(){et&&(document.removeEventListener("keydown",et),et=null),he&&(window.removeEventListener("resize",he),he=null)}return e.watch(p,W=>{if(Ke(),W){if(!vt.value&&le.initialPresetCount==null){const Z=le.presetColors.length;Z>0&&(ne.value<0||Z<ne.value)&&(ne.value=Z)}et=Z=>{Z.key==="Escape"&&Ve()},he=lt,document.addEventListener("keydown",et),window.addEventListener("resize",he)}}),e.watch(()=>le.modelValue,()=>{p.value&&Nt()},{immediate:!1}),e.watch(Ce,W=>{W.length===0&&(xe.value=!1,de.value=-1,ve.value=!1)}),e.onBeforeUnmount(Ke),(W,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:X,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:G},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:tt.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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ve,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:pe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Tt.value)},[fe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(j,oe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+oe,class:"dss-color-picker__section"},[e.createElementVNode("span",G1,e.toDisplayString(j.title),1),e.createElementVNode("div",Q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(He,N)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+oe+"-"+N,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(He)}]),style:e.normalizeStyle({backgroundColor:He}),title:He,onClick:e.withModifiers(b=>Ze(He),["stop"])},null,14,J1))),128))])]))),128)):st.value.length?(e.openBlock(),e.createElementBlock("div",em,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,(j,oe)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+oe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(He=>Ze(j),["stop"])},null,14,lm))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",nm,[e.createElementVNode("div",om,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":xe.value}]),title:"Manage custom colors",onClick:e.withModifiers(pt,["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",am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(j,oe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+oe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":xe.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!xe.value&&Dt(j),"dss-color-picker__preset-bubble--editing":xe.value&&de.value===Ue(oe)}]),style:e.normalizeStyle({backgroundColor:de.value===Ue(oe)?tt.value:j}),title:de.value===Ue(oe)?tt.value:j,onClick:e.withModifiers(He=>xe.value?Pe(Ue(oe)):Ze(j),["stop"])},null,14,sm),xe.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(He=>At(Ue(oe)),["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,rm)):e.createCommentVNode("",!0)],2))),128)),Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ve.value}]),onClick:e.withModifiers(ml,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(j,oe)=>(e.openBlock(),e.createElementBlock("button",{key:oe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(He=>Ze(j),["stop"])},null,14,cm))),128)),Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ve.value}]),onClick:e.withModifiers(ml,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:A,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Ft.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ut.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ie},[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(ft.value)},null,4)],32),e.createElementVNode("div",um,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ge,type:"text",class:"dss-color-picker__hex-input",value:It.value,onInput:ut},null,40,dm)]),fe.value&&(L.presetColors.length||vt.value)&&Y.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:$t}," Save color ")):e.createCommentVNode("",!0),fe.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ct}," Save color ")):e.createCommentVNode("",!0),fe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ve}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},pm={key:0,class:"dss-loader"},fm={key:0,class:"dss-loader-label"},vm={key:1,class:"dss-loader"},gm={key:0,class:"dss-loader-label"},hm={key:2,class:"dss-loader"},ym={key:0,class:"dss-loader-label"},Cm={key:3,class:"dss-loader"},km={key:0,class:"dss-loader-label"},bm={key:4,class:"dss-loader"},wm={key:0,class:"dss-loader-label"},xm={key:5,class:"dss-loader dss-loader--inline"},Em={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(L){const re=L,M=e.computed(()=>re.size==="small"?"dss-loaders--size-small":re.size==="large"?"dss-loaders--size-large":re.size==="medium"||re.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>re.size==="small"||re.size==="medium"||re.size==="large"||re.size==null?{}:{"--dss-loader-size":typeof re.size=="number"?`${re.size}px`:String(re.size)});return(se,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle($.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",pm,[C[0]||(C[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",fm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",vm,[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)),L.label?(e.openBlock(),e.createElementBlock("span",gm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",hm,[C[2]||(C[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.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)),L.label?(e.openBlock(),e.createElementBlock("span",km,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",bm,[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)),L.label?(e.openBlock(),e.createElementBlock("span",wm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",xm,[C[5]||(C[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Em,[e.renderSlot(se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},Yo="dss-skeleton-item",Sm={__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:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:Yo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const re=L,M=e.computed(()=>{const C={"dss-skeleton--loading":re.loading,"dss-skeleton--static":!re.shimmer,"dss-skeleton--multiple":re.mode==="multiple","dss-skeleton--dark":re.darkMode};return re.mode==="multiple"&&re.targetClass!==Yo&&(C[`dss-skeleton--target-${re.targetClass}`]=!0),C}),$=e.computed(()=>{const C={};return re.borderRadius&&(C.borderRadius=re.borderRadius),C}),se=e.computed(()=>{const C={};return re.borderRadius&&(C["--dss-skeleton-border-radius"]=re.borderRadius),re.darkMode?(C["--dss-skeleton-bg"]=re.bgDark||"#322c3f",C["--dss-skeleton-shimmer"]=re.shimmerDark||"#3e3f41",C):(re.bgColor&&(C["--dss-skeleton-bg"]=re.bgColor),re.shimmerColor&&(C["--dss-skeleton-shimmer"]=re.shimmerColor),C)});return(C,Ee)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(se.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle($.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":L.loading&&L.mode==="single"}])},[e.renderSlot(C.$slots,"default")],2)],6))}},Nm={key:0,class:"dss-dnd-column-header"},Bm={class:"dss-dnd-column-title"},Mm={class:"dss-dnd-column-count"},_m=["data-column"],$m={key:0,class:"dss-dnd-indicator"},Lm=["onPointerdown"],Tm=["onPointerdown"],Am={class:"dss-dnd-item-content"},Dm={class:"dss-dnd-item-default"},Hm={key:0,class:"dss-dnd-empty"},Rm={name:"DSSDnd"},Fm=Object.assign(Rm,{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(L,{emit:re}){const M=L,$=re,se=e.useSlots(),C=e.computed(()=>!!se["delete-zone"]),Ee={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},le=e.computed(()=>({...Ee,...M.options})),Ge=e.computed(()=>({"--dss-dnd-col-min-w":le.value.columnMinWidth,"--dss-dnd-col-max-w":le.value.columnMaxWidth,"--dss-dnd-col-gap":le.value.columnGap,"--dss-dnd-indicator-color":le.value.indicatorColor,"--dss-dnd-body-max-h":le.value.columnBodyMaxHeight}));function p(G){if(!le.value.ColColor||!G)return{};const Ve=G.background||G.color;return Ve?{background:Ve}:{}}const ve=e.ref(null),xe=e.ref(null),de=e.ref(!1),ne=e.ref(-1),X=e.ref(null);let pe=null,A=null,ge=null,Le=null,qe=0,vt=0,R="",Y=null;const _e=5,fe=e.computed(()=>{const G={};for(const Ve of M.columns)G[Ve.value]=M.items.filter(Ne=>Ne[M.columnKey]===Ve.value).sort((Ne,Ie)=>(Ne[M.positionKey]??0)-(Ie[M.positionKey]??0));return G}),st=e.computed(()=>{const G={},Ve=!!ve.value,Ne=ve.value?.[M.itemKey],Ie=xe.value,ut=ne.value;for(const Ze of M.columns){const et=fe.value[Ze.value]||[],he=[],Ke=Ie==Ze.value;let W=0;for(let Z=0;Z<et.length;Z++){const j=et[Z],oe=Ve&&j[M.itemKey]===Ne;!oe&&Ke&&ut===W&&he.push({type:"indicator",key:`ind-${W}`}),oe||W++,he.push({type:"item",item:j,isDragged:oe,key:`item-${j[M.itemKey]}`})}Ke&&ut>=W&&he.push({type:"indicator",key:"ind-end"}),G[Ze.value]=he}return G});function Ce(G,Ve){const Ie=(fe.value[G]||[]).filter(et=>et[M.itemKey]!==ve.value?.[M.itemKey]);if(Ie.length===0)return 1;if(Ve<=0){const et=Ie[0][M.positionKey];return et!=null&&et>0?et/2:.5}if(Ve>=Ie.length){const et=Ie[Ie.length-1][M.positionKey];return(et??0)+1}const ut=Ie[Ve-1][M.positionKey]??0,Ze=Ie[Ve][M.positionKey]??0;return(ut+Ze)/2}function Ue(G,Ve,Ne){ge&&ge.remove();const Ie=G.getBoundingClientRect(),ut=G.cloneNode(!0);ut.classList.add("dss-dnd-ghost"),ut.style.cssText=`
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)}}ct()}e.nextTick(()=>{Kt(),qn()})},Ol=()=>{if(!p.value||de.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=bt());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(p.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 _=[...h.matchAll(a)];if(_.length===0)continue;const T=_.filter(U=>{const Re=U[0],be=U.index;if(be>0&&h[be-1]==="@"||be+Re.length<h.length&&h[be+Re.length]==="@")return!1;const mt=v.parentElement;return!(mt&&mt.closest("a"))});if(T.length===0)continue;if(T.length===1&&T[0][0]===h.trim()){const U=T[0][0],Re=U.startsWith("http://")||U.startsWith("https://")?U:`https://${U}`,be=document.createElement("a");be.href=Re,be.textContent=U,be.style.color="#60afdf",be.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(be,v),u=!0);continue}let S=0;const te=document.createDocumentFragment();if(T.forEach(U=>{const Re=U.index,be=U[0];if(Re>S){const nl=h.substring(S,Re);nl&&te.appendChild(document.createTextNode(nl))}const mt=be.startsWith("http://")||be.startsWith("https://")?be:`https://${be}`,ml=document.createElement("a");ml.href=mt,ml.textContent=be,ml.style.color="#60afdf",ml.style.textDecoration="underline",te.appendChild(ml),S=Re+be.length}),S<h.length){const U=h.substring(S);U&&te.appendChild(document.createTextNode(U))}v.parentNode&&te.childNodes.length>0&&(v.parentNode.replaceChild(te,v),u=!0)}u&&n&&e.nextTick(()=>{ye(n),Kt()})},Cn=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(p.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(_=>{const T=_.index,S=_[0].startsWith("<u>")?"u":"ins",te=_[1]||_[2]||"";T>v&&h.appendChild(document.createTextNode(u.substring(v,T)));const U=document.createElement(S);U.textContent=te,h.appendChild(U),v=T+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},on=o=>{if(!p.value||de.value)return;if(!o){Cn();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===p.value||!p.value.contains(c))return;const d=()=>{let nl="",Xt=0,ol=!1;const al=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jl=>jl.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let qt=0;for(;al.nextNode();){const jl=al.currentNode,pn=jl.textContent||"",Kl=qt;if(qt+=pn.length,jl===r.startContainer){nl+=pn.substring(0,r.startOffset),Xt=Kl+r.startOffset,ol=!0;break}nl+=pn}return ol||(Xt=nl.length),{textBeforeCursor:nl,cursorCharOffset:Xt}},{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[1],T=u.length-h.length,te=(nl=>{let Xt=0;const ol=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:qt=>qt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let al;for(;al=ol.nextNode();){const qt=(al.textContent||"").length;if(Xt+qt>=nl)return{node:al,offset:nl-Xt};Xt+=qt}return null})(T);if(!te)return;const U=document.createRange();U.setStart(te.node,te.offset),U.setEnd(r.endContainer,r.endOffset);const Re=document.createElement(v);Re.textContent=_,U.deleteContents(),U.insertNode(Re);const be=window.getSelection(),mt=document.createRange();mt.setStartAfter(Re),mt.collapse(!0),be.removeAllRanges(),be.addRange(mt);const ml=bt();e.nextTick(()=>{ct(),ml&&ye(ml)})},Wt=()=>{p.value&&(Tt.value=bt(),Ct.value="",Dt.value="",Ne.value="",$t.value="",tt.value="",pl.value=null,ft.value=null,Ve.value="upload",pt.value=!0,Ot(),e.nextTick(()=>{It.value&&It.value.focus(),Ft.value&&(Ft.value.value="")}))},bo=o=>{const n=o.target?.files?.[0];if(!n){pl.value=null,Dt.value="";return}pl.value=n;const a=new FileReader;a.onload=r=>{Dt.value=r.target?.result||""},a.readAsDataURL(n)},Qt=()=>{Ft.value&&Ft.value.click()},dl=()=>{$t.value&&(tt.value="")},wo=()=>{tt.value&&($t.value="")},Ro=()=>{let o=ft.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")||"";ft.value=o,Ct.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ne.value=a,Dt.value="",Ve.value="url"):(Dt.value=a,Ne.value="",Ve.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";$t.value=c.endsWith("px")?c.replace("px",""):c,tt.value=d.endsWith("px")?d.replace("px",""):d,Tt.value=null}else{Wt();return}pt.value=!0,G.value=!1,lt.value=!1,e.nextTick(()=>{Ve.value==="url"&&Ut.value?(Ut.value.focus(),Ut.value.select()):It.value&&(It.value.focus(),It.value.select()),Ft.value&&(Ft.value.value="")})},kn=()=>{pt.value=!1,Ct.value="",Dt.value="",Ne.value="",$t.value="",tt.value="",pl.value=null,ft.value=null,Tt.value=null,Ve.value="upload"},mn=()=>{const o=(Ct.value||"").trim(),n=p.value?._mutationObserver;n&&n.disconnect(),Ke.value?(he.value&&(clearTimeout(he.value),he.value=null),Ae(),Ke.value=!1):Ae();const a=Ve.value==="url"?Ne.value.trim():Dt.value;if(ft.value&&p.value&&p.value.contains(ft.value)){a&&(ft.value.src=a),ft.value.setAttribute("alt",o),ft.value.setAttribute("data-alt",o),$t.value?(ft.value.style.width=`${$t.value}px`,ft.value.setAttribute("width",$t.value)):(ft.value.style.removeProperty("width"),ft.value.removeAttribute("width")),tt.value?(ft.value.style.height=`${tt.value}px`,ft.value.setAttribute("height",tt.value)):(ft.value.style.removeProperty("height"),ft.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(ft.value),c.collapse(!0),r.addRange(c)}ct()}else{if(!a){n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),kn();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Tt.value&&(ye(Tt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){kn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",p.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(p.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),$t.value&&(v.style.width=`${$t.value}px`,v.setAttribute("width",$t.value)),tt.value&&(v.style.height=`${tt.value}px`,v.setAttribute("height",tt.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const T=document.createElement("p");p.value.appendChild(T),T.appendChild(v)}else{const T=p.value.lastChild;if(T&&T.nodeType===1)T.appendChild(v);else{const S=document.createElement("p");p.value.appendChild(S),S.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}ft.value=v,ct()}}e.nextTick(()=>{n&&p.value&&n.observe(p.value,{childList:!0,subtree:!0}),Kt(),Zt(),kn()})};e.watch(()=>C.modelValue,o=>{if(C.richText&&p.value&&!de.value){const n=Nn(o||""),r=p.value.innerHTML.replace(/&nbsp;|\u00A0/g," "),c=n.replace(/&nbsp;|\u00A0/g," ");if(r!==c){const d=bt();p.value.innerHTML=n,e.nextTick(()=>{ht();const u=p.value.innerHTML||"",m=C.title||"",v=C.description||"";W.value=u,j.value=m,oe.value=v,Z.value=u,He.value=m,N.value=v,Ze.value=[],et.value=[],he.value&&(clearTimeout(he.value),he.value=null),Ke.value=!1,d&&ye(d),x(),K(),El(),Kt(),Zt(),tn(),Il("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,o=>{o?(Zt(),e.nextTick(()=>{Dn()})):(Pl(),gt.value=[],Et.value&&(Et.value.disconnect(),Et.value=null)),tn()}),e.watch(()=>C.floatingToolbar,o=>{o?Zt():Pl()}),e.watch(()=>C.disabled,o=>{o&&Pl(),tn()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{Be.value?wl():gn()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{ot.value?Bl():il()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{Mt()})},{deep:!0}),e.watch(()=>C.comments,(o,n)=>{if(to.value){to.value=!1;return}Tn.value||C.richText&&p.value&&e.nextTick(()=>{Un()})},{deep:!0,immediate:!1});const Un=()=>{if(!Tn.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!p.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=p.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=p.value.querySelector(`[data-comment="${v}"]`);if(h){En(h,u),d.add(v);return}try{const _=io(u.selection_range,u.selection_text);if(_&&!_.collapsed){const T=_.commonAncestorContainer,S=T.nodeType===3?T.parentElement:T;if(S){const Re=S.closest("[data-comment], [data-fake-comment]");if(Re){const be=Re.getAttribute("data-comment")||Re.getAttribute("data-fake-comment");if(String(be)===String(m)){Re.setAttribute("data-comment",v),Re.removeAttribute("data-fake-comment"),En(Re,u),d.add(v);return}else return}}const te=p.value.querySelector(`[data-comment="${v}"]`);if(te){En(te,u),d.add(v);return}const U=document.createElement("span");U.setAttribute("data-comment",v),En(U,u);try{_.surroundContents(U),c++,d.add(v)}catch{try{const be=document.createRange();be.setStart(_.startContainer,_.startOffset),be.setEnd(_.endContainer,_.endOffset),Pt(be),be.surroundContents(U),c++,d.add(v)}catch{try{const mt=_.extractContents();U.appendChild(mt),_.insertNode(U),c++,d.add(v)}catch(mt){console.warn("Failed to create comment marker:",mt)}}}}}catch{}}),e.nextTick(()=>{Il("restoreCommentsFromModel"),ct(),Tn.value=!1})}catch{Tn.value=!1}}},Pt=o=>{if(!o||!p.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&&!Fo(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&&!ro(c)||o.setEndAfter(u))}else c.nodeType===1&&n.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Fo=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},ro=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},io=(o,n)=>{if(!o||!p.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=[p.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?Pt(a):null}}catch{return null}return null},En=(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")},Il=(o="unknown")=>{if(!C.richText||!p.value){gt.value=[];return}Date.now()-Ht.value<Gl&&Vt.value!==null||Vt.value===null&&(Vt.value=requestAnimationFrame(()=>{if(Vt.value=null,Ht.value=Date.now(),kt.value)return;kt.value=!0;const a={},r=p.value;if(!r){kt.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){kt.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(S=>{const te=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");te&&S.tagName==="SPAN"&&(m.has(te)||(u.push(S),m.add(te)))}),d.forEach(S=>{const te=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");!te||m.has(te)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(S.tagName)?S.querySelector(`span[data-comment="${te}"], span[data-fake-comment="${te}"]`)||(u.push(S),m.add(te)):S.tagName!=="SPAN"&&(u.push(S),m.add(te)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((S,te)=>{let U=S.getAttribute("data-comment")||S.getAttribute("data-fake-comment");if(!U)return;if(typeof U=="string"&&U.startsWith("comment-")){const dt=S.textContent?.trim(),Zl=C.comments?.find(sl=>(typeof sl.conversation_id=="string"&&sl.conversation_id.startsWith("comment-")?null:sl.conversation_id)&&sl.selection_text?.trim()===dt);Zl?(U=String(Zl.conversation_id),S.setAttribute("data-comment",U),S.removeAttribute("data-fake-comment")):(U=String(Date.now()),S.setAttribute("data-comment",U),S.removeAttribute("data-fake-comment"))}const Re=S.getBoundingClientRect(),be=window.getComputedStyle(S),mt=parseFloat(be.lineHeight)||parseFloat(be.fontSize)*1.2,Xt=Re.top-h.top+mt/2-15,al=h.top-v.top+Xt;let qt=null,jl=null,pn=0;const Kl=[],Eo=new Set;if(U&&C.comments){const dt=C.comments.find(Zl=>String(Zl.conversation_id||Zl.id)===String(U));if(dt){const Zl=dt.conversation||[];Zl.length>0?(Zl.forEach(sl=>{sl.user&&sl.user.id&&!Eo.has(sl.user.id)&&(Eo.add(sl.user.id),Kl.push(sl.user))}),pn=Zl.length):(pn=0,qt=null,jl=null),Kl.length>0?qt=Kl[0]:qt=null,Kl.length>1?jl=Kl[1]:jl=null}}const an=Re.top+mt/2-15,uo=an+30,Hn=5,Vn=uo>h.top+Hn&&an<h.bottom-Hn?1:0;gt.value.find(dt=>dt.id===U);let fn=S;if(!fn&&U&&p.value){const dt=String(U);fn=p.value.querySelector(`[data-comment="${dt}"], [data-fake-comment="${dt}"]`)}const Sn=Kl.length;a[U]?(a[U].top=al,a[U].opacity=Vn,a[U].element=fn,a[U].firstUser=qt,a[U].secondUser=jl,a[U].totalCount=pn,a[U].uniqueUserCount=Sn):a[U]={id:U,top:al,opacity:Vn,element:fn,firstUser:qt,secondUser:jl,totalCount:pn,uniqueUserCount:Sn}});const _=Object.values(a).map(S=>{const te=Math.max(0,(S.uniqueUserCount??0)-2);if(!S.element&&S.id&&p.value){const Re=String(S.id);S.element=p.value.querySelector(`[data-comment="${Re}"], [data-fake-comment="${Re}"]`)}return{...S,firstUser:S.firstUser||null,secondUser:S.secondUser||null,totalCount:S.totalCount,additionalCount:te}});(gt.value.length!==_.length||_.some((S,te)=>{const U=gt.value[te];if(!U)return!0;const Re=(U.firstUser?.id||null)!==(S.firstUser?.id||null),be=(U.secondUser?.id||null)!==(S.secondUser?.id||null);return U.id!==S.id||Math.abs(U.top-S.top)>1||U.opacity!==S.opacity||U.totalCount!==S.totalCount||U.additionalCount!==S.additionalCount||Re||be||U.element!==S.element}))&&(gt.value=_),kt.value=!1}))},xo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&p.value){const a=String(o.id);n=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(bn(),xt.value=n,n.classList.add("editor-comment-highlighted"))},bn=(o=!1)=>{!o&&Qe.value!==null&&xt.value&&(xt.value.getAttribute("data-comment")||xt.value.getAttribute("data-fake-comment"))===Qe.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),xt.value&&(xt.value.classList.remove("editor-comment-highlighted"),xt.value=null))},co=o=>{if(!o||!o.element)return;bn(!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}"]`;Ee("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},Io=()=>{bn()},Dn=()=>{!C.richText||!p.value||(Et.value&&Et.value.disconnect(),fl.value!==null&&(clearTimeout(fl.value),fl.value=null),Et.value=new MutationObserver(()=>{fl.value===null&&(fl.value=setTimeout(()=>{fl.value=null,e.nextTick(()=>{Il("MutationObserver")})},200))}),Et.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Il("setupCommentMarkersObserver-initial"))},Xn=(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(()=>Ie.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(()=>{Xn(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(()=>[ve.value,At.value],()=>{ve.value==="askAi"||At.value==="askAi"?e.nextTick(()=>{en()}):(Ie.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!==se.value&&(se.value=o)},{immediate:!0}),re({openCommentOverlayForSelector:oo,updateCommentMarkers:Il,restoreCommentsFromModel:Un}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",jt.value]),style:e.normalizeStyle(Rt.value)},[L.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",su,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:De,title:e.unref($)("textEditor.toolbar.undo")},[...n[45]||(n[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:_n,title:e.unref($)("textEditor.toolbar.redo")},[...n[46]||(n[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,iu),n[73]||(n[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",cu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>Pn("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[Xe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",du,[...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)])])):Xe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",mu,[...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)])])):Xe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",pu,[...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)])])):Xe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",fu,[...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)])])):Xe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",vu,[...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)])])):Xe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",gu,[...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",hu,[...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,uu),ve.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=>gl("<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($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[2]||(n[2]=a=>gl("<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($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[3]||(n[3]=a=>gl("<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($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[4]||(n[4]=a=>gl("<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($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[5]||(n[5]=a=>gl("<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($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[6]||(n[6]=a=>gl("<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($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[7]||(n[7]=a=>gl("<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($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("bold")}]),onClick:n[9]||(n[9]=a=>xl("bold")),title:e.unref($)("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,yu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("italic")}]),onClick:n[10]||(n[10]=a=>xl("italic")),title:e.unref($)("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":Cl("underline")}]),onClick:n[11]||(n[11]=a=>xl("underline")),title:e.unref($)("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,ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st.value}]),onClick:On,title:e.unref($)("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,bu),n[74]||(n[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),xe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:$n,title:e.unref($)("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,xu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Al,title:e.unref($)("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,wu)),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":Cl("insertUnorderedList")}]),onClick:Ln,title:e.unref($)("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,Eu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("insertOrderedList")}]),onClick:k,title:e.unref($)("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:Wt,title:e.unref($)("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,Su),at.value?(e.openBlock(),e.createElementBlock("div",Nu)):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:mo},[...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,Bu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",Mu)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",_u,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>Pn("askAi")),title:e.unref($)("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",Lu,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,$u),ve.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",Tu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[nt(a)?(e.openBlock(),e.createElementBlock("div",Au,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),nt(a)&&r<L.customToolbarSlots.length-1&&yl(r)?(e.openBlock(),e.createElementBlock("div",Du)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ve.value==="paragraph"||ve.value==="askAi")&&L.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ot})):e.createCommentVNode("",!0),e.createVNode(Oo,{showModal:ge.value,width:"500px",height:"55vh",onCloseModal:qn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Hu,[e.createElementVNode("div",Ru,[e.createElementVNode("label",Fu,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:R,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>qe.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(so,["enter"])},null,40,Iu),[[e.vModelText,qe.value]])]),e.createElementVNode("div",zu,[e.createElementVNode("label",Pu,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:vt,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>Le.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(so,["enter"])},null,40,Ou),[[e.vModelText,Le.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:qn},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:so},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Oo,{showModal:pt.value,width:"500px",height:"80vh",onCloseModal:kn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(ft.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Zu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Ve.value==="upload"}]),onClick:n[17]||(n[17]=a=>Ve.value="upload")},e.toDisplayString(e.unref($)("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":Ve.value==="url"}]),onClick:n[18]||(n[18]=a=>Ve.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Ve.value==="upload"?(e.openBlock(),e.createElementBlock("div",Wu,[e.createElementVNode("div",qu,[e.createElementVNode("div",Uu,[Te.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Xu,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qt},[e.createElementVNode("img",{src:Dt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Yu),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:Ft,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:bo},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ft,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:bo},null,544))]),e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:It,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mn,["enter"])},null,40,Gu),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>$t.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:dl},null,40,ed),[[e.vModelText,$t.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",ld,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:wo},null,40,nd),[[e.vModelText,tt.value]])])])])):e.createCommentVNode("",!0),Ve.value==="url"?(e.openBlock(),e.createElementBlock("div",od,[e.createElementVNode("div",ad,[e.createElementVNode("div",sd,[e.createElementVNode("label",rd,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Ut,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Ne.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(mn,["enter"])},null,40,id),[[e.vModelText,Ne.value]])]),e.createElementVNode("div",cd,[e.createElementVNode("label",ud,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mn,["enter"])},null,40,dd),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",md,[e.createElementVNode("label",pd,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>$t.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:dl},null,40,fd),[[e.vModelText,$t.value]])]),e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(mn,["enter"]),onInput:wo},null,40,hd),[[e.vModelText,tt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:kn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:mn},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":ql.value&&ot.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",yd,[ot.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Cd,[L.title?(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(L.title),1)):(e.openBlock(),e.createElementBlock("span",bd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:b,value:L.title,onInput:Tl,onFocus:In,onBlur:Ul,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!ot.value}]),placeholder:rt.value,disabled:L.disabled,rows:"1"},null,42,wd)])],2),ql.value&&ot.value?(e.openBlock(),e.createElementBlock("div",xd,[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":vn.value&&Be.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",Ed,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Vd,[L.description?(e.openBlock(),e.createElementBlock("span",Sd,e.toDisplayString(L.description),1)):(e.openBlock(),e.createElementBlock("span",Nd,e.toDisplayString(it.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:V,value:L.description,onInput:zn,onFocus:cn,onBlur:Mn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Be.value}]),placeholder:it.value,disabled:L.disabled,rows:"1"},null,42,Bd)])],2),vn.value&&Be.value?(e.openBlock(),e.createElementBlock("div",Md,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Qe.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=>xo(a),onMouseleave:Io},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Ld)):(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,$d)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Dd)):(e.openBlock(),e.createElementBlock("span",Hd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Ad)):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=>co(a),["stop"])},[e.createElementVNode("span",Fd,"+"+e.toDisplayString(a.additionalCount),1)],12,Rd)):e.createCommentVNode("",!0)],46,_d))),128)),L.richText?(e.openBlock(),e.createElementBlock("div",qd,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":L.disabled,"dss-text-editor-fixed-height":L.fixedHeight}]),style:e.normalizeStyle(bl.value),onInput:ct,onBlur:yt,onClick:ll,onMouseup:vo,onKeyup:vo,onKeydown:Vl,onPaste:P,onMousemove:Do,onMouseleave:Ho},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Qe.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(Jt.value)},[tl.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",Ud,[e.createElementVNode("div",Xd,[tl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:tl.value},null,8,Yd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",jd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.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",Kd,[e.createElementVNode("div",Gd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Qd)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",e1,[e.createElementVNode("div",t1,[e.createElementVNode("div",l1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",n1,e.toDisplayString(Rn(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Fn(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),C.commentUser&&a.user&&a.user.id===C.commentUser.id&&!Fn(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>fo(a,r),["stop"]),title:e.unref($)("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,o1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",a1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:el,"onUpdate:modelValue":n[26]||(n[26]=a=>zt.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(po,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(el.value){const a=el.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,s1),[[e.vModelText,zt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(po,["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",r1,[e.createElementVNode("div",i1,[e.createElementVNode("span",c1,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[82]||(n[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",u1,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("textarea",{value:L.modelValue,onInput:Bn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":L.fixedHeight}]),placeholder:Ye.value,rows:L.rows,disabled:L.disabled,style:e.normalizeStyle(Ll.value)},null,46,zd),e.createElementVNode("div",Pd,[e.createElementVNode("div",Od,[e.createElementVNode("span",Zd,e.toDisplayString(z.value)+" "+e.toDisplayString(z.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[79]||(n[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Wd,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ne.value&&X.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(pe.value),onMouseenter:n[28]||(n[28]=a=>A.value=!0),onMouseleave:nn},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Co,["stop"]),title:X.value},e.toDisplayString(X.value),9,d1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(ko,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",p1,[...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,m1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[lt.value&&Nt.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(rl.value),onMouseenter:n[29]||(n[29]=a=>G.value=!0),onMouseleave:xn},[e.createElementVNode("div",f1,[Nt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",v1,[...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:Nt.value},e.toDisplayString(Nt.value),9,g1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Ro,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",y1,[...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,h1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[L.floatingToolbar&&L.richText&&Ue.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Pe,class:"dss-floating-toolbar",style:e.normalizeStyle(Lt.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",C1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(De,["stop"]),title:e.unref($)("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,k1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!I.value}]),onClick:e.withModifiers(_n,["stop"]),title:e.unref($)("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,b1),n[107]||(n[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",w1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>An("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[Xe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",E1,[...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)])])):Xe.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)])])):Xe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",S1,[...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)])])):Xe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",N1,[...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)])])):Xe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",B1,[...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)])])):Xe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",M1,[...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",_1,[...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,x1),At.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=>un("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>un("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>un("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>un("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>un("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>un("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>un("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("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":Cl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>xl("bold"),["stop"])),title:e.unref($)("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,$1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>xl("italic"),["stop"])),title:e.unref($)("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,L1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>xl("underline"),["stop"])),title:e.unref($)("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,T1),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":st.value}]),onClick:e.withModifiers(On,["stop"]),title:e.unref($)("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,A1),n[110]||(n[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),xe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers($n,["stop"]),title:e.unref($)("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,H1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Al,["stop"]),title:e.unref($)("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,D1)),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":Cl("insertUnorderedList")}]),onClick:e.withModifiers(Ln,["stop"]),title:e.unref($)("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,R1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Cl("insertOrderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref($)("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,F1),n[112]||(n[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Wt,["stop"]),title:e.unref($)("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,I1),n[113]||(n[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:e.withModifiers(mo,["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,z1),L.askAi?(e.openBlock(),e.createElementBlock("div",P1)):e.createCommentVNode("",!0),L.askAi?(e.openBlock(),e.createElementBlock("div",O1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>An("askAi"),["stop"])),title:e.unref($)("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",W1,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,Z1),At.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)]),zl.value?(e.openBlock(),e.createElementBlock("div",q1,[L.askAi&&zl.value?(e.openBlock(),e.createElementBlock("div",U1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[nt(a)&&Nl(a)?(e.openBlock(),e.createElementBlock("div",X1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),nt(a)&&Nl(a)&&r<L.customToolbarSlots.length-1&&vl(r)?(e.openBlock(),e.createElementBlock("div",Y1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),G1={class:"dss-color-picker__section-title"},Q1={class:"dss-color-picker__presets-row"},J1=["title","onClick"],em={key:1,class:"dss-color-picker__section"},tm={class:"dss-color-picker__presets-row"},lm=["title","onClick"],nm={class:"dss-color-picker__section"},om={class:"dss-color-picker__section-header"},am={class:"dss-color-picker__presets-row"},sm=["title","onClick"],rm=["onClick"],im={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},cm=["title","onClick"],um={class:"dss-color-picker__input-row"},dm=["value"],mm={__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(L,{emit:re}){function M(W){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(W);if(!Z)return{h:0,s:0,l:50};const j=parseInt(Z[1],16)/255,oe=parseInt(Z[2],16)/255,He=parseInt(Z[3],16)/255,N=Math.max(j,oe,He),b=Math.min(j,oe,He);let V=0,ee=0;const J=(N+b)/2;if(N!==b){const Se=N-b;switch(ee=J>.5?Se/(2-N-b):Se/(N+b),N){case j:V=((oe-He)/Se+(oe<He?6:0))/6;break;case oe:V=((He-j)/Se+2)/6;break;case He:V=((j-oe)/Se+4)/6;break}}return{h:V*360,s:ee*100,l:J*100}}function $(W,Z,j){Z/=100,j/=100;const oe=Z*Math.min(j,1-j),He=N=>{const b=(N+W/30)%12,V=j-oe*Math.max(Math.min(b-3,9-b,1),-1);return Math.round(255*V).toString(16).padStart(2,"0")};return`#${He(0)}${He(8)}${He(4)}`}function se(W){const Z=W.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let j=Z[1];return j.length===3&&(j=j.split("").map(oe=>oe+oe).join("")),"#"+j}function C(W,Z,j){Z/=100,j/=100;const oe=j+Z*Math.min(j,1-j),He=oe===0?0:2-2*j/oe;return{h:W,s:He*100,v:oe*100}}function Ee(W,Z,j){Z/=100,j/=100;const oe=j*(1-Z/2),He=oe===0||oe===1?0:(j-oe)/Math.min(oe,1-oe);return{h:W,s:He*100,l:oe*100}}const le=L,Ge=re,p=e.ref(!1),ve=e.ref(!1),xe=e.ref(!1),de=e.ref(-1),ne=e.ref(-1),X=e.ref(null),pe=e.ref(null),A=e.ref(null),ge=e.ref(null),Le=e.ref({top:0,left:0}),qe=e.ref(M(le.modelValue||"#b8a5de")),vt=e.computed(()=>Array.isArray(le.presetGroups)&&le.presetGroups.length>0),R=e.computed(()=>vt.value?0:le.initialPresetCount!=null?le.initialPresetCount:ne.value<0?null:ne.value),Y=e.computed(()=>{const W=R.value;return W==null?!0:Math.max(0,le.presetColors.length-W)<le.max}),_e=e.computed(()=>!!(ve.value||de.value>=0||!fe.value&&le.presetColors.length===0));e.computed(()=>{const W=R.value;return W!=null&&le.presetColors.length>W});const fe=e.computed(()=>vt.value||R.value!=null),st=e.computed(()=>{const W=R.value;return W==null?[]:le.presetColors.slice(0,W)}),Ce=e.computed(()=>{const W=R.value;return W==null?[]:le.presetColors.slice(W)});function Ue(W){const Z=R.value;return Z!=null?Z+W:-1}function Lt(W){const Z=R.value;return Z!=null&&W>=Z}function Pe(W){Lt(W)&&(de.value=W,qe.value=M(le.presetColors[W]),ve.value=!0,e.nextTick(()=>ge.value?.focus()))}function At(W){if(!Lt(W))return;const Z=le.presetColors.filter((He,N)=>N!==W);Ge("update:presetColors",Z);const j=se(le.modelValue),oe=se(le.presetColors[W]);if(j&&oe&&j.toLowerCase()===oe.toLowerCase()){const He=Z[Math.max(0,W-1)]||Z[0];He&&Ge("update:modelValue",He)}}function pt(){xe.value=!xe.value,xe.value||(de.value=-1,ve.value=!1)}function Ct(){if(de.value<0)return;const W=tt.value,Z=se(W);if(Z){const j=[...le.presetColors];j[de.value]=Z,Ge("update:presetColors",j),Ge("update:modelValue",Z),de.value=-1,ve.value=!1}}function pl(){le.disabled||(de.value=-1,ve.value=!ve.value,ve.value&&(Nt(),e.nextTick(()=>ge.value?.focus())))}function Dt(W){const Z=se(W),j=se(le.modelValue);return Z&&j&&Z.toLowerCase()===j.toLowerCase()}function $t(){if(le.disabled||!Y.value)return;const W=tt.value,Z=se(W);if(Z){const j=[...le.presetColors,Z];Ge("update:presetColors",j),Ge("update:modelValue",Z);const oe=R.value??ne.value;oe>=0&&j.length-oe>=le.max&&(ve.value=!1)}}const tt=e.computed(()=>{const{h:W,s:Z,l:j}=qe.value;return $(W,Z,j)}),It=e.computed(()=>tt.value.toLowerCase()),Ft=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),Ut=e.computed(()=>{const W=C(qe.value.h,qe.value.s,qe.value.l);return{left:`${W.s}%`,bottom:`${W.v}%`,transform:"translate(-50%, 50%)"}}),ft=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),Tt=e.computed(()=>({position:"fixed",left:`${Le.value.left}px`,top:`${Le.value.top}px`,zIndex:1002}));function lt(){if(!X.value||!p.value)return;const W=X.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let j=W.bottom+4;const oe=pe.value;oe&&j+oe.offsetHeight>Z-8&&(j=W.top-4-oe.offsetHeight),Le.value={top:j,left:W.left}}function Nt(){const W=le.modelValue||"#b8a5de";se(W)&&(qe.value=M(W))}function rl(){Ge("update:modelValue",tt.value)}function G(){le.disabled||(p.value=!p.value,p.value&&(Nt(),e.nextTick(()=>{lt(),ge.value?.focus()})))}function Ve(){const W=tt.value,Z=se(W);if(Z){if(de.value>=0){const j=[...le.presetColors];j[de.value]=Z,Ge("update:presetColors",j),Ge("update:modelValue",Z)}else if((le.presetColors.length>0||vt.value)&&ve.value&&Y.value&&!le.presetColors.some(oe=>se(oe)?.toLowerCase()===Z.toLowerCase())){const oe=[...le.presetColors,Z];Ge("update:presetColors",oe),Ge("update:modelValue",Z)}}p.value=!1,ve.value=!1,xe.value=!1,de.value=-1}function Ne(W){if(!A.value)return;const Z=A.value.getBoundingClientRect(),j=oe=>{const He=Math.max(0,Math.min(1,(oe.clientX-Z.left)/Z.width)),N=Math.max(0,Math.min(1,1-(oe.clientY-Z.top)/Z.height)),b={h:qe.value.h,s:He*100,v:N*100};qe.value=Ee(b.h,b.s,b.v)};j(W),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),rl()},{once:!0})}function Ie(W){if(!W.currentTarget)return;const j=W.currentTarget.getBoundingClientRect(),oe=He=>{const N=Math.max(0,Math.min(1,(He.clientX-j.left)/j.width));qe.value={...qe.value,h:N*360}};oe(W),document.addEventListener("mousemove",oe),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",oe),rl()},{once:!0})}function ut(W){const Z=W.target.value,j=se(Z);j&&(qe.value=M(j),Ge("update:modelValue",j))}function Ze(W){if(le.disabled)return;const Z=se(W);Z&&(qe.value=M(Z),Ge("update:modelValue",Z))}let et=null,he=null;function Ke(){et&&(document.removeEventListener("keydown",et),et=null),he&&(window.removeEventListener("resize",he),he=null)}return e.watch(p,W=>{if(Ke(),W){if(!vt.value&&le.initialPresetCount==null){const Z=le.presetColors.length;Z>0&&(ne.value<0||Z<ne.value)&&(ne.value=Z)}et=Z=>{Z.key==="Escape"&&Ve()},he=lt,document.addEventListener("keydown",et),window.addEventListener("resize",he)}}),e.watch(()=>le.modelValue,()=>{p.value&&Nt()},{immediate:!1}),e.watch(Ce,W=>{W.length===0&&(xe.value=!1,de.value=-1,ve.value=!1)}),e.onBeforeUnmount(Ke),(W,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":L.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:X,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:G},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:tt.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"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Ve,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:pe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Tt.value)},[fe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(L.presetGroups,(j,oe)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+oe,class:"dss-color-picker__section"},[e.createElementVNode("span",G1,e.toDisplayString(j.title),1),e.createElementVNode("div",Q1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(He,N)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+oe+"-"+N,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(He)}]),style:e.normalizeStyle({backgroundColor:He}),title:He,onClick:e.withModifiers(b=>Ze(He),["stop"])},null,14,J1))),128))])]))),128)):st.value.length?(e.openBlock(),e.createElementBlock("div",em,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,(j,oe)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+oe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(He=>Ze(j),["stop"])},null,14,lm))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",nm,[e.createElementVNode("div",om,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":xe.value}]),title:"Manage custom colors",onClick:e.withModifiers(pt,["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",am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(j,oe)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+oe,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":xe.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!xe.value&&Dt(j),"dss-color-picker__preset-bubble--editing":xe.value&&de.value===Ue(oe)}]),style:e.normalizeStyle({backgroundColor:de.value===Ue(oe)?tt.value:j}),title:de.value===Ue(oe)?tt.value:j,onClick:e.withModifiers(He=>xe.value?Pe(Ue(oe)):Ze(j),["stop"])},null,14,sm),xe.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(He=>At(Ue(oe)),["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,rm)):e.createCommentVNode("",!0)],2))),128)),Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ve.value}]),onClick:e.withModifiers(pl,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):L.presetColors.length?(e.openBlock(),e.createElementBlock("div",im,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.presetColors,(j,oe)=>(e.openBlock(),e.createElementBlock("button",{key:oe,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Dt(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(He=>Ze(j),["stop"])},null,14,cm))),128)),Y.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ve.value}]),onClick:e.withModifiers(pl,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_e.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:A,onMousedown:Ne},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Ft.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ut.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ie},[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(ft.value)},null,4)],32),e.createElementVNode("div",um,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ge,type:"text",class:"dss-color-picker__hex-input",value:It.value,onInput:ut},null,40,dm)]),fe.value&&(L.presetColors.length||vt.value)&&Y.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:$t}," Save color ")):e.createCommentVNode("",!0),fe.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ct}," Save color ")):e.createCommentVNode("",!0),fe.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Ve}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},pm={key:0,class:"dss-loader"},fm={key:0,class:"dss-loader-label"},vm={key:1,class:"dss-loader"},gm={key:0,class:"dss-loader-label"},hm={key:2,class:"dss-loader"},ym={key:0,class:"dss-loader-label"},Cm={key:3,class:"dss-loader"},km={key:0,class:"dss-loader-label"},bm={key:4,class:"dss-loader"},wm={key:0,class:"dss-loader-label"},xm={key:5,class:"dss-loader dss-loader--inline"},Em={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(L){const re=L,M=e.computed(()=>re.size==="small"?"dss-loaders--size-small":re.size==="large"?"dss-loaders--size-large":re.size==="medium"||re.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>re.size==="small"||re.size==="medium"||re.size==="large"||re.size==null?{}:{"--dss-loader-size":typeof re.size=="number"?`${re.size}px`:String(re.size)});return(se,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",M.value]),style:e.normalizeStyle($.value)},[L.type==="spinner"?(e.openBlock(),e.createElementBlock("div",pm,[C[0]||(C[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",fm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="dots"?(e.openBlock(),e.createElementBlock("div",vm,[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)),L.label?(e.openBlock(),e.createElementBlock("span",gm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="battery"?(e.openBlock(),e.createElementBlock("div",hm,[C[2]||(C[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),L.label?(e.openBlock(),e.createElementBlock("span",ym,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.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)),L.label?(e.openBlock(),e.createElementBlock("span",km,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="bars"?(e.openBlock(),e.createElementBlock("div",bm,[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)),L.label?(e.openBlock(),e.createElementBlock("span",wm,e.toDisplayString(L.label),1)):e.createCommentVNode("",!0)])):L.type==="inline"?(e.openBlock(),e.createElementBlock("div",xm,[C[5]||(C[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Em,[e.renderSlot(se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(L.label),1)])])])):e.createCommentVNode("",!0)],6))}},Yo="dss-skeleton-item",Sm={__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:L=>["single","multiple"].includes(L)},targetClass:{type:String,default:Yo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(L){const re=L,M=e.computed(()=>{const C={"dss-skeleton--loading":re.loading,"dss-skeleton--static":!re.shimmer,"dss-skeleton--multiple":re.mode==="multiple","dss-skeleton--dark":re.darkMode};return re.mode==="multiple"&&re.targetClass!==Yo&&(C[`dss-skeleton--target-${re.targetClass}`]=!0),C}),$=e.computed(()=>{const C={};return re.borderRadius&&(C.borderRadius=re.borderRadius),C}),se=e.computed(()=>{const C={};return re.borderRadius&&(C["--dss-skeleton-border-radius"]=re.borderRadius),re.darkMode?(C["--dss-skeleton-bg"]=re.bgDark||"#322c3f",C["--dss-skeleton-shimmer"]=re.shimmerDark||"#3e3f41",C):(re.bgColor&&(C["--dss-skeleton-bg"]=re.bgColor),re.shimmerColor&&(C["--dss-skeleton-shimmer"]=re.shimmerColor),C)});return(C,Ee)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",M.value]),style:e.normalizeStyle(se.value)},[L.loading&&L.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle($.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":L.loading&&L.mode==="single"}])},[e.renderSlot(C.$slots,"default")],2)],6))}},Nm={key:0,class:"dss-dnd-column-header"},Bm={class:"dss-dnd-column-title"},Mm={class:"dss-dnd-column-count"},_m=["data-column"],$m={key:0,class:"dss-dnd-indicator"},Lm=["onPointerdown"],Tm=["onPointerdown"],Am={class:"dss-dnd-item-content"},Dm={class:"dss-dnd-item-default"},Hm={key:0,class:"dss-dnd-empty"},Rm={name:"DSSDnd"},Fm=Object.assign(Rm,{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(L,{emit:re}){const M=L,$=re,se=e.useSlots(),C=e.computed(()=>!!se["delete-zone"]),Ee={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},le=e.computed(()=>({...Ee,...M.options})),Ge=e.computed(()=>({"--dss-dnd-col-min-w":le.value.columnMinWidth,"--dss-dnd-col-max-w":le.value.columnMaxWidth,"--dss-dnd-col-gap":le.value.columnGap,"--dss-dnd-indicator-color":le.value.indicatorColor,"--dss-dnd-body-max-h":le.value.columnBodyMaxHeight}));function p(G){if(!le.value.ColColor||!G)return{};const Ve=G.background||G.color;return Ve?{background:Ve}:{}}const ve=e.ref(null),xe=e.ref(null),de=e.ref(!1),ne=e.ref(-1),X=e.ref(null);let pe=null,A=null,ge=null,Le=null,qe=0,vt=0,R="",Y=null;const _e=5,fe=e.computed(()=>{const G={};for(const Ve of M.columns)G[Ve.value]=M.items.filter(Ne=>Ne[M.columnKey]===Ve.value).sort((Ne,Ie)=>(Ne[M.positionKey]??0)-(Ie[M.positionKey]??0));return G}),st=e.computed(()=>{const G={},Ve=!!ve.value,Ne=ve.value?.[M.itemKey],Ie=xe.value,ut=ne.value;for(const Ze of M.columns){const et=fe.value[Ze.value]||[],he=[],Ke=Ie==Ze.value;let W=0;for(let Z=0;Z<et.length;Z++){const j=et[Z],oe=Ve&&j[M.itemKey]===Ne;!oe&&Ke&&ut===W&&he.push({type:"indicator",key:`ind-${W}`}),oe||W++,he.push({type:"item",item:j,isDragged:oe,key:`item-${j[M.itemKey]}`})}Ke&&ut>=W&&he.push({type:"indicator",key:"ind-end"}),G[Ze.value]=he}return G});function Ce(G,Ve){const Ie=(fe.value[G]||[]).filter(et=>et[M.itemKey]!==ve.value?.[M.itemKey]);if(Ie.length===0)return 1;if(Ve<=0){const et=Ie[0][M.positionKey];return et!=null&&et>0?et/2:.5}if(Ve>=Ie.length){const et=Ie[Ie.length-1][M.positionKey];return(et??0)+1}const ut=Ie[Ve-1][M.positionKey]??0,Ze=Ie[Ve][M.positionKey]??0;return(ut+Ze)/2}function Ue(G,Ve,Ne){ge&&ge.remove();const Ie=G.getBoundingClientRect(),ut=G.cloneNode(!0);ut.classList.add("dss-dnd-ghost"),ut.style.cssText=`
104
104
  position: fixed;
105
105
  left: ${Ve-qe}px;
106
106
  top: ${Ne-vt}px;
@@ -114,5 +114,5 @@
114
114
  background-color: ${le.value.dragSourceBackground};
115
115
  font-family: 'Work Sans', sans-serif;
116
116
  cursor: grabbing;
117
- `,document.body.appendChild(ut),ge=ut}function Lt(G,Ve){ge&&(ge.style.left=`${G-qe}px`,ge.style.top=`${Ve-vt}px`)}function Pe(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=le.value.dragSourceBackground,G.style.borderColor=le.value.dragSourceBorder,G.style.transform="scale(0.97)"}function At(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function pt(G,Ve){return document.elementFromPoint(G,Ve)?.closest(".dss-dnd-column-body")??null}function Ct(G,Ve){return!!document.elementFromPoint(G,Ve)?.closest("[data-dss-dnd-delete-zone]")}function ml(G,Ve){if(C.value&&Ct(G,Ve)){de.value=!0,xe.value=null,ne.value=-1;return}de.value=!1;const Ne=pt(G,Ve),Ie=Ne?.getAttribute("data-column")??null;if(!Ie){xe.value=null,ne.value=-1;return}xe.value=Ie;const ut=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ze=ut.length;for(let et=0;et<ut.length;et++){const he=ut[et].getBoundingClientRect();if(Ve<he.top+he.height/2){Ze=et;break}}ne.value=Ze}function Dt(G){G.preventDefault(),Lt(G.clientX,G.clientY),!pe&&(pe=requestAnimationFrame(()=>{pe=null,ml(G.clientX,G.clientY)}))}function $t(G){window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",$t),window.removeEventListener("pointercancel",$t),Le?.releasePointerCapture?.(G.pointerId),At(Le),Le=null;const Ve=C.value&&Ct(G.clientX,G.clientY);if(ve.value&&Ve)$("delete",{item:ve.value});else{const Ie=pt(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(ve.value&&Ie){const ut=ve.value[M.columnKey],Ze=Ie,he=(fe.value[Ze]||[]).filter(j=>j[M.itemKey]!==ve.value[M.itemKey]),Ke=Math.max(0,Math.min(ne.value,he.length)),W=Ce(Ze,Ke),Z=ve.value[M.itemKey];$("move",{item:ve.value,from:ut,to:Ze,position:W,index:Ke}),A&&clearTimeout(A),X.value={id:Z,from:ut,to:Ze},A=setTimeout(()=>{X.value=null},3500)}}ge&&(ge.remove(),ge=null),R!==null&&(document.body.style.cursor=R,R=""),rl()}function tt(G,Ve){G.preventDefault();const Ne=G.target.closest(".dss-dnd-item");if(!Ne)return;const Ie=Ne.getBoundingClientRect();qe=G.clientX-Ie.left,vt=G.clientY-Ie.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",ve.value=Ve,Le=Ne,Ue(Ne,G.clientX,G.clientY),requestAnimationFrame(()=>Pe(Ne)),Ne.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",$t,{once:!0}),window.addEventListener("pointercancel",$t,{once:!0})}function It(){Y&&(window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),Y=null)}function Ft(G){if(!Y||G.pointerId!==Y.pointerId)return;const Ve=G.clientX-Y.startX,Ne=G.clientY-Y.startY;if(Math.abs(Ve)>=_e||Math.abs(Ne)>=_e){const Ie=Y.item;It(),tt(G,Ie)}}function Ut(G){!Y||G.pointerId!==Y.pointerId||It()}function ft(G,Ve){It(),Y={item:Ve,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",Ut),window.addEventListener("pointercancel",Ut)}function Tt(G,Ve){le.value.useHandle||ft(G,Ve)}function lt(G,Ve){ft(G,Ve)}function Nt(){pe&&(cancelAnimationFrame(pe),pe=null)}function rl(){Nt(),ve.value=null,xe.value=null,de.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{Nt(),It(),A&&clearTimeout(A),ge&&(ge.remove(),ge=null)}),(G,Ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":le.value.unstyled}]),style:e.normalizeStyle(Ge.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":de.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!ve.value,isOver:de.value})],2),[[e.vShow,!!ve.value||le.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":xe.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(p(Ne))},[le.value.showHeader?(e.openBlock(),e.createElementBlock("div",Nm,[e.renderSlot(G.$slots,"column-header",{column:Ne,items:fe.value[Ne.value]||[]},()=>[e.createElementVNode("span",Bm,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",Mm,e.toDisplayString((fe.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value[Ne.value],Ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie.key},[Ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",$m)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ie.isDragged,"dss-dnd-item--no-handle":!le.value.useHandle}]),onPointerdown:ut=>Tt(ut,Ie.item)},[le.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(ut=>lt(ut,Ie.item),["stop"])},[e.renderSlot(G.$slots,"handle",{},()=>[Ve[0]||(Ve[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Tm)):e.createCommentVNode("",!0),e.createElementVNode("div",Am,[e.renderSlot(G.$slots,"item",{item:Ie.item,column:Ne,justDropped:X.value?.id===Ie.item[L.itemKey],droppedFrom:X.value?.id===Ie.item[L.itemKey]?X.value.from:null,droppedTo:X.value?.id===Ie.item[L.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",Dm,e.toDisplayString(Ie.item[L.itemKey]),1)])])],42,Lm))],64))),128)),(fe.value[Ne.value]||[]).length===0&&xe.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",Hm,[e.renderSlot(G.$slots,"empty",{column:Ne},()=>[Ve[1]||(Ve[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,_m)],6))),128))],6))}}),Im={name:"DSSConfetti"},zm=Object.assign(Im,{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(L){const re=L,M=e.ref(null),$=e.ref(!1);let se=[],C=null,Ee=null;function le(ne,X){const pe=[];for(let A=0;A<re.count;A++)pe.push(Ge(ne));return pe}function Ge(ne,X){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:re.colors[Math.floor(Math.random()*re.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 p(ne,X,pe,A){ne.clearRect(0,0,X,pe);for(const ge of se)ne.save(),ne.globalAlpha=ge.opacity*A,ne.beginPath(),ne.lineWidth=ge.r,ne.strokeStyle=ge.color,ne.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),ne.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),ne.stroke(),ne.restore()}function ve(ne,X,pe){const A=.3+pe*.7;for(let ge=0;ge<se.length;ge++){const Le=se[ge];Le.tiltAngle+=Le.tiltInc,Le.y+=Le.speed*A,Le.x+=Math.sin(Le.d)*.5*A,Le.tilt=Math.sin(Le.tiltAngle)*15,pe>=.99&&Le.y>X+20&&(se[ge]=Ge(ne))}}function xe(){$.value=!0,e.nextTick(()=>{const ne=M.value;if(!ne)return;const X=ne.getContext("2d"),pe=ne.parentElement;if(!pe)return;const A=pe.getBoundingClientRect();ne.width=A.width,ne.height=A.height,se=le(ne.width,ne.height);const ge=Date.now(),Le=ge+re.duration,qe=()=>{const vt=Date.now(),R=vt-ge;if(vt<Le){let Y=1;R>re.fadeStart&&(Y=1-(R-re.fadeStart)/(re.duration-re.fadeStart)),p(X,ne.width,ne.height,Y),ve(ne.width,ne.height,Y),C=requestAnimationFrame(qe)}else de()};qe()})}function de(){C&&(cancelAnimationFrame(C),C=null),se=[],$.value=!1}return e.watch(()=>re.trigger,ne=>{ne&&(Ee&&clearTimeout(Ee),Ee=setTimeout(xe,re.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Ee&&clearTimeout(Ee)}),(ne,X)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Pm={class:"dss-filter-global-inner"},Om=["placeholder","value"],Zm=["title"],Wm={key:0,class:"dss-filter-funnel-badge"},qm={class:"dss-filter-panel"},Um={key:0,class:"dss-filter-empty"},Xm={class:"dss-filter-row-prefix"},Ym={class:"dss-filter-cell"},jm=["onClick"],Km={class:"dss-filter-trigger-text"},Gm=["placeholder"],Qm={class:"dss-filter-popup-list"},Jm=["onClick"],e2={key:0,class:"dss-filter-popup-empty"},t2={key:0,class:"dss-filter-cell"},l2=["onClick"],n2={class:"dss-filter-trigger-text"},o2={class:"dss-filter-popup-list"},a2=["onClick"],s2={key:1,class:"dss-filter-cell dss-filter-cell--value"},r2=["placeholder","onUpdate:modelValue"],i2={key:1,class:"dss-filter-date-wrap"},c2=["placeholder","onUpdate:modelValue"],u2=["placeholder","value","onInput","step"],d2={key:4,class:"dss-filter-between"},m2=["placeholder","value","onInput","step"],p2={class:"dss-filter-between-sep"},f2=["placeholder","value","onInput","step"],v2={key:5,class:"dss-filter-multiselect"},g2=["onClick"],h2={class:"dss-filter-trigger-text"},y2=["placeholder"],C2={class:"dss-filter-popup-list dss-filter-popup-list--check"},k2=["onClick"],b2=["checked"],w2={key:0,class:"dss-filter-popup-empty"},x2=["onClick"],E2={class:"dss-filter-foot"},V2={class:"dss-filter-cell"},S2=["placeholder"],N2={class:"dss-filter-popup-list"},B2=["onClick"],M2={key:0,class:"dss-filter-popup-divider"},_2=["onClick"],$2=["placeholder"],L2={class:"dss-filter-popup-list"},T2=["onClick"],A2={key:0,class:"dss-filter-popup-empty"},D2=["placeholder"],H2={class:"dss-filter-popup-list"},R2=["onClick"],F2={key:0,class:"dss-filter-popup-empty"},I2={name:"DSSFilter"},z2=Object.assign(I2,{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(L,{expose:re,emit:M}){const{t:$}=Kn.useI18n(),se=L,C=M,Ee={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},le=e.computed(()=>({...Ee,...se.options})),Ge={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},p=new Set(["is_empty","is_not_empty","is_true","is_false"]),ve=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),de=e.ref([]),ne=e.ref(null),X=e.ref(!1),pe=e.ref(null),A=e.ref(""),ge=e.ref(null);let Le=1;function qe(N){const b=N.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of ve)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function vt(N,b){const V=b.filter(ee=>ee!=null&&ee!=="NULL");if(V.length===0)return null;if(V.every(ee=>Array.isArray(ee))){const ee=V.flatMap(Se=>Se).filter(Se=>Se!=null);return ee.length===0?null:typeof ee.find(Se=>Se!=null)=="object"?"arraySelect":"arrayText"}return V.every(ee=>typeof ee=="boolean")?"boolean":V.every(ee=>typeof ee=="number")?new Set(V).size<=le.value.maxUniqueForEnum?"select":"range":V.every(ee=>typeof ee=="string")?new Set(V).size<=le.value.maxUniqueForSelect?"select":"text":V.some(ee=>typeof ee=="object"&&!Array.isArray(ee))?null:"text"}const R=e.computed(()=>{if(!se.data?.length)return[];const N=new Set;for(const J of se.data)if(J&&typeof J=="object")for(const Se of Object.keys(J))N.add(Se);const b=new Set(se.exclude),V=[];for(const J of N){if(b.has(J))continue;const Se=se.config[J]||{},ot=se.data.map(gt=>gt?.[J]),Be=Se.type||vt(J,ot);if(!Be)continue;const We=Se.filterMode||"contain",Xe=We==="date"?"date":We==="string"?"text":Be,at={key:J,label:Se.label||oe(J),type:Xe,filterMode:We};if(Be==="select"){const gt=ot.filter(Et=>Et!=null&&Et!=="NULL");at.uniqueValues=[...new Set(gt)].sort((Et,Vt)=>typeof Et=="number"&&typeof Vt=="number"?Et-Vt:String(Et).localeCompare(String(Vt)))}else if(Be==="range"||Be==="int"){const gt=ot.filter(Et=>typeof Et=="number");at.min=Math.min(...gt),at.max=Math.max(...gt)}else if(Be==="arraySelect"){const gt=Se.displayKey||qe(ot.flatMap(Vt=>Array.isArray(Vt)?Vt:[]));at.displayKey=gt;const Et=ot.flatMap(Vt=>Array.isArray(Vt)?Vt:[]).filter(Vt=>Vt!=null).map(Vt=>gt&&typeof Vt=="object"?Vt[gt]:String(Vt)).filter(Vt=>Vt!=null&&Vt!=="");at.uniqueValues=[...new Set(Et)].sort((Vt,kl)=>String(Vt).localeCompare(String(kl)))}V.push(at)}const ee=se.config._order;return ee&&V.sort((J,Se)=>{const ot=ee.indexOf(J.key),Be=ee.indexOf(Se.key);return ot===-1&&Be===-1?0:ot===-1?1:Be===-1?-1:ot-Be}),V}),Y=e.computed(()=>{const N={};for(const b of R.value)N[b.key]=b;return N}),_e=e.computed(()=>Array.isArray(se.config.groups)&&se.config.groups.length>0),fe=e.computed(()=>{if(!_e.value)return[];const N=new Set(R.value.map(b=>b.key));return se.config.groups.map(b=>({...b,keys:b.keys.filter(V=>N.has(V))})).filter(b=>b.keys.length>0)}),st=e.computed(()=>{if(!_e.value)return[];const N=new Set(se.config.groups.flatMap(b=>b.keys));return R.value.filter(b=>!N.has(b.key))}),Ce=e.computed(()=>{if(!ge.value)return[];const N=new Set(ge.value.keys),b=R.value.filter(ee=>N.has(ee.key));if(!A.value)return b;const V=A.value.toLowerCase();return b.filter(ee=>ee.label.toLowerCase().includes(V))}),Ue=e.computed(()=>{if(!A.value)return R.value;const N=A.value.toLowerCase();return R.value.filter(b=>b.label.toLowerCase().includes(N))});function Lt(N){ne.value===N?Pe():(ne.value=N,A.value="",ge.value=null)}function Pe(){ne.value=null,A.value="",ge.value=null}function At(N){const b=N.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!b&&!N.target.closest(".dss-filter-popup")&&!N.target.closest(".dss-filter-trigger")&&!N.target.closest(".dss-filter-add-btn")&&Pe(),X.value&&pe.value&&!pe.value.contains(N.target)&&(b||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",At)),e.onBeforeUnmount(()=>document.removeEventListener("click",At));function pt(N){return Y.value[N]?.label||oe(N)}function Ct(N){return Y.value[N.key]?.filterMode||"contain"}function ml(N){return $(`filter.operators.${N}`)}function Dt(N){const b=Y.value[N.key];return(Ge[b?.type]||Ge.text).map(V=>({...V,label:$(`filter.operators.${V.value}`)}))}function $t(N){return p.has(N)}function tt(N){const b=Y.value[N.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?N.operator==="between"?"between":"number":"text":"text"}function It(N){return Ge[N]?.[0]?.value||"contains"}function Ft(N,b){return p.has(b)||N==="date"?null:N==="select"||N==="arraySelect"?[]:(N==="range"||N==="int")&&b==="between"?{min:null,max:null}:N==="range"||N==="int"?null:""}function Ut(N){return Y.value[N.key]?.uniqueValues||[]}function ft(N){const b=Ut(N);if(!A.value)return b;const V=A.value.toLowerCase();return b.filter(ee=>String(ee).toLowerCase().includes(V))}function Tt(N){const b=N.value;return!b||b.length===0?$("filter.select"):b.length<=2?b.join(", "):$("filter.selectedCount",{count:b.length})}function lt(N){const b=Y.value[N],V=b?.filterMode||"contain",ee=b?.type||"text",J=V==="string"?"contains":It(ee);de.value.push(e.reactive({id:Le++,key:N,operator:J,value:Ft(ee,J)})),Pe()}function Nt(N){de.value=de.value.filter(b=>b.id!==N)}function rl(N,b){const ee=Y.value[b]?.type||"text";N.key=b,N.operator=It(ee),N.value=Ft(ee,N.operator),Pe()}function G(N,b){const V=tt(N);N.operator=b;const ee=tt(N);if(V!==ee||p.has(b)){const J=Y.value[N.key];N.value=Ft(J?.type||"text",b)}Pe()}function Ve(N,b){const V=b.target.value;N.value=V===""?null:Number(V)}function Ne(N,b,V){const ee=V.target.value,J=ee===""?null:Number(ee);(!N.value||typeof N.value!="object")&&(N.value={min:null,max:null}),N.value={...N.value,[b]:isNaN(J)?null:J}}function Ie(N,b){const V=N.value||[],ee=V.indexOf(b);N.value=ee>=0?V.filter(J=>J!==b):[...V,b]}function ut(){de.value=[],xe.value="",Pe()}function Ze(N){xe.value=N.target.value}const et=e.computed(()=>{if(!se.data)return[];let N=se.data;if(xe.value){const b=xe.value.toLowerCase();N=N.filter(V=>{for(const ee of Object.keys(V)){const J=V[ee];if(typeof J=="string"&&J.toLowerCase().includes(b)||typeof J=="number"&&String(J).includes(b)||Array.isArray(J)&&J.some(Se=>Se!=null&&(typeof Se=="string"?Se.toLowerCase().includes(b):typeof Se=="object"?Object.values(Se).some(ot=>typeof ot=="string"&&ot.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of de.value){if(!he(b))continue;const V=Y.value[b.key];V&&(N=N.filter(ee=>Ke(ee,b,V)))}return N});function he(N){return p.has(N.operator)?!0:N.value==null||typeof N.value=="string"&&N.value===""||Array.isArray(N.value)&&N.value.length===0?!1:N.value instanceof Date?!isNaN(N.value.getTime()):!(typeof N.value=="object"&&!Array.isArray(N.value)&&N.value.min==null&&N.value.max==null)}function Ke(N,b,V){const ee=N?.[b.key],J=b.value,Se=b.operator;if(Se==="is_empty")return j(ee);if(Se==="is_not_empty")return!j(ee);const ot=V.type;if(ot==="text"||ot==="arrayText"){const Be=ot==="arrayText"&&Array.isArray(ee)?ee.filter(at=>at!=null).map(String).join(" "):ee!=null?String(ee):"",We=String(J).toLowerCase(),Xe=Be.toLowerCase();switch(Se){case"contains":return Xe.includes(We);case"not_contains":return!Xe.includes(We);case"equals":return Xe===We;case"not_equals":return Xe!==We;case"starts_with":return Xe.startsWith(We);case"ends_with":return Xe.endsWith(We);default:return!0}}if(ot==="select")switch(Se){case"is_any_of":return J.includes(ee);case"is_none_of":return!J.includes(ee);default:return!0}if(ot==="range"||ot==="int"){const Be=typeof ee=="number"?ee:Number(ee);if(typeof Be!="number"||isNaN(Be))return!1;if(Se==="between"){const Xe=J?.min!=null?Number(J.min):null,at=J?.max!=null?Number(J.max):null,gt=Xe!=null&&!isNaN(Xe)?Xe:null,Et=at!=null&&!isNaN(at)?at:null;return(gt==null||Be>=gt)&&(Et==null||Be<=Et)}const We=typeof J=="number"&&!isNaN(J)?J:Number(J);if(Se==="contains"||Se==="not_contains"){const Xe=String(Be),at=String(J??"").toLowerCase(),gt=Xe.toLowerCase().includes(at);return Se==="contains"?gt:!gt}if(typeof We!="number"||isNaN(We))return!1;switch(Se){case"eq":return Be===We;case"neq":return Be!==We;case"gt":return Be>We;case"gte":return Be>=We;case"lt":return Be<We;case"lte":return Be<=We;default:return!0}}if(ot==="arraySelect"){if(!Array.isArray(ee))return!1;const Be=ee.filter(We=>We!=null).map(We=>V.displayKey&&typeof We=="object"?We[V.displayKey]:String(We));switch(Se){case"contains_any":return Be.some(We=>J.includes(We));case"contains_all":return J.every(We=>Be.includes(We));case"not_contains_any":return!Be.some(We=>J.includes(We));default:return!0}}if(ot==="date"){const Be=W(J);if(!Be||isNaN(Be.getTime()))return!1;const We=W(ee);if(!We||isNaN(We.getTime()))return!1;const Xe=Z(We),at=Z(Be);switch(Se){case"eq":return Xe===at;case"before":return Xe<at;case"after":return Xe>at;default:return!0}}if(ot==="boolean"){const Be=ee===!0||ee==="true"||ee===1,We=ee===!1||ee==="false"||ee===0;switch(Se){case"is_true":return Be;case"is_false":return We;default:return!0}}return!0}function W(N){if(N==null)return null;if(N instanceof Date)return isNaN(N.getTime())?null:N;if(typeof N=="number")return new Date(N>1e10?N:N*1e3);if(typeof N=="string"){const b=new Date(N);return isNaN(b.getTime())?null:b}return null}function Z(N){const b=N.getFullYear(),V=String(N.getMonth()+1).padStart(2,"0"),ee=String(N.getDate()).padStart(2,"0");return`${b}-${V}-${ee}`}function j(N){return!!(N==null||N===""||N==="NULL"||Array.isArray(N)&&N.length===0||Array.isArray(N)&&N.every(b=>b==null))}e.watch(et,N=>C("update:modelValue",N),{immediate:!0}),e.watch(()=>se.data,()=>{de.value=[],xe.value="",X.value=!1,Pe()});function oe(N){return N.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function He(){const N=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(N);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const ee of Object.keys(b))V[ee]=N(b[ee]);return V}return b};return{globalSearch:xe.value,rows:de.value.map(b=>({key:b.key,operator:b.operator,value:N(b.value),defType:Y.value[b.key]?.type,defFilterMode:Y.value[b.key]?.filterMode})),filteredCount:et.value?.length??0}}return re({getDebugState:He}),(N,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":le.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:pe},[e.createElementVNode("div",Pm,[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:e.unref($)("filter.searchAcrossFields"),value:xe.value,onInput:Ze},null,40,Om),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>xe.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||de.value.length>0}]),onClick:b[1]||(b[1]=V=>X.value=!X.value),type:"button",title:X.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),de.value.length>0?(e.openBlock(),e.createElementBlock("span",Wm,e.toDisplayString(de.value.length),1)):e.createCommentVNode("",!0)],10,Zm)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",qm,[de.value.length===0?(e.openBlock(),e.createElementBlock("div",Um,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,(V,ee)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Xm,e.toDisplayString(ee===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",Ym,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Km,e.toDisplayString(pt(V.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,jm),ne.value===`${V.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]=J=>A.value=J),placeholder:e.unref($)("filter.searchAttributes")},null,8,Gm),[[e.vModelText,A.value]]),e.createElementVNode("ul",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,J=>(e.openBlock(),e.createElementBlock("li",{key:J.key,class:"dss-filter-popup-item",onClick:Se=>rl(V,J.key)},e.toDisplayString(J.label),9,Jm))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",e2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Ct(V)==="contain"||Ct(V)==="date"?(e.openBlock(),e.createElementBlock("div",t2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",n2,e.toDisplayString(ml(V.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,l2),ne.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",o2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(V),J=>(e.openBlock(),e.createElementBlock("li",{key:J.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===J.value}]),onClick:Se=>G(V,J.value)},e.toDisplayString(J.label),11,a2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),$t(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",s2,[Ct(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":J=>V.value=J},null,8,r2)),[[e.vModelText,V.value]]):Ct(V)==="date"?(e.openBlock(),e.createElementBlock("div",i2,[e.createVNode(Zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":J=>V.value=J},null,8,["modelValue","onUpdate:modelValue"])])):tt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":J=>V.value=J},null,8,c2)),[[e.vModelText,V.value]]):tt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:V.value,onInput:J=>Ve(V,J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,u2)):tt(V)==="between"?(e.openBlock(),e.createElementBlock("div",d2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:V.value?.min,onInput:J=>Ne(V,"min",J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,m2),e.createElementVNode("span",p2,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:V.value?.max,onInput:J=>Ne(V,"max",J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,f2)])):tt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",h2,e.toDisplayString(Tt(V)),1),b[18]||(b[18]=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,g2),ne.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[Ut(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=J=>A.value=J),placeholder:e.unref($)("filter.search")},null,8,y2)),[[e.vModelText,A.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft(V),J=>(e.openBlock(),e.createElementBlock("li",{key:J,class:"dss-filter-popup-item",onClick:Se=>Ie(V,J)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(J),tabindex:"-1"},null,8,b2),e.createElementVNode("span",null,e.toDisplayString(J),1)],8,k2))),128)),ft(V).length===0?(e.openBlock(),e.createElementBlock("li",w2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:J=>Nt(V.id)},[...b[19]||(b[19]=[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,x2)]))),128)),e.createElementVNode("div",E2,[e.createElementVNode("div",V2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>Lt("add"),["stop"]))},e.toDisplayString(e.unref($)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!ge.value&&!A.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]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,S2),[[e.vModelText,A.value]]),e.createElementVNode("ul",N2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ee=>ge.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[20]||(b[20]=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,B2))),128)),st.value.length>0?(e.openBlock(),e.createElementBlock("li",M2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,_2))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>ge.value=null)},[b[21]||(b[21]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,$2),[[e.vModelText,A.value]]),e.createElementVNode("ul",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,T2))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",A2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,D2),[[e.vModelText,A.value]]),e.createElementVNode("ul",H2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,R2))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",F2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),de.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:ut},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),P2={class:"dss-pill-field__pills"},O2=["disabled"],Z2={class:"dss-pill-field__pill-text"},W2={key:0,class:"dss-pill-field__pill-actions"},q2=["onClick"],U2=["onClick"],X2=["placeholder","disabled"],Y2=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:re}){const M=L,$=re,se=e.ref(""),C=e.ref([...M.modelValue]),Ee=e.ref(null);let le=null;const Ge=e.ref(null),p=e.ref(""),ve=e.ref(null),xe=e.computed(()=>new Set(C.value.map(R=>R.trim()).filter(Boolean)));function de(R){Ee.value=R,le&&clearTimeout(le),le=setTimeout(()=>{Ee.value=null,le=null},900)}function ne(R){const Y=R.trim();return Y?xe.value.has(Y)?(de(Y),!1):(C.value=[...C.value,Y],$("update:modelValue",[...C.value]),!0):!1}function X(R){const Y=R.split(/\r?\n/g).map(Ce=>Ce.trim()).filter(Boolean);if(!Y.length)return;const _e=new Set(C.value.map(Ce=>Ce.trim()).filter(Boolean)),fe=[...C.value];let st=null;for(const Ce of Y){if(_e.has(Ce)){st??=Ce;continue}_e.add(Ce),fe.push(Ce)}fe.length!==C.value.length&&(C.value=fe,$("update:modelValue",[...C.value])),st&&de(st)}function pe(R){M.disabled||(Ge.value===R&&(Ge.value=null,p.value=""),C.value=C.value.filter((Y,_e)=>_e!==R),$("update:modelValue",[...C.value]))}async function A(R){M.disabled||(Ge.value=R,p.value=C.value[R]??"",await e.nextTick(),ve.value?.focus(),ve.value?.select())}function ge(){Ge.value=null,p.value=""}function Le(){if(M.disabled||Ge.value===null)return;const R=Ge.value,Y=C.value[R]??"",_e=p.value.trim();if(Ge.value=null,p.value="",_e!==Y&&xe.value.has(_e)){de(_e);return}if(!_e){C.value=C.value.filter((st,Ce)=>Ce!==R),$("update:modelValue",[...C.value]);return}const fe=C.value.map((st,Ce)=>Ce===R?_e:st);C.value=fe,$("update:modelValue",[...C.value])}function qe(R){R.preventDefault(),!M.disabled&&(ne(se.value),se.value="")}function vt(R){if(M.disabled)return;const Y=R.clipboardData?.getData("text")??"";!Y.includes(`
117
+ `,document.body.appendChild(ut),ge=ut}function Lt(G,Ve){ge&&(ge.style.left=`${G-qe}px`,ge.style.top=`${Ve-vt}px`)}function Pe(G){G.classList.add("dss-dnd-item--dragging"),G.style.background=le.value.dragSourceBackground,G.style.borderColor=le.value.dragSourceBorder,G.style.transform="scale(0.97)"}function At(G){G.classList.remove("dss-dnd-item--dragging"),G.style.background="",G.style.borderColor="",G.style.transform=""}function pt(G,Ve){return document.elementFromPoint(G,Ve)?.closest(".dss-dnd-column-body")??null}function Ct(G,Ve){return!!document.elementFromPoint(G,Ve)?.closest("[data-dss-dnd-delete-zone]")}function pl(G,Ve){if(C.value&&Ct(G,Ve)){de.value=!0,xe.value=null,ne.value=-1;return}de.value=!1;const Ne=pt(G,Ve),Ie=Ne?.getAttribute("data-column")??null;if(!Ie){xe.value=null,ne.value=-1;return}xe.value=Ie;const ut=Ne.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ze=ut.length;for(let et=0;et<ut.length;et++){const he=ut[et].getBoundingClientRect();if(Ve<he.top+he.height/2){Ze=et;break}}ne.value=Ze}function Dt(G){G.preventDefault(),Lt(G.clientX,G.clientY),!pe&&(pe=requestAnimationFrame(()=>{pe=null,pl(G.clientX,G.clientY)}))}function $t(G){window.removeEventListener("pointermove",Dt),window.removeEventListener("pointerup",$t),window.removeEventListener("pointercancel",$t),Le?.releasePointerCapture?.(G.pointerId),At(Le),Le=null;const Ve=C.value&&Ct(G.clientX,G.clientY);if(ve.value&&Ve)$("delete",{item:ve.value});else{const Ie=pt(G.clientX,G.clientY)?.getAttribute("data-column")??null;if(ve.value&&Ie){const ut=ve.value[M.columnKey],Ze=Ie,he=(fe.value[Ze]||[]).filter(j=>j[M.itemKey]!==ve.value[M.itemKey]),Ke=Math.max(0,Math.min(ne.value,he.length)),W=Ce(Ze,Ke),Z=ve.value[M.itemKey];$("move",{item:ve.value,from:ut,to:Ze,position:W,index:Ke}),A&&clearTimeout(A),X.value={id:Z,from:ut,to:Ze},A=setTimeout(()=>{X.value=null},3500)}}ge&&(ge.remove(),ge=null),R!==null&&(document.body.style.cursor=R,R=""),rl()}function tt(G,Ve){G.preventDefault();const Ne=G.target.closest(".dss-dnd-item");if(!Ne)return;const Ie=Ne.getBoundingClientRect();qe=G.clientX-Ie.left,vt=G.clientY-Ie.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",ve.value=Ve,Le=Ne,Ue(Ne,G.clientX,G.clientY),requestAnimationFrame(()=>Pe(Ne)),Ne.setPointerCapture?.(G.pointerId),window.addEventListener("pointermove",Dt),window.addEventListener("pointerup",$t,{once:!0}),window.addEventListener("pointercancel",$t,{once:!0})}function It(){Y&&(window.removeEventListener("pointermove",Ft),window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),Y=null)}function Ft(G){if(!Y||G.pointerId!==Y.pointerId)return;const Ve=G.clientX-Y.startX,Ne=G.clientY-Y.startY;if(Math.abs(Ve)>=_e||Math.abs(Ne)>=_e){const Ie=Y.item;It(),tt(G,Ie)}}function Ut(G){!Y||G.pointerId!==Y.pointerId||It()}function ft(G,Ve){It(),Y={item:Ve,startX:G.clientX,startY:G.clientY,pointerId:G.pointerId},window.addEventListener("pointermove",Ft),window.addEventListener("pointerup",Ut),window.addEventListener("pointercancel",Ut)}function Tt(G,Ve){le.value.useHandle||ft(G,Ve)}function lt(G,Ve){ft(G,Ve)}function Nt(){pe&&(cancelAnimationFrame(pe),pe=null)}function rl(){Nt(),ve.value=null,xe.value=null,de.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{Nt(),It(),A&&clearTimeout(A),ge&&(ge.remove(),ge=null)}),(G,Ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":le.value.unstyled}]),style:e.normalizeStyle(Ge.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":de.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(G.$slots,"delete-zone",{isDragging:!!ve.value,isOver:de.value})],2),[[e.vShow,!!ve.value||le.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.columns,Ne=>(e.openBlock(),e.createElementBlock("div",{key:Ne.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":xe.value==Ne.value},Ne.class||""]]),style:e.normalizeStyle(p(Ne))},[le.value.showHeader?(e.openBlock(),e.createElementBlock("div",Nm,[e.renderSlot(G.$slots,"column-header",{column:Ne,items:fe.value[Ne.value]||[]},()=>[e.createElementVNode("span",Bm,e.toDisplayString(Ne.title||Ne.value),1),e.createElementVNode("span",Mm,e.toDisplayString((fe.value[Ne.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Ne.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value[Ne.value],Ie=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie.key},[Ie.type==="indicator"?(e.openBlock(),e.createElementBlock("div",$m)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ie.isDragged,"dss-dnd-item--no-handle":!le.value.useHandle}]),onPointerdown:ut=>Tt(ut,Ie.item)},[le.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(ut=>lt(ut,Ie.item),["stop"])},[e.renderSlot(G.$slots,"handle",{},()=>[Ve[0]||(Ve[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Tm)):e.createCommentVNode("",!0),e.createElementVNode("div",Am,[e.renderSlot(G.$slots,"item",{item:Ie.item,column:Ne,justDropped:X.value?.id===Ie.item[L.itemKey],droppedFrom:X.value?.id===Ie.item[L.itemKey]?X.value.from:null,droppedTo:X.value?.id===Ie.item[L.itemKey]?X.value.to:null},()=>[e.createElementVNode("div",Dm,e.toDisplayString(Ie.item[L.itemKey]),1)])])],42,Lm))],64))),128)),(fe.value[Ne.value]||[]).length===0&&xe.value!=Ne.value?(e.openBlock(),e.createElementBlock("div",Hm,[e.renderSlot(G.$slots,"empty",{column:Ne},()=>[Ve[1]||(Ve[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,_m)],6))),128))],6))}}),Im={name:"DSSConfetti"},zm=Object.assign(Im,{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(L){const re=L,M=e.ref(null),$=e.ref(!1);let se=[],C=null,Ee=null;function le(ne,X){const pe=[];for(let A=0;A<re.count;A++)pe.push(Ge(ne));return pe}function Ge(ne,X){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:re.colors[Math.floor(Math.random()*re.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 p(ne,X,pe,A){ne.clearRect(0,0,X,pe);for(const ge of se)ne.save(),ne.globalAlpha=ge.opacity*A,ne.beginPath(),ne.lineWidth=ge.r,ne.strokeStyle=ge.color,ne.moveTo(ge.x+ge.tilt+ge.r/2,ge.y),ne.lineTo(ge.x+ge.tilt,ge.y+ge.tilt+ge.r/2),ne.stroke(),ne.restore()}function ve(ne,X,pe){const A=.3+pe*.7;for(let ge=0;ge<se.length;ge++){const Le=se[ge];Le.tiltAngle+=Le.tiltInc,Le.y+=Le.speed*A,Le.x+=Math.sin(Le.d)*.5*A,Le.tilt=Math.sin(Le.tiltAngle)*15,pe>=.99&&Le.y>X+20&&(se[ge]=Ge(ne))}}function xe(){$.value=!0,e.nextTick(()=>{const ne=M.value;if(!ne)return;const X=ne.getContext("2d"),pe=ne.parentElement;if(!pe)return;const A=pe.getBoundingClientRect();ne.width=A.width,ne.height=A.height,se=le(ne.width,ne.height);const ge=Date.now(),Le=ge+re.duration,qe=()=>{const vt=Date.now(),R=vt-ge;if(vt<Le){let Y=1;R>re.fadeStart&&(Y=1-(R-re.fadeStart)/(re.duration-re.fadeStart)),p(X,ne.width,ne.height,Y),ve(ne.width,ne.height,Y),C=requestAnimationFrame(qe)}else de()};qe()})}function de(){C&&(cancelAnimationFrame(C),C=null),se=[],$.value=!1}return e.watch(()=>re.trigger,ne=>{ne&&(Ee&&clearTimeout(Ee),Ee=setTimeout(xe,re.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Ee&&clearTimeout(Ee)}),(ne,X)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:M,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Pm={class:"dss-filter-global-inner"},Om=["placeholder","value"],Zm=["title"],Wm={key:0,class:"dss-filter-funnel-badge"},qm={class:"dss-filter-panel"},Um={key:0,class:"dss-filter-empty"},Xm={class:"dss-filter-row-prefix"},Ym={class:"dss-filter-cell"},jm=["onClick"],Km={class:"dss-filter-trigger-text"},Gm=["placeholder"],Qm={class:"dss-filter-popup-list"},Jm=["onClick"],e2={key:0,class:"dss-filter-popup-empty"},t2={key:0,class:"dss-filter-cell"},l2=["onClick"],n2={class:"dss-filter-trigger-text"},o2={class:"dss-filter-popup-list"},a2=["onClick"],s2={key:1,class:"dss-filter-cell dss-filter-cell--value"},r2=["placeholder","onUpdate:modelValue"],i2={key:1,class:"dss-filter-date-wrap"},c2=["placeholder","onUpdate:modelValue"],u2=["placeholder","value","onInput","step"],d2={key:4,class:"dss-filter-between"},m2=["placeholder","value","onInput","step"],p2={class:"dss-filter-between-sep"},f2=["placeholder","value","onInput","step"],v2={key:5,class:"dss-filter-multiselect"},g2=["onClick"],h2={class:"dss-filter-trigger-text"},y2=["placeholder"],C2={class:"dss-filter-popup-list dss-filter-popup-list--check"},k2=["onClick"],b2=["checked"],w2={key:0,class:"dss-filter-popup-empty"},x2=["onClick"],E2={class:"dss-filter-foot"},V2={class:"dss-filter-cell"},S2=["placeholder"],N2={class:"dss-filter-popup-list"},B2=["onClick"],M2={key:0,class:"dss-filter-popup-divider"},_2=["onClick"],$2=["placeholder"],L2={class:"dss-filter-popup-list"},T2=["onClick"],A2={key:0,class:"dss-filter-popup-empty"},D2=["placeholder"],H2={class:"dss-filter-popup-list"},R2=["onClick"],F2={key:0,class:"dss-filter-popup-empty"},I2={name:"DSSFilter"},z2=Object.assign(I2,{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(L,{expose:re,emit:M}){const{t:$}=Kn.useI18n(),se=L,C=M,Ee={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},le=e.computed(()=>({...Ee,...se.options})),Ge={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},p=new Set(["is_empty","is_not_empty","is_true","is_false"]),ve=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),de=e.ref([]),ne=e.ref(null),X=e.ref(!1),pe=e.ref(null),A=e.ref(""),ge=e.ref(null);let Le=1;function qe(N){const b=N.find(V=>V&&typeof V=="object");if(!b)return null;for(const V of ve)if(V in b&&typeof b[V]=="string")return V;return Object.keys(b).find(V=>typeof b[V]=="string")||null}function vt(N,b){const V=b.filter(ee=>ee!=null&&ee!=="NULL");if(V.length===0)return null;if(V.every(ee=>Array.isArray(ee))){const ee=V.flatMap(Se=>Se).filter(Se=>Se!=null);return ee.length===0?null:typeof ee.find(Se=>Se!=null)=="object"?"arraySelect":"arrayText"}return V.every(ee=>typeof ee=="boolean")?"boolean":V.every(ee=>typeof ee=="number")?new Set(V).size<=le.value.maxUniqueForEnum?"select":"range":V.every(ee=>typeof ee=="string")?new Set(V).size<=le.value.maxUniqueForSelect?"select":"text":V.some(ee=>typeof ee=="object"&&!Array.isArray(ee))?null:"text"}const R=e.computed(()=>{if(!se.data?.length)return[];const N=new Set;for(const J of se.data)if(J&&typeof J=="object")for(const Se of Object.keys(J))N.add(Se);const b=new Set(se.exclude),V=[];for(const J of N){if(b.has(J))continue;const Se=se.config[J]||{},ot=se.data.map(gt=>gt?.[J]),Be=Se.type||vt(J,ot);if(!Be)continue;const We=Se.filterMode||"contain",Xe=We==="date"?"date":We==="string"?"text":Be,at={key:J,label:Se.label||oe(J),type:Xe,filterMode:We};if(Be==="select"){const gt=ot.filter(Et=>Et!=null&&Et!=="NULL");at.uniqueValues=[...new Set(gt)].sort((Et,Vt)=>typeof Et=="number"&&typeof Vt=="number"?Et-Vt:String(Et).localeCompare(String(Vt)))}else if(Be==="range"||Be==="int"){const gt=ot.filter(Et=>typeof Et=="number");at.min=Math.min(...gt),at.max=Math.max(...gt)}else if(Be==="arraySelect"){const gt=Se.displayKey||qe(ot.flatMap(Vt=>Array.isArray(Vt)?Vt:[]));at.displayKey=gt;const Et=ot.flatMap(Vt=>Array.isArray(Vt)?Vt:[]).filter(Vt=>Vt!=null).map(Vt=>gt&&typeof Vt=="object"?Vt[gt]:String(Vt)).filter(Vt=>Vt!=null&&Vt!=="");at.uniqueValues=[...new Set(Et)].sort((Vt,kl)=>String(Vt).localeCompare(String(kl)))}V.push(at)}const ee=se.config._order;return ee&&V.sort((J,Se)=>{const ot=ee.indexOf(J.key),Be=ee.indexOf(Se.key);return ot===-1&&Be===-1?0:ot===-1?1:Be===-1?-1:ot-Be}),V}),Y=e.computed(()=>{const N={};for(const b of R.value)N[b.key]=b;return N}),_e=e.computed(()=>Array.isArray(se.config.groups)&&se.config.groups.length>0),fe=e.computed(()=>{if(!_e.value)return[];const N=new Set(R.value.map(b=>b.key));return se.config.groups.map(b=>({...b,keys:b.keys.filter(V=>N.has(V))})).filter(b=>b.keys.length>0)}),st=e.computed(()=>{if(!_e.value)return[];const N=new Set(se.config.groups.flatMap(b=>b.keys));return R.value.filter(b=>!N.has(b.key))}),Ce=e.computed(()=>{if(!ge.value)return[];const N=new Set(ge.value.keys),b=R.value.filter(ee=>N.has(ee.key));if(!A.value)return b;const V=A.value.toLowerCase();return b.filter(ee=>ee.label.toLowerCase().includes(V))}),Ue=e.computed(()=>{if(!A.value)return R.value;const N=A.value.toLowerCase();return R.value.filter(b=>b.label.toLowerCase().includes(N))});function Lt(N){ne.value===N?Pe():(ne.value=N,A.value="",ge.value=null)}function Pe(){ne.value=null,A.value="",ge.value=null}function At(N){const b=N.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!b&&!N.target.closest(".dss-filter-popup")&&!N.target.closest(".dss-filter-trigger")&&!N.target.closest(".dss-filter-add-btn")&&Pe(),X.value&&pe.value&&!pe.value.contains(N.target)&&(b||(X.value=!1))}e.onMounted(()=>document.addEventListener("click",At)),e.onBeforeUnmount(()=>document.removeEventListener("click",At));function pt(N){return Y.value[N]?.label||oe(N)}function Ct(N){return Y.value[N.key]?.filterMode||"contain"}function pl(N){return $(`filter.operators.${N}`)}function Dt(N){const b=Y.value[N.key];return(Ge[b?.type]||Ge.text).map(V=>({...V,label:$(`filter.operators.${V.value}`)}))}function $t(N){return p.has(N)}function tt(N){const b=Y.value[N.key];return b?b.type==="date"?"date":b.type==="boolean"?"boolean":b.type==="text"||b.type==="arrayText"?"text":b.type==="select"||b.type==="arraySelect"?"multiselect":b.type==="range"||b.type==="int"?N.operator==="between"?"between":"number":"text":"text"}function It(N){return Ge[N]?.[0]?.value||"contains"}function Ft(N,b){return p.has(b)||N==="date"?null:N==="select"||N==="arraySelect"?[]:(N==="range"||N==="int")&&b==="between"?{min:null,max:null}:N==="range"||N==="int"?null:""}function Ut(N){return Y.value[N.key]?.uniqueValues||[]}function ft(N){const b=Ut(N);if(!A.value)return b;const V=A.value.toLowerCase();return b.filter(ee=>String(ee).toLowerCase().includes(V))}function Tt(N){const b=N.value;return!b||b.length===0?$("filter.select"):b.length<=2?b.join(", "):$("filter.selectedCount",{count:b.length})}function lt(N){const b=Y.value[N],V=b?.filterMode||"contain",ee=b?.type||"text",J=V==="string"?"contains":It(ee);de.value.push(e.reactive({id:Le++,key:N,operator:J,value:Ft(ee,J)})),Pe()}function Nt(N){de.value=de.value.filter(b=>b.id!==N)}function rl(N,b){const ee=Y.value[b]?.type||"text";N.key=b,N.operator=It(ee),N.value=Ft(ee,N.operator),Pe()}function G(N,b){const V=tt(N);N.operator=b;const ee=tt(N);if(V!==ee||p.has(b)){const J=Y.value[N.key];N.value=Ft(J?.type||"text",b)}Pe()}function Ve(N,b){const V=b.target.value;N.value=V===""?null:Number(V)}function Ne(N,b,V){const ee=V.target.value,J=ee===""?null:Number(ee);(!N.value||typeof N.value!="object")&&(N.value={min:null,max:null}),N.value={...N.value,[b]:isNaN(J)?null:J}}function Ie(N,b){const V=N.value||[],ee=V.indexOf(b);N.value=ee>=0?V.filter(J=>J!==b):[...V,b]}function ut(){de.value=[],xe.value="",Pe()}function Ze(N){xe.value=N.target.value}const et=e.computed(()=>{if(!se.data)return[];let N=se.data;if(xe.value){const b=xe.value.toLowerCase();N=N.filter(V=>{for(const ee of Object.keys(V)){const J=V[ee];if(typeof J=="string"&&J.toLowerCase().includes(b)||typeof J=="number"&&String(J).includes(b)||Array.isArray(J)&&J.some(Se=>Se!=null&&(typeof Se=="string"?Se.toLowerCase().includes(b):typeof Se=="object"?Object.values(Se).some(ot=>typeof ot=="string"&&ot.toLowerCase().includes(b)):!1)))return!0}return!1})}for(const b of de.value){if(!he(b))continue;const V=Y.value[b.key];V&&(N=N.filter(ee=>Ke(ee,b,V)))}return N});function he(N){return p.has(N.operator)?!0:N.value==null||typeof N.value=="string"&&N.value===""||Array.isArray(N.value)&&N.value.length===0?!1:N.value instanceof Date?!isNaN(N.value.getTime()):!(typeof N.value=="object"&&!Array.isArray(N.value)&&N.value.min==null&&N.value.max==null)}function Ke(N,b,V){const ee=N?.[b.key],J=b.value,Se=b.operator;if(Se==="is_empty")return j(ee);if(Se==="is_not_empty")return!j(ee);const ot=V.type;if(ot==="text"||ot==="arrayText"){const Be=ot==="arrayText"&&Array.isArray(ee)?ee.filter(at=>at!=null).map(String).join(" "):ee!=null?String(ee):"",We=String(J).toLowerCase(),Xe=Be.toLowerCase();switch(Se){case"contains":return Xe.includes(We);case"not_contains":return!Xe.includes(We);case"equals":return Xe===We;case"not_equals":return Xe!==We;case"starts_with":return Xe.startsWith(We);case"ends_with":return Xe.endsWith(We);default:return!0}}if(ot==="select")switch(Se){case"is_any_of":return J.includes(ee);case"is_none_of":return!J.includes(ee);default:return!0}if(ot==="range"||ot==="int"){const Be=typeof ee=="number"?ee:Number(ee);if(typeof Be!="number"||isNaN(Be))return!1;if(Se==="between"){const Xe=J?.min!=null?Number(J.min):null,at=J?.max!=null?Number(J.max):null,gt=Xe!=null&&!isNaN(Xe)?Xe:null,Et=at!=null&&!isNaN(at)?at:null;return(gt==null||Be>=gt)&&(Et==null||Be<=Et)}const We=typeof J=="number"&&!isNaN(J)?J:Number(J);if(Se==="contains"||Se==="not_contains"){const Xe=String(Be),at=String(J??"").toLowerCase(),gt=Xe.toLowerCase().includes(at);return Se==="contains"?gt:!gt}if(typeof We!="number"||isNaN(We))return!1;switch(Se){case"eq":return Be===We;case"neq":return Be!==We;case"gt":return Be>We;case"gte":return Be>=We;case"lt":return Be<We;case"lte":return Be<=We;default:return!0}}if(ot==="arraySelect"){if(!Array.isArray(ee))return!1;const Be=ee.filter(We=>We!=null).map(We=>V.displayKey&&typeof We=="object"?We[V.displayKey]:String(We));switch(Se){case"contains_any":return Be.some(We=>J.includes(We));case"contains_all":return J.every(We=>Be.includes(We));case"not_contains_any":return!Be.some(We=>J.includes(We));default:return!0}}if(ot==="date"){const Be=W(J);if(!Be||isNaN(Be.getTime()))return!1;const We=W(ee);if(!We||isNaN(We.getTime()))return!1;const Xe=Z(We),at=Z(Be);switch(Se){case"eq":return Xe===at;case"before":return Xe<at;case"after":return Xe>at;default:return!0}}if(ot==="boolean"){const Be=ee===!0||ee==="true"||ee===1,We=ee===!1||ee==="false"||ee===0;switch(Se){case"is_true":return Be;case"is_false":return We;default:return!0}}return!0}function W(N){if(N==null)return null;if(N instanceof Date)return isNaN(N.getTime())?null:N;if(typeof N=="number")return new Date(N>1e10?N:N*1e3);if(typeof N=="string"){const b=new Date(N);return isNaN(b.getTime())?null:b}return null}function Z(N){const b=N.getFullYear(),V=String(N.getMonth()+1).padStart(2,"0"),ee=String(N.getDate()).padStart(2,"0");return`${b}-${V}-${ee}`}function j(N){return!!(N==null||N===""||N==="NULL"||Array.isArray(N)&&N.length===0||Array.isArray(N)&&N.every(b=>b==null))}e.watch(et,N=>C("update:modelValue",N),{immediate:!0}),e.watch(()=>se.data,()=>{de.value=[],xe.value="",X.value=!1,Pe()});function oe(N){return N.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,b=>b.toUpperCase())}function He(){const N=b=>{if(b==null)return b;if(b instanceof Date)return{_type:"Date",value:b.toISOString(),local:b.toLocaleDateString()};if(Array.isArray(b))return b.map(N);if(typeof b=="object"&&!Array.isArray(b)){const V={};for(const ee of Object.keys(b))V[ee]=N(b[ee]);return V}return b};return{globalSearch:xe.value,rows:de.value.map(b=>({key:b.key,operator:b.operator,value:N(b.value),defType:Y.value[b.key]?.type,defFilterMode:Y.value[b.key]?.filterMode})),filteredCount:et.value?.length??0}}return re({getDebugState:He}),(N,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":le.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:pe},[e.createElementVNode("div",Pm,[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:e.unref($)("filter.searchAcrossFields"),value:xe.value,onInput:Ze},null,40,Om),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:b[0]||(b[0]=V=>xe.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:X.value||de.value.length>0}]),onClick:b[1]||(b[1]=V=>X.value=!X.value),type:"button",title:X.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[b[14]||(b[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),de.value.length>0?(e.openBlock(),e.createElementBlock("span",Wm,e.toDisplayString(de.value.length),1)):e.createCommentVNode("",!0)],10,Zm)]),X.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:b[13]||(b[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",qm,[de.value.length===0?(e.openBlock(),e.createElementBlock("div",Um,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,(V,ee)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Xm,e.toDisplayString(ee===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",Ym,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Km,e.toDisplayString(pt(V.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,jm),ne.value===`${V.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]=J=>A.value=J),placeholder:e.unref($)("filter.searchAttributes")},null,8,Gm),[[e.vModelText,A.value]]),e.createElementVNode("ul",Qm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,J=>(e.openBlock(),e.createElementBlock("li",{key:J.key,class:"dss-filter-popup-item",onClick:Se=>rl(V,J.key)},e.toDisplayString(J.label),9,Jm))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",e2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Ct(V)==="contain"||Ct(V)==="date"?(e.openBlock(),e.createElementBlock("div",t2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:op`),["stop"])},[e.createElementVNode("span",n2,e.toDisplayString(pl(V.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,l2),ne.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[4]||(b[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",o2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dt(V),J=>(e.openBlock(),e.createElementBlock("li",{key:J.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===J.value}]),onClick:Se=>G(V,J.value)},e.toDisplayString(J.label),11,a2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),$t(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",s2,[Ct(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":J=>V.value=J},null,8,r2)),[[e.vModelText,V.value]]):Ct(V)==="date"?(e.openBlock(),e.createElementBlock("div",i2,[e.createVNode(Zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":J=>V.value=J},null,8,["modelValue","onUpdate:modelValue"])])):tt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":J=>V.value=J},null,8,c2)),[[e.vModelText,V.value]]):tt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:V.value,onInput:J=>Ve(V,J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,u2)):tt(V)==="between"?(e.openBlock(),e.createElementBlock("div",d2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:V.value?.min,onInput:J=>Ne(V,"min",J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,m2),e.createElementVNode("span",p2,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:V.value?.max,onInput:J=>Ne(V,"max",J),step:Y.value[V.key]?.type==="int"?1:void 0},null,40,f2)])):tt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",v2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Lt(`${V.id}:val`),["stop"])},[e.createElementVNode("span",h2,e.toDisplayString(Tt(V)),1),b[18]||(b[18]=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,g2),ne.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:b[6]||(b[6]=e.withModifiers(()=>{},["stop"]))},[Ut(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[5]||(b[5]=J=>A.value=J),placeholder:e.unref($)("filter.search")},null,8,y2)),[[e.vModelText,A.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft(V),J=>(e.openBlock(),e.createElementBlock("li",{key:J,class:"dss-filter-popup-item",onClick:Se=>Ie(V,J)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(J),tabindex:"-1"},null,8,b2),e.createElementVNode("span",null,e.toDisplayString(J),1)],8,k2))),128)),ft(V).length===0?(e.openBlock(),e.createElementBlock("li",w2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:J=>Nt(V.id)},[...b[19]||(b[19]=[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,x2)]))),128)),e.createElementVNode("div",E2,[e.createElementVNode("div",V2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:b[7]||(b[7]=e.withModifiers(V=>Lt("add"),["stop"]))},e.toDisplayString(e.unref($)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:b[12]||(b[12]=e.withModifiers(()=>{},["stop"]))},[_e.value&&!ge.value&&!A.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]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,S2),[[e.vModelText,A.value]]),e.createElementVNode("ul",N2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:ee=>ge.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),b[20]||(b[20]=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,B2))),128)),st.value.length>0?(e.openBlock(),e.createElementBlock("li",M2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,_2))),128))])],64)):ge.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:b[9]||(b[9]=V=>ge.value=null)},[b[21]||(b[21]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ge.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[10]||(b[10]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,$2),[[e.vModelText,A.value]]),e.createElementVNode("ul",L2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,T2))),128)),Ce.value.length===0?(e.openBlock(),e.createElementBlock("li",A2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":b[11]||(b[11]=V=>A.value=V),placeholder:e.unref($)("filter.searchAttributes")},null,8,D2),[[e.vModelText,A.value]]),e.createElementVNode("ul",H2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:ee=>lt(V.key)},e.toDisplayString(V.label),9,R2))),128)),Ue.value.length===0?(e.openBlock(),e.createElementBlock("li",F2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),de.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:ut},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),P2={class:"dss-pill-field__pills"},O2=["disabled"],Z2={class:"dss-pill-field__pill-text"},W2={key:0,class:"dss-pill-field__pill-actions"},q2=["onClick"],U2=["onClick"],X2=["placeholder","disabled"],Y2=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(L,{emit:re}){const M=L,$=re,se=e.ref(""),C=e.ref([...M.modelValue]),Ee=e.ref(null);let le=null;const Ge=e.ref(null),p=e.ref(""),ve=e.ref(null),xe=e.computed(()=>new Set(C.value.map(R=>R.trim()).filter(Boolean)));function de(R){Ee.value=R,le&&clearTimeout(le),le=setTimeout(()=>{Ee.value=null,le=null},900)}function ne(R){const Y=R.trim();return Y?xe.value.has(Y)?(de(Y),!1):(C.value=[...C.value,Y],$("update:modelValue",[...C.value]),!0):!1}function X(R){const Y=R.split(/\r?\n/g).map(Ce=>Ce.trim()).filter(Boolean);if(!Y.length)return;const _e=new Set(C.value.map(Ce=>Ce.trim()).filter(Boolean)),fe=[...C.value];let st=null;for(const Ce of Y){if(_e.has(Ce)){st??=Ce;continue}_e.add(Ce),fe.push(Ce)}fe.length!==C.value.length&&(C.value=fe,$("update:modelValue",[...C.value])),st&&de(st)}function pe(R){M.disabled||(Ge.value===R&&(Ge.value=null,p.value=""),C.value=C.value.filter((Y,_e)=>_e!==R),$("update:modelValue",[...C.value]))}async function A(R){M.disabled||(Ge.value=R,p.value=C.value[R]??"",await e.nextTick(),ve.value?.focus(),ve.value?.select())}function ge(){Ge.value=null,p.value=""}function Le(){if(M.disabled||Ge.value===null)return;const R=Ge.value,Y=C.value[R]??"",_e=p.value.trim();if(Ge.value=null,p.value="",_e!==Y&&xe.value.has(_e)){de(_e);return}if(!_e){C.value=C.value.filter((st,Ce)=>Ce!==R),$("update:modelValue",[...C.value]);return}const fe=C.value.map((st,Ce)=>Ce===R?_e:st);C.value=fe,$("update:modelValue",[...C.value])}function qe(R){R.preventDefault(),!M.disabled&&(ne(se.value),se.value="")}function vt(R){if(M.disabled)return;const Y=R.clipboardData?.getData("text")??"";!Y.includes(`
118
118
  `)&&!Y.includes("\r")||(R.preventDefault(),X(Y),se.value="")}return e.watch(()=>M.modelValue,R=>{C.value=Array.isArray(R)?[...R]:[]},{deep:!0}),e.onBeforeUnmount(()=>{le&&clearTimeout(le)}),(R,Y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":R.disabled}])},[e.createElementVNode("div",P2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C.value,(_e,fe)=>(e.openBlock(),e.createElementBlock("span",{key:_e,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":Ee.value===_e}])},[Ge.value===fe?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:ve,"onUpdate:modelValue":Y[0]||(Y[0]=st=>p.value=st),class:"dss-pill-field__pill-edit",type:"text",disabled:R.disabled,onKeydown:[e.withKeys(Le,["enter"]),e.withKeys(ge,["esc"])],onBlur:Le},null,40,O2)),[[e.vModelText,p.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",Z2,e.toDisplayString(_e),1),R.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",W2,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:st=>A(fe)},[...Y[2]||(Y[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,q2),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:st=>pe(fe)}," × ",8,U2)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Y[1]||(Y[1]=_e=>se.value=_e),class:"dss-pill-field__input",type:"text",placeholder:C.value.length?"":R.placeholder,disabled:R.disabled,onPaste:vt,onKeydown:e.withKeys(qe,["enter"])},null,40,X2),[[e.vModelText,se.value]])])],2))}}),j2={class:"dss-step-bar__header"},K2={class:"dss-step-bar__label"},G2={class:"dss-step-bar__counter"},Q2={class:"dss-step-bar__track-wrapper"},J2=["aria-valuemax","aria-valuenow","aria-label"],e9=["onMouseenter"],t9={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"}},setup(L){const re=L,M=e.computed(()=>Math.max(1,Number(re.steps)||1)),$=e.computed(()=>Math.min(M.value,Math.max(0,Number(re.currentStep)||0))),se=e.computed(()=>Array.isArray(re.segments)&&re.segments.length>0),C=e.computed(()=>se.value?re.segments.map((Y,_e)=>{const fe=Number(Y?.value);return{label:Y?.label||`Step ${_e+1}`,value:Number.isFinite(fe)&&fe>0?fe:0,color:Y?.color||re.activeColor}}):[]),Ee=e.computed(()=>se.value?C.value.reduce((Y,_e)=>Y+_e.value,0):$.value),le=e.computed(()=>se.value?Number.isFinite(Number(re.totalValue))&&Number(re.totalValue)>0?Number(re.totalValue):Math.max(1,Ee.value):M.value),Ge=e.computed(()=>se.value&&Number.isFinite(Number(re.totalValue))&&Number(re.totalValue)>0),p=e.computed(()=>Ge.value?Math.max(0,Number(re.totalValue)-Ee.value):0),ve=e.computed(()=>se.value?Ge.value?C.value.filter(Y=>Y.value>0):C.value:[]),xe=e.computed(()=>`${Ee.value} / ${le.value}`),de=e.computed(()=>Ee.value),ne=e.computed(()=>le.value),X=e.reactive({visible:!1,x:0,content:""}),pe=e.computed(()=>({left:`${X.x}px`})),A=Y=>{if(Ge.value){const st=Math.max(0,Number(Y.value)||0);return{flex:`${st} 0 0`,minWidth:st>0?"6px":"0",backgroundColor:Y.color}}const _e=Ee.value;return{flex:`${Y.value>0?Y.value:_e>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:Y.color}},ge=e.computed(()=>({flex:`${p.value} 0 0`,minWidth:p.value>0?"6px":"0",backgroundColor:re.inactiveColor})),Le=(Y,_e)=>{if(!Y||!_e?.currentTarget)return;const fe=_e.currentTarget;X.x=fe.offsetLeft+fe.offsetWidth/2,X.content=`${Y.label}: ${Y.value}`,X.visible=!0},qe=Y=>{if(!p.value||!Y?.currentTarget)return;const _e=Y.currentTarget;X.x=_e.offsetLeft+_e.offsetWidth/2,X.content=`${re.remainderLabel}: ${p.value}`,X.visible=!0},vt=()=>{X.visible=!1},R=e.computed(()=>({"--dss-step-bar-active-color":re.activeColor,"--dss-step-bar-inactive-color":re.inactiveColor}));return(Y,_e)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(R.value)},[e.createElementVNode("div",j2,[e.createElementVNode("span",K2,e.toDisplayString(L.label),1),e.createElementVNode("span",G2,e.toDisplayString(xe.value),1)]),e.createElementVNode("div",Q2,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":ne.value,"aria-valuenow":de.value,"aria-label":L.label},[se.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(fe,st)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${st}-${fe.label}`,class:"dss-step-bar__segment dss-step-bar__segment--interactive",style:e.normalizeStyle(A(fe)),onMouseenter:Ce=>Le(fe,Ce),onMouseleave:vt},null,44,e9))),128)),p.value>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ge.value),onMouseenter:_e[0]||(_e[0]=fe=>qe(fe)),onMouseleave:vt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(M.value,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":fe<=$.value}])},null,2))),128))],8,J2),X.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(pe.value)},e.toDisplayString(X.content),5)):e.createCommentVNode("",!0)])],4))}},l9={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"}},n9={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},o9={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},a9={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"}},s9={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},Gn={chart:l9,table:n9,filter:o9,datepicker:a9,textEditor:s9},r9={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"}},i9={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},c9={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},u9={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"}},d9={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"}},Qn={chart:r9,table:i9,filter:c9,datepicker:u9,textEditor:d9},m9={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"}},p9={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},f9={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},v9={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"}},g9={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"}},Jn={chart:m9,table:p9,filter:f9,datepicker:v9,textEditor:g9},No={en:Gn,fr:Qn,nl:Jn};function jo(L){if(!L||!L.global)return;const re=L.global.availableLocales||[];Object.keys(No).forEach(M=>{re.includes(M)&&L.global.mergeLocaleMessage(M,No[M])})}const Bo={en:{textEditor:Gn.textEditor},fr:{textEditor:Qn.textEditor},nl:{textEditor:Jn.textEditor}};function Ko(L){if(!L||!L.global)return;const re=L.global.availableLocales||[];Object.keys(Bo).forEach(M=>{re.includes(M)&&L.global.mergeLocaleMessage(M,Bo[M])})}const Mo={en:{table:Gn.table},fr:{table:Qn.table},nl:{table:Jn.table}};function Go(L){if(!L||!L.global)return;const re=L.global.availableLocales||[];Object.keys(Mo).forEach(M=>{re.includes(M)&&L.global.mergeLocaleMessage(M,Mo[M])})}const _o={en:{datepicker:Gn.datepicker},fr:{datepicker:Qn.datepicker},nl:{datepicker:Jn.datepicker}};function Qo(L){if(!L||!L.global)return;const re=L.global.availableLocales||[];Object.keys(_o).forEach(M=>{re.includes(M)&&L.global.mergeLocaleMessage(M,_o[M])})}const $o={en:{filter:Gn.filter},fr:{filter:Qn.filter},nl:{filter:Jn.filter}};function Jo(L){if(!L||!L.global)return;const re=L.global.availableLocales||[];Object.keys($o).forEach(M=>{re.includes(M)&&L.global.mergeLocaleMessage(M,$o[M])})}const h9={chart:No,textEditor:Bo,table:Mo,datepicker:_o,filter:$o};function y9(L){!L||!L.global||(jo(L),Ko(L),Go(L),Qo(L),Jo(L))}const C9={en:{...Gn},fr:{...Qn},nl:{...Jn}};Kn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:C9});exports.DSSChart=Ri;exports.DSSChartMessages=No;exports.DSSColorPicker=mm;exports.DSSConfetti=zm;exports.DSSDatepicker=Zo;exports.DSSDatepickerMessages=_o;exports.DSSDnd=Fm;exports.DSSFilter=z2;exports.DSSFilterMessages=$o;exports.DSSLoader=Vm;exports.DSSMessages=h9;exports.DSSModal=Oo;exports.DSSPillField=Y2;exports.DSSSkeleton=Sm;exports.DSSStepBar=t9;exports.DSSTable=au;exports.DSSTableMessages=Mo;exports.DSSTextEditor=K1;exports.DSSTextEditorMessages=Bo;exports.addDSSChartTranslations=jo;exports.addDSSDatepickerTranslations=Qo;exports.addDSSFilterTranslations=Jo;exports.addDSSTableTranslations=Go;exports.addDSSTextEditorTranslations=Ko;exports.addDSSTranslations=y9;