dsp-semactic 0.6.44 → 0.6.45
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 +18 -18
- package/dist/index.es.js +1709 -1705
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gn=require("vue-i18n"),ca={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ua=["value"],da=["placeholder","value","disabled"],ma=["placeholder","value"],pa={key:0,class:"dss-datepicker__double-wrap"},fa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},va=["onClick"],ga={class:"dss-datepicker__double-calendars"},ha={class:"dss-datepicker__double-calendar"},ya={class:"dss-datepicker__calendar-header"},ka=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ba=["aria-label"],wa={class:"dss-datepicker__weekdays"},xa={class:"dss-datepicker__grid"},Ea=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__double-calendar"},Na={class:"dss-datepicker__calendar-header"},Ba=["aria-label"],Ma={class:"dss-datepicker__month-year-row"},_a=["aria-label"],$a={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],Aa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Da={class:"dss-datepicker__calendar-header"},Ha=["aria-label"],Ra={class:"dss-datepicker__month-year-row"},Ia=["aria-label"],Fa={class:"dss-datepicker__weekdays"},za={class:"dss-datepicker__grid"},Pa=["disabled","onClick","onMouseenter"],Oa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},qa={class:"dss-datepicker__calendar-header"},Wa={class:"dss-datepicker__month-year-row"},Za={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ua={class:"dss-datepicker__months-grid"},Xa=["onClick"],Ya={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ja={class:"dss-datepicker__month-year"},Ka={class:"dss-datepicker__years-grid"},Ga=["data-year","onClick"],Yo=27,Wo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:_=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(_)},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(_,{emit:J}){const B=_,$=J,{t:ae,locale:F}=Gn.useI18n(),T=e.ref(!1),X=e.ref("days"),Qe=new Date,pe=e.computed(()=>B.minDate instanceof Date?B.minDate:Qe),f=e.ref(pe.value.getMonth()),we=e.ref(pe.value.getFullYear()),fe=e.ref(pe.value.getMonth()),ne=e.ref(pe.value.getFullYear()),ee=e.ref(pe.value.getMonth()),ce=e.ref(pe.value.getFullYear()),H=e.ref("start"),ke=e.ref(null),ve=e.ref(null);function Oe(){const z=pe.value,Z=z.getMonth(),P=z.getFullYear(),ie=Z===11?0:Z+1,De=Z===11?P+1:P;return{left:{month:Z,year:P},right:{month:ie,year:De}}}const ot=e.ref(null),I=e.ref(null),qe=e.ref(null),_e=e.ref(null),Ce=e.ref(null),pt=e.ref(null),ht=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(B.mode)),he=e.computed(()=>["range","rangeFromAvailable"].includes(B.mode)),de=e.computed(()=>{if(B.mode!=="single"&&B.mode!=="singleFromAvailable")return null;const z=B.modelValue;return z instanceof Date?z:null}),st=e.computed(()=>{if(!he.value)return{start:null,end:null};const z=B.modelValue;return!z||typeof z!="object"?{start:null,end:null}:{start:z.start instanceof Date?z.start:null,end:z.end instanceof Date?z.end:null}});function Ye(z){if(!z||!(z instanceof Date))return"";const Z=z.getDate(),P=z.getMonth()+1,ie=z.getFullYear(),De=ut=>String(ut).padStart(2,"0");return`${De(Z)}/${De(P)}/${ie}`}const xt=e.computed(()=>Ye(de.value)),Rt=e.computed(()=>{const{start:z,end:Z}=st.value;if(!z&&!Z)return"";const P=!Z||z&&z<=Z?z:Z,ie=!z||Z&&Z>=z?Z:z;return q(P,ie)?Ye(P):`${Ye(P)} - ${Ye(ie)}`}),tl=e.computed(()=>{if(B.mode!=="readonly")return"—";const z=B.modelValue;if(z instanceof Date)return Ye(z)||"—";if(z&&typeof z=="object"&&("start"in z||"end"in z)){const Z=z.start instanceof Date?z.start:null,P=z.end instanceof Date?z.end:null;if(!Z&&!P)return"—";const ie=!P||Z&&Z<=P?Z:P,De=!Z||P&&P>=Z?P:Z;return q(ie,De)?Ye(ie):`${Ye(ie)} - ${Ye(De)}`}return"—"});e.computed(()=>{const z=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)});const Ft=e.computed(()=>ve.value==="left"?fe.value:ve.value==="right"?ee.value:f.value),rt=e.computed(()=>ve.value==="left"?ne.value:ve.value==="right"?ce.value:we.value),Vt=e.computed(()=>{const z=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),ll=e.computed(()=>{const z=new Date(rt.value,Ft.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),zt=e.computed(()=>{const z=new Intl.DateTimeFormat(F.value,{month:"short"});return Array.from({length:12},(Z,P)=>z.format(new Date(2024,P,1)))}),Gt=e.computed(()=>{const Z=(ve.value?rt.value:we.value)-Math.floor(Yo/2);return Array.from({length:Yo},(P,ie)=>Z+ie)}),Je=e.computed(()=>{const z=Gt.value;return z.length?`${z[0]} – ${z[z.length-1]}`:""}),lt=e.computed(()=>{const z=new Intl.DateTimeFormat(F.value,{weekday:"short"}),Z=new Date(2024,0,1),P=[];for(let ie=0;ie<7;ie++){const De=new Date(Z);De.setDate(Z.getDate()+ie),P.push(z.format(De).slice(0,2))}return P});function $t(z,Z){const P=new Date(z,Z,1),ie=new Date(z,Z+1,0),De=P.getDay(),ut=ie.getDate(),dt=[];for(let je=0;je<De;je++)dt.push(null);for(let je=1;je<=ut;je++)dt.push(new Date(z,Z,je));return dt}const Xt=e.computed(()=>$t(we.value,f.value)),te=e.computed(()=>$t(ne.value,fe.value)),Te=e.computed(()=>$t(ce.value,ee.value));e.computed(()=>{const z=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)}),e.computed(()=>{const z=new Date(ce.value,ee.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)});const Me=e.computed(()=>{const z=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),Ue=e.computed(()=>{const z=new Date(ce.value,ee.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),it=e.computed(()=>B.availableDates&&B.availableDates.length>0),Xe=e.computed(()=>it.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ge=e.ref({top:0,left:0});function ft(){if(!_e.value||!T.value)return;const z=_e.value.getBoundingClientRect(),Z=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let ie=z.left,De=z.bottom+4;const ut=Ce.value;if(ut){const dt=ut.offsetWidth,je=ut.offsetHeight;if(ie+dt>Z-8&&(ie=z.right-dt,ie<8&&(ie=8)),De+je>P-8){const bt=z.top-4-je;bt>=8?De=bt:De=Math.max(8,P-je-8)}}Ge.value={top:De,left:ie}}const Ae=e.computed(()=>!_e.value||!T.value?{}:{position:"fixed",left:`${Ge.value.left}px`,top:`${Ge.value.top}px`,zIndex:1002});function q(z,Z){return!z||!Z?!1:z.getFullYear()===Z.getFullYear()&&z.getMonth()===Z.getMonth()&&z.getDate()===Z.getDate()}function U(z){return new Date(z.getFullYear(),z.getMonth(),z.getDate()).getTime()}function Q(z){return!B.availableDates||!B.availableDates.length?!0:B.availableDates.some(Z=>Z instanceof Date&&q(Z,z))}function re(z){const Z=U(z);return!(B.minDate instanceof Date&&Z<U(B.minDate)||B.maxDate instanceof Date&&Z>U(B.maxDate))}function Re(z){return!B.exceptDates||!B.exceptDates.length?!1:B.exceptDates.some(Z=>Z instanceof Date&&q(Z,z))}function ct(z){return Re(z)?!1:["singleFromAvailable","rangeFromAvailable"].includes(B.mode)?Q(z):re(z)}function Et(z){const Z=de.value,P=st.value,ie=U(z),De=he.value&&P.start&&P.end&&ie>U(P.start)&&ie<U(P.end),ut=he.value&&P.start&&q(z,P.start),dt=he.value&&P.end&&q(z,P.end),je=ut&&dt,bt=ge.value&&Z&&q(z,Z)||ut||dt;let Wt=!1;if(he.value&&P.start&&!P.end&&ke.value){const kl=U(P.start),Zl=U(ke.value),Ml=Math.min(kl,Zl),Ul=Math.max(kl,Zl);Wt=ie>Ml&&ie<Ul}return{"dss-datepicker__day--selected":bt&&!je,"dss-datepicker__day--range-start":ut&&!je,"dss-datepicker__day--range-end":dt&&!je,"dss-datepicker__day--range-single":je,"dss-datepicker__day--in-range":De&&!ut&&!dt,"dss-datepicker__day--in-range-preview":Wt&&!ut&&!dt&&!De,"dss-datepicker__day--disabled":!ct(z)}}function Ie(z){if(!he.value)return;const Z=st.value;if(!Z.start||Z.end){ke.value=null;return}if(!ct(z)){ke.value=null;return}ke.value=new Date(z.getFullYear(),z.getMonth(),z.getDate())}function kt(){ke.value=null}function It(){if(!B.doubleCalendar||!he.value)return;const z=st.value,{start:Z,end:P}=z;if(Z&&P){const ut=Z<=P?Z:P,dt=Z<=P?P:Z,je=ut.getMonth(),bt=ut.getFullYear(),Wt=dt.getMonth(),kl=dt.getFullYear();if(je!==Wt||bt!==kl){const Zl=fe.value===je&&ne.value===bt,Ml=ee.value===Wt&&ce.value===kl;if(Zl&&Ml)return;fe.value=je,ne.value=bt,ee.value=Wt,ce.value=kl}else{const Zl=je===0?11:je-1,Ml=je===0?bt-1:bt;fe.value===Zl&&ne.value===Ml&&ee.value===je&&ce.value===bt||(fe.value=je,ne.value=bt,je===11?(ee.value=0,ce.value=bt+1):(ee.value=je+1,ce.value=bt))}return}const ie=Z||P;if(ie){const ut=ie.getMonth(),dt=ie.getFullYear(),je=fe.value===ut&&ne.value===dt,bt=ee.value===ut&&ce.value===dt;if(je||bt)return;fe.value=ut,ne.value=dt,ut===11?(ee.value=0,ce.value=dt+1):(ee.value=ut+1,ce.value=dt);return}const De=Oe();fe.value=De.left.month,ne.value=De.left.year,ee.value=De.right.month,ce.value=De.right.year}function Qt(z="start"){if(B.mode==="readonly")return;H.value=z;const Z=de.value,P=st.value;if(ge.value&&Z)f.value=Z.getMonth(),we.value=Z.getFullYear();else if(he.value)if(B.doubleCalendar)It();else{const ie=z==="start"&&P.start?P.start:P.end||P.start;ie&&(f.value=ie.getMonth(),we.value=ie.getFullYear())}_e.value=ge.value?ot.value?.closest(".dss-datepicker__input-wrap"):I.value,X.value="days",ve.value=null,T.value=!0,e.nextTick(()=>{ft()})}function qt(){X.value="days",ve.value=null,ke.value=null,T.value=!1}function Dt(z,Z){ve.value=z,X.value=Z}function V(){X.value="days",ve.value=null}function w(z){const Z=new Date,P=Z.getFullYear(),ie=Z.getMonth(),De=Z.getDate();let ut,dt;if(it.value){const je=[...B.availableDates].filter(bt=>bt instanceof Date).map(bt=>new Date(bt.getFullYear(),bt.getMonth(),bt.getDate()));if(je.sort((bt,Wt)=>bt.getTime()-Wt.getTime()),je.length===0)return;if(z==="all")ut=je[0],dt=je[je.length-1];else{const bt=parseInt(z.replace("last",""),10);if(bt<2||bt>5)return;const Wt=je.slice(-bt);ut=Wt[0],dt=Wt[Wt.length-1]}}else{const je=new Date(P,ie,De);switch(z){case"today":ut=je,dt=je;break;case"lastWeek":ut=new Date(P,ie,De-6),dt=je;break;case"last15Days":ut=new Date(P,ie,De-14),dt=je;break;case"last30Days":ut=new Date(P,ie,De-29),dt=je;break;case"thisMonth":ut=new Date(P,ie,1),dt=je;break;case"last3Months":ut=new Date(P,ie-3,1),dt=new Date(P,ie,0);break;case"last6Months":ut=new Date(P,ie-6,1),dt=new Date(P,ie,0);break;case"last12Months":ut=new Date(P,ie-12,1),dt=new Date(P,ie,0);break;case"lastYear":ut=new Date(P-1,0,1),dt=new Date(P-1,11,31);break;default:return}}$("update:modelValue",{start:ut,end:dt}),It()}function S(z){ve.value==="left"?fe.value=z:ve.value==="right"?ee.value=z:f.value=z,V()}function j(z){ve.value==="left"?ne.value=z:ve.value==="right"?ce.value=z:we.value=z,V()}function G(){f.value===0?(f.value=11,we.value--):f.value--}function Ze(){f.value===11?(f.value=0,we.value++):f.value++}function vt(){fe.value===0?(fe.value=11,ne.value--):fe.value--}function Ve(){fe.value===11?(fe.value=0,ne.value++):fe.value++}function Ne(){ee.value===0?(ee.value=11,ce.value--):ee.value--}function Tt(){ee.value===11?(ee.value=0,ce.value++):ee.value++}function At(z){if(!ct(z))return;const Z=new Date(z.getFullYear(),z.getMonth(),z.getDate());if(ge.value){$("update:modelValue",Z),qt();return}const P=st.value;if(!P.start&&!P.end){$("update:modelValue",{start:Z,end:null}),H.value="end";return}if(P.start&&P.end){$("update:modelValue",{start:Z,end:null}),H.value="end";return}if(H.value==="start"){let ie=Z,De=P.end;ie&&De&&ie>De&&([ie,De]=[De,ie]),$("update:modelValue",{start:ie||De,end:De||ie}),H.value="end"}else{let ie=P.start,De=Z;ie&&De&&De<ie&&([ie,De]=[De,ie]),$("update:modelValue",{start:ie||De,end:De||ie}),H.value="start"}}e.watch(st,()=>{B.doubleCalendar&&he.value&&T.value&&It()},{deep:!0});let et=null,tt=null,Lt=null;function fl(){et&&(document.removeEventListener("keydown",et),et=null),tt&&(window.removeEventListener("resize",tt),tt=null),Lt&&(window.removeEventListener("scroll",Lt,!0),Lt=null)}return e.watch(X,z=>{z==="years"&&e.nextTick(()=>{pt.value?.querySelector(`[data-year="${rt.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(T,z=>{fl(),z&&(et=Z=>{Z.key==="Escape"&&(X.value==="years"||X.value==="months"?V():qt())},tt=()=>{ft()},Lt=()=>{ft()},document.addEventListener("keydown",et),window.addEventListener("resize",tt),window.addEventListener("scroll",Lt,!0))}),e.onBeforeUnmount(()=>{fl()}),(z,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":_.mode==="readonly"}])},[_.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ca,[Z[10]||(Z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:tl.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ua)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:Z[0]||(Z[0]=P=>Qt("start"))},[Z[11]||(Z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:ot,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(ae)("datepicker.selectDate"),value:xt.value,readonly:"",disabled:_.mode==="readonly"},null,8,da)])):he.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:I,onClick:Z[1]||(Z[1]=P=>Qt("start"))},[Z[12]||(Z[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:qe,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(ae)("datepicker.selectRange"),value:Rt.value,readonly:""},null,8,ma)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(qt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ce,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":_.doubleCalendar&&he.value&&X.value==="days","dss-datepicker__dropdown--quick-select":_.doubleCalendar&&he.value&&X.value==="days"&&_.quickSelect}]),onClick:Z[9]||(Z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ae.value)},[X.value==="days"&&_.doubleCalendar&&he.value?(e.openBlock(),e.createElementBlock("div",pa,[_.quickSelect?(e.openBlock(),e.createElementBlock("nav",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ie=>w(P.id)},e.toDisplayString(e.unref(ae)(P.labelKey)),9,va))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.prevMonth"),onClick:vt}," ‹ ",8,ka),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[2]||(Z[2]=P=>Dt("left","months"))},e.toDisplayString(Me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[3]||(Z[3]=P=>Dt("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.nextMonth"),onClick:Ve}," › ",8,ba)]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>At(P),onMouseenter:De=>Ie(P),onMouseleave:kt},e.toDisplayString(P.getDate()),43,Ea)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])]),e.createElementVNode("div",Va,[e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.prevMonth"),onClick:Ne}," ‹ ",8,Ba),e.createElementVNode("div",Ma,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[4]||(Z[4]=P=>Dt("right","months"))},e.toDisplayString(Ue.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[5]||(Z[5]=P=>Dt("right","years"))},e.toDisplayString(ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.nextMonth"),onClick:Tt}," › ",8,_a)]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>At(P),onMouseenter:De=>Ie(P),onMouseleave:kt},e.toDisplayString(P.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",Aa))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.prevMonth"),onClick:G}," ‹ ",8,Ha),e.createElementVNode("div",Ra,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[6]||(Z[6]=P=>X.value="months")},e.toDisplayString(Vt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[7]||(Z[7]=P=>X.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ae)("datepicker.nextMonth"),onClick:Ze}," › ",8,Ia)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(P,ie)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ie},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>At(P),onMouseenter:De=>Ie(P),onMouseleave:kt},e.toDisplayString(P.getDate()),43,Pa)):(e.openBlock(),e.createElementBlock("span",Oa))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",qa,[e.createElementVNode("div",Wa,[e.createElementVNode("span",Za,e.toDisplayString(ll.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[8]||(Z[8]=P=>X.value="years")},e.toDisplayString(rt.value),1)])]),e.createElementVNode("div",Ua,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(P,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ie===Ft.value}]),onClick:De=>S(ie)},e.toDisplayString(P),11,Xa))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ya,[e.createElementVNode("span",ja,e.toDisplayString(Je.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:pt},[e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===rt.value,"dss-datepicker__year-cell--current":P===e.unref(ht)}]),"data-year":P,onClick:ie=>j(P)},e.toDisplayString(P),11,Ga))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Qa=["data-chart-type"],Ja={class:"dss-chart-header-titles"},es={key:0,class:"dss-chart-title"},ts={key:1,class:"dss-chart-subtitle"},ls=["onClick","onMouseenter"],ns={class:"dss-legend-text"},os=["onClick","onMouseenter"],as={class:"dss-legend-text"},ss=["title"],rs=["src"],is={class:"dss-chart-area-wrapper"},cs={key:0,class:"dss-chart-z-axis-label"},us=["width","height","data-smooth","data-animated"],ds=["id"],ms=["y","width","height"],ps=["id"],fs=["d"],vs=["id"],gs=["d"],hs={key:0},ys=["clip-path"],ks=["x1","x2","y1","y2"],Cs={class:"dss-axes"},bs=["x1","x2","y1","y2"],ws=["x1","x2","y1","y2"],xs={class:"dss-axis-labels"},Es=["x","y"],Ss=["x","y"],Vs=["x","y"],Ns=["y","transform"],Bs={key:1,class:"dss-flag-markers"},Ms=["clip-path"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["x1","x2","y1","y2","onMouseover"],Ts=["cx","cy","onMouseover"],As=["cx","cy","fill","onMouseover"],Ds=["x","y"],Hs=["clip-path"],Rs={key:0},Is=["d","onMouseover"],Fs=["x","y","width","height","fill","onMouseover"],zs={class:"dss-line-chart"},Ps=["d","stroke","stroke-width"],Os=["d","stroke","stroke-width","opacity"],qs=["cx","cy","r","fill","onMouseover"],Ws={key:1},Zs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width"],Xs=["d","stroke","stroke-width","opacity"],Ys=["cx","cy","r","fill","onMouseover"],js={key:2},Ks=["id"],Gs=["x","y","width","height"],Qs=["d","fill","fill-opacity","mask"],Js=["d","stroke","stroke-width"],er=["d","fill","onMouseover"],tr=["x","y","width","height","onMouseover"],lr=["clip-path"],nr=["x1","x2","y1","y2","stroke"],or=["cx","cy","r","fill"],ar={key:1,class:"dss-bubble-chart"},sr={key:0,class:"dss-bubble-group"},rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],ir=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],cr=["transform"],ur=["cx","cy","r"],dr=["data-chart-type","clip-path"],mr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],pr={key:1,class:"dss-radial-segment-data-labels"},fr=["x","y"],vr=["x","y","font-size","fill"],gr=["x1","y1","x2","y2","stroke"],hr=["x1","y1","x2","y2","stroke"],yr=["x","y","text-anchor","font-size"],kr=["transform"],Cr={key:0,class:"dss-spider-grid"},br=["cx","cy","r"],wr={class:"dss-spider-grid-labels"},xr=["x","y"],Er=["x","y"],Sr=["x1","x2","y1","y2"],Vr={class:"dss-spider-labels"},Nr=["x","y","text-anchor","dominant-baseline"],Br=["points","fill","fill-opacity","stroke","stroke-width"],Mr=["cx","cy","r","fill","onMouseover"],_r={class:"dss-chart-logos"},$r=["cx","cy","r","fill"],Lr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Tr=["onClick","onMouseenter"],Ar=["src"],Dr={class:"dss-marker-tooltip-category"},Hr={key:0,class:"dss-marker-tooltip-description"},Rr={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Ir={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Fr={class:"dss-tooltip-series-name"},zr={class:"dss-tooltip-series-value"},Pr={key:1,class:"dss-tooltip-section"},Or={key:0,class:"dss-tooltip-title"},qr={class:"dss-bubble-tooltip-data"},Wr={key:2,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-title"},Ur={class:"dss-tooltip-value"},Xr={key:0,class:"dss-tooltip-section"},Yr={class:"dss-tooltip-section-title"},jr={class:"dss-tooltip-group-header"},Kr={class:"dss-tooltip-item-content"},Gr={class:"dss-tooltip-item-text"},Qr={key:1,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-item-content"},ti={class:"dss-tooltip-item-title"},li={key:0,class:"dss-tooltip-item-description"},ni={class:"dss-tooltip-section"},oi={class:"dss-tooltip-title"},ai={key:0,class:"dss-bubble-tooltip-data"},si={class:"dss-tooltip-series-name"},ri={class:"dss-tooltip-series-value"},ii={key:0,class:"dss-tooltip-section"},ci={class:"dss-tooltip-section-title"},ui={class:"dss-tooltip-group-header"},di={class:"dss-tooltip-item-content"},mi={class:"dss-tooltip-item-text"},pi={key:1,class:"dss-tooltip-section"},fi={class:"dss-tooltip-section-title"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-title"},hi={key:0,class:"dss-tooltip-item-description"},yi=["onClick","onMouseenter"],ki={class:"dss-legend-text"},Ci={key:1,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi={key:0,class:"dss-context-menu-separator"},xi=["onClick"],Ei=["innerHTML"],Si={key:0,class:"dss-context-menu-icon"},Vi={class:"dss-marker-modal-header"},Ni={class:"dss-marker-modal-body"},Bi={class:"dss-form-group"},Mi={class:"dss-form-group"},_i={for:"dss-marker-description"},$i={key:0,class:"dss-form-text-display"},Li=["placeholder"],Ti={class:"dss-marker-modal-footer"},Ai={class:"modal-footer-left"},Di={class:"dss-modal-footer-right"},Hi=["disabled"],Ri={name:"DSSChart"},Ii=Object.assign(Ri,{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:_=>typeof _=="object"&&_!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(_,{emit:J}){const{t:B,locale:$}=Gn.useI18n(),ae=J,F=e.ref(null),T=e.ref(null),X=e.ref(null),Qe=e.ref(0),pe=e.ref(0);let f=null,we=null;const fe=20,ne=e.computed(()=>{if(pe.value,Qe.value,!F.value||!T.value)return 0;try{const t=F.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),ee=e.computed(()=>`chart-clip-${H.chartId}`),ce=e.computed(()=>`url(#${ee.value})`),H=_,ke={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},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 ve(t,s){const l=Object.assign({},t);return ot(t)&&ot(s)&&Object.keys(s).forEach(i=>{ot(s[i])?i in t?l[i]=ve(t[i],s[i]):Object.assign(l,{[i]:s[i]}):Object.assign(l,{[i]:s[i]})}),l}const Oe=()=>{let t=20,s=0,l=0;if(Ye.value&&(t+=30),xt.value&&(t+=25),Je.value&&H.series.length>0){const i=H.series.filter((p,g)=>!Pt.value.has(g)).length;if(lt.value==="top"||lt.value==="bottom"){if($t.value==="horizontal"){const g=Math.floor(Ce.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 ot(t){return t&&typeof t=="object"&&!Array.isArray(t)}const I=e.computed(()=>ve(ke,H.options)),qe=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.width==="auto"}),_e=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.height==="auto"}),Ce=e.computed(()=>{const t=I.value;return qe.value?Qe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),pt=e.ref(fe),ht=e.computed(()=>{if(_e.value){const t=ht.value;return t??Math.max(0,(pe.value||400)-pt.value*5)}}),ge=e.computed(()=>{const t=I.value;if(de.value==="mini-radial")return Ce.value;if(_e.value){const s=ht.value;return s??Math.max(0,(pe.value||400)-pt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),he=e.computed(()=>{if(_e.value&&de.value==="semi-radial"&&ht.value!=null)return pt.value+ge.value+"px";if(_e.value)return"100%";if(vl.value)return pt.value+ge.value+"px";if(Je.value&<.value==="bottom"){const t=Oe();return ge.value+(t.legendHeight||35)+"px"}return ge.value+(Je.value?20:0)+"px"}),de=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),st=e.computed(()=>{const t=H.series.map(s=>s.type||de.value);return new Set(t).size>1}),Ye=e.computed(()=>{const t=I.value;return t&&t.title&&t.title.text?t.title.text:""}),xt=e.computed(()=>{const t=I.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Rt=e.computed(()=>{const t=I.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),tl=e.computed(()=>{const t=I.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ft=e.computed(()=>{const t=I.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),rt=e.computed(()=>{const t=I.value;if(!t||!t.yAxis)return sn;const s=t.yAxis.min;return typeof s=="number"||s===sn?s:sn}),Vt=e.computed(()=>{const t=I.value;if(!t||!t.yAxis)return sn;const s=t.yAxis.max;return typeof s=="number"||s===sn?s:sn}),ll=e.computed(()=>{const t=I.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),zt=e.computed(()=>{const t=I.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Gt=e.computed(()=>{const t=I.value;return t&&t.grid&&t.grid.show!==!1}),Je=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.show!==!1}),lt=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),$t=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xt=e.computed(()=>{const t=I.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),te=e.computed(()=>{const t=I.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),Te=e.computed(()=>{const t=I.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Me=e.computed(()=>{const t=I.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ue=e.computed(()=>{const t=I.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),it=e.computed(()=>{const t=I.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Xe=e.computed(()=>{const t=I.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ge=e.computed(()=>{if(!vl.value)return 0;const t=I.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ft=e.computed(()=>{const t=I.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ae=e.computed(()=>{const{maxX:t}=jt.value;return t===0}),q=(t,s)=>Ae.value&&s===0?5:s,U=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},Q=e.computed(()=>{const t=I.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),re=e.computed(()=>{const t=I.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Re=e.computed(()=>{const t=I.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ct=e.computed(()=>{const t=I.value;return re.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Et=e.computed(()=>{const t=I.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ie=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.enabled!==!1}),kt=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),It=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Qt=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),qt=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Dt=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),V=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.onDataChange!==!1}),w=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),S=e.computed(()=>{const t=I.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),j=e.computed(()=>I.value?.spider?.gridSteps||5),G=e.computed(()=>{const t=[],s=j.value;for(let l=1;l<=s;l++)t.push(wt.value/s*l);return t}),Ze=t=>{const s=vt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=G.value[t];return Math.round(l/wt.value*100)+"%"},vt=e.computed(()=>I.value?.spider?.gridLabels||null),Ve=e.computed(()=>{const t=I.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ne=e.computed(()=>{const t=I.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tt=e.computed(()=>{const t=I.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),At=e.computed(()=>{const t=I.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Zl.value}),et=e.computed(()=>{const t=I.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),tt=e.computed(()=>{const t=I.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Lt=e.computed(()=>{const s=I.value?.valueFormat?.extension;return typeof s=="string"?s:""}),fl=t=>{const s=Lt.value;if(t==null)return"";const l=String(t);return s?l+s:l},z=e.computed(()=>!oe.value.isZooming);e.computed(()=>nt.value.map(t=>{if(t.categoryIndex!==void 0&&(xl.value||al.value)){const s=sl(t.categoryIndex),l=ne.value+O.value.bottom-tt.value/2;return{...t,x:s,y:l}}return t}));function Z(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,b,C]=t.split("-"),D=Number(C?.length===2?`20${C}`:C);l=new Date(D,Number(b)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,b)=>{const[C,D,L]=g.split("-"),R=Number(L?.length===2?`20${L}`:L),N=new Date(R,Number(D)-1,Number(C)),K=Math.abs(N-l);K<p&&(p=K,i=b)}),i}const P=e.computed(()=>{const t=H.markers.map(l=>{const i=Z(l.marker_date,H.categories),p=sl(i),g=ne.value+O.value.bottom-tt.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),s=nt.value.map(l=>{if(l.categoryIndex!==void 0&&(xl.value||al.value)){const i=sl(l.categoryIndex),p=ne.value+O.value.bottom-tt.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ie=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.enabled===!0}),De=e.computed(()=>{const t=I.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ut=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),dt=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),je=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let s,l;const i=String(ut.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,l=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),l=s*(96/499)}return{width:s,height:l,area:t}}),bt=e.computed(()=>{const{width:t,height:s}=je.value,l=dt.value;let i,p;const g=O.value.left,b=O.value.right,C=O.value.top,D=O.value.bottom,L=O.value.width,R=O.value.height;switch(l){case"center":i=g+(L-t)/2,p=C+(R-s)/2;break;case"top-left":i=g+15,p=C+5;break;case"top-right":i=b-t-15,p=C+5;break;case"bottom-left":i=g+15,p=D-s-5;break;case"bottom-right":default:i=b-t-15,p=D-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),Wt=t=>!H.flags||!H.flags.length?[]:H.flags.filter(s=>s.categoryIndex===t),kl=t=>{const s=Wt(t),l=Hn(t),i=s.filter(b=>b.manual),p=s.filter(b=>!b.manual),g=[];return i.length>0&&g.push({type:B("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(b=>({text:b.text,color:"#698dbe"}))}),p.length>0&&g.push({type:B("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(b=>({title:b.title,description:b.description,type:B("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},Zl=e.computed(()=>{const t=H.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"),Gn=require("vue-i18n"),ca={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ua=["value"],da=["placeholder","value","disabled"],ma=["placeholder","value"],pa={key:0,class:"dss-datepicker__double-wrap"},fa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},va=["onClick"],ga={class:"dss-datepicker__double-calendars"},ha={class:"dss-datepicker__double-calendar"},ya={class:"dss-datepicker__calendar-header"},ka=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ba=["aria-label"],wa={class:"dss-datepicker__weekdays"},xa={class:"dss-datepicker__grid"},Ea=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__double-calendar"},Na={class:"dss-datepicker__calendar-header"},Ba=["aria-label"],Ma={class:"dss-datepicker__month-year-row"},_a=["aria-label"],$a={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],Aa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Da={class:"dss-datepicker__calendar-header"},Ha=["aria-label"],Ra={class:"dss-datepicker__month-year-row"},Ia=["aria-label"],Fa={class:"dss-datepicker__weekdays"},za={class:"dss-datepicker__grid"},Pa=["disabled","onClick","onMouseenter"],Oa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},qa={class:"dss-datepicker__calendar-header"},Wa={class:"dss-datepicker__month-year-row"},Za={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ua={class:"dss-datepicker__months-grid"},Xa=["onClick"],Ya={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ja={class:"dss-datepicker__month-year"},Ka={class:"dss-datepicker__years-grid"},Ga=["data-year","onClick"],Yo=27,Wo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:_=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(_)},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(_,{emit:J}){const B=_,$=J,{t:se,locale:F}=Gn.useI18n(),T=e.ref(!1),X=e.ref("days"),Qe=new Date,pe=e.computed(()=>B.minDate instanceof Date?B.minDate:Qe),f=e.ref(pe.value.getMonth()),be=e.ref(pe.value.getFullYear()),fe=e.ref(pe.value.getMonth()),ne=e.ref(pe.value.getFullYear()),ee=e.ref(pe.value.getMonth()),ue=e.ref(pe.value.getFullYear()),H=e.ref("start"),ye=e.ref(null),ve=e.ref(null);function Oe(){const z=pe.value,Z=z.getMonth(),P=z.getFullYear(),ce=Z===11?0:Z+1,De=Z===11?P+1:P;return{left:{month:Z,year:P},right:{month:ce,year:De}}}const ot=e.ref(null),I=e.ref(null),qe=e.ref(null),Ve=e.ref(null),ke=e.ref(null),pt=e.ref(null),kt=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(B.mode)),ht=e.computed(()=>["range","rangeFromAvailable"].includes(B.mode)),ae=e.computed(()=>{if(B.mode!=="single"&&B.mode!=="singleFromAvailable")return null;const z=B.modelValue;return z instanceof Date?z:null}),Xe=e.computed(()=>{if(!ht.value)return{start:null,end:null};const z=B.modelValue;return!z||typeof z!="object"?{start:null,end:null}:{start:z.start instanceof Date?z.start:null,end:z.end instanceof Date?z.end:null}});function $e(z){if(!z||!(z instanceof Date))return"";const Z=z.getDate(),P=z.getMonth()+1,ce=z.getFullYear(),De=ut=>String(ut).padStart(2,"0");return`${De(Z)}/${De(P)}/${ce}`}const rt=e.computed(()=>$e(ae.value)),Tt=e.computed(()=>{const{start:z,end:Z}=Xe.value;if(!z&&!Z)return"";const P=!Z||z&&z<=Z?z:Z,ce=!z||Z&&Z>=z?Z:z;return q(P,ce)?$e(P):`${$e(P)} - ${$e(ce)}`}),tl=e.computed(()=>{if(B.mode!=="readonly")return"—";const z=B.modelValue;if(z instanceof Date)return $e(z)||"—";if(z&&typeof z=="object"&&("start"in z||"end"in z)){const Z=z.start instanceof Date?z.start:null,P=z.end instanceof Date?z.end:null;if(!Z&&!P)return"—";const ce=!P||Z&&Z<=P?Z:P,De=!Z||P&&P>=Z?P:Z;return q(ce,De)?$e(ce):`${$e(ce)} - ${$e(De)}`}return"—"});e.computed(()=>{const z=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)});const Ft=e.computed(()=>ve.value==="left"?fe.value:ve.value==="right"?ee.value:f.value),st=e.computed(()=>ve.value==="left"?ne.value:ve.value==="right"?ue.value:be.value),Vt=e.computed(()=>{const z=new Date(be.value,f.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),ll=e.computed(()=>{const z=new Date(st.value,Ft.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),zt=e.computed(()=>{const z=new Intl.DateTimeFormat(F.value,{month:"short"});return Array.from({length:12},(Z,P)=>z.format(new Date(2024,P,1)))}),Gt=e.computed(()=>{const Z=(ve.value?st.value:be.value)-Math.floor(Yo/2);return Array.from({length:Yo},(P,ce)=>Z+ce)}),Je=e.computed(()=>{const z=Gt.value;return z.length?`${z[0]} – ${z[z.length-1]}`:""}),lt=e.computed(()=>{const z=new Intl.DateTimeFormat(F.value,{weekday:"short"}),Z=new Date(2024,0,1),P=[];for(let ce=0;ce<7;ce++){const De=new Date(Z);De.setDate(Z.getDate()+ce),P.push(z.format(De).slice(0,2))}return P});function $t(z,Z){const P=new Date(z,Z,1),ce=new Date(z,Z+1,0),De=P.getDay(),ut=ce.getDate(),dt=[];for(let je=0;je<De;je++)dt.push(null);for(let je=1;je<=ut;je++)dt.push(new Date(z,Z,je));return dt}const Xt=e.computed(()=>$t(be.value,f.value)),te=e.computed(()=>$t(ne.value,fe.value)),Te=e.computed(()=>$t(ue.value,ee.value));e.computed(()=>{const z=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)}),e.computed(()=>{const z=new Date(ue.value,ee.value,1);return new Intl.DateTimeFormat(F.value,{month:"long",year:"numeric"}).format(z)});const Me=e.computed(()=>{const z=new Date(ne.value,fe.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),Ue=e.computed(()=>{const z=new Date(ue.value,ee.value,1);return new Intl.DateTimeFormat(F.value,{month:"long"}).format(z)}),it=e.computed(()=>B.availableDates&&B.availableDates.length>0),Ye=e.computed(()=>it.value?[{id:"all",labelKey:"datepicker.quickSelect.allDates"},{id:"last2",labelKey:"datepicker.quickSelect.last2Dates"},{id:"last3",labelKey:"datepicker.quickSelect.last3Dates"},{id:"last4",labelKey:"datepicker.quickSelect.last4Dates"},{id:"last5",labelKey:"datepicker.quickSelect.last5Dates"}]:[{id:"today",labelKey:"datepicker.quickSelect.today"},{id:"lastWeek",labelKey:"datepicker.quickSelect.lastWeek"},{id:"last15Days",labelKey:"datepicker.quickSelect.last15Days"},{id:"last30Days",labelKey:"datepicker.quickSelect.last30Days"},{id:"thisMonth",labelKey:"datepicker.quickSelect.thisMonth"},{id:"last3Months",labelKey:"datepicker.quickSelect.last3Months"},{id:"last6Months",labelKey:"datepicker.quickSelect.last6Months"},{id:"last12Months",labelKey:"datepicker.quickSelect.last12Months"},{id:"lastYear",labelKey:"datepicker.quickSelect.lastYear"}]),Ge=e.ref({top:0,left:0});function ft(){if(!Ve.value||!T.value)return;const z=Ve.value.getBoundingClientRect(),Z=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let ce=z.left,De=z.bottom+4;const ut=ke.value;if(ut){const dt=ut.offsetWidth,je=ut.offsetHeight;if(ce+dt>Z-8&&(ce=z.right-dt,ce<8&&(ce=8)),De+je>P-8){const wt=z.top-4-je;wt>=8?De=wt:De=Math.max(8,P-je-8)}}Ge.value={top:De,left:ce}}const Ae=e.computed(()=>!Ve.value||!T.value?{}:{position:"fixed",left:`${Ge.value.left}px`,top:`${Ge.value.top}px`,zIndex:1002});function q(z,Z){return!z||!Z?!1:z.getFullYear()===Z.getFullYear()&&z.getMonth()===Z.getMonth()&&z.getDate()===Z.getDate()}function U(z){return new Date(z.getFullYear(),z.getMonth(),z.getDate()).getTime()}function Q(z){return!B.availableDates||!B.availableDates.length?!0:B.availableDates.some(Z=>Z instanceof Date&&q(Z,z))}function ie(z){const Z=U(z);return!(B.minDate instanceof Date&&Z<U(B.minDate)||B.maxDate instanceof Date&&Z>U(B.maxDate))}function Re(z){return!B.exceptDates||!B.exceptDates.length?!1:B.exceptDates.some(Z=>Z instanceof Date&&q(Z,z))}function ct(z){return Re(z)?!1:["singleFromAvailable","rangeFromAvailable"].includes(B.mode)?Q(z):ie(z)}function Et(z){const Z=ae.value,P=Xe.value,ce=U(z),De=ht.value&&P.start&&P.end&&ce>U(P.start)&&ce<U(P.end),ut=ht.value&&P.start&&q(z,P.start),dt=ht.value&&P.end&&q(z,P.end),je=ut&&dt,wt=ge.value&&Z&&q(z,Z)||ut||dt;let Wt=!1;if(ht.value&&P.start&&!P.end&&ye.value){const kl=U(P.start),Zl=U(ye.value),Ml=Math.min(kl,Zl),Ul=Math.max(kl,Zl);Wt=ce>Ml&&ce<Ul}return{"dss-datepicker__day--selected":wt&&!je,"dss-datepicker__day--range-start":ut&&!je,"dss-datepicker__day--range-end":dt&&!je,"dss-datepicker__day--range-single":je,"dss-datepicker__day--in-range":De&&!ut&&!dt,"dss-datepicker__day--in-range-preview":Wt&&!ut&&!dt&&!De,"dss-datepicker__day--disabled":!ct(z)}}function Ie(z){if(!ht.value)return;const Z=Xe.value;if(!Z.start||Z.end){ye.value=null;return}if(!ct(z)){ye.value=null;return}ye.value=new Date(z.getFullYear(),z.getMonth(),z.getDate())}function Ct(){ye.value=null}function It(){if(!B.doubleCalendar||!ht.value)return;const z=Xe.value,{start:Z,end:P}=z;if(Z&&P){const ut=Z<=P?Z:P,dt=Z<=P?P:Z,je=ut.getMonth(),wt=ut.getFullYear(),Wt=dt.getMonth(),kl=dt.getFullYear();if(je!==Wt||wt!==kl){const Zl=fe.value===je&&ne.value===wt,Ml=ee.value===Wt&&ue.value===kl;if(Zl&&Ml)return;fe.value=je,ne.value=wt,ee.value=Wt,ue.value=kl}else{const Zl=je===0?11:je-1,Ml=je===0?wt-1:wt;fe.value===Zl&&ne.value===Ml&&ee.value===je&&ue.value===wt||(fe.value=je,ne.value=wt,je===11?(ee.value=0,ue.value=wt+1):(ee.value=je+1,ue.value=wt))}return}const ce=Z||P;if(ce){const ut=ce.getMonth(),dt=ce.getFullYear(),je=fe.value===ut&&ne.value===dt,wt=ee.value===ut&&ue.value===dt;if(je||wt)return;fe.value=ut,ne.value=dt,ut===11?(ee.value=0,ue.value=dt+1):(ee.value=ut+1,ue.value=dt);return}const De=Oe();fe.value=De.left.month,ne.value=De.left.year,ee.value=De.right.month,ue.value=De.right.year}function Qt(z="start"){if(B.mode==="readonly")return;H.value=z;const Z=ae.value,P=Xe.value;if(ge.value&&Z)f.value=Z.getMonth(),be.value=Z.getFullYear();else if(ht.value)if(B.doubleCalendar)It();else{const ce=z==="start"&&P.start?P.start:P.end||P.start;ce&&(f.value=ce.getMonth(),be.value=ce.getFullYear())}Ve.value=ge.value?ot.value?.closest(".dss-datepicker__input-wrap"):I.value,X.value="days",ve.value=null,T.value=!0,e.nextTick(()=>{ft()})}function qt(){X.value="days",ve.value=null,ye.value=null,T.value=!1}function Ht(z,Z){ve.value=z,X.value=Z}function V(){X.value="days",ve.value=null}function w(z){const Z=new Date,P=Z.getFullYear(),ce=Z.getMonth(),De=Z.getDate();let ut,dt;if(it.value){const je=[...B.availableDates].filter(wt=>wt instanceof Date).map(wt=>new Date(wt.getFullYear(),wt.getMonth(),wt.getDate()));if(je.sort((wt,Wt)=>wt.getTime()-Wt.getTime()),je.length===0)return;if(z==="all")ut=je[0],dt=je[je.length-1];else{const wt=parseInt(z.replace("last",""),10);if(wt<2||wt>5)return;const Wt=je.slice(-wt);ut=Wt[0],dt=Wt[Wt.length-1]}}else{const je=new Date(P,ce,De);switch(z){case"today":ut=je,dt=je;break;case"lastWeek":ut=new Date(P,ce,De-6),dt=je;break;case"last15Days":ut=new Date(P,ce,De-14),dt=je;break;case"last30Days":ut=new Date(P,ce,De-29),dt=je;break;case"thisMonth":ut=new Date(P,ce,1),dt=je;break;case"last3Months":ut=new Date(P,ce-3,1),dt=new Date(P,ce,0);break;case"last6Months":ut=new Date(P,ce-6,1),dt=new Date(P,ce,0);break;case"last12Months":ut=new Date(P,ce-12,1),dt=new Date(P,ce,0);break;case"lastYear":ut=new Date(P-1,0,1),dt=new Date(P-1,11,31);break;default:return}}$("update:modelValue",{start:ut,end:dt}),It()}function S(z){ve.value==="left"?fe.value=z:ve.value==="right"?ee.value=z:f.value=z,V()}function j(z){ve.value==="left"?ne.value=z:ve.value==="right"?ue.value=z:be.value=z,V()}function G(){f.value===0?(f.value=11,be.value--):f.value--}function Ze(){f.value===11?(f.value=0,be.value++):f.value++}function vt(){fe.value===0?(fe.value=11,ne.value--):fe.value--}function Se(){fe.value===11?(fe.value=0,ne.value++):fe.value++}function Ne(){ee.value===0?(ee.value=11,ue.value--):ee.value--}function At(){ee.value===11?(ee.value=0,ue.value++):ee.value++}function Dt(z){if(!ct(z))return;const Z=new Date(z.getFullYear(),z.getMonth(),z.getDate());if(ge.value){$("update:modelValue",Z),qt();return}const P=Xe.value;if(!P.start&&!P.end){$("update:modelValue",{start:Z,end:null}),H.value="end";return}if(P.start&&P.end){$("update:modelValue",{start:Z,end:null}),H.value="end";return}if(H.value==="start"){let ce=Z,De=P.end;ce&&De&&ce>De&&([ce,De]=[De,ce]),$("update:modelValue",{start:ce||De,end:De||ce}),H.value="end"}else{let ce=P.start,De=Z;ce&&De&&De<ce&&([ce,De]=[De,ce]),$("update:modelValue",{start:ce||De,end:De||ce}),H.value="start"}}e.watch(Xe,()=>{B.doubleCalendar&&ht.value&&T.value&&It()},{deep:!0});let et=null,tt=null,Lt=null;function fl(){et&&(document.removeEventListener("keydown",et),et=null),tt&&(window.removeEventListener("resize",tt),tt=null),Lt&&(window.removeEventListener("scroll",Lt,!0),Lt=null)}return e.watch(X,z=>{z==="years"&&e.nextTick(()=>{pt.value?.querySelector(`[data-year="${st.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(T,z=>{fl(),z&&(et=Z=>{Z.key==="Escape"&&(X.value==="years"||X.value==="months"?V():qt())},tt=()=>{ft()},Lt=()=>{ft()},document.addEventListener("keydown",et),window.addEventListener("resize",tt),window.addEventListener("scroll",Lt,!0))}),e.onBeforeUnmount(()=>{fl()}),(z,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":_.mode==="readonly"}])},[_.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",ca,[Z[10]||(Z[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:tl.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ua)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:Z[0]||(Z[0]=P=>Qt("start"))},[Z[11]||(Z[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:ot,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(se)("datepicker.selectDate"),value:rt.value,readonly:"",disabled:_.mode==="readonly"},null,8,da)])):ht.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:I,onClick:Z[1]||(Z[1]=P=>Qt("start"))},[Z[12]||(Z[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:qe,type:"text",class:"dss-datepicker__input",placeholder:B.placeholder||e.unref(se)("datepicker.selectRange"),value:Tt.value,readonly:""},null,8,ma)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(qt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ke,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":_.doubleCalendar&&ht.value&&X.value==="days","dss-datepicker__dropdown--quick-select":_.doubleCalendar&&ht.value&&X.value==="days"&&_.quickSelect}]),onClick:Z[9]||(Z[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ae.value)},[X.value==="days"&&_.doubleCalendar&&ht.value?(e.openBlock(),e.createElementBlock("div",pa,[_.quickSelect?(e.openBlock(),e.createElementBlock("nav",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ce=>w(P.id)},e.toDisplayString(e.unref(se)(P.labelKey)),9,va))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:vt}," ‹ ",8,ka),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[2]||(Z[2]=P=>Ht("left","months"))},e.toDisplayString(Me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[3]||(Z[3]=P=>Ht("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Se}," › ",8,ba)]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(te.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>Dt(P),onMouseenter:De=>Ie(P),onMouseleave:Ct},e.toDisplayString(P.getDate()),43,Ea)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])]),e.createElementVNode("div",Va,[e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:Ne}," ‹ ",8,Ba),e.createElementVNode("div",Ma,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[4]||(Z[4]=P=>Ht("right","months"))},e.toDisplayString(Ue.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[5]||(Z[5]=P=>Ht("right","years"))},e.toDisplayString(ue.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:At}," › ",8,_a)]),e.createElementVNode("div",$a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>Dt(P),onMouseenter:De=>Ie(P),onMouseleave:Ct},e.toDisplayString(P.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",Aa))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.prevMonth"),onClick:G}," ‹ ",8,Ha),e.createElementVNode("div",Ra,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[6]||(Z[6]=P=>X.value="months")},e.toDisplayString(Vt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[7]||(Z[7]=P=>X.value="years")},e.toDisplayString(be.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(se)("datepicker.nextMonth"),onClick:Ze}," › ",8,Ia)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,(P,ce)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ce},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Et(P)]),disabled:!ct(P),onClick:De=>Dt(P),onMouseenter:De=>Ie(P),onMouseleave:Ct},e.toDisplayString(P.getDate()),43,Pa)):(e.openBlock(),e.createElementBlock("span",Oa))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",qa,[e.createElementVNode("div",Wa,[e.createElementVNode("span",Za,e.toDisplayString(ll.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:Z[8]||(Z[8]=P=>X.value="years")},e.toDisplayString(st.value),1)])]),e.createElementVNode("div",Ua,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(P,ce)=>(e.openBlock(),e.createElementBlock("button",{key:ce,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ce===Ft.value}]),onClick:De=>S(ce)},e.toDisplayString(P),11,Xa))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ya,[e.createElementVNode("span",ja,e.toDisplayString(Je.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:pt},[e.createElementVNode("div",Ka,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Gt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===st.value,"dss-datepicker__year-cell--current":P===e.unref(kt)}]),"data-year":P,onClick:ce=>j(P)},e.toDisplayString(P),11,Ga))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Qa=["data-chart-type"],Ja={class:"dss-chart-header-titles"},es={key:0,class:"dss-chart-title"},ts={key:1,class:"dss-chart-subtitle"},ls=["onClick","onMouseenter"],ns={class:"dss-legend-text"},os=["onClick","onMouseenter"],as={class:"dss-legend-text"},ss=["title"],rs=["src"],is={class:"dss-chart-area-wrapper"},cs={key:0,class:"dss-chart-z-axis-label"},us=["width","height","data-smooth","data-animated"],ds=["id"],ms=["y","width","height"],ps=["id"],fs=["d"],vs=["id"],gs=["d"],hs={key:0},ys=["clip-path"],ks=["x1","x2","y1","y2"],Cs={class:"dss-axes"},bs=["x1","x2","y1","y2"],ws=["x1","x2","y1","y2"],xs={class:"dss-axis-labels"},Es=["x","y"],Ss=["x","y"],Vs=["x","y"],Ns=["y","transform"],Bs={key:1,class:"dss-flag-markers"},Ms=["clip-path"],_s=["x1","x2","y1","y2","onMouseover"],$s=["x1","x2","y1","y2","onMouseover"],Ls=["x1","x2","y1","y2","onMouseover"],Ts=["cx","cy","onMouseover"],As=["cx","cy","fill","onMouseover"],Ds=["x","y"],Hs=["clip-path"],Rs={key:0},Is=["d","onMouseover"],Fs=["x","y","width","height","fill","onMouseover"],zs={class:"dss-line-chart"},Ps=["d","stroke","stroke-width"],Os=["d","stroke","stroke-width","opacity"],qs=["cx","cy","r","fill","onMouseover"],Ws={key:1},Zs=["d","stroke","stroke-width"],Us=["d","stroke","stroke-width"],Xs=["d","stroke","stroke-width","opacity"],Ys=["cx","cy","r","fill","onMouseover"],js={key:2},Ks=["id"],Gs=["x","y","width","height"],Qs=["d","fill","fill-opacity","mask"],Js=["d","stroke","stroke-width"],er=["d","fill","onMouseover"],tr=["x","y","width","height","onMouseover"],lr=["clip-path"],nr=["x1","x2","y1","y2","stroke"],or=["cx","cy","r","fill"],ar={key:1,class:"dss-bubble-chart"},sr={key:0,class:"dss-bubble-group"},rr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],ir=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],cr=["transform"],ur=["cx","cy","r"],dr=["data-chart-type","clip-path"],mr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],pr={key:1,class:"dss-radial-segment-data-labels"},fr=["x","y"],vr=["x","y","font-size","fill"],gr=["x1","y1","x2","y2","stroke"],hr=["x1","y1","x2","y2","stroke"],yr=["x","y","text-anchor","font-size"],kr=["transform"],Cr={key:0,class:"dss-spider-grid"},br=["cx","cy","r"],wr={class:"dss-spider-grid-labels"},xr=["x","y"],Er=["x","y"],Sr=["x1","x2","y1","y2"],Vr={class:"dss-spider-labels"},Nr=["x","y","text-anchor","dominant-baseline"],Br=["points","fill","fill-opacity","stroke","stroke-width"],Mr=["cx","cy","r","fill","onMouseover"],_r={class:"dss-chart-logos"},$r=["cx","cy","r","fill"],Lr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Tr=["onClick","onMouseenter"],Ar=["src"],Dr={class:"dss-marker-tooltip-category"},Hr={key:0,class:"dss-marker-tooltip-description"},Rr={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},Ir={class:"dss-tooltip-title dss-spider-tooltip-area-title"},Fr={class:"dss-tooltip-series-name"},zr={class:"dss-tooltip-series-value"},Pr={key:1,class:"dss-tooltip-section"},Or={key:0,class:"dss-tooltip-title"},qr={class:"dss-bubble-tooltip-data"},Wr={key:2,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-title"},Ur={class:"dss-tooltip-value"},Xr={key:0,class:"dss-tooltip-section"},Yr={class:"dss-tooltip-section-title"},jr={class:"dss-tooltip-group-header"},Kr={class:"dss-tooltip-item-content"},Gr={class:"dss-tooltip-item-text"},Qr={key:1,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-item-content"},ti={class:"dss-tooltip-item-title"},li={key:0,class:"dss-tooltip-item-description"},ni={class:"dss-tooltip-section"},oi={class:"dss-tooltip-title"},ai={key:0,class:"dss-bubble-tooltip-data"},si={class:"dss-tooltip-series-name"},ri={class:"dss-tooltip-series-value"},ii={key:0,class:"dss-tooltip-section"},ci={class:"dss-tooltip-section-title"},ui={class:"dss-tooltip-group-header"},di={class:"dss-tooltip-item-content"},mi={class:"dss-tooltip-item-text"},pi={key:1,class:"dss-tooltip-section"},fi={class:"dss-tooltip-section-title"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-title"},hi={key:0,class:"dss-tooltip-item-description"},yi=["onClick","onMouseenter"],ki={class:"dss-legend-text"},Ci={key:1,class:"dss-context-menu-separator"},bi={key:0,class:"dss-context-menu-separator"},wi={key:0,class:"dss-context-menu-separator"},xi=["onClick"],Ei=["innerHTML"],Si={key:0,class:"dss-context-menu-icon"},Vi={class:"dss-marker-modal-header"},Ni={class:"dss-marker-modal-body"},Bi={class:"dss-form-group"},Mi={class:"dss-form-group"},_i={for:"dss-marker-description"},$i={key:0,class:"dss-form-text-display"},Li=["placeholder"],Ti={class:"dss-marker-modal-footer"},Ai={class:"modal-footer-left"},Di={class:"dss-modal-footer-right"},Hi=["disabled"],Ri={name:"DSSChart"},Ii=Object.assign(Ri,{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:_=>typeof _=="object"&&_!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(_,{emit:J}){const{t:B,locale:$}=Gn.useI18n(),se=J,F=e.ref(null),T=e.ref(null),X=e.ref(null),Qe=e.ref(0),pe=e.ref(0);let f=null,be=null;const fe=20,ne=e.computed(()=>{if(pe.value,Qe.value,!F.value||!T.value)return 0;try{const t=F.value.getBoundingClientRect();return T.value.getBoundingClientRect().top-t.top}catch{return 0}}),ee=e.computed(()=>`chart-clip-${H.chartId}`),ue=e.computed(()=>`url(#${ee.value})`),H=_,ye={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},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 ve(t,s){const l=Object.assign({},t);return ot(t)&&ot(s)&&Object.keys(s).forEach(i=>{ot(s[i])?i in t?l[i]=ve(t[i],s[i]):Object.assign(l,{[i]:s[i]}):Object.assign(l,{[i]:s[i]})}),l}const Oe=()=>{let t=20,s=0,l=0;if($e.value&&(t+=30),rt.value&&(t+=25),Je.value&&H.series.length>0){const i=H.series.filter((p,g)=>!Pt.value.has(g)).length;if(lt.value==="top"||lt.value==="bottom"){if($t.value==="horizontal"){const g=Math.floor(ke.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 ot(t){return t&&typeof t=="object"&&!Array.isArray(t)}const I=e.computed(()=>ve(ye,H.options)),qe=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.width==="auto"}),Ve=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=I.value;return qe.value?Qe.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),pt=e.ref(fe),kt=e.computed(()=>{if(Ve.value){const t=kt.value;return t??Math.max(0,(pe.value||400)-pt.value*5)}}),ge=e.computed(()=>{const t=I.value;if(ae.value==="mini-radial")return ke.value;if(Ve.value){const s=kt.value;return s??Math.max(0,(pe.value||400)-pt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ht=e.computed(()=>{if(Ve.value&&ae.value==="semi-radial"&&kt.value!=null)return pt.value+ge.value+"px";if(Ve.value)return"100%";if(vl.value)return pt.value+ge.value+"px";if(Je.value&<.value==="bottom"){const t=Oe();return ge.value+(t.legendHeight||35)+"px"}return ge.value+(Je.value?20:0)+"px"}),ae=e.computed(()=>{const t=I.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Xe=e.computed(()=>{const t=H.series.map(s=>s.type||ae.value);return new Set(t).size>1}),$e=e.computed(()=>{const t=I.value;return t&&t.title&&t.title.text?t.title.text:""}),rt=e.computed(()=>{const t=I.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Tt=e.computed(()=>{const t=I.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),tl=e.computed(()=>{const t=I.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ft=e.computed(()=>{const t=I.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),st=e.computed(()=>{const t=I.value;if(!t||!t.yAxis)return sn;const s=t.yAxis.min;return typeof s=="number"||s===sn?s:sn}),Vt=e.computed(()=>{const t=I.value;if(!t||!t.yAxis)return sn;const s=t.yAxis.max;return typeof s=="number"||s===sn?s:sn}),ll=e.computed(()=>{const t=I.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),zt=e.computed(()=>{const t=I.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Gt=e.computed(()=>{const t=I.value;return t&&t.grid&&t.grid.show!==!1}),Je=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.show!==!1}),lt=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),$t=e.computed(()=>{const t=I.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Xt=e.computed(()=>{const t=I.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),te=e.computed(()=>{const t=I.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),Te=e.computed(()=>{const t=I.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Me=e.computed(()=>{const t=I.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Ue=e.computed(()=>{const t=I.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),it=e.computed(()=>{const t=I.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ye=e.computed(()=>{const t=I.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ge=e.computed(()=>{if(!vl.value)return 0;const t=I.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ft=e.computed(()=>{const t=I.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ae=e.computed(()=>{const{maxX:t}=jt.value;return t===0}),q=(t,s)=>Ae.value&&s===0?5:s,U=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},Q=e.computed(()=>{const t=I.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ie=e.computed(()=>{const t=I.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),Re=e.computed(()=>{const t=I.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),ct=e.computed(()=>{const t=I.value;return ie.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),Et=e.computed(()=>{const t=I.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ie=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.enabled!==!1}),Ct=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),It=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Qt=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),qt=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Ht=e.computed(()=>{const t=I.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),V=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.onDataChange!==!1}),w=e.computed(()=>{const t=I.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),S=e.computed(()=>{const t=I.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),j=e.computed(()=>I.value?.spider?.gridSteps||5),G=e.computed(()=>{const t=[],s=j.value;for(let l=1;l<=s;l++)t.push(xt.value/s*l);return t}),Ze=t=>{const s=vt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const l=G.value[t];return Math.round(l/xt.value*100)+"%"},vt=e.computed(()=>I.value?.spider?.gridLabels||null),Se=e.computed(()=>{const t=I.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ne=e.computed(()=>{const t=I.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),At=e.computed(()=>{const t=I.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Dt=e.computed(()=>{const t=I.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Zl.value}),et=e.computed(()=>{const t=I.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),tt=e.computed(()=>{const t=I.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Lt=e.computed(()=>{const s=I.value?.valueFormat?.extension;return typeof s=="string"?s:""}),fl=t=>{const s=Lt.value;if(t==null)return"";const l=String(t);return s?l+s:l},z=e.computed(()=>!oe.value.isZooming);e.computed(()=>nt.value.map(t=>{if(t.categoryIndex!==void 0&&(xl.value||al.value)){const s=sl(t.categoryIndex),l=ne.value+O.value.bottom-tt.value/2;return{...t,x:s,y:l}}return t}));function Z(t,s){let l;if(t instanceof Date)l=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,b,C]=t.split("-"),D=Number(C?.length===2?`20${C}`:C);l=new Date(D,Number(b)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,b)=>{const[C,D,L]=g.split("-"),R=Number(L?.length===2?`20${L}`:L),N=new Date(R,Number(D)-1,Number(C)),K=Math.abs(N-l);K<p&&(p=K,i=b)}),i}const P=e.computed(()=>{const t=H.markers.map(l=>{const i=Z(l.marker_date,H.categories),p=sl(i),g=ne.value+O.value.bottom-tt.value/2;return{...l,x:p,y:g,categoryIndex:i,source:"props"}}),s=nt.value.map(l=>{if(l.categoryIndex!==void 0&&(xl.value||al.value)){const i=sl(l.categoryIndex),p=ne.value+O.value.bottom-tt.value/2;return{...l,x:i,y:p,source:"internal"}}return{...l,source:"internal"}});return[...t,...s]}),ce=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.enabled===!0}),De=e.computed(()=>{const t=I.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),ut=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),dt=e.computed(()=>{const t=I.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),je=e.computed(()=>{const t={left:O.value.left,top:O.value.top,width:O.value.width,height:O.value.height};let s,l;const i=String(ut.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,l=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),l=s*(96/499)}return{width:s,height:l,area:t}}),wt=e.computed(()=>{const{width:t,height:s}=je.value,l=dt.value;let i,p;const g=O.value.left,b=O.value.right,C=O.value.top,D=O.value.bottom,L=O.value.width,R=O.value.height;switch(l){case"center":i=g+(L-t)/2,p=C+(R-s)/2;break;case"top-left":i=g+15,p=C+5;break;case"top-right":i=b-t-15,p=C+5;break;case"bottom-left":i=g+15,p=D-s-5;break;case"bottom-right":default:i=b-t-15,p=D-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),Wt=t=>!H.flags||!H.flags.length?[]:H.flags.filter(s=>s.categoryIndex===t),kl=t=>{const s=Wt(t),l=Hn(t),i=s.filter(b=>b.manual),p=s.filter(b=>!b.manual),g=[];return i.length>0&&g.push({type:B("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(b=>({text:b.text,color:"#698dbe"}))}),p.length>0&&g.push({type:B("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(b=>({text:b.text,color:"#a1d499"}))}),{flagGroups:g,markers:l.map(b=>({title:b.title,description:b.description,type:B("chart.tooltip.markers"),color:b.color||"#9784ba"}))}},Zl=e.computed(()=>{const t=H.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,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Ul=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),hn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=I.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const yn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),xn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),qn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Wn=e.computed(()=>{const s=I.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),to=e.computed(()=>{const s=I.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),En=e.computed(()=>{const s=I.value?.radialBar?.dataCenter;return Bn.value?!0:zl.value&&s&&(s.show===!0||s.enabled===!0)}),Sn=e.computed(()=>{if(!En.value||!n.value.length)return"";if(Bn.value){const i=n.value[1]??n.value[0];return fl(i?.value??0)}const l=I.value?.radialBar?.dataCenter?.showValueOnly===!0?n.value[0]?.value??0:n.value.reduce((i,p)=>i+(p.value??0),0);return fl(l)}),Rl=e.computed(()=>{const s=I.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Xl=e.computed(()=>({x:_t.value,y:Bn.value?Mt.value:Mt.value-Rl.value/2})),bl=e.computed(()=>{const s=I.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Vl=e.computed(()=>{if(!Wn.value||!vl.value||!n.value.length)return[];const t=to.value*Math.PI/180,s=(il.value+
|
|
45
|
-
`)}})}),Il=e.ref({show:!1,x:0,y:0,content:"",count:0}),Tn=e.computed(()=>I.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),An=e.computed(()=>{const t=I.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Vn=e.computed(()=>I.value?.bubbles?.tooltip?.formatters||{}),Pt=e.ref(new Set),be=e.ref(null),El=e.ref(!1),at=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Nt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),xe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Ct=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),oe=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),nt=e.ref([]),Fe=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 et.value&&t.push(...Object.keys(et.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=jt.value;return Array.from({length:t+1},(s,l)=>B("chart.fallback.item",{number:l+1}))}return H.categories});const Dn=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),Fl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),Yl=e.computed(()=>Fe.value.editingMarkerId!==null),Cl=e.computed(()=>Fe.value.readonly),Nn=t=>{Pt.value.has(t)||(mo.value=!0,be.value=t)},un=()=>{mo.value=!1,be.value=null},jl=t=>{if($n.value||On.value){xe.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=al.value?i>=O.value.left-50&&i<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:i>=O.value.left&&i<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(El.value=g,al.value){if(!te.value||!g||oe.value.isDragging||oe.value.isZooming){xe.value.show=!1;return}if(Pn.value.find(se=>!se||se.isHidden?!1:Math.sqrt(Math.pow(se.x-i,2)+Math.pow(se.y-p,2))<=se.radius+3))xe.value.show=!1;else{const se=Pn.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(se.length>0){let ye=se[0],Be=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));se.forEach(Pe=>{const Le=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Le<Be&&(Be=Le,ye=Pe)});const ue=30,Ke=Pn.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-ye.x)<=ue).sort((Pe,Le)=>Pe.y-Le.y);xe.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Pe=Tn.value,Le=An.value,$e=[];return Ke.forEach(He=>{Pe.forEach(St=>{const Ht=Le[St]||St,ql=h(St,He);ql&&$e.push({seriesName:He.seriesName,label:He.label,value:`${Ht}: ${ql}`,color:He.color,y:He.y})})}),$e})()}}else xe.value.show=!1}return}if(oe.value.isDragging&&oe.value.scale>1&&xl.value&&Me.value){xe.value.show=!1;const We=t.clientX-oe.value.lastMouseX,{minX:se,maxX:ye}=jt.value,Be=ye-se||1,Ke=We*.8;oe.value.offsetX+=Ke;const Pe=Be/oe.value.scale,Le=Be-Pe,$e=0,He=-Le/Be*O.value.width,St=$e;oe.value.offsetX=Math.max(He,Math.min(St,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY;return}if(!te.value||!xl.value||oe.value.isDragging||oe.value.isZooming||!g){xe.value.show=!1;return}const{minX:b,maxX:C}=jt.value,D=C-b||1,L=D/oe.value.scale,R=b-oe.value.offsetX/O.value.width*D,N=(i-O.value.left)/O.value.width,K=R+N*L,Ee=Math.round(K);if(Ee>=0&&Ee<=C){const We=sl(Ee),se=Cn.value.map((ye,Be)=>{const ue=H.series.findIndex(Pe=>Pe===ye),Ke=ye.data[Ee];return{seriesName:ye.name,value:Ke!==void 0?Ke:null,color:Ut(ue),y:Ke!==void 0?hl(Ke):null}}).filter(ye=>ye.value!==null);xe.value={show:!0,x:We,categoryIndex:Ee,data:se}}},wl=()=>{xe.value.show=!1,El.value=!1,On.value=!1,$n.value||(Il.value.show=!1),oe.value.isDragging&&(oe.value.isDragging=!1),oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1,setTimeout(()=>{be.value=null,at.value.show=!1},150)},en=t=>{if(t.preventDefault(),t.stopPropagation(),!Ve.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(vl.value){Ct.value.show=!1,e.nextTick(()=>{Ct.value.show=!0,Ct.value.x=t.clientX,Ct.value.y=t.clientY,Ct.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,b=O.value.top,C=O.value.bottom+80;l>=p&&l<=g&&i>=b&&i<=C&&(Ct.value.show=!1,e.nextTick(()=>{Ct.value.show=!0,Ct.value.x=t.clientX,Ct.value.y=t.clientY,Ct.value.categoryIndex=null;const D=Math.max(O.value.left,Math.min(l,O.value.right))-O.value.left,R=O.value.width/bn.value.length,N=Math.floor(D/R);N>=0&&N<bn.value.length&&(Ct.value.categoryIndex=N)}))},Ot=t=>{if(!(t&&t.button===2)){if(Ct.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}Ct.value.show=!1}},Nl=t=>{if(typeof t.template=="function"){const s={series:H.series,categories:H.categories,markers:nt.value},l={chartX:Ct.value.chartX,chartY:Ct.value.chartY,dataX:Ct.value.mouseDataX,dataY:Ct.value.mouseDataY,categoryIndex:Ct.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Zn=t=>t.style||{},tn=t=>t.type&&et.value[t.type]?et.value[t.type]:t.customIcon?t.customIcon:At.value,Zt=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Hn=t=>nt.value.length?nt.value.filter(s=>s.categoryIndex===t):[],Rn=t=>{if(!xl.value&&!al.value)return{x:0,y:0};const s=sl(t),l=ne.value+O.value.bottom-tt.value/2;return{x:s,y:l}},k=()=>{nt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xl.value||al.value)){const s=Rn(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(Fe.value.description&&Fe.value.description.length&&Fe.value.date){if(Yl.value){const t=nt.value.findIndex(s=>s.id===Fe.value.editingMarkerId);t!==-1?(nt.value[t].description=Fe.value.description||"",nt.value[t].color=Fe.value.color||"",nt.value[t].type=Fe.value.type||"default",ae("update-marker",nt.value[t])):ae("update-marker",{id:Fe.value.editingMarkerId,description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Z(Fe.value.date,H.categories||[]);if(al.value){const{maxX:b}=jt.value;s=Math.max(0,Math.min(s,Math.floor(b)))}else xl.value&&(s=Math.max(0,Math.min(s,jt.value.maxX)));const l=sl(s),i=ne.value+O.value.bottom-tt.value/2,p=Array.isArray(H.categories)?H.categories[s]:null,g={id:t,title:"",description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:p||null};Fe.value.categoryIndex=s,nt.value.push(g),ae("add-marker",g)}x(),mt()}},x=()=>{Fe.value.show=!1,Fe.value.title="",Fe.value.description="",Fe.value.color="#FF6B6B",Fe.value.type="default",Fe.value.editingMarkerId=null,Fe.value.readonly=!1,Fe.value.categoryIndex=null,Fe.value.fromButton=!1,Fe.value.date=null},W=()=>{Yl.value&&(me(Fe.value.editingMarkerId),x())},me=t=>{const s=nt.value.findIndex(l=>l.id===t);s!==-1&&(nt.value.splice(s,1),mt()),ae("delete-marker",t)},Bt=t=>{if(Fe.value.show=!0,Fe.value.title=t?.title??t?.comment??"",Fe.value.description=t?.description??t?.comment??"",Fe.value.color=t?.color??"",Fe.value.type=t?.type??"default",Fe.value.editingMarkerId=t?.id??t?.marker_id??null,Fe.value.readonly=t?.readonly??!1,Fe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;g&&l&&p?Fe.value.date=new Date(p,b,g):Fe.value.date=null}else Fe.value.date=null},mt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(nt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Jt=()=>{try{const t=`dss-chart-markers-${H.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(nt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),nt.value=[]}},nl=t=>{const s=Ye.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}`},rl=()=>{const t=xe.value.show,s=at.value.show;return xe.value.show=!1,at.value.show=!1,{originalCrosshair:t,originalTooltip:s}},ol=t=>{xe.value.show=t.originalCrosshair,at.value.show=t.originalTooltip},Kl=async(t,s=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(b);try{const C=document.createElement("canvas"),D=C.getContext("2d");C.width=s,C.height=l,D.fillStyle="#fafafa",D.fillRect(0,0,s,l),D.drawImage(g,0,0,s,l);const L=C.toDataURL("image/png");i(L)}catch(C){console.warn("Canvas conversion failed:",C),i(t)}},g.onerror=C=>{clearTimeout(b),console.warn("Failed to load image:",t,C),i(t)},g.src=t}),dn=async()=>{try{const t=rl();setTimeout(async()=>{try{const s=T.value;if(!s){console.error("Chart SVG element not found"),ol(t);return}const l=Oe(),i=Ce.value,p=ge.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(ue=>ue.remove());const C=g.querySelectorAll("image"),D=Array.from(C).map(async ue=>{const Ke=ue.getAttribute("xlink:href")||ue.getAttribute("href");if(Ke&&!Ke.startsWith("data:"))try{const Pe=await Kl(Ke,32,32);ue.setAttribute("xlink:href",Pe),ue.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(D);const R=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let N="",K=30;if(Ye.value&&(N+=`
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Ul=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),hn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=I.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const yn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),xn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),qn=e.computed(()=>{const t=I.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Wn=e.computed(()=>{const s=I.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),to=e.computed(()=>{const s=I.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),En=e.computed(()=>{const s=I.value?.radialBar?.dataCenter;return Bn.value?!0:zl.value&&s&&(s.show===!0||s.enabled===!0)}),Sn=e.computed(()=>{if(!En.value||!n.value.length)return"";if(Bn.value){const i=n.value[1]??n.value[0];return fl(i?.value??0)}const l=I.value?.radialBar?.dataCenter?.showValueOnly===!0?n.value[0]?.value??0:n.value.reduce((i,p)=>i+(p.value??0),0);return fl(l)}),Rl=e.computed(()=>{const s=I.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Xl=e.computed(()=>({x:_t.value,y:Bn.value?Mt.value:Mt.value-Rl.value/2})),bl=e.computed(()=>{const s=I.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Vl=e.computed(()=>{if(!Wn.value||!vl.value||!n.value.length)return[];const t=to.value*Math.PI/180,s=(il.value+xt.value)/2;return n.value.map(l=>{const p=l.endAngle-l.startAngle>=t&&!l.isHidden,g=_t.value+Math.cos(l.midAngle)*s,b=Mt.value+Math.sin(l.midAngle)*s;return{value:fl(l.value),x:g,y:b,show:p,color:l.color,contrastColor:Fo(l.color)}})}),$l=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.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=sl(s),p=l.filter(b=>b.manual),g=l.filter(b=>!b.manual);return{categoryIndex:parseInt(s),x:i,flags:l,manualCount:p.length,autoCount:g.length,totalCount:l.length,hasManual:p.length>0,hasAuto:g.length>0,texts:l.map(b=>b.text).join(`
|
|
45
|
+
`)}})}),Il=e.ref({show:!1,x:0,y:0,content:"",count:0}),Tn=e.computed(()=>I.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),An=e.computed(()=>{const t=I.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Vn=e.computed(()=>I.value?.bubbles?.tooltip?.formatters||{}),Pt=e.ref(new Set),Ce=e.ref(null),El=e.ref(!1),at=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Nt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),we=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),bt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),oe=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),nt=e.ref([]),Fe=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 et.value&&t.push(...Object.keys(et.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=jt.value;return Array.from({length:t+1},(s,l)=>B("chart.fallback.item",{number:l+1}))}return H.categories});const Dn=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),Fl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[s,l,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;return!g||!l||!p?null:new Date(p,b,g)}),Yl=e.computed(()=>Fe.value.editingMarkerId!==null),Cl=e.computed(()=>Fe.value.readonly),Nn=t=>{Pt.value.has(t)||(mo.value=!0,Ce.value=t)},un=()=>{mo.value=!1,Ce.value=null},jl=t=>{if($n.value||On.value){we.value.show=!1;return}const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top,g=al.value?i>=O.value.left-50&&i<=O.value.right+50&&p>=O.value.top-50&&p<=O.value.bottom+100:i>=O.value.left&&i<=O.value.right&&p>=O.value.top&&p<=O.value.bottom;if(El.value=g,al.value){if(!te.value||!g||oe.value.isDragging||oe.value.isZooming){we.value.show=!1;return}if(Pn.value.find(re=>!re||re.isHidden?!1:Math.sqrt(Math.pow(re.x-i,2)+Math.pow(re.y-p,2))<=re.radius+3))we.value.show=!1;else{const re=Pn.value.filter(he=>!he||he.isHidden?!1:Math.sqrt(Math.pow(he.x-i,2)+Math.pow(he.y-p,2))<=250);if(re.length>0){let he=re[0],Be=Math.sqrt(Math.pow(he.x-i,2)+Math.pow(he.y-p,2));re.forEach(Pe=>{const Le=Math.sqrt(Math.pow(Pe.x-i,2)+Math.pow(Pe.y-p,2));Le<Be&&(Be=Le,he=Pe)});const de=30,Ke=Pn.value.filter(Pe=>!Pe||Pe.isHidden?!1:Math.abs(Pe.x-he.x)<=de).sort((Pe,Le)=>Pe.y-Le.y);we.value={show:!0,x:he.x,categoryIndex:Math.round(he.originalX),data:(()=>{const Pe=Tn.value,Le=An.value,_e=[];return Ke.forEach(He=>{Pe.forEach(St=>{const Rt=Le[St]||St,ql=h(St,He);ql&&_e.push({seriesName:He.seriesName,label:He.label,value:`${Rt}: ${ql}`,color:He.color,y:He.y})})}),_e})()}}else we.value.show=!1}return}if(oe.value.isDragging&&oe.value.scale>1&&xl.value&&Me.value){we.value.show=!1;const We=t.clientX-oe.value.lastMouseX,{minX:re,maxX:he}=jt.value,Be=he-re||1,Ke=We*.8;oe.value.offsetX+=Ke;const Pe=Be/oe.value.scale,Le=Be-Pe,_e=0,He=-Le/Be*O.value.width,St=_e;oe.value.offsetX=Math.max(He,Math.min(St,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY;return}if(!te.value||!xl.value||oe.value.isDragging||oe.value.isZooming||!g){we.value.show=!1;return}const{minX:b,maxX:C}=jt.value,D=C-b||1,L=D/oe.value.scale,R=b-oe.value.offsetX/O.value.width*D,N=(i-O.value.left)/O.value.width,K=R+N*L,xe=Math.round(K);if(xe>=0&&xe<=C){const We=sl(xe),re=Cn.value.map((he,Be)=>{const de=H.series.findIndex(Pe=>Pe===he),Ke=he.data[xe];return{seriesName:he.name,value:Ke!==void 0?Ke:null,color:Ut(de),y:Ke!==void 0?hl(Ke):null}}).filter(he=>he.value!==null);we.value={show:!0,x:We,categoryIndex:xe,data:re}}},wl=()=>{we.value.show=!1,El.value=!1,On.value=!1,$n.value||(Il.value.show=!1),oe.value.isDragging&&(oe.value.isDragging=!1),oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1,setTimeout(()=>{Ce.value=null,at.value.show=!1},150)},en=t=>{if(t.preventDefault(),t.stopPropagation(),!Se.value)return;const s=t.currentTarget.getBoundingClientRect(),l=t.clientX-s.left,i=t.clientY-s.top;if(vl.value){bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null});return}const p=Math.max(0,O.value.left-20),g=O.value.right,b=O.value.top,C=O.value.bottom+80;l>=p&&l<=g&&i>=b&&i<=C&&(bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null;const D=Math.max(O.value.left,Math.min(l,O.value.right))-O.value.left,R=O.value.width/bn.value.length,N=Math.floor(D/R);N>=0&&N<bn.value.length&&(bt.value.categoryIndex=N)}))},Ot=t=>{if(!(t&&t.button===2)){if(bt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}bt.value.show=!1}},Nl=t=>{if(typeof t.template=="function"){const s={series:H.series,categories:H.categories,markers:nt.value},l={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:bt.value.categoryIndex};return t.template(s,l)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},Zn=t=>t.style||{},tn=t=>t.type&&et.value[t.type]?et.value[t.type]:t.customIcon?t.customIcon:Dt.value,Zt=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Hn=t=>nt.value.length?nt.value.filter(s=>s.categoryIndex===t):[],Rn=t=>{if(!xl.value&&!al.value)return{x:0,y:0};const s=sl(t),l=ne.value+O.value.bottom-tt.value/2;return{x:s,y:l}},k=()=>{nt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(xl.value||al.value)){const s=Rn(t.categoryIndex);t.x=s.x,t.y=s.y}})},y=()=>{if(Fe.value.description&&Fe.value.description.length&&Fe.value.date){if(Yl.value){const t=nt.value.findIndex(s=>s.id===Fe.value.editingMarkerId);t!==-1?(nt.value[t].description=Fe.value.description||"",nt.value[t].color=Fe.value.color||"",nt.value[t].type=Fe.value.type||"default",se("update-marker",nt.value[t])):se("update-marker",{id:Fe.value.editingMarkerId,description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Z(Fe.value.date,H.categories||[]);if(al.value){const{maxX:b}=jt.value;s=Math.max(0,Math.min(s,Math.floor(b)))}else xl.value&&(s=Math.max(0,Math.min(s,jt.value.maxX)));const l=sl(s),i=ne.value+O.value.bottom-tt.value/2,p=Array.isArray(H.categories)?H.categories[s]:null,g={id:t,title:"",description:Fe.value.description||"",color:Fe.value.color||"",type:Fe.value.type||"default",categoryIndex:s,x:l,y:i,marker_date:p||null};Fe.value.categoryIndex=s,nt.value.push(g),se("add-marker",g)}x(),mt()}},x=()=>{Fe.value.show=!1,Fe.value.title="",Fe.value.description="",Fe.value.color="#FF6B6B",Fe.value.type="default",Fe.value.editingMarkerId=null,Fe.value.readonly=!1,Fe.value.categoryIndex=null,Fe.value.fromButton=!1,Fe.value.date=null},W=()=>{Yl.value&&(me(Fe.value.editingMarkerId),x())},me=t=>{const s=nt.value.findIndex(l=>l.id===t);s!==-1&&(nt.value.splice(s,1),mt()),se("delete-marker",t)},Bt=t=>{if(Fe.value.show=!0,Fe.value.title=t?.title??t?.comment??"",Fe.value.description=t?.description??t?.comment??"",Fe.value.color=t?.color??"",Fe.value.type=t?.type??"default",Fe.value.editingMarkerId=t?.id??t?.marker_id??null,Fe.value.readonly=t?.readonly??!1,Fe.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,l,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),b=Number(l)-1;g&&l&&p?Fe.value.date=new Date(p,b,g):Fe.value.date=null}else Fe.value.date=null},mt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(nt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Jt=()=>{try{const t=`dss-chart-markers-${H.chartId}`,s=localStorage.getItem(t);if(s){const l=JSON.parse(s);Array.isArray(l)&&(nt.value=l.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),nt.value=[]}},nl=t=>{const s=$e.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}`},rl=()=>{const t=we.value.show,s=at.value.show;return we.value.show=!1,at.value.show=!1,{originalCrosshair:t,originalTooltip:s}},ol=t=>{we.value.show=t.originalCrosshair,at.value.show=t.originalTooltip},Kl=async(t,s=32,l=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const b=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(b);try{const C=document.createElement("canvas"),D=C.getContext("2d");C.width=s,C.height=l,D.fillStyle="#fafafa",D.fillRect(0,0,s,l),D.drawImage(g,0,0,s,l);const L=C.toDataURL("image/png");i(L)}catch(C){console.warn("Canvas conversion failed:",C),i(t)}},g.onerror=C=>{clearTimeout(b),console.warn("Failed to load image:",t,C),i(t)},g.src=t}),dn=async()=>{try{const t=rl();setTimeout(async()=>{try{const s=T.value;if(!s){console.error("Chart SVG element not found"),ol(t);return}const l=Oe(),i=ke.value,p=ge.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(de=>de.remove());const C=g.querySelectorAll("image"),D=Array.from(C).map(async de=>{const Ke=de.getAttribute("xlink:href")||de.getAttribute("href");if(Ke&&!Ke.startsWith("data:"))try{const Pe=await Kl(Ke,32,32);de.setAttribute("xlink:href",Pe),de.setAttribute("href",Pe)}catch(Pe){console.warn("Failed to convert logo to base64:",Pe)}});await Promise.all(D);const R=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let N="",K=30;if($e.value&&(N+=`
|
|
46
46
|
<text x="24" y="${K}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,K+=30),
|
|
51
|
+
${$e.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,K+=30),rt.value&&(N+=`
|
|
53
53
|
<text x="24" y="${K}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,K+=25),Je.value&&H.series.length>0){let
|
|
57
|
+
${rt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,K+=25),Je.value&&H.series.length>0){let de=i-200,Ke=$e.value||rt.value?35:25;const Pe=Math.floor((i-250)/120);let Le=0;H.series.forEach((_e,He)=>{if(!Pt.value.has(He)){const St=Ut(He),Rt=_e.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");N+=`<circle cx="${de+6}" cy="${Ke-4}" r="6" fill="${St}"/>`,N+=`<text x="${de+18}" y="${Ke}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Rt}</text>`,Le++,Le%Pe===0?(de=i-200,Ke+=20):de+=Math.min(120,Rt.length*8+35)}})}let xe="";if(ce.value)try{const{width:de,height:Ke}=je.value,Pe=dt.value,Le=O.value.left,_e=O.value.right,He=O.value.top,St=O.value.bottom,Rt=O.value.width,ql=O.value.height;let pl,Wl;switch(Pe){case"center":pl=Le+(Rt-de)/2,Wl=He+(ql-Ke)/2;break;case"top-left":pl=Le+15,Wl=He+5;break;case"top-right":pl=_e-de-5,Wl=He+5;break;case"bottom-left":pl=Le+15,Wl=St-Ke-5;break;case"bottom-right":default:pl=_e-de-5,Wl=St-Ke-5;break}xe=`
|
|
59
59
|
<g opacity="${De.value}">
|
|
60
|
-
<g transform="translate(${pl}, ${Wl}) scale(${
|
|
60
|
+
<g transform="translate(${pl}, ${Wl}) scale(${de/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(
|
|
75
|
+
</g>`}catch(de){console.warn("Watermark processing failed, skipping watermark in SVG:",de),xe=""}const We=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${i}" height="${p}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -87,20 +87,20 @@
|
|
|
87
87
|
${N}
|
|
88
88
|
<g transform="translate(0, ${l.height})">
|
|
89
89
|
${R}
|
|
90
|
-
${
|
|
90
|
+
${xe}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
92
|
+
</svg>`,re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),he=URL.createObjectURL(re),Be=document.createElement("a");Be.href=he,Be.download=nl("svg"),document.body.appendChild(Be),Be.click(),document.body.removeChild(Be),URL.revokeObjectURL(he),ol(t),Ot()}catch(s){console.error("Error downloading SVG:",s),ol(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},_l=async()=>{try{const t=rl();F.value&&F.value.offsetHeight,await new Promise(de=>setTimeout(de,300));const s=Oe(),l=ke.value,i=ge.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),b=2;p.width=l*b,p.height=i*b,p.style.width=l+"px",p.style.height=i+"px",g.scale(b,b),g.fillStyle="#fafafa",g.fillRect(0,0,l,i);let C=30;if($e.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText($e.value,24,C),C+=30),rt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(rt.value,24,C),C+=25),Je.value&&H.series.length>0){let de=l-200,Ke=$e.value||rt.value?35:25;const Pe=Math.floor((l-250)/120);let Le=0;g.font="12px Arial, sans-serif",H.series.forEach((_e,He)=>{if(!Pt.value.has(He)){const St=Ut(He);g.beginPath(),g.arc(de+6,Ke-4,6,0,2*Math.PI),g.fillStyle=St,g.fill(),g.fillStyle="#333",g.fillText(_e.name,de+18,Ke),Le++,Le%Pe===0?(de=l-200,Ke+=20):de+=Math.min(120,_e.name.length*8+35)}})}const L=T.value.cloneNode(!0),R=L.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),N=L.querySelectorAll(".dss-crosshair"),K=L.querySelectorAll('[class*="tooltip"]');R.forEach(de=>de.remove()),N.forEach(de=>de.remove()),K.forEach(de=>de.remove()),L.querySelectorAll("image").forEach((de,Ke)=>{const Pe=de.getAttribute("xlink:href")||de.getAttribute("href");if(Pe&&!Pe.startsWith("data:")){const Le=Kt.value[Ke],_e=Le?Ut(Le.seriesIndex):"#3B82F6",He=de.getAttribute("x")||0,St=de.getAttribute("y")||0,Rt=de.getAttribute("width")||32,ql=de.getAttribute("height")||32,pl=document.createElementNS("http://www.w3.org/2000/svg","circle");pl.setAttribute("cx",parseFloat(He)+parseFloat(Rt)/2),pl.setAttribute("cy",parseFloat(St)+parseFloat(ql)/2),pl.setAttribute("r",Math.min(parseFloat(Rt),parseFloat(ql))/2-1),pl.setAttribute("fill",_e),pl.setAttribute("stroke","#fafafa"),pl.setAttribute("stroke-width","2"),de.parentNode.replaceChild(pl,de)}});const We=new XMLSerializer().serializeToString(L),re=new Blob([We],{type:"image/svg+xml;charset=utf-8"}),he=URL.createObjectURL(re),Be=new Image;return new Promise((de,Ke)=>{Be.onload=async()=>{try{if(g.drawImage(Be,0,s.height),Kt.value.forEach(Pe=>{const Le=Pe.x,_e=Pe.y+s.height,He=(Pe.width||32)/2,St=Ut(Pe.seriesIndex);g.save(),g.beginPath(),g.arc(Le,_e,He-1,0,2*Math.PI),g.fillStyle=St,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),ce.value){const Pe=new Image,Le=()=>{const{width:He,height:St}=je.value,Rt=dt.value,ql=O.value.left,pl=O.value.right,Wl=O.value.top,No=O.value.bottom,ra=O.value.width,ia=O.value.height;let jn,Kn;switch(Rt){case"center":jn=ql+(ra-He)/2,Kn=Wl+s.height+(ia-St)/2;break;case"top-left":jn=ql+15,Kn=Wl+s.height+10;break;case"top-right":jn=pl-He-5,Kn=Wl+s.height+10;break;case"bottom-left":jn=ql+15,Kn=No+s.height-St-5;break;case"bottom-right":default:jn=pl-He-5,Kn=No+s.height-St-5;break}g.globalAlpha=De.value,g.drawImage(Pe,jn,Kn,He,St),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(He=>{const St=URL.createObjectURL(He),Rt=document.createElement("a");Rt.href=St,Rt.download=nl("png"),document.body.appendChild(Rt),Rt.click(),document.body.removeChild(Rt),URL.revokeObjectURL(St),URL.revokeObjectURL(he),ol(t),Ot(),de()},"image/png")};Pe.onload=Le,Pe.onerror=_e,Pe.src=Ml.value}else p.toBlob(Pe=>{const Le=URL.createObjectURL(Pe),_e=document.createElement("a");_e.href=Le,_e.download=nl("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Le),URL.revokeObjectURL(he),ol(t),Ot(),de()},"image/png")}catch(Pe){URL.revokeObjectURL(he),ol(t),Ke(Pe)}},Be.onerror=()=>{URL.revokeObjectURL(he),ol(t),Ke(new Error("Failed to load SVG image"))},Be.src=he})}catch(t){console.error("Error downloading PNG:",t)}},no=()=>{try{let t="";$e.value&&(t+=`# ${B("chart.csv.chartTitle")}: ${$e.value}
|
|
93
|
+
`),rt.value&&(t+=`# ${B("chart.csv.chartSubtitle")}: ${rt.value}
|
|
94
94
|
`),t+=`# ${B("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
96
|
`,t+="Category",H.series.forEach(g=>{const b=g.name.replace(/"/g,'""');t+=',"'+b+'"'}),t+=`
|
|
97
97
|
`;const s=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let D='"'+(H.categories[g]||B("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach(L=>{const R=L.data&&L.data[g]!==void 0?L.data[g]:"";D+=","+R}),t+=D+`
|
|
98
|
-
`}const l=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(l),p=document.createElement("a");p.href=i,p.download=nl("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Ot()}catch(t){console.error("Error downloading CSV:",t)}},In=t=>{if(typeof t.action=="function"){const s={series:H.series,categories:H.categories,markers:nt.value},l={chartX:Ct.value.chartX,chartY:Ct.value.chartY,dataX:Ct.value.mouseDataX,dataY:Ct.value.mouseDataY,categoryIndex:clampedCategoryIndex||Ct.value.categoryIndex};t.action(s,l)}Ot()},To=()=>{x(),Fe.value.show=!0,Fe.value.categoryIndex=Ct.value.categoryIndex,Fe.value.fromButton=!1,Ot()},po=()=>{x(),Fe.value.show=!0,Fe.value.categoryIndex=0,Fe.value.fromButton=!0},oo=t=>{if(Ct.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Ct.value.show=!1)}},ao=t=>{Ct.value.show&&!t.target.closest(".context-menu")&&(Ct.value.show=!1)},fo=t=>{if(!xl.value||!Me.value)return;t.preventDefault(),t.stopPropagation(),oe.value.isZooming=!0,xe.value.show=!1,oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<O.value.left-50||i>O.value.right+50||p<O.value.top-50||p>O.value.bottom+100){oe.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,b=Math.max(oe.value.minScale,Math.min(oe.value.maxScale,oe.value.scale*g));if(b!==oe.value.scale){const{minX:C,maxX:D}=jt.value,L=D-C||1,R=L/oe.value.scale,N=C-oe.value.offsetX/O.value.width*L,K=(i-O.value.left)/O.value.width,Ee=N+K*R;oe.value.scale=b;const We=L/oe.value.scale,se=Ee-K*We;oe.value.offsetX=-(se-C)/L*O.value.width,oe.value.scale<=1.01&&(oe.value.scale=1,oe.value.offsetX=0)}oe.value.zoomTimeout=setTimeout(()=>{oe.value.isZooming=!1,oe.value.zoomTimeout=null},300)},vo=t=>{if(!xl.value||!Me.value||oe.value.scale<=1)return;xe.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,oe.value.isDragging=!0,oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY,t.preventDefault()},Ao=()=>{oe.value.isDragging=!1},so=()=>{!xl.value||!Me.value||(oe.value.scale=1,oe.value.offsetX=0,oe.value.isDragging=!1,oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1)},Do=()=>!xl.value||!El.value||!Me.value?"default":oe.value.isDragging?"grabbing":oe.value.scale>1?"grab":"dss-crosshair",Fn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],b=t[Math.min(l+2,t.length-1)],C=p.x+(g.x-i.x)/6*Re.value,D=p.y+(g.y-i.y)/6*Re.value,L=g.x-(b.x-p.x)/6*Re.value,R=g.y-(b.y-p.y)/6*Re.value;s+=` C ${C} ${D} ${L} ${R} ${g.x} ${g.y}`}return s},Sl=e.computed(()=>{const s=I.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(tl.value?30:0)+60;if(Gl.value){const N={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??N.left,top:i.top??N.top,right:i.right??N.right,bottom:i.bottom??N.bottom}:N}if(vl.value){const N=!Je.value,K=Ul.value,Ee=K?yn.value+xn.value+Math.max(24,hn.value+16):0,We=N?12:p;let se=0;Ye.value&&(se+=N?8:15),xt.value&&(se+=N?6:10);const ye=Oe();let Be=We+(N?4:16)+(K?Ee:0),ue=We+(K?Ee:0);Je.value&<.value==="left"?Be+=ye.legendWidth||150:Je.value&<.value==="right"&&(ue+=ye.legendWidth||150);const Pe=de.value==="semi-radial"?K?Ee:8:K?Ee:N?8:p+80,Le=K?14:0,$e=We+se+Le,He={left:Be,top:$e,right:ue,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??He.left,top:i.top??He.top,right:i.right??He.right,bottom:i.bottom??He.bottom}:He}let b=0;Ye.value&&(b+=15),xt.value&&(b+=10);const C=Oe();let D=p+16,L=p;Je.value&<.value==="left"?D+=C.legendWidth||150:Je.value&<.value==="right"&&(L+=C.legendWidth||150);const R={left:D,top:p+b,right:L,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??R.left,top:i.top??R.top,right:i.right??R.right,bottom:i.bottom??R.bottom}:R}),O=e.computed(()=>({left:Sl.value.left,top:Sl.value.top,right:Ce.value-Sl.value.right,bottom:ge.value-Sl.value.bottom,width:Ce.value-(Sl.value.left+Sl.value.right),height:ge.value-(Sl.value.top+Sl.value.bottom)})),xl=e.computed(()=>["line","area","bar"].includes(de.value)||st.value),Ll=e.computed(()=>st.value),Bn=e.computed(()=>de.value==="mini-radial"),vl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(de.value)),Gl=e.computed(()=>de.value==="spider"),al=e.computed(()=>de.value==="bubble"),gl=e.computed(()=>I.value?.chart?.orientation==="horizontal"&&(de.value==="bar"||Ll.value)),ln=t=>{const{minY:s,maxY:l}=jt.value,i=l-s||1;return O.value.left+(t-s)/i*O.value.width},Tl=t=>{const{maxX:s}=jt.value,l=s+1,p=O.value.height/l;return O.value.top+(t+.5)*p},_t=e.computed(()=>vl.value?Sl.value.left+(Ce.value-Sl.value.left-Sl.value.right)/2:Ce.value/2),Mt=e.computed(()=>Gl.value?ge.value/2-40:vl.value?Sl.value.top+(ge.value-Sl.value.top-Sl.value.bottom)/2:ge.value/2),wt=e.computed(()=>{if(Gl.value){const t=O.value.width-80,s=O.value.height-80;return Math.min(t,s)/2}return Math.min(O.value.width,O.value.height)/2}),il=e.computed(()=>{const t=I.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return wt.value*l}),go=e.computed(()=>{const t=I.value,s=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(vl.value||Gl.value)?1:1+s/100}),nn=e.computed(()=>{const t=go.value;if(t===1||t<=0)return;const s=_t.value,l=Mt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Al=e.ref(0),on=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),zl=e.computed(()=>de.value==="semi-radial"),Yt=e.computed(()=>zl.value&&Ie.value&&!ml.value),zn=e.computed(()=>zl.value&&Ie.value&&!ml.value&&kt.value==="fill"),ho=e.computed(()=>{const t=Yt.value?Al.value:1,s=_t.value,l=Mt.value,i=il.value,p=wt.value,g=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const C=s+p*Math.cos(g),D=l+p*Math.sin(g),L=s+p*Math.cos(b),R=l+p*Math.sin(b),N=s+i*Math.cos(b),K=l+i*Math.sin(b),Ee=s+i*Math.cos(g),We=l+i*Math.sin(g),se=t>.5?1:0;return`M ${s} ${l} L ${C} ${D} A ${p} ${p} 0 ${se} 1 ${L} ${R} L ${N} ${K} A ${i} ${i} 0 ${se} 1 ${Ee} ${We} Z`}),mn=e.computed(()=>{if(!(!zl.value||!Yt.value)&&!zn.value)return`url(#${on.value})`}),kn=t=>{if(!(!zn.value||t!==0))return`url(#${on.value})`},Dl=e.ref(0),pn=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Bl=e.computed(()=>de.value==="radial"),Ho=e.computed(()=>{const t=Bl.value?Dl.value:1,s=_t.value,l=Mt.value,i=Math.max(wt.value*1.5,Ce.value,ge.value);if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;if(t>=1){const N=s-i,K=s+i;return`M ${N} ${l} A ${i} ${i} 0 0 1 ${K} ${l} A ${i} ${i} 0 0 1 ${N} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,b=s+i*Math.cos(p),C=l+i*Math.sin(p),D=s+i*Math.cos(g),L=l+i*Math.sin(g),R=t>=.5?1:0;return`M ${s} ${l} L ${b} ${C} A ${i} ${i} 0 ${R} 1 ${D} ${L} Z`}),Ro=e.computed(()=>{if(mn.value)return mn.value;if(Bl.value)return`url(#${pn.value})`});let an=null;const yo=()=>{if(!Yt.value)return;Al.value=0;const t=It.value,s=performance.now(),l=i=>{const p=i-s,g=Math.min(1,p/t);Al.value=Ol(qt.value,g),g<1&&(an=requestAnimationFrame(l))};an=requestAnimationFrame(l)},Mn=e.computed(()=>I.value?.bubbles?.minSize||8),ko=e.computed(()=>I.value?.bubbles?.maxSize||50),Co=e.computed(()=>I.value?.bubbles?.opacity||.7),bo=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Un=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},ro=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Pl=e.computed(()=>H.series),Cn=e.computed(()=>H.series.filter((t,s)=>!Pt.value.has(s))),sn="auto",jt=e.computed(()=>{if(al.value)return wo();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(C=>{C.data&&C.data.length&&(l=Math.max(l,C.data.length-1),C.data.forEach(D=>{typeof D=="number"&&(t=Math.min(t,D),s=Math.max(s,D))}))}),H.categories.length>0&&(l=Math.max(l,H.categories.length-1)),t===1/0&&(t=0,s=100);const i=rt.value,p=Vt.value;let g,b;if(i===sn){const C=s-t,D=C>0?C*.1:1;g=Math.max(0,t-D)}else if(typeof i=="number")g=i;else{const C=s-t,D=C>0?C*.1:1;g=Math.max(0,t-D)}if(p===sn){const C=s-t,D=C>0?C*.1:2;b=s+D}else if(typeof p=="number")b=p;else{const C=s-t,D=C>0?C*.1:2;b=s+D}return{minX:0,maxX:l,minY:g,maxY:b}}),wo=()=>{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,p=1/0,g=-1/0,b=!1;if(Cn.value.forEach((Ee,We)=>{Ee?.data?.length&&Ee.data.forEach((se,ye)=>{let Be,ue,Ke;if(typeof se=="object"&&se!==null&&!Array.isArray(se))Be=typeof se.x=="number"?se.x:ye,ue=typeof se.y=="number"?se.y:0,Ke=typeof se.size=="number"?se.size:20;else if(Array.isArray(se)&&se.length>=3)Be=typeof se[0]=="number"?se[0]:ye,ue=typeof se[1]=="number"?se[1]:0,Ke=typeof se[2]=="number"?se[2]:20;else if(typeof se=="number")Be=ye,ue=se,Ke=bo(We,ye);else return;isFinite(Be)&&isFinite(ue)&&isFinite(Ke)&&(t=Math.min(t,Be),s=Math.max(s,Be),l=Math.min(l,ue),i=Math.max(i,ue),p=Math.min(p,Ke),g=Math.max(g,Ke),b=!0)})}),!b)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,H.categories?.length-1||8)),l===i&&(l=Math.max(0,l-10),i=l+20);const C=s-t,D=i-l;let L,R,N,K;return ll.value!==null?L=ll.value:L=t-C*.1,zt.value!==null?R=zt.value:R=s+C*.1,rt.value!==null&&typeof rt.value=="number"?N=rt.value:N=Math.max(0,l-D*.1),Vt.value!==null&&typeof Vt.value=="number"?K=Vt.value:K=i+D*.1,{minX:L,maxX:R,minY:N,maxY:K,minSize:p,maxSize:g}},sl=t=>{if(al.value){const{minX:C,maxX:D}=jt.value,L=D-C||1;return O.value.left+(t-C)/L*O.value.width}const{minX:s,maxX:l}=jt.value,i=l-s;if(l===0||i===0)return O.value.left+O.value.width/2;const p=i/oe.value.scale,g=s-oe.value.offsetX/O.value.width*i,b=(t-g)/p;return O.value.left+b*O.value.width},hl=t=>{const{minY:s,maxY:l}=jt.value,i=l-s||1;return O.value.bottom-(t-s)/i*O.value.height},xo=t=>{if(!al.value)return ft.value||4;const{maxSize:s}=jt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return Mn.value+i*(ko.value-Mn.value)},Io=e.computed(()=>Xn.value.map(t=>({y:t.y}))),bn=e.computed(()=>{if(al.value)return fn();if(de.value==="bar"){if(gl.value){const $e=[],{minY:He,maxY:St}=jt.value,Ht=5,ql=St-He||1;for(let pl=0;pl<=Ht;pl++){const Wl=He+ql*(pl/Ht),No=ln(Wl);$e.push({x:No,y:O.value.bottom+20,text:fl(Math.round(Wl))})}return $e}const ye=[],{maxX:Be}=jt.value,ue=Be+1,Ke=5,Le=(O.value.width-Ke*2)/ue;for(let $e=0;$e<=Be;$e++){const He=O.value.left+Ke+($e+.5)*Le;ye.push({x:He,y:O.value.bottom+20,text:H.categories[$e]||B("chart.fallback.item",{number:$e+1})})}return ye}const t=[],{minX:s,maxX:l}=jt.value,i=ll.value!==null?ll.value:s,p=zt.value!==null?zt.value:l,g=p-i||1,b=g/oe.value.scale,C=i-oe.value.offsetX/O.value.width*g,D=C+b,L=Math.max(0,Math.floor(C-2)),R=Math.min(p,Math.ceil(D+2)),N=R-L,K=O.value.width,We=Math.floor(K/60);let se=1;N>We&&(se=Math.ceil(N/We));for(let ye=L;ye<=R;ye+=se)if(ye>=0&&ye<=p){const Be=sl(ye);Be>=O.value.left-100&&Be<=O.value.right+100&&t.push({x:Be,y:O.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),fn=()=>{const t=[],{minX:s,maxX:l}=jt.value,i=l-s||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const b=s+i*g/p,C=sl(b);if(C>=O.value.left-10&&C<=O.value.right+10){const D=Math.round(b),L=H.categories?.[D];t.push({x:C,y:O.value.bottom+20,text:L||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},Xn=e.computed(()=>{if(gl.value){const p=[],{maxX:g}=jt.value;for(let b=0;b<=g;b++)p.push({x:O.value.left-10,y:Tl(b),text:H.categories[b]||`Item ${b+1}`});return p}const t=[],{minY:s,maxY:l}=jt.value,i=5;for(let p=0;p<=i;p++){const g=s+(l-s)*(p/i),b=Math.round(g);t.push({x:O.value.left-10,y:hl(g),text:fl(b)})}return t}),Ut=t=>{const s=Et.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,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const C=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(C)l=Number(C[1])/255,i=Number(C[2])/255,p=Number(C[3])/255;else{const D=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(D){let L=D[1];L.length===3&&(L=L[0]+L[0]+L[1]+L[1]+L[2]+L[2]),l=parseInt(L.slice(0,2),16)/255,i=parseInt(L.slice(2,4),16)/255,p=parseInt(L.slice(4,6),16)/255}else if(typeof document<"u"){const L=document.createElement("span");L.style.color=s,L.style.display="none",document.body.appendChild(L);const R=getComputedStyle(L).color;document.body.removeChild(L);const N=R.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(N)l=Number(N[1])/255,i=Number(N[2])/255,p=Number(N[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},io=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)),b=Math.max(0,Math.floor(Number(l[2])*.65)),C=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${b}, ${C})`}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)),b=Math.max(0,Math.floor(Number(i[2])*.65)),C=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${b}, ${C}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),D=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[b,C,D].map(L=>L.toString(16).padStart(2,"0")).join("")}`}return s},co=(t,s)=>{const i=I.value?.stroke?.color;return i==null?io(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??io(s):io(s)},_n=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+p*p)}return s},Hl=e.computed(()=>de.value==="line"||Ll.value?(Ll.value?H.series.filter(s=>(s.type||de.value)==="line"):Pl.value).map((s,l)=>{const i=H.series.findIndex(N=>N===s),p=[];let g=[];s.data.forEach((N,K)=>{N==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:gl.value?ln(N):sl(K),y:gl.value?Tl(K):hl(N),index:K})}),g.length>0&&p.push(g);let b="";p.forEach(N=>{if(N.length>0){let K="";re.value?K=Fn(N):K=`M ${N[0].x} ${N[0].y}`+N.slice(1).map(Ee=>` L ${Ee.x} ${Ee.y}`).join(""),b+=(b?" ":"")+K}});const C=p.reduce((N,K)=>N+_n(K),0),D=Pt.value.has(i),L=be.value===i,R=be.value!==null&&be.value!==i;return{path:b,color:Ut(i),pathLength:C,seriesIndex:i,animationDelay:l*Dt.value,isHighlighted:L,isDimmed:R,isHidden:D}}):[]),Eo=e.computed(()=>{if(!(de.value==="line"||Ll.value))return[];const t=Ll.value?H.series.filter(l=>(l.type||de.value)==="line"):Pl.value,s=[];return t.forEach((l,i)=>{const p=H.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const b=l.data[g];if(b!=null){let C=-1,D=0;for(let L=g+1;L<l.data.length;L++){const R=l.data[L];if(R==null)D++;else{C=L;break}}if(D>0&&C!==-1){const L=l.data[C],R=gl.value?ln(b):sl(g),N=gl.value?Tl(g):hl(b),K=gl.value?ln(L):sl(C),Ee=gl.value?Tl(C):hl(L),We=Pt.value.has(p),se=be.value===p,ye=be.value!==null&&be.value!==p;s.push({path:`M ${R} ${N} L ${K} ${Ee}`,color:Ut(p),seriesIndex:p,animationDelay:i*Dt.value,isHighlighted:se,isDimmed:ye,isHidden:We,gapSize:D}),g=C-1}}}}),s}),wn=e.computed(()=>de.value==="line"||Ll.value?!Ie.value||ml.value||gt.value.hasAnimated?[]:(Ll.value?H.series.filter(s=>(s.type||de.value)==="line"):Pl.value).map((s,l)=>{const i=H.series.findIndex(D=>D===s);let p="",g=null;s.data.forEach((D,L)=>{if(D!=null){const R={x:gl.value?ln(D):sl(L),y:gl.value?Tl(L):hl(D)};g===null?p+=`M ${R.x} ${R.y}`:p+=` L ${R.x} ${R.y}`,g=R}else if(g!==null){const R=s.data.findIndex((N,K)=>K>L&&N!==null&&N!==void 0);if(R!==-1){const N={x:gl.value?ln(s.data[R]):sl(R),y:gl.value?Tl(R):hl(s.data[R])};p+=` L ${N.x} ${N.y}`,g=N}}});const b=s.data.map((D,L)=>D==null?null:{x:gl.value?ln(D):sl(L),y:gl.value?Tl(L):hl(D)}).filter(D=>D!==null),C=_n(b);return{path:p,pathLength:C,color:Ut(i),animationDelay:l*Dt.value,seriesIndex:i}}):[]),uo=e.computed(()=>{if(de.value!=="line")return[];const t=[];return Pl.value.forEach((s,l)=>{const i=be.value===l,p=be.value!==null&&be.value!==l,g=Pt.value.has(l);s.data.forEach((b,C)=>{b!=null&&t.push({x:sl(C),y:hl(b),color:Ut(l),value:b,label:H.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(l*s.data.length+C)*(Dt.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),zo=e.computed(()=>{if(!Ll.value)return[];const t=[];return H.series.filter(l=>(l.type||de.value)==="line").forEach((l,i)=>{const p=H.series.findIndex(D=>D===l),g=be.value===p,b=be.value!==null&&be.value!==p,C=Pt.value.has(p);l.data.forEach((D,L)=>{D!=null&&t.push({x:sl(L),y:hl(D),color:Ut(p),value:D,label:H.categories[L]||L.toString(),seriesName:l.name,categoryIndex:L,dataIndex:L,animationDelay:(i*l.data.length+L)*(Dt.value/8),isHighlighted:g,isDimmed:b,isHidden:C})})}),t}),Pn=e.computed(()=>{if(!al.value)return[];const t=[];return Pl.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=be.value,p=i!==null&&i===l,g=i!==null&&i!==l,b=Pt.value.has(l);s.data.forEach((C,D)=>{let L,R,N,K,Ee;if(typeof C=="object"&&C!==null&&!Array.isArray(C))L=typeof C.x=="number"?C.x:D,R=typeof C.y=="number"?C.y:0,N=typeof C.size=="number"?C.size:20,K=C.label||H.categories?.[D]||`Point ${D+1}`,Ee=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)L=typeof C[0]=="number"?C[0]:D,R=typeof C[1]=="number"?C[1]:0,N=typeof C[2]=="number"?C[2]:20,K=C[3]||H.categories?.[D]||`Point ${D+1}`,Ee=C[4];else if(typeof C=="number")L=D,R=C,N=bo(l,D),K=H.categories?.[D]||`Point ${D+1}`;else return;!isFinite(L)||!isFinite(R)||!isFinite(N)||t.push({x:sl(L),y:hl(R),radius:xo(N),originalX:L,originalY:R,originalSize:N,color:Ut(l),seriesName:s.name||`Series ${l+1}`,label:K,imageUrl:Ee,seriesIndex:l,dataIndex:D,categoryIndex:Math.round(L),isHighlighted:p,isDimmed:g,isHidden:b,opacity:Co.value})})}),t}),Yn=e.computed(()=>de.value!=="area"?[]:Pl.value.map((t,s)=>{const l=[];let i=[];if(t.data.forEach((N,K)=>{N==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:sl(K),y:hl(N),index:K})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Ut(s),isHidden:Pt.value.has(s)};const p=O.value.bottom+1;let g="",b="";l.forEach((N,K)=>{if(N.length===0)return;let Ee=`M ${N[0].x} ${N[0].y}`;re.value&&N.length>1?Ee=Fn(N):N.slice(1).forEach(se=>{Ee+=` L ${se.x} ${se.y}`}),g+=(g?" ":"")+Ee;let We=`M ${N[0].x} ${p}`;if(We+=` L ${N[0].x} ${N[0].y}`,re.value&&N.length>1){const se=Fn(N),ye=se.substring(se.indexOf("C")||se.indexOf("Q")||se.indexOf("L"));ye?We+=" "+ye:N.slice(1).forEach(Be=>{We+=` L ${Be.x} ${Be.y}`})}else N.slice(1).forEach(se=>{We+=` L ${se.x} ${se.y}`});We+=` L ${N[N.length-1].x} ${p} Z`,b+=(b?" ":"")+We});const C=be.value===s,D=be.value!==null&&be.value!==s,L=Pt.value.has(s),R=l.reduce((N,K)=>N+_n(K),0);return{linePath:g,areaPath:b,color:Ut(s),pathLength:R,isHighlighted:C,isDimmed:D,isHidden:L}})),o=e.computed(()=>{if(!(["bar"].includes(de.value)||Ll.value))return[];const t=[],{maxX:s}=jt.value,l=Ll.value?H.series.filter(p=>(p.type||de.value)==="bar"):Pl.value,i=l.length;if(gl.value){const p=s+1,b=O.value.height/p,C=b*(2/3),D=Math.min(4,C/i*.15),L=C-(i-1)*D,R=Math.max(4,L/i);l.forEach((N,K)=>{const Ee=H.series.findIndex(Be=>Be===N),We=be.value===Ee,se=be.value!==null&&be.value!==Ee,ye=Pt.value.has(Ee);N.data.forEach((Be,ue)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Le=O.value.top+(ue+.5)*b-C/2+K*(R+D),$e=O.value.left,He=Math.abs(ln(Be)-O.value.left);let St="";if(re.value&&He>0){const Ht=Math.min(ct.value,R/2,He/2);St=[`M ${$e} ${Le}`,`L ${$e+He-Ht} ${Le}`,`Q ${$e+He} ${Le} ${$e+He} ${Le+Ht}`,`L ${$e+He} ${Le+R-Ht}`,`Q ${$e+He} ${Le+R} ${$e+He-Ht} ${Le+R}`,`L ${$e} ${Le+R}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:He,height:R,color:Ut(i===1?ue:Ee),value:Be,label:H.categories[ue]||ue.toString(),seriesName:N.name,animationDelay:(K*l.length+ue)*(Dt.value/4),isHighlighted:We,isDimmed:se,isHidden:ye,barPath:St,isSmooth:re.value&&He>0})})})}else{const p=s+1,b=O.value.width/p,C=b*.8,D=C/i,L=D*.05,R=D-L;l.forEach((N,K)=>{const Ee=H.series.findIndex(Be=>Be===N),We=be.value===Ee,se=be.value!==null&&be.value!==Ee,ye=Pt.value.has(Ee);N.data.forEach((Be,ue)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Le=O.value.left+(ue+.5)*b-C/2+K*D+L/2,$e=hl(Math.max(0,Be)),He=Math.abs(hl(0)-hl(Be));let St="";if(re.value&&He>0){const Ht=Math.min(ct.value,R/2,He/2);St=[`M ${Le} ${$e+He}`,`L ${Le} ${$e+Ht}`,`Q ${Le} ${$e} ${Le+Ht} ${$e}`,`L ${Le+R-Ht} ${$e}`,`Q ${Le+R} ${$e} ${Le+R} ${$e+Ht}`,`L ${Le+R} ${$e+He}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:R,height:He,color:Ut(i===1?ue:Ee),value:Be,label:H.categories[ue]||ue.toString(),seriesName:N.name,animationDelay:(K*l.length+ue)*(Dt.value/4),isHighlighted:We,isDimmed:se,isHidden:ye,barPath:St,isSmooth:re.value&&He>0})})})}return t}),n=e.computed(()=>{if(!vl.value)return[];const t=Pl.value.map((b,C)=>({series:b,originalIndex:C})).filter(({originalIndex:b})=>!Pt.value.has(b));if(t.length===0)return[];let s=de.value==="semi-radial"?Math.PI:-Math.PI/2;const l=de.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(b,C,D,L,R,N)=>{const K=b+(C-b)/2,Ee=C-b,We=_t.value+Math.cos(b)*il.value,se=Mt.value+Math.sin(b)*il.value,ye=_t.value+Math.cos(C)*il.value,Be=Mt.value+Math.sin(C)*il.value,ue=_t.value+Math.cos(C)*wt.value,Ke=Mt.value+Math.sin(C)*wt.value,Pe=_t.value+Math.cos(b)*wt.value,Le=Mt.value+Math.sin(b)*wt.value,$e=Ee>Math.PI?1:0,He=[`M ${We} ${se}`,`A ${il.value} ${il.value} 0 ${$e} 1 ${ye} ${Be}`,`L ${ue} ${Ke}`,`A ${wt.value} ${wt.value} 0 ${$e} 0 ${Pe} ${Le}`,"Z"].join(" "),St=N||Ut(D);return{path:He,color:St,strokeWidth:Ge.value,strokeColor:co(i.length,St),value:R,seriesName:L,opacity:.8,isHighlighted:be.value===D,isDimmed:be.value!==null&&be.value!==D,isHidden:!1,startAngle:b,endAngle:C,midAngle:K}};if(Bn.value){const{series:b,originalIndex:C}=t[0],D=Number(b?.data?.[0]??0),L=Number.isFinite(D)?Math.min(Math.max(D,0),100):0,R=I.value,N=Math.min(Math.max(Number(R?.miniRadial?.minVisiblePercent??1),0),100),Ee=(L<=0?N:L)/100*l,We=Number(R?.miniRadial?.thresholds?.low??33),se=Number(R?.miniRadial?.thresholds?.medium??66),ye=R?.miniRadial?.colors?.low||"#E53E3E",Be=R?.miniRadial?.colors?.medium||"#ED8936",ue=R?.miniRadial?.colors?.high||"#38A169",Ke=L<=We?ye:L<=se?Be:ue,Pe=R?.miniRadial?.trackColor||"#E5E7EB",Le=b?.name||"Score";return i.push(p(s,s+l-.001,C+1,"Track",100,Pe)),i.push(p(s,s+Ee,C,Le,L,Ke)),i}if(t.length===1){const{series:b,originalIndex:C}=t[0],D=b.data[0]||0,L=s,R=s+l-.001,N=L+l/2,K=_t.value+Math.cos(L)*il.value,Ee=Mt.value+Math.sin(L)*il.value,We=_t.value+Math.cos(R)*il.value,se=Mt.value+Math.sin(R)*il.value,ye=_t.value+Math.cos(R)*wt.value,Be=Mt.value+Math.sin(R)*wt.value,ue=_t.value+Math.cos(L)*wt.value,Ke=Mt.value+Math.sin(L)*wt.value,Pe=1,Le=[`M ${K} ${Ee}`,`A ${il.value} ${il.value} 0 ${Pe} 1 ${We} ${se}`,`L ${ye} ${Be}`,`A ${wt.value} ${wt.value} 0 ${Pe} 0 ${ue} ${Ke}`,"Z"].join(" "),$e=Ut(C);return i.push({path:Le,color:$e,strokeWidth:Ge.value,strokeColor:co(0,$e),value:D,seriesName:b.name,opacity:.8,isHighlighted:be.value===C,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:R,midAngle:N}),i}if(zn.value&&t.length===2){const b=t[0],C=t[1],D=Math.min(100,Math.max(0,b.series.data[0]||0)),L=D/100*l;return i.push(p(s,s+L,b.originalIndex,b.series.name,D)),i.push(p(s,s+l,C.originalIndex,C.series.name,100)),i}const g=t.reduce((b,{series:C})=>b+(C.data[0]||0),0);return g===0?[]:(t.forEach(({series:b,originalIndex:C})=>{const D=b.data[0]||0,L=D/g*l,R=s,N=s+L,K=R+L/2,Ee=_t.value+Math.cos(R)*il.value,We=Mt.value+Math.sin(R)*il.value,se=_t.value+Math.cos(N)*il.value,ye=Mt.value+Math.sin(N)*il.value,Be=_t.value+Math.cos(N)*wt.value,ue=Mt.value+Math.sin(N)*wt.value,Ke=_t.value+Math.cos(R)*wt.value,Pe=Mt.value+Math.sin(R)*wt.value,Le=L>Math.PI?1:0,$e=[`M ${Ee} ${We}`,`A ${il.value} ${il.value} 0 ${Le} 1 ${se} ${ye}`,`L ${Be} ${ue}`,`A ${wt.value} ${wt.value} 0 ${Le} 0 ${Ke} ${Pe}`,"Z"].join(" "),He=Ut(C);i.push({path:$e,color:He,strokeWidth:Ge.value,strokeColor:co(i.length,He),value:D,seriesName:b.name,opacity:.8,isHighlighted:be.value===C,isDimmed:be.value!==null&&be.value!==C,isHidden:!1,startAngle:R,endAngle:N,midAngle:K}),s=N}),i)}),a=e.computed(()=>{const t=n.value;return zn.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(!Ul.value||!vl.value)return[];const t=hn.value,s=yn.value,l=xn.value,i=qn.value,p=15,g=t*1.3,b=.55,C=(N,K)=>{const Ee=_t.value+Math.cos(N.midAngle)*wt.value,We=Mt.value+Math.sin(N.midAngle)*wt.value,se=_t.value+Math.cos(N.midAngle)*(wt.value+s),ye=Mt.value+Math.sin(N.midAngle)*(wt.value+s),ue=se+l*(K?1:-1),Ke=K?se+p:se-p,Pe=ye-i,Le=`${N.seriesName}: ${fl(N.value)}`,$e=Le.length*t*b;return{pointerStartX:Ee,pointerStartY:We,pointerEndX:se,pointerEndY:ye,horizontalEndX:ue,horizontalEndY:ye,textX:Ke,textY:Pe,text:Le,textWidth:$e,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(se-Ee,ye-We),horizontalLineLength:Math.hypot(ue-se,0)}},D=(N,K)=>{const Ee=Math.abs(N.textY-K.textY)<g,We=N.isRightSide?N.textX:N.textX-N.textWidth,se=N.isRightSide?N.textX+N.textWidth:N.textX,ye=K.isRightSide?K.textX:K.textX-K.textWidth,Be=K.isRightSide?K.textX+K.textWidth:K.textX,ue=We<Be&&ye<se;return Ee&&ue},L=n.value.filter(N=>!N.isHidden),R=[];for(let N=0;N<L.length;N++){const K=L[N];let Ee=Math.cos(K.midAngle)>=0;if(N>0){const se=R[N-1],ye=C(K,Ee);D(se,ye)&&(Ee=!Ee)}const We=C(K,Ee);R.push({...We,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return R}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||Co.value||.7;return be.value===null||be.value===void 0?s:be.value!==null?t.seriesIndex===be.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 be.value!==null?t.seriesIndex===be.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(be.value===t.seriesIndex?be.value=null:be.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:H.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(),On.value=!0,be.value=t.seriesIndex,xe.value.show=!1,!Xt.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const b=200,C=120;p+b>Ce.value&&(p=s.clientX-i.left-b-10),g+C>i.height&&(g=s.clientY-i.top-C-10),p<0&&(p=10),g<0&&(g=10);const D=Tn.value,L=An.value,R=D.map(N=>{const K=L[N]||N,Ee=h(N,t);return Ee?{seriesName:t.seriesName,label:t.label,value:`${K}: ${Ee}`,color:t.color}:null}).filter(Boolean);at.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:R,categoryIndex:void 0,spiderAreas:[]}},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=Vn.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const p=l.toFixed(1);return Lt.value?p+Lt.value:p}return l?.toString()||""},M=()=>{if(!al.value||!xe.value.data||xe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return xe.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"},A=(t,s)=>{t&&(On.value=!1,be.value=null,at.value.show=!1,at.value.bubbleData=[])},E=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=Zt(t.categoryIndex),g=t.description||t.comment||"";let b=s.clientX-i.left+15,C=s.clientY-i.top-10;const D=200,L=g?80:50;b+D>Ce.value&&(b=s.clientX-i.left-D-15),C+L>ge.value&&(C=s.clientY-i.top-L-10),b<0&&(b=10),C<0&&(C=10),Nt.value={show:!0,x:b,y:C,categoryValue:p,description:g}},le=()=>{Nt.value.show=!1},Y=e.computed(()=>H.categories.length||Math.max(...Cn.value.map(t=>t.data.length))),ze=e.computed(()=>{let t=0;return Cn.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Se=e.computed(()=>{const t=[],s=Y.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,p=_t.value+Math.cos(i)*wt.value,g=Mt.value+Math.sin(i)*wt.value;t.push({x:p,y:g,angle:i,index:l})}return t}),yt=e.computed(()=>{const t=[],s=Y.value;return Se.value.forEach((l,i)=>{const p=wt.value+15,g=i*2*Math.PI/s-Math.PI/2,b=_t.value+Math.cos(g)*p,C=Mt.value+Math.sin(g)*p+5;let D="middle",L="middle";Math.abs(Math.cos(g))>.5&&(D=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(L=Math.sin(g)>0?"hanging":"auto"),t.push({x:b,y:C,text:H.categories[i]||`Axis ${i+1}`,anchor:D,baseline:L})}),t}),yl=e.ref(new Set),cl=(t,s,l)=>{const i=`current-${l}`,p=yl.value.has(i);return!p&&be.value===null?s.fillOpacity||S.value:s.isHighlighted||p?(s.fillOpacity||S.value)+.15:s.isDimmed?(s.fillOpacity||S.value)*.3:s.fillOpacity||S.value},el=e.computed(()=>{if(!Gl.value)return[];const t=[],s=Y.value;return Pl.value.forEach((l,i)=>{const p=[],g=[],b=[],C=be.value===i,D=be.value!==null&&be.value!==i,L=Pt.value.has(i);for(let R=0;R<s;R++){const N=l.data[R]||0,Ee=N/ze.value*wt.value,We=R*2*Math.PI/s-Math.PI/2,se=_t.value+Math.cos(We)*Ee,ye=Mt.value+Math.sin(We)*Ee;p.push(`${se},${ye}`),g.push({x:se,y:ye}),b.push({x:se,y:ye,value:N,label:H.categories[R]||`Axis ${R+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:b,color:Ut(i),fillOpacity:S.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:C,isDimmed:D,isHidden:L,seriesIndex:i})}),t}),ul=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,b=s[i].y,C=s[p].x,D=s[p].y;b>t.y!=D>t.y&&t.x<(C-g)*(t.y-b)/(D-b)+g&&(l=!l)}return l},dl=t=>{if(!Gl.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=T.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,b=el.value.filter(C=>C.isHidden?!1:ul({x:p,y:g},C.polygonPoints));if(b.length>0){b.length,be.value=b[0].seriesIndex;const C=t.clientX-l.left+10,D=t.clientY-l.top-10,L=b.length>1?460:260,R=70+Y.value*20;let N=C,K=D;N+L>Ce.value&&(N=t.clientX-l.left-L-10),K+R>ge.value&&(K=t.clientY-l.top-R-10),N<0&&(N=10),K<0&&(K=10);const Ee=b.map(We=>({seriesName:We.seriesName,color:We.color,points:We.dataPoints.map(se=>({label:se.label,value:fl(se.value)}))}));at.value={show:!0,x:N,y:K,title:"",value:"",bubbleData:[],spiderAreas:Ee}}else cn()},Kt=e.computed(()=>{const t=I.value;return t.logos.map((s,l)=>{const i=H.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Pt.value.has(s.seriesIndex))return null;let p,g;if(xl.value){let C=-1,D=null;for(let R=i.data.length-1;R>=0;R--)if(i.data[R]!==null&&i.data[R]!==void 0){C=R,D=i.data[R];break}if(C===-1||D===null)return null;const L=i.data.map((R,N)=>R==null?null:{x:sl(N),y:hl(R),index:N}).filter(R=>R!==null);if(t.animations.enabled&&!ml.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(gt.value.isAnimating||!gt.value.hasAnimated))if(gt.value.isAnimating){const R=gt.value.currentFrame/gt.value.totalFrames,N=Ol(t.animations.easing,Math.min(R,1)),K=sa(L,N);p=K.x+(s.offsetX||0),g=K.y+(s.offsetY||0)}else p=L[0].x+(s.offsetX||0),g=L[0].y+(s.offsetY||0);else p=sl(C)+(s.offsetX||0),g=hl(D)+(s.offsetY||0)}else if(vl.value||Gl.value){const C=Math.PI*2/t.logos.length*l;p=_t.value+Math.cos(C)*(wt.value+30)+(s.offsetX||0),g=Mt.value+Math.sin(C)*(wt.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Ql=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),l&&(l.style.opacity="1")},vn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Jl=t=>{Pt.value.has(t)?Pt.value.delete(t):Pt.value.add(t)},So=e.computed(()=>{if(!at.value.show&&!(te.value&&xe.value.show&&!oe.value.isZooming))return{display:"none"};let t,s;if(te.value&&xe.value.show&&!oe.value.isZooming){t=xe.value.x+15,s=O.value.top;const l=al.value?200:150;t+l>Ce.value&&(t=xe.value.x-l-15),t<0&&(t=10),s<10&&(s=10)}else t=at.value.x,s=at.value.y;return{left:t+"px",top:s+"px"}}),rn=(t,s)=>{if(!Xt.value||$n.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const b=200,C=120,D=Ce.value,L=ge.value;p+b>D&&(p=s.clientX-i.left-b-10),g+C>L&&(g=s.clientY-i.top-C-10),p<0&&(p=10),g<0&&(g=10);let R;typeof t.categoryIndex=="number"?R=t.categoryIndex:typeof t.dataIndex=="number"?R=t.dataIndex:t.label&&H.categories.includes(t.label)&&(R=H.categories.indexOf(t.label));const N=(gl.value||de.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";at.value={show:!0,x:p,y:g,title:N,value:fl(t.value)||"",categoryIndex:R,spiderAreas:[]}},mo=e.ref(!1),On=e.ref(!1),cn=()=>{at.value.show=!1,at.value.spiderAreas=[],at.value.bubbleData=[],xe.value.show=!1,mo.value||(be.value=null)},$n=e.ref(!1),gn=(t,s)=>{$n.value=!0,at.value.show=!1,xe.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const b=250;p+b>Ce.value&&(p=s.clientX-i.left-b-15),p<0&&(p=10),g<0&&(g=10),Il.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},Ln=()=>{$n.value=!1,Il.value.show=!1},gt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Ol=(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}},ml=e.computed(()=>w.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Po=()=>{if(!Ie.value||ml.value){gt.value.hasAnimated=!0,Bl.value&&(Dl.value=1);return}Bl.value&&(Dl.value=0),gt.value.isAnimating=!0,gt.value.currentFrame=0,gt.value.totalFrames=Math.ceil(It.value/16.67);const t=()=>{const s=gt.value.currentFrame/gt.value.totalFrames,l=Ol(qt.value,Math.min(s,1));ta(l),Bl.value&&(Dl.value=l),s<1?(gt.value.currentFrame++,gt.value.animationId=requestAnimationFrame(t)):la()};gt.value.animationId=requestAnimationFrame(t)},ta=t=>{const s=F.value;s&&s.style.setProperty("--dss-animation-progress",t)},la=()=>{gt.value.isAnimating=!1,gt.value.hasAnimated=!0,Bl.value&&(Dl.value=1),gt.value.animationId&&(cancelAnimationFrame(gt.value.animationId),gt.value.animationId=null)},Oo=e.computed(()=>!vl.value||gt.value.hasAnimated?!0:Bl.value?Dl.value>=1:zl.value?Al.value>=1:!0),Zo=e.computed(()=>Ul.value&&Oo.value),Vo=e.ref(!1);e.watch(Zo,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const na=e.computed(()=>{if(!Ie.value||ml.value||gt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${It.value}ms`,t["--dss-animation-easing"]=oa(qt.value),t["--dss-stagger-delay"]=`${Dt.value}ms`,t}),oa=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",aa=()=>{if(!Ie.value||ml.value)return"";const t=["dss-chart-animated"];return gt.value.hasAnimated||t.push(`dss-animate-${kt.value}`),gt.value.hasAnimated||(vl.value&&de.value!=="semi-radial"?t.push("dss-animate-fill"):vl.value||t.push(`dss-animate-${kt.value}`)),gt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,s)=>{V.value&&s&>.value.hasAnimated&&(gt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Po(),Qt.value)}))},{deep:!0}),e.watch(()=>oe.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[oe.value.scale,oe.value.offsetX],()=>{!oe.value.isZooming&&!oe.value.isDragging&&k()},{flush:"post"}),e.watch([Ue,it],([t,s])=>{oe.value.minScale=t,oe.value.maxScale=s,(oe.value.scale<t||oe.value.scale>s)&&so()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>Ct.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",ao)}):document.removeEventListener("click",ao)}),e.onMounted(()=>{be.value=null,Bl.value&&(!Ie.value||ml.value)&&(Dl.value=1),Jt(),F.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:l,height:i}=s.contentRect;Qe.value=Math.round(l),pe.value=Math.round(i),X.value&&(pt.value=X.value.offsetHeight||fe)}))}),f.observe(F.value)),Ie.value&&!ml.value?de.value==="semi-radial"?setTimeout(()=>yo(),Qt.value):setTimeout(()=>Po(),Qt.value):(gt.value.hasAnimated=!0,de.value==="semi-radial"&&(Al.value=1)),document.addEventListener("mousemove",Uo),document.addEventListener("mouseup",Xo),document.addEventListener("click",oo)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&F.value&&(f.unobserve(F.value),f.disconnect(),f=null),gt.value.animationId&&cancelAnimationFrame(gt.value.animationId),an&&(cancelAnimationFrame(an),an=null),oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout),document.removeEventListener("mousemove",Uo),document.removeEventListener("mouseup",Xo),document.removeEventListener("click",oo),document.removeEventListener("click",ao)});const Uo=t=>{if(oe.value.isDragging&&oe.value.scale>1&&xl.value){xe.value.show=!1;const s=t.clientX-oe.value.lastMouseX,{minX:l,maxX:i}=jt.value,p=i-l||1,b=s*.8;oe.value.offsetX+=b;const C=p/oe.value.scale,D=p-C,L=0,R=-D/p*O.value.width,N=L;oe.value.offsetX=Math.max(R,Math.min(N,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY}},Xo=()=>{oe.value.isDragging&&(oe.value.isDragging=!1,setTimeout(()=>{!oe.value.isDragging&&oe.value.isZooming},100))},sa=(t,s)=>{const l=t.filter(C=>C!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||s<=0)return l[0];if(s>=1)return l[l.length-1];let i=0;const p=[];for(let C=1;C<l.length;C++){const D=l[C].x-l[C-1].x,L=l[C].y-l[C-1].y,R=Math.sqrt(D*D+L*L);p.push(R),i+=R}const g=i*s;let b=0;for(let C=0;C<p.length;C++){const D=b+p[C];if(g<=D){const L=(g-b)/p[C],R=l[C],N=l[C+1];return{x:R.x+(N.x-R.x)*L,y:R.y+(N.y-R.y)*L}}b=D}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",[aa(),{"dss-chart-fill-width":qe.value,"dss-chart-fill-height":_e.value,"dss-chart-compact":vl.value&&!Je.value}]]),style:e.normalizeStyle({width:qe.value?"100%":Ce.value+"px",height:he.value,...qe.value||_e.value?{overflow:vl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...na.value,cursor:Do()}),"data-chart-type":de.value,ref_key:"containerEl",ref:F,onWheel:fo,onMousedown:vo,onMousemove:jl,onMouseup:Ao,onMouseleave:wl,onDblclick:so,onContextmenu:e.withModifiers(en,["prevent"]),onClick:e.withModifiers(Ot,["left"]),onWheelCapture:fo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",Ja,[Ye.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString(Ye.value),1)):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",ts,e.toDisplayString(xt.value),1)):e.createCommentVNode("",!0)]),Je.value&<.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.value==="vertical","dss-legend-top":lt.value==="top","dss-legend-bottom":lt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":be.value===i,"dss-legend-dimmed":be.value!==null&&be.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",ns,e.toDisplayString(l.name),1)],46,ls))),128))],2)):e.createCommentVNode("",!0),Je.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(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":be.value===i,"dss-legend-dimmed":be.value!==null&&be.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",as,e.toDisplayString(l.name),1)],46,os))),128))],2)):e.createCommentVNode("",!0)],512),_.showAddMarkerButton&&Ve.value&&Ne.value.addMarker&&(xl.value||al.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:po,title:e.unref(B)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:At.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,rs),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,ss)):e.createCommentVNode("",!0),e.createElementVNode("div",is,[al.value&&Rt.value?(e.openBlock(),e.createElementBlock("div",cs,"Bubble size: "+e.toDisplayString(Rt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ce.value,height:ge.value,class:"dss-chart-svg","data-smooth":re.value,"data-animated":Ie.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ee.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:Ce.value,height:O.value.height*4},null,8,ms)],8,ds),zl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:on.value},[e.createElementVNode("path",{d:ho.value},null,8,fs)],8,ps)):e.createCommentVNode("",!0),Bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:pn.value},[e.createElementVNode("path",{d:Ho.value},null,8,gs)],8,vs)):e.createCommentVNode("",!0)]),xl.value||al.value?(e.openBlock(),e.createElementBlock("g",hs,[Gt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ce.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:O.value.left,x2:O.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,ks))),128))],8,ys)):e.createCommentVNode("",!0),e.createElementVNode("g",Cs,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bs),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ws)]),e.createElementVNode("g",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,Es))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.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,Ss))),128)),tl.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(tl.value),9,Vs)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(Ft.value),9,Ns)):e.createCommentVNode("",!0)]),$l.value.length>0?(e.openBlock(),e.createElementBlock("g",Bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ce.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,_s)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,$s)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,Ls)):e.createCommentVNode("",!0)],8,Ms),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,Ts)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,O.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,As),e.createElementVNode("text",{x:l.x,y:Math.max(15,O.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,Ds)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ce.value},[Ll.value?(e.openBlock(),e.createElementBlock("g",Rs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":gl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Is)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Fs))],64))),128))],2),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Os))),128)),ft.value>0||Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(zo.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,ft.value)+2:q(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,qs))),128)):e.createCommentVNode("",!0)])])):de.value==="line"?(e.openBlock(),e.createElementBlock("g",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":gt.value.hasAnimated}]),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(Hl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${l.animationDelay}ms`})},null,14,Us))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+2:Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:l.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,Xs))),128)),ft.value>0||Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(uo.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,ft.value)+2:q(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Ys))),128)):e.createCommentVNode("",!0)])):de.value==="area"?(e.openBlock(),e.createElementBlock("g",js,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${_.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Gs)],8,Ks))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Q.value+.2:Q.value,mask:`url(#area-mask-${i}-${_.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+1:Xe.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({"--dss-path-length":l.pathLength,animationDelay:`${i*Dt.value}ms`})},null,14,Js))),128))])):de.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":gl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,er)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,tr))],64))),128))],2)):e.createCommentVNode("",!0)],8,Hs),te.value&&xe.value.show&&!oe.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ce.value},[e.createElementVNode("line",{x1:xe.value.x,x2:xe.value.x,y1:O.value.top,y2:O.value.bottom,stroke:Te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:xe.value.x,cy:l.y,r:U(ft.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,or))),128))],8,lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),al.value?(e.openBlock(),e.createElementBlock("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",sr,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:U(l.radius),fill:l.color,"fill-opacity":c(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>v(l,p),onMouseleave:p=>A(l),onClick:p=>u(l,p)},null,42,rr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:d(l)}),onLoad:p=>Un(i),onError:p=>ro(i),onMouseenter:p=>v(l,p),onMouseleave:p=>A(l),onClick:p=>u(l,p)},null,46,ir)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:nn.value},[de.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:_t.value,cy:Mt.value,r:wt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ur)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":de.value,"clip-path":Ro.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":kn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>rn(l.segment,p),onMouseleave:cn},null,42,mr))),128))],8,dr),Wn.value&&Oo.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vl.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,fr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),En.value&&(Oo.value||zl.value||Bn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Xl.value.x,y:Xl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Rl.value,fill:bl.value,class:"dss-radial-data-center"},e.toDisplayString(Sn.value),9,vr)):e.createCommentVNode("",!0),Zo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":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,gr),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,hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":hn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,cr)):e.createCommentVNode("",!0),Gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:nn.value},[Gt.value?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:_t.value,cy:Mt.value,r:U(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,br))),128)),e.createElementVNode("g",wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:_t.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,xr),e.createElementVNode("text",{x:_t.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(Ze(i)),9,Er)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:_t.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Sr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/Y.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/Y.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,Nr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:dl,onMouseleave:cn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":cl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Xe.value+1:Xe.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${i*Dt.value}ms`,transition:"all 0.2s ease"})},null,14,Br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:U(l.isHighlighted?ft.value+1:ft.value>0?ft.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*Dt.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>rn(p,b),onMouseleave:cn},null,46,Mr))),128))]))),128))],32)],8,kr)):e.createCommentVNode("",!0),e.createElementVNode("g",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:U(l.width/2),fill:Ut(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(Kt.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>Ql(i),onError:p=>vn(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Lr))),128))])],8,us))]),ie.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ce.value+"px",height:ge.value+"px",backgroundImage:`url('${Ml.value}')`,backgroundRepeat:"no-repeat",...bt.value,opacity:De.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.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:tt.value+"px",height:tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Bt(l),["stop"]),onMouseenter:p=>E(l,p),onMouseleave:le},[e.createElementVNode("img",{src:tn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ar)],44,Tr)),[[e.vShow,z.value]])),128)),Nt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Nt.value.x+"px",top:Nt.value.y+"px"})},[e.createElementVNode("div",Dr,e.toDisplayString(Nt.value.categoryValue),1),Nt.value.description?(e.openBlock(),e.createElementBlock("div",Hr,e.toDisplayString(Nt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xt.value&&(at.value.show||te.value&&xe.value.show&&!oe.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":te.value&&xe.value.show&&!oe.value.isZooming,"dss-spider-tooltip":Gl.value&&at.value.spiderAreas&&at.value.spiderAreas.length>0}]),style:e.normalizeStyle(So.value)},[!te.value||!xe.value.show||oe.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Gl.value&&at.value.spiderAreas&&at.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Ir,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Fr,e.toDisplayString(p.label),1),e.createElementVNode("span",zr,e.toDisplayString(p.value),1)]))),128))]))),128))])):al.value&&at.value.bubbleData&&at.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Pr,[at.value.title?(e.openBlock(),e.createElementBlock("div",Or,e.toDisplayString(at.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.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",Wr,[e.createElementVNode("div",Zr,e.toDisplayString(at.value.title),1),e.createElementVNode("div",Ur,e.toDisplayString(at.value.value),1)])),at.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[kl(at.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Xr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Yr,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(at.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",jr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(at.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(at.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",ei,[e.createElementVNode("div",ti,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",li,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",ni,[e.createElementVNode("div",oi,e.toDisplayString(al.value?M():_.categories[xe.value.categoryIndex]||`Category ${xe.value.categoryIndex+1}`),1),al.value?(e.openBlock(),e.createElementBlock("div",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.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(xe.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",si,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",ri,e.toDisplayString(fl(l.value)),1)]))),128))]),kl(xe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ii,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ci,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(xe.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ui,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",di,[e.createElementVNode("div",mi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(xe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",pi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",fi,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(xe.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",vi,[e.createElementVNode("div",gi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",hi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xl.value&&Me.value&&oe.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:so},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(oe.value.scale*100))+"% "+e.toDisplayString(e.unref(B)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qa),Je.value&<.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.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(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":be.value===i,"dss-legend-dimmed":be.value!==null&&be.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",ki,e.toDisplayString(l.name),1)],46,yi))),128))],2)):e.createCommentVNode("",!0),Ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Ct.value.x+"px",top:Ct.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ne.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:To},e.toDisplayString(e.unref(B)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ne.value.addMarker&&(Ne.value.downloadSvg||Ne.value.downloadPng||Ne.value.downloadCsv||Tt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),Ne.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:dn},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ne.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ne.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:no},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ne.value.downloadSvg||Ne.value.downloadPng||Ne.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",wi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(l)),style:e.normalizeStyle(Zn(l)),onClick:p=>In(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Nl(l),class:"dss-custom-menu-content"},null,8,Ei)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Si,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,xi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.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(Cl.value?e.unref(B)("chart.modalMarker.viewMarker"):Yl.value?e.unref(B)("chart.modalMarker.editMarker"):e.unref(B)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Bi,[e.createVNode(Wo,{id:"dss-marker-date",mode:"single",modelValue:Fe.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>Fe.value.date=l),"min-date":Dn.value,"max-date":Fl.value,disabled:Cl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Mi,[e.createElementVNode("label",_i,e.toDisplayString(e.unref(B)("chart.modalMarker.description")),1),Cl.value?(e.openBlock(),e.createElementBlock("div",$i,e.toDisplayString(Fe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>Fe.value.description=l),placeholder:e.unref(B)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Li)),[[e.vModelText,Fe.value.description]])])]),e.createElementVNode("div",Ti,[e.createElementVNode("div",Ai,[Yl.value&&!Cl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:W},e.toDisplayString(e.unref(B)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(Cl.value?e.unref(B)("chart.modalMarker.close"):e.unref(B)("chart.modalMarker.cancel")),1),Cl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(Fe.value.description&&Fe.value.description.length)},e.toDisplayString(Yl.value?e.unref(B)("chart.modalMarker.save"):e.unref(B)("chart.contextMenu.addMarker")),9,Hi))])])])])):e.createCommentVNode("",!0)],64))}}),Fi={class:"dss-modal-title"},zi={class:"dss-modal-actions"},qo={__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(_,{emit:J}){const B=_,$=J,ae=e.ref(null),F=e.ref(null),T=e.computed(()=>{const ee={"max-width":B.width};return B.height!=="auto"&&(ee.height=B.height,ee["min-height"]="0"),ee}),X=e.computed(()=>({}));function Qe(){$("close-modal")}function pe(){B.backDrop&&!ae.value&&$("close-modal")}function f(ee){ee.target.tagName==="INPUT"&&(ae.value=ee.target.tagName)}function we(){setTimeout(()=>{ae.value=null},300)}function fe(){const ee=document.body,ce=document.documentElement;F.value={bodyOverflow:ee.style.overflow,bodyPosition:ee.style.position,bodyTop:ee.style.top,bodyWidth:ee.style.width,htmlOverflow:ce.style.overflow,scrollY:window.scrollY},ee.style.overflow="hidden",ee.style.position="fixed",ee.style.top=`-${F.value.scrollY}px`,ee.style.width="100%",ee.style.left="0",ce.style.overflow="hidden"}function ne(){if(!F.value)return;const ee=document.body,ce=document.documentElement,{bodyOverflow:H,bodyPosition:ke,bodyTop:ve,bodyWidth:Oe,htmlOverflow:ot,scrollY:I}=F.value;ee.style.overflow=H||"",ee.style.position=ke||"",ee.style.top=ve||"",ee.style.width=Oe||"",ee.style.left="",ce.style.overflow=ot||"",window.scrollTo(0,I||0)}return e.watch(()=>B.showModal,ee=>{if(ee)fe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ce=document.getElementById("dss-modal-backdrop");ce&&(ce.addEventListener("focusin",f),ce.addEventListener("focusout",we))},100);else{ne(),document.body.classList.remove("dss-modal-open");const ce=document.getElementById("dss-modal-backdrop");ce&&(ce.removeEventListener("focusin",f),ce.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{B.showModal&&ne()}),(ee,ce)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:pe},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ce[0]||(ce[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":_.headerType,"font-size":_.titleSize})},[e.createElementVNode("h1",Fi,[e.renderSlot(ee.$slots,"title",{},()=>[ce[1]||(ce[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(ee.$slots,"title-data"),_.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Qe,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(ee.$slots,"content",{},()=>[ce[2]||(ce[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",zi,[e.renderSlot(ee.$slots,"actions")])])],4),[[e.vShow,_.showModal]])])):e.createCommentVNode("",!0)]))}},Pi={key:0,class:"dss-table-toolbar"},Oi={class:"dss-table-toolbar-left"},qi=["aria-expanded"],Wi={class:"dss-pagination-select-dropdown",role:"listbox"},Zi={class:"dss-table-column-visibility-label"},Ui={class:"dss-table-checkbox-wrapper"},Xi=["checked","onChange"],Yi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},ji={class:"dss-table-column-visibility-text"},Ki={class:"dss-table-toolbar-right"},Gi=["placeholder","aria-label"],Qi=["aria-label"],Ji=["aria-label","aria-expanded"],ec={key:1,class:"dss-table-toolbar-extra"},tc={class:"dss-table-thead"},lc={key:0,class:"dss-table-th dss-table-selection-column"},nc={key:0,class:"dss-table-checkbox-wrapper"},oc=["checked","indeterminate"],ac={key:0,class:"dss-table-checkbox__indeterminate"},sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},rc=["aria-label"],ic=["onClick"],cc={class:"dss-table-th-content"},uc={class:"dss-table-th-text"},dc={key:0},mc={key:1},pc={key:2},fc=["data-filter-column-key","aria-expanded","aria-label","onClick"],vc={class:"dss-table-tbody"},gc=["onClick"],hc={class:"dss-table-checkbox-wrapper"},yc=["type","name","checked","onChange"],kc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={key:1,class:"dss-table-checkbox__dot"},bc=["onClick"],wc=["aria-expanded","aria-label"],xc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ec={key:0,class:"dss-table-expansion-row"},Sc=["colspan"],Vc=["colspan"],Nc={key:1,class:"dss-table-pagination"},Bc={class:"dss-table-pagination-left"},Mc={key:0},_c={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},$c={class:"dss-table-pagination-center"},Lc={key:0,class:"dss-pagination-controls"},Tc=["disabled","title"],Ac=["disabled","title"],Dc=["aria-label","onKeydown"],Hc={class:"dss-pagination-of"},Rc=["disabled","title"],Ic=["disabled","title"],Fc={class:"dss-table-pagination-right"},zc={class:"dss-pagination-rows-label"},Pc=["aria-expanded"],Oc=["aria-selected","onClick"],qc={key:0,class:"dss-table-filter-row"},Wc=["value","placeholder"],Zc=["min","max","value"],Uc=["min","max","value"],Xc={class:"dss-table-filter-double-range-values"},Yc={key:2,class:"dss-table-filter-daterange"},jc={class:"dss-table-filter-daterange-row"},Kc={class:"dss-table-filter-daterange-label"},Gc=["value"],Qc={class:"dss-table-filter-daterange-row"},Jc={class:"dss-table-filter-daterange-label"},eu=["value"],tu=["value","placeholder"],lu={class:"dss-table-filter-list"},nu=["checked","onChange"],ou={class:"dss-table-filter-actions"},au={name:"DSSTable"},su=Object.assign(au,{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:_=>typeof _=="object"&&_!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(_,{emit:J}){const{t:B,locale:$}=Gn.useI18n(),ae=_,F=J,T={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 X(k,y){const x=Object.assign({},k);return Qe(k)&&Qe(y)&&Object.keys(y).forEach(W=>{Qe(y[W])?W in k?x[W]=X(k[W],y[W]):Object.assign(x,{[W]:y[W]}):Object.assign(x,{[W]:y[W]})}),x}function Qe(k){return k&&typeof k=="object"&&!Array.isArray(k)}const pe=e.computed(()=>X(T,ae.options)),f=e.computed(()=>{const k=pe.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),we=e.computed(()=>pe.value.table.height),fe=e.computed(()=>pe.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:fe.value})),ee=e.computed(()=>pe.value.table.expandable===!0),ce=e.computed(()=>pe.value.table.expandableRowData??null),H=e.computed(()=>pe.value.table.expandableRowCondition??null),ke=e.computed(()=>pe.value.table.truncated===!0),ve=e.computed(()=>pe.value.table.striped),Oe=e.computed(()=>pe.value.table.bordered),ot=e.computed(()=>pe.value.table.hoverable),I=e.computed(()=>pe.value.table.size),qe=e.computed(()=>pe.value.table.align||"left");e.computed(()=>pe.value.title.text),e.computed(()=>pe.value.subtitle.text);const _e=e.computed(()=>pe.value.selection.enabled),Ce=e.computed(()=>pe.value.selection.mode),pt=e.computed(()=>pe.value.sorting.enabled),ht=e.computed(()=>pe.value.sorting.mode),ge=e.computed(()=>pe.value.pagination.enabled),he=e.computed(()=>pe.value.pagination.rows),de=e.computed(()=>pe.value.pagination.rowsPerPageOptions),st=e.computed(()=>pe.value.pagination.showCounter!==!1),Ye=e.computed(()=>pe.value.pagination.showControlsGroup),xt=e.computed(()=>Ye.value===!1?!1:pe.value.pagination.showControls!==!1),Rt=e.computed(()=>Ye.value===!1?!1:pe.value.pagination.showRowsPerPage!==!1),tl=e.computed(()=>ge.value&&(st.value||xt.value||Rt.value)),Ft=e.computed(()=>pe.value.scrollable),rt=e.computed(()=>pe.value.emptyMessage||B("table.emptyMessage")),Vt=e.computed(()=>pe.value.toolbar?.downloads?.pdf!==!1),ll=e.computed(()=>pe.value.toolbar?.downloads?.excel!==!1),zt=e.computed(()=>pe.value.toolbar?.search!==!1),Gt=e.computed(()=>Vt.value||ll.value||zt.value||Je.value),Je=e.computed(()=>pe.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),$t=e.ref(!1),Xt=e.ref(null);let te=null;function Te(){$t.value?(te&&(clearTimeout(te),te=null),$t.value=!1,lt.value="",F("search",""),Xt.value?.blur()):($t.value=!0,te=setTimeout(()=>{te=null,Xt.value?.focus()},80))}function Me(){lt.value||($t.value=!1)}function Ue(){lt.value="",F("search",""),Xt.value?.focus()}const it=e.computed(()=>({"dss-table-striped":ve.value,"dss-table-bordered":Oe.value,"dss-table-hoverable":ot.value,[`dss-table-${I.value}`]:I.value!=="default","dss-table-truncated":ke.value})),Xe=(k,y)=>k?.field??k?.key??y,Ge=e.ref(new Set);function ft(){const k=new Set;ae.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Xe(y,x))}),Ge.value=k}const Ae=e.computed(()=>ae.columns.filter((k,y)=>Ge.value.has(Xe(k,y)))),q=k=>{const y=ae.columns.findIndex(x=>x===k);return Xe(k,y>=0?y:0)},U=(k,y)=>Ge.value.has(Xe(k,y));function Q(k,y){const x=Xe(k,y),W=new Set(Ge.value);W.has(x)?W.delete(x):W.add(x),Ge.value=W}const re=e.ref(null),Re=e.ref(!1);function ct(k){re.value&&!re.value.contains(k.target)&&(Re.value=!1)}const Et=e.computed(()=>Ae.value.length+(_e.value?1:0)+(ee.value?1:0)),Ie=(k,y)=>k?.id??k?.key??y,kt=e.ref(new Set),It=e.ref(null),Qt=(k,y)=>kt.value.has(Ie(k,y)),qt=(k,y)=>{if(!ee.value)return!1;if(typeof H.value=="function")return!!H.value(k,y);if(typeof ce.value=="string"&&ce.value.trim()){const x=Zt(k,ce.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Dt=(k,y,x)=>{if(x&&x.stopPropagation(),!qt(k,y))return;const W=Ie(k,y),me=new Set(kt.value);me.has(W)?(me.delete(W),F("row-collapse",{data:k,index:y})):(me.add(W),F("row-expand",{data:k,index:y})),kt.value=me},V=(k,y)=>{if(!ke.value)return;const x=Ie(k,y);It.value!==x&&(It.value=x)},w=e.ref(null),S=e.ref(0),j=e.ref([]),G=k=>{if(ht.value==="single")return w.value===k.field?S.value:0;{const y=j.value.find(x=>x.field===k.field);return y?y.order:0}},Ze=k=>{const y=G(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},vt=e.ref({}),Ve=e.ref(null),Ne=e.ref(null),Tt=220,At=e.ref(null),et=e.computed(()=>Ae.value.find(k=>q(k)===Ve.value)??null),tt=e.computed(()=>{if(!et.value||et.value.filter!=="range")return null;const k=et.value,y=Ve.value,{min:x,max:W}=Ml(k),me=k.filterMin??x,Bt=k.filterMax??W,mt=Z(y),Jt=mt.min??me,nl=mt.max??Bt,rl=Bt-me,ol=rl===0?0:(Jt-me)/rl*100,Kl=rl===0?100:(nl-me)/rl*100;return{rangeMin:me,rangeMax:Bt,currentMin:Jt,currentMax:nl,minPct:ol,maxPct:Kl}}),Lt=e.ref(null),fl=e.ref("max");function z(k){const y=Lt.value,x=tt.value;if(!y||!x)return;const W=y.getBoundingClientRect(),Bt=(k.clientX-W.left)/W.width*100,mt=(x.minPct+x.maxPct)/2;fl.value=Bt<mt?"min":"max"}function Z(k){return vt.value[k]??{}}function P(k,y){vt.value={...vt.value,[k]:y}}function ie(k){const y=vt.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 De(k){const y={...vt.value};delete y[k],vt.value=y,Ve.value=null,Ne.value=null}function ut(){if(!Ve.value){Ne.value=null;return}const k=At.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ve.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ne.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}const dt=e.computed(()=>{const k=String(lt.value??"").trim().toLowerCase();return k?ae.data.filter(y=>Ae.value.some(x=>bt(tn(y,x)).some(me=>String(me).toLowerCase().includes(k)))):ae.data}),je=e.computed(()=>{let k=[...dt.value];const y=(lt.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>ae.columns.some(W=>{if(!W||!W.field)return!1;const me=tn(x,W);return String(me??"").toLowerCase().includes(y)}))),Ae.value.forEach(x=>{const W=q(x),me=vt.value[W];if(!me)return;const Bt=x.field;if(Bt){if(me.type==="string"&&me.value?.trim()){const mt=me.value.trim().toLowerCase();k=k.filter(Jt=>{const nl=tn(Jt,x);return String(nl??"").toLowerCase().includes(mt)})}else if(me.type==="range")k=k.filter(mt=>{const Jt=Zt(mt,Bt),nl=Number(Jt);return!(Number.isNaN(nl)||me.min!=null&&nl<me.min||me.max!=null&&nl>me.max)});else if(me.type==="dateRange"){const mt=me.from?new Date(me.from).getTime():null,Jt=me.to?new Date(me.to).getTime():null;k=k.filter(nl=>{const rl=Zt(nl,Bt),ol=rl?new Date(rl).getTime():NaN;return!(Number.isNaN(ol)||mt!=null&&ol<mt||Jt!=null&&ol>Jt)})}else if(me.type==="list"&&me.selected?.length){const mt=new Set(me.selected);k=k.filter(Jt=>bt(tn(Jt,x)).some(rl=>mt.has(rl)))}}}),k});function bt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(bt);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 Wt(k){const y=new Set;return ae.data.forEach(x=>{bt(tn(x,k)).forEach(me=>y.add(me))}),Array.from(y).sort((x,W)=>String(x).localeCompare(String(W)))}function kl(k,y){if(Ve.value===k){Ve.value=null,Ne.value=null;return}if(Ve.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ne.value={top:x.bottom+6,left:Math.max(8,x.right-Tt)}}else ut()}function Zl(k,y){P(k,{type:"string",value:y})}function Ml(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,W=-1/0;return ae.data.forEach(me=>{const Bt=Zt(me,y),mt=Number(Bt);Number.isNaN(mt)||(x=Math.min(x,mt),W=Math.max(W,mt))}),{min:x===1/0?0:x,max:W===-1/0?100:W}}function Ul(k,y,x){const W={...Z(k),type:"range"},me=x===""?null:Number(x),Bt=me===null||Number.isNaN(me)?null:me;W[y]=Bt,Bt!=null&&(y==="min"&&W.max!=null&&Bt>W.max&&(W.max=Bt),y==="max"&&W.min!=null&&Bt<W.min&&(W.min=Bt)),P(k,W)}function hn(k,y,x){const W={...Z(k),type:"dateRange"};W[y]=x||"",P(k,W)}const yn=e.reactive({});function xn(k,y){yn[k]=y}function qn(k){const y=q(k),x=(yn[y]??"").trim().toLowerCase(),W=Wt(k);return x?W.filter(me=>String(me).toLowerCase().includes(x)):W}function Wn(k,y){return(Z(k).selected??[]).includes(y!=null?String(y):"")}function to(k,y){const W=[...Z(k).selected??[]],me=y!=null?String(y):"",Bt=W.indexOf(me);Bt>=0?W.splice(Bt,1):W.push(me),P(k,{type:"list",selected:W})}function En(k){Ve.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ve.value=null,Ne.value=null)}function Sn(){ut(),$l.value&&El()}const Rl=k=>{if(!(k.sortable===!1||!pt.value))if(ht.value==="single")w.value===k.field?S.value=S.value===1?-1:S.value===-1?0:1:(w.value=k.field,S.value=1),S.value===0&&(w.value=null),F("sort",{field:w.value,order:S.value});else{const y=j.value.findIndex(x=>x.field===k.field);y>=0?j.value[y].order===1?j.value[y].order=-1:j.value.splice(y,1):j.value.push({field:k.field,order:1}),F("sort",{multiSortMeta:j.value})}},Xl=e.computed(()=>{if(!pt.value)return je.value;let k=[...je.value];return ht.value==="single"&&w.value&&S.value!==0?k.sort((y,x)=>{const W=Zt(y,w.value),me=Zt(x,w.value);return W===me?0:W==null?1:me==null?-1:(W<me?-1:W>me?1:0)*S.value}):ht.value==="multiple"&&j.value.length>0&&k.sort((y,x)=>{for(const W of j.value){const me=Zt(y,W.field),Bt=Zt(x,W.field);if(me===Bt)continue;if(me==null)return 1;if(Bt==null)return-1;const mt=me<Bt?-1:me>Bt?1:0;if(mt!==0)return mt*W.order}return 0}),k}),bl=e.ref(0),Vl=e.ref(he.value),$l=e.ref(!1),Il=e.ref(null),Tn=e.ref(null),An=e.ref("bottom"),Vn=e.ref(null),Pt=k=>{Vl.value=k,$l.value=!1,bl.value=0,F("page",{page:0,rows:Vl.value})};function be(k){Il.value&&!Il.value.contains(k.target)&&($l.value=!1)}function El(){const k=Il.value,y=Tn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const W=y.getBoundingClientRect(),me=x.offsetHeight||0,mt=(window.innerHeight||document.documentElement.clientHeight)-W.bottom,Jt=W.top;An.value=mt<me+8&&Jt>mt?"top":"bottom",Vn.value={width:`${Math.ceil(W.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const at=e.computed(()=>Xl.value.length),Nt=e.computed(()=>Math.ceil(at.value/Vl.value)),xe=e.computed(()=>Math.max(Nt.value,1)),Ct=e.computed(()=>at.value===0?0:nt.value+1),oe=e.computed(()=>Fe.value),nt=e.computed(()=>ge.value?bl.value*Vl.value:0),Fe=e.computed(()=>ge.value?Math.min((bl.value+1)*Vl.value,at.value):at.value),Dn=e.computed(()=>{if(!ge.value)return Xl.value;const k=nt.value,y=Fe.value;return Xl.value.slice(k,y)}),Fl=e.ref(new Set),Yl=e.computed(()=>Xl.value.filter((k,y)=>Fl.value.has(Ie(k,y)))),Cl=e.computed(()=>{const k=Xl.value.length;return k>0&&Fl.value.size===k}),Nn=e.computed(()=>{const k=Xl.value.length,y=Fl.value.size;return y>0&&y<k}),un=(k,y)=>Fl.value.has(Ie(k,y)),jl=()=>{if(Cl.value)Fl.value=new Set,F("unselect-all");else{const k=new Set;Xl.value.forEach((y,x)=>k.add(Ie(y,x))),Fl.value=k,F("select-all",Yl.value)}},wl=(k,y)=>{const x=Ie(k,y),W=new Set(Fl.value),me=W.has(x);Ce.value==="single"?me?(W.delete(x),F("row-unselect",k)):(W.clear(),W.add(x),F("row-select",k)):me?(W.delete(x),F("row-unselect",k)):(W.add(x),F("row-select",k)),Fl.value=W},en=e.ref("1"),Ot=()=>{const k=Number.parseInt(String(en.value),10);if(!Number.isFinite(k)){en.value=String(bl.value+1);return}const y=Math.min(xe.value,Math.max(1,k));y!==bl.value+1?Nl(y-1):en.value=String(y)},Nl=k=>{k<0||k>=Nt.value||(bl.value=k,F("page",{page:k,rows:Vl.value}))},lo=(k,y,x)=>{F("row-click",{data:k,index:y,originalEvent:x}),V(k,nt.value+y)},Zn=(k,y)=>{const x=nt.value+y;return{"dss-table-row-selected":un(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ke.value,"dss-table-row-truncated-expanded":It.value===Ie(k,x)}},tn=(k,y)=>y.field?Zt(k,y.field):"",Zt=(k,y)=>y.split(".").reduce((x,W)=>x&&x[W],k),Hn=k=>{const y=k.align??qe.value;return{"dss-table-sortable":k.sortable!==!1&&pt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Rn=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(()=>ae.locale,k=>{k&&k!==$.value&&($.value=k)},{immediate:!0}),e.watch(he,k=>{Vl.value=k,bl.value=0}),e.watch($l,async k=>{k&&(await e.nextTick(),El())}),e.watch(bl,k=>{en.value=String(k+1)},{immediate:!0}),e.watch(lt,k=>{F("search",k??"")}),e.watch(()=>ae.columns,()=>{ft()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",be),document.addEventListener("click",ct),document.addEventListener("click",En),window.addEventListener("resize",Sn),window.addEventListener("scroll",Sn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",be),document.removeEventListener("click",ct),document.removeEventListener("click",En),window.removeEventListener("resize",Sn),window.removeEventListener("scroll",Sn,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:At,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[Gt.value?(e.openBlock(),e.createElementBlock("div",Pi,[e.createElementVNode("div",Oi,[Vt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>F("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(B)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ll.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>F("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(B)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Je.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:re},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Re.value}]),onClick:y[2]||(y[2]=x=>Re.value=!Re.value),"aria-expanded":Re.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(B)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,qi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,(x,W)=>(e.openBlock(),e.createElementBlock("li",{key:Xe(x,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Zi,[e.createElementVNode("span",Ui,[e.createElementVNode("input",{type:"checkbox",checked:U(x,W),onChange:me=>Q(x,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Xi),U(x,W)?(e.openBlock(),e.createElementBlock("span",Yi,[...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",ji,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Re.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ki,[zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":$t.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Xt,"onUpdate:modelValue":y[4]||(y[4]=x=>lt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(B)("table.searchPlaceholder"),"aria-label":e.unref(B)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>$t.value=!0),onBlur:Me},null,40,Gi),[[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(B)("table.clearSearchAriaLabel"),onClick:Ue},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Qi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(B)("table.searchAriaLabel"),"aria-expanded":$t.value||!!lt.value,onMousedown:e.withModifiers(Te,["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,Ji)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ec,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ft.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",it.value])},[e.createElementVNode("thead",tc,[e.createElementVNode("tr",null,[_e.value?(e.openBlock(),e.createElementBlock("th",lc,[Ce.value==="multiple"?(e.openBlock(),e.createElementBlock("span",nc,[e.createElementVNode("input",{type:"checkbox",checked:Cl.value,indeterminate:Nn.value,onChange:jl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,oc),Nn.value?(e.openBlock(),e.createElementBlock("span",ac)):Cl.value?(e.openBlock(),e.createElementBlock("span",sc,[...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),ee.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(B)("table.expandRowAriaLabel")},null,8,rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(x,W)=>(e.openBlock(),e.createElementBlock("th",{key:q(x),class:e.normalizeClass(["dss-table-th",Hn(x)]),style:e.normalizeStyle(Rn(x)),onClick:me=>Rl(x)},[e.createElementVNode("div",cc,[e.createElementVNode("span",uc,e.toDisplayString(x.header),1),x.sortable!==!1&&pt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ze(x)])},[G(x)===0?(e.openBlock(),e.createElementBlock("span",dc,[...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)])])):G(x)===1?(e.openBlock(),e.createElementBlock("span",mc,[...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)])])):G(x)===-1?(e.openBlock(),e.createElementBlock("span",pc,[...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":Ve.value===q(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(q(x))}]),"data-filter-column-key":q(x),"aria-expanded":Ve.value===q(x),"aria-label":e.unref(B)("table.filterColumnAriaLabel"),onClick:me=>kl(q(x),me)},[...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,fc)],2)):e.createCommentVNode("",!0)])],14,ic))),128))])]),e.createElementVNode("tbody",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(x,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie(x,nt.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Zn(x,W)]),style:e.normalizeStyle(ne.value),onClick:me=>lo(x,W,me)},[_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",hc,[e.createElementVNode("input",{type:Ce.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${_.tableId}`,checked:un(x,nt.value+W),onChange:me=>wl(x,nt.value+W),class:e.normalizeClass(["dss-table-checkbox",Ce.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,yc),Ce.value==="multiple"&&un(x,nt.value+W)?(e.openBlock(),e.createElementBlock("span",kc,[...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)])])):Ce.value==="single"&&un(x,nt.value+W)?(e.openBlock(),e.createElementBlock("span",Cc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(me=>Dt(x,nt.value+W,me),["stop"])},[qt(x,nt.value+W)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Qt(x,nt.value+W),"aria-label":Qt(x,nt.value+W)?e.unref(B)("table.collapseRowAriaLabel"):e.unref(B)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Qt(x,nt.value+W)}]),"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,wc)):(e.openBlock(),e.createElementBlock("span",xc))],8,bc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(me,Bt)=>(e.openBlock(),e.createElementBlock("td",{key:q(me),class:e.normalizeClass(["dss-table-td",Hn(me)]),style:e.normalizeStyle(Rn(me))},[e.renderSlot(k.$slots,`cell-${me.field}`,{data:x,column:me,rowIndex:W,isExpanded:It.value===Ie(x,nt.value+W)},()=>[e.createTextVNode(e.toDisplayString(tn(x,me)),1)])],6))),128))],14,gc),ee.value&&qt(x,nt.value+W)&&Qt(x,nt.value+W)?(e.openBlock(),e.createElementBlock("tr",Ec,[e.createElementVNode("td",{colspan:Et.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:W})],8,Sc)])):e.createCommentVNode("",!0)],64))),128)),Dn.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:Et.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(rt.value),1)])],8,Vc)],4))])],2)],2),tl.value?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",Bc,[st.value?(e.openBlock(),e.createElementBlock("span",Mc,e.toDisplayString(e.unref(B)("table.showingRange",{start:Ct.value,end:oe.value,total:at.value})),1)):(e.openBlock(),e.createElementBlock("span",_c," "))]),e.createElementVNode("div",$c,[xt.value?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[8]||(y[8]=x=>Nl(0)),title:e.unref(B)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Tc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[9]||(y[9]=x=>Nl(bl.value-1)),title:e.unref(B)("table.previousPage")}," ‹ ",8,Ac),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>en.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(B)("table.currentPageAriaLabel"),onBlur:Ot,onKeydown:e.withKeys(e.withModifiers(Ot,["prevent"]),["enter"])},null,40,Dc),[[e.vModelText,en.value]]),e.createElementVNode("span",Hc,e.toDisplayString(e.unref(B)("table.ofPages",{total:xe.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Nt.value-1,onClick:y[11]||(y[11]=x=>Nl(bl.value+1)),title:e.unref(B)("table.nextPage")}," › ",8,Rc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Nt.value-1,onClick:y[12]||(y[12]=x=>Nl(Nt.value-1)),title:e.unref(B)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ic)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fc,[Rt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Il},[e.createElementVNode("span",zc,e.toDisplayString(e.unref(B)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":$l.value}]),onClick:y[13]||(y[13]=x=>$l.value=!$l.value),"aria-expanded":$l.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Tn},[e.createTextVNode(e.toDisplayString(Vl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Pc),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":An.value==="top"}]),style:e.normalizeStyle(Vn.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Vl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Vl.value}]),onClick:W=>Pt(x)},e.toDisplayString(x),11,Oc))),128))],6),[[e.vShow,$l.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(Ne.value?{top:Ne.value.top+"px",left:Ne.value.left+"px",width:Tt+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[et.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[et.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",qc,[e.createElementVNode("input",{type:"text",value:Z(Ve.value).value??"",onInput:y[14]||(y[14]=x=>Zl(Ve.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(B)("table.search")},null,40,Wc)])):et.value.filter==="range"&&tt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":tt.value.minPct+"%","--range-max-pct":tt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Lt,class:"dss-table-filter-double-range-track",onMousemove:z,onMouseenter:z},[e.createElementVNode("input",{type:"range",min:tt.value.rangeMin,max:tt.value.rangeMax,value:tt.value.currentMin,onInput:y[15]||(y[15]=x=>Ul(Ve.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:fl.value==="min"?2:1})},null,44,Zc),e.createElementVNode("input",{type:"range",min:tt.value.rangeMin,max:tt.value.rangeMax,value:tt.value.currentMax,onInput:y[16]||(y[16]=x=>Ul(Ve.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:fl.value==="max"?2:1})},null,44,Uc)],544),e.createElementVNode("div",Xc,e.toDisplayString(tt.value.currentMin)+" – "+e.toDisplayString(tt.value.currentMax),1)],4)):et.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Yc,[e.createElementVNode("div",jc,[e.createElementVNode("label",Kc,e.toDisplayString(e.unref(B)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Z(Ve.value).from??"",onInput:y[17]||(y[17]=x=>hn(Ve.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Gc)]),e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(B)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Z(Ve.value).to??"",onInput:y[18]||(y[18]=x=>hn(Ve.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,eu)])])):et.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:yn[Ve.value]??"",onInput:y[19]||(y[19]=x=>xn(Ve.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(B)("table.search")},null,40,tu),e.createElementVNode("div",lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn(et.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Wn(Ve.value,x),onChange:W=>to(Ve.value,x)},null,40,nu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",ou,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>De(Ve.value))},e.toDisplayString(e.unref(B)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ve.value&&et.value&&Ne.value]])]),_:1})]))],64))}}),ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",cu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",uu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",pu={class:"dss-toolbar-left"},fu=["title"],vu=["title"],gu={class:"dss-toolbar-dropdown-wrapper"},hu=["title"],yu=["src"],ku=["src"],Cu=["src"],bu=["src"],wu=["src"],xu=["src"],Eu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Su=["src"],Vu=["src"],Nu=["src"],Bu=["src"],Mu=["src"],_u=["src"],$u=["title"],Lu=["title"],Tu=["title"],Au=["title"],Du=["title"],Hu=["title"],Ru=["title"],Iu=["title"],Fu=["title"],zu={key:2,class:"dss-toolbar-separator"},Pu=["title"],Ou={key:4,class:"dss-toolbar-separator"},qu={key:5,class:"dss-toolbar-dropdown-wrapper"},Wu=["title"],Zu={class:"dss-toolbar-dropdown-ai"},Uu={class:"dss-toolbar-right"},Xu={key:0,class:"dss-toolbar-custom-group"},Yu={key:1,class:"dss-toolbar-separator"},ju={class:"dss-link-modal-content"},Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],ld={class:"dss-image-modal-tabs"},nd={key:0,class:"dss-image-tab-content"},od={class:"dss-link-modal-content"},ad={class:"dss-link-modal-field"},sd={key:0,class:"dss-link-modal-label"},rd=["src"],id={class:"dss-link-modal-field"},cd={class:"dss-link-modal-label"},ud=["placeholder"],dd={class:"dss-link-modal-field"},md={class:"dss-link-modal-label"},pd=["placeholder"],fd={class:"dss-link-modal-field"},vd={class:"dss-link-modal-label"},gd=["placeholder"],hd={key:1,class:"dss-image-tab-content"},yd={class:"dss-link-modal-content"},kd={class:"dss-link-modal-field"},Cd={class:"dss-link-modal-label"},bd=["placeholder"],wd={class:"dss-link-modal-field"},xd={class:"dss-link-modal-label"},Ed=["placeholder"],Sd={class:"dss-link-modal-field"},Vd={class:"dss-link-modal-label"},Nd=["placeholder"],Bd={class:"dss-link-modal-field"},Md={class:"dss-link-modal-label"},_d=["placeholder"],$d={class:"dss-text-editor-title-input-container"},Ld={key:0,class:"dss-text-editor-title-preview"},Td={key:0},Ad={key:1,class:"dss-text-editor-preview-placeholder"},Dd=["value","placeholder","disabled"],Hd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Rd={class:"dss-text-editor-description-input-container"},Id={key:0,class:"dss-text-editor-description-preview"},Fd={key:0},zd={key:1,class:"dss-text-editor-preview-placeholder"},Pd=["value","placeholder","disabled"],Od={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},qd=["data-comment-id","onMouseenter"],Wd=["onClick"],Zd=["src","alt"],Ud={key:1},Xd=["onClick"],Yd=["src","alt"],jd={key:1},Kd=["data-has-second-user","onClick"],Gd={class:"editor-comment-marker-count"},Qd={key:4,class:"dss-text-editor-textarea-wrapper"},Jd=["value","placeholder","rows","disabled"],e1={class:"dss-text-editor-footer"},t1={class:"dss-text-editor-footer-content"},l1={class:"dss-text-editor-footer-stat"},n1={class:"dss-text-editor-footer-stat"},o1={key:5,class:"dss-text-editor-content-wrapper"},a1={key:0,class:"dss-comment-overlay-body"},s1={class:"dss-comment-selection-wrapper"},r1=["innerHTML"],i1={class:"dss-comment-messages-wrapper"},c1={key:0,class:"dss-comment-avatar-wrapper"},u1={class:"dss-comment-avatar"},d1=["src","alt"],m1={key:1},p1={class:"dss-comment-header"},f1={class:"dss-comment-header-text"},v1={class:"dss-comment-author"},g1={key:0,class:"dss-comment-date"},h1=["onClick","title"],y1={class:"dss-comment-overlay-inner"},k1=["placeholder","onKeydown"],C1={class:"dss-text-editor-footer"},b1={class:"dss-text-editor-footer-content"},w1={class:"dss-text-editor-footer-stat"},x1={class:"dss-text-editor-footer-stat"},E1=["title"],S1=["title"],V1={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:""},N1={class:"dss-image-popup-content"},B1={key:0,class:"dss-image-popup-no-alt-icon"},M1=["title"],_1=["title"],$1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},L1={class:"dss-toolbar-left"},T1=["title"],A1=["title"],D1={class:"dss-toolbar-dropdown-wrapper"},H1=["title"],R1=["src"],I1=["src"],F1=["src"],z1=["src"],P1=["src"],O1=["src"],q1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},W1=["title"],Z1=["title"],U1=["title"],X1=["title"],Y1=["title"],j1=["title"],K1=["title"],G1=["title"],Q1=["title"],J1=["title"],em={key:2,class:"dss-toolbar-separator"},tm={key:3,class:"dss-toolbar-dropdown-wrapper"},lm=["title"],nm={class:"dss-toolbar-dropdown-ai"},om={key:0,class:"dss-toolbar-right"},am={key:0,class:"dss-toolbar-separator"},sm={key:0,class:"dss-toolbar-custom-group"},rm={key:1,class:"dss-toolbar-separator"},im={name:"DSSTextEditor"},cm=Object.assign(im,{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:_=>typeof _=="object"&&_!==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:_=>typeof _=="object"&&_!==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(_,{expose:J,emit:B}){const{t:$,locale:ae}=Gn.useI18n(),F={h1:ru,h2:iu,h3:cu,h4:uu,h5:du,h6:mu},T=_,X=B,Qe=e.useSlots(),pe=`<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),p=document.createElement("a");p.href=i,p.download=nl("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Ot()}catch(t){console.error("Error downloading CSV:",t)}},In=t=>{if(typeof t.action=="function"){const s={series:H.series,categories:H.categories,markers:nt.value},l={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:clampedCategoryIndex||bt.value.categoryIndex};t.action(s,l)}Ot()},To=()=>{x(),Fe.value.show=!0,Fe.value.categoryIndex=bt.value.categoryIndex,Fe.value.fromButton=!1,Ot()},po=()=>{x(),Fe.value.show=!0,Fe.value.categoryIndex=0,Fe.value.fromButton=!0},oo=t=>{if(bt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(bt.value.show=!1)}},ao=t=>{bt.value.show&&!t.target.closest(".context-menu")&&(bt.value.show=!1)},fo=t=>{if(!xl.value||!Me.value)return;t.preventDefault(),t.stopPropagation(),oe.value.isZooming=!0,we.value.show=!1,oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout);const l=t.currentTarget.getBoundingClientRect(),i=t.clientX-l.left,p=t.clientY-l.top;if(i<O.value.left-50||i>O.value.right+50||p<O.value.top-50||p>O.value.bottom+100){oe.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,b=Math.max(oe.value.minScale,Math.min(oe.value.maxScale,oe.value.scale*g));if(b!==oe.value.scale){const{minX:C,maxX:D}=jt.value,L=D-C||1,R=L/oe.value.scale,N=C-oe.value.offsetX/O.value.width*L,K=(i-O.value.left)/O.value.width,xe=N+K*R;oe.value.scale=b;const We=L/oe.value.scale,re=xe-K*We;oe.value.offsetX=-(re-C)/L*O.value.width,oe.value.scale<=1.01&&(oe.value.scale=1,oe.value.offsetX=0)}oe.value.zoomTimeout=setTimeout(()=>{oe.value.isZooming=!1,oe.value.zoomTimeout=null},300)},vo=t=>{if(!xl.value||!Me.value||oe.value.scale<=1)return;we.value.show=!1;const l=t.currentTarget.getBoundingClientRect();t.clientX-l.left,t.clientY-l.top,oe.value.isDragging=!0,oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY,t.preventDefault()},Ao=()=>{oe.value.isDragging=!1},so=()=>{!xl.value||!Me.value||(oe.value.scale=1,oe.value.offsetX=0,oe.value.isDragging=!1,oe.value.zoomTimeout&&(clearTimeout(oe.value.zoomTimeout),oe.value.zoomTimeout=null),oe.value.isZooming=!1)},Do=()=>!xl.value||!El.value||!Me.value?"default":oe.value.isDragging?"grabbing":oe.value.scale>1?"grab":"dss-crosshair",Fn=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let l=0;l<t.length-1;l++){const i=t[Math.max(l-1,0)],p=t[l],g=t[l+1],b=t[Math.min(l+2,t.length-1)],C=p.x+(g.x-i.x)/6*Re.value,D=p.y+(g.y-i.y)/6*Re.value,L=g.x-(b.x-p.x)/6*Re.value,R=g.y-(b.y-p.y)/6*Re.value;s+=` C ${C} ${D} ${L} ${R} ${g.x} ${g.y}`}return s},Sl=e.computed(()=>{const s=I.value?.chart?.padding,l=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(tl.value?30:0)+60;if(Gl.value){const N={left:p+40,top:p+40,right:p+40,bottom:p+40};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??N.left,top:i.top??N.top,right:i.right??N.right,bottom:i.bottom??N.bottom}:N}if(vl.value){const N=!Je.value,K=Ul.value,xe=K?yn.value+xn.value+Math.max(24,hn.value+16):0,We=N?12:p;let re=0;$e.value&&(re+=N?8:15),rt.value&&(re+=N?6:10);const he=Oe();let Be=We+(N?4:16)+(K?xe:0),de=We+(K?xe:0);Je.value&<.value==="left"?Be+=he.legendWidth||150:Je.value&<.value==="right"&&(de+=he.legendWidth||150);const Pe=ae.value==="semi-radial"?K?xe:8:K?xe:N?8:p+80,Le=K?14:0,_e=We+re+Le,He={left:Be,top:_e,right:de,bottom:Pe};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??He.left,top:i.top??He.top,right:i.right??He.right,bottom:i.bottom??He.bottom}:He}let b=0;$e.value&&(b+=15),rt.value&&(b+=10);const C=Oe();let D=p+16,L=p;Je.value&<.value==="left"?D+=C.legendWidth||150:Je.value&<.value==="right"&&(L+=C.legendWidth||150);const R={left:D,top:p+b,right:L,bottom:g};return l!=null?{left:l,top:l,right:l,bottom:l}:i?{left:i.left??R.left,top:i.top??R.top,right:i.right??R.right,bottom:i.bottom??R.bottom}:R}),O=e.computed(()=>({left:Sl.value.left,top:Sl.value.top,right:ke.value-Sl.value.right,bottom:ge.value-Sl.value.bottom,width:ke.value-(Sl.value.left+Sl.value.right),height:ge.value-(Sl.value.top+Sl.value.bottom)})),xl=e.computed(()=>["line","area","bar"].includes(ae.value)||Xe.value),Ll=e.computed(()=>Xe.value),Bn=e.computed(()=>ae.value==="mini-radial"),vl=e.computed(()=>["radial","semi-radial","mini-radial"].includes(ae.value)),Gl=e.computed(()=>ae.value==="spider"),al=e.computed(()=>ae.value==="bubble"),gl=e.computed(()=>I.value?.chart?.orientation==="horizontal"&&(ae.value==="bar"||Ll.value)),ln=t=>{const{minY:s,maxY:l}=jt.value,i=l-s||1;return O.value.left+(t-s)/i*O.value.width},Tl=t=>{const{maxX:s}=jt.value,l=s+1,p=O.value.height/l;return O.value.top+(t+.5)*p},_t=e.computed(()=>vl.value?Sl.value.left+(ke.value-Sl.value.left-Sl.value.right)/2:ke.value/2),Mt=e.computed(()=>Gl.value?ge.value/2-40:vl.value?Sl.value.top+(ge.value-Sl.value.top-Sl.value.bottom)/2:ge.value/2),xt=e.computed(()=>{if(Gl.value){const t=O.value.width-80,s=O.value.height-80;return Math.min(t,s)/2}return Math.min(O.value.width,O.value.height)/2}),il=e.computed(()=>{const t=I.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,l=typeof s=="number"&&s>=0&&s<=1?s:.45;return xt.value*l}),go=e.computed(()=>{const t=I.value,s=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(vl.value||Gl.value)?1:1+s/100}),nn=e.computed(()=>{const t=go.value;if(t===1||t<=0)return;const s=_t.value,l=Mt.value;return`translate(${s}, ${l}) scale(${t}) translate(${-s}, ${-l})`}),Al=e.ref(0),on=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),zl=e.computed(()=>ae.value==="semi-radial"),Yt=e.computed(()=>zl.value&&Ie.value&&!ml.value),zn=e.computed(()=>zl.value&&Ie.value&&!ml.value&&Ct.value==="fill"),ho=e.computed(()=>{const t=Yt.value?Al.value:1,s=_t.value,l=Mt.value,i=il.value,p=xt.value,g=Math.PI,b=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;const C=s+p*Math.cos(g),D=l+p*Math.sin(g),L=s+p*Math.cos(b),R=l+p*Math.sin(b),N=s+i*Math.cos(b),K=l+i*Math.sin(b),xe=s+i*Math.cos(g),We=l+i*Math.sin(g),re=t>.5?1:0;return`M ${s} ${l} L ${C} ${D} A ${p} ${p} 0 ${re} 1 ${L} ${R} L ${N} ${K} A ${i} ${i} 0 ${re} 1 ${xe} ${We} Z`}),mn=e.computed(()=>{if(!(!zl.value||!Yt.value)&&!zn.value)return`url(#${on.value})`}),kn=t=>{if(!(!zn.value||t!==0))return`url(#${on.value})`},Dl=e.ref(0),pn=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Bl=e.computed(()=>ae.value==="radial"),Ho=e.computed(()=>{const t=Bl.value?Dl.value:1,s=_t.value,l=Mt.value,i=Math.max(xt.value*1.5,ke.value,ge.value);if(t<=0)return`M ${s} ${l} L ${s} ${l} Z`;if(t>=1){const N=s-i,K=s+i;return`M ${N} ${l} A ${i} ${i} 0 0 1 ${K} ${l} A ${i} ${i} 0 0 1 ${N} ${l} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,b=s+i*Math.cos(p),C=l+i*Math.sin(p),D=s+i*Math.cos(g),L=l+i*Math.sin(g),R=t>=.5?1:0;return`M ${s} ${l} L ${b} ${C} A ${i} ${i} 0 ${R} 1 ${D} ${L} Z`}),Ro=e.computed(()=>{if(mn.value)return mn.value;if(Bl.value)return`url(#${pn.value})`});let an=null;const yo=()=>{if(!Yt.value)return;Al.value=0;const t=It.value,s=performance.now(),l=i=>{const p=i-s,g=Math.min(1,p/t);Al.value=Ol(qt.value,g),g<1&&(an=requestAnimationFrame(l))};an=requestAnimationFrame(l)},Mn=e.computed(()=>I.value?.bubbles?.minSize||8),ko=e.computed(()=>I.value?.bubbles?.maxSize||50),Co=e.computed(()=>I.value?.bubbles?.opacity||.7),bo=(t,s)=>{const l=[15,20,25,18,22],i=l[t%l.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Un=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},ro=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Pl=e.computed(()=>H.series),Cn=e.computed(()=>H.series.filter((t,s)=>!Pt.value.has(s))),sn="auto",jt=e.computed(()=>{if(al.value)return wo();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(C=>{C.data&&C.data.length&&(l=Math.max(l,C.data.length-1),C.data.forEach(D=>{typeof D=="number"&&(t=Math.min(t,D),s=Math.max(s,D))}))}),H.categories.length>0&&(l=Math.max(l,H.categories.length-1)),t===1/0&&(t=0,s=100);const i=st.value,p=Vt.value;let g,b;if(i===sn){const C=s-t,D=C>0?C*.1:1;g=Math.max(0,t-D)}else if(typeof i=="number")g=i;else{const C=s-t,D=C>0?C*.1:1;g=Math.max(0,t-D)}if(p===sn){const C=s-t,D=C>0?C*.1:2;b=s+D}else if(typeof p=="number")b=p;else{const C=s-t,D=C>0?C*.1:2;b=s+D}return{minX:0,maxX:l,minY:g,maxY:b}}),wo=()=>{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,p=1/0,g=-1/0,b=!1;if(Cn.value.forEach((xe,We)=>{xe?.data?.length&&xe.data.forEach((re,he)=>{let Be,de,Ke;if(typeof re=="object"&&re!==null&&!Array.isArray(re))Be=typeof re.x=="number"?re.x:he,de=typeof re.y=="number"?re.y:0,Ke=typeof re.size=="number"?re.size:20;else if(Array.isArray(re)&&re.length>=3)Be=typeof re[0]=="number"?re[0]:he,de=typeof re[1]=="number"?re[1]:0,Ke=typeof re[2]=="number"?re[2]:20;else if(typeof re=="number")Be=he,de=re,Ke=bo(We,he);else return;isFinite(Be)&&isFinite(de)&&isFinite(Ke)&&(t=Math.min(t,Be),s=Math.max(s,Be),l=Math.min(l,de),i=Math.max(i,de),p=Math.min(p,Ke),g=Math.max(g,Ke),b=!0)})}),!b)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,H.categories?.length-1||8)),l===i&&(l=Math.max(0,l-10),i=l+20);const C=s-t,D=i-l;let L,R,N,K;return ll.value!==null?L=ll.value:L=t-C*.1,zt.value!==null?R=zt.value:R=s+C*.1,st.value!==null&&typeof st.value=="number"?N=st.value:N=Math.max(0,l-D*.1),Vt.value!==null&&typeof Vt.value=="number"?K=Vt.value:K=i+D*.1,{minX:L,maxX:R,minY:N,maxY:K,minSize:p,maxSize:g}},sl=t=>{if(al.value){const{minX:C,maxX:D}=jt.value,L=D-C||1;return O.value.left+(t-C)/L*O.value.width}const{minX:s,maxX:l}=jt.value,i=l-s;if(l===0||i===0)return O.value.left+O.value.width/2;const p=i/oe.value.scale,g=s-oe.value.offsetX/O.value.width*i,b=(t-g)/p;return O.value.left+b*O.value.width},hl=t=>{const{minY:s,maxY:l}=jt.value,i=l-s||1;return O.value.bottom-(t-s)/i*O.value.height},xo=t=>{if(!al.value)return ft.value||4;const{maxSize:s}=jt.value,l=Math.max(1,s),i=Math.min(1,Math.max(0,t/l));return Mn.value+i*(ko.value-Mn.value)},Io=e.computed(()=>Xn.value.map(t=>({y:t.y}))),bn=e.computed(()=>{if(al.value)return fn();if(ae.value==="bar"){if(gl.value){const _e=[],{minY:He,maxY:St}=jt.value,Rt=5,ql=St-He||1;for(let pl=0;pl<=Rt;pl++){const Wl=He+ql*(pl/Rt),No=ln(Wl);_e.push({x:No,y:O.value.bottom+20,text:fl(Math.round(Wl))})}return _e}const he=[],{maxX:Be}=jt.value,de=Be+1,Ke=5,Le=(O.value.width-Ke*2)/de;for(let _e=0;_e<=Be;_e++){const He=O.value.left+Ke+(_e+.5)*Le;he.push({x:He,y:O.value.bottom+20,text:H.categories[_e]||B("chart.fallback.item",{number:_e+1})})}return he}const t=[],{minX:s,maxX:l}=jt.value,i=ll.value!==null?ll.value:s,p=zt.value!==null?zt.value:l,g=p-i||1,b=g/oe.value.scale,C=i-oe.value.offsetX/O.value.width*g,D=C+b,L=Math.max(0,Math.floor(C-2)),R=Math.min(p,Math.ceil(D+2)),N=R-L,K=O.value.width,We=Math.floor(K/60);let re=1;N>We&&(re=Math.ceil(N/We));for(let he=L;he<=R;he+=re)if(he>=0&&he<=p){const Be=sl(he);Be>=O.value.left-100&&Be<=O.value.right+100&&t.push({x:Be,y:O.value.bottom+20,text:H.categories[he]||`Item ${he+1}`})}return t}),fn=()=>{const t=[],{minX:s,maxX:l}=jt.value,i=l-s||1,p=Math.min(8,Math.max(4,Math.floor(O.value.width/80)));for(let g=0;g<=p;g++){const b=s+i*g/p,C=sl(b);if(C>=O.value.left-10&&C<=O.value.right+10){const D=Math.round(b),L=H.categories?.[D];t.push({x:C,y:O.value.bottom+20,text:L||(Number.isInteger(b)?b.toString():b.toFixed(1))})}}return t},Xn=e.computed(()=>{if(gl.value){const p=[],{maxX:g}=jt.value;for(let b=0;b<=g;b++)p.push({x:O.value.left-10,y:Tl(b),text:H.categories[b]||`Item ${b+1}`});return p}const t=[],{minY:s,maxY:l}=jt.value,i=5;for(let p=0;p<=i;p++){const g=s+(l-s)*(p/i),b=Math.round(g);t.push({x:O.value.left-10,y:hl(g),text:fl(b)})}return t}),Ut=t=>{const s=Et.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,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)l=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const C=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(C)l=Number(C[1])/255,i=Number(C[2])/255,p=Number(C[3])/255;else{const D=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(D){let L=D[1];L.length===3&&(L=L[0]+L[0]+L[1]+L[1]+L[2]+L[2]),l=parseInt(L.slice(0,2),16)/255,i=parseInt(L.slice(2,4),16)/255,p=parseInt(L.slice(4,6),16)/255}else if(typeof document<"u"){const L=document.createElement("span");L.style.color=s,L.style.display="none",document.body.appendChild(L);const R=getComputedStyle(L).color;document.body.removeChild(L);const N=R.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(N)l=Number(N[1])/255,i=Number(N[2])/255,p=Number(N[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*l+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},io=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)),b=Math.max(0,Math.floor(Number(l[2])*.65)),C=Math.max(0,Math.floor(Number(l[3])*.65));return`rgb(${g}, ${b}, ${C})`}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)),b=Math.max(0,Math.floor(Number(i[2])*.65)),C=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${b}, ${C}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),C=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),D=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[b,C,D].map(L=>L.toString(16).padStart(2,"0")).join("")}`}return s},co=(t,s)=>{const i=I.value?.stroke?.color;return i==null?io(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??io(s):io(s)},_n=t=>{let s=0;for(let l=1;l<t.length;l++){const i=t[l].x-t[l-1].x,p=t[l].y-t[l-1].y;s+=Math.sqrt(i*i+p*p)}return s},Hl=e.computed(()=>ae.value==="line"||Ll.value?(Ll.value?H.series.filter(s=>(s.type||ae.value)==="line"):Pl.value).map((s,l)=>{const i=H.series.findIndex(N=>N===s),p=[];let g=[];s.data.forEach((N,K)=>{N==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:gl.value?ln(N):sl(K),y:gl.value?Tl(K):hl(N),index:K})}),g.length>0&&p.push(g);let b="";p.forEach(N=>{if(N.length>0){let K="";ie.value?K=Fn(N):K=`M ${N[0].x} ${N[0].y}`+N.slice(1).map(xe=>` L ${xe.x} ${xe.y}`).join(""),b+=(b?" ":"")+K}});const C=p.reduce((N,K)=>N+_n(K),0),D=Pt.value.has(i),L=Ce.value===i,R=Ce.value!==null&&Ce.value!==i;return{path:b,color:Ut(i),pathLength:C,seriesIndex:i,animationDelay:l*Ht.value,isHighlighted:L,isDimmed:R,isHidden:D}}):[]),Eo=e.computed(()=>{if(!(ae.value==="line"||Ll.value))return[];const t=Ll.value?H.series.filter(l=>(l.type||ae.value)==="line"):Pl.value,s=[];return t.forEach((l,i)=>{const p=H.series.findIndex(g=>g===l);for(let g=0;g<l.data.length-1;g++){const b=l.data[g];if(b!=null){let C=-1,D=0;for(let L=g+1;L<l.data.length;L++){const R=l.data[L];if(R==null)D++;else{C=L;break}}if(D>0&&C!==-1){const L=l.data[C],R=gl.value?ln(b):sl(g),N=gl.value?Tl(g):hl(b),K=gl.value?ln(L):sl(C),xe=gl.value?Tl(C):hl(L),We=Pt.value.has(p),re=Ce.value===p,he=Ce.value!==null&&Ce.value!==p;s.push({path:`M ${R} ${N} L ${K} ${xe}`,color:Ut(p),seriesIndex:p,animationDelay:i*Ht.value,isHighlighted:re,isDimmed:he,isHidden:We,gapSize:D}),g=C-1}}}}),s}),wn=e.computed(()=>ae.value==="line"||Ll.value?!Ie.value||ml.value||gt.value.hasAnimated?[]:(Ll.value?H.series.filter(s=>(s.type||ae.value)==="line"):Pl.value).map((s,l)=>{const i=H.series.findIndex(D=>D===s);let p="",g=null;s.data.forEach((D,L)=>{if(D!=null){const R={x:gl.value?ln(D):sl(L),y:gl.value?Tl(L):hl(D)};g===null?p+=`M ${R.x} ${R.y}`:p+=` L ${R.x} ${R.y}`,g=R}else if(g!==null){const R=s.data.findIndex((N,K)=>K>L&&N!==null&&N!==void 0);if(R!==-1){const N={x:gl.value?ln(s.data[R]):sl(R),y:gl.value?Tl(R):hl(s.data[R])};p+=` L ${N.x} ${N.y}`,g=N}}});const b=s.data.map((D,L)=>D==null?null:{x:gl.value?ln(D):sl(L),y:gl.value?Tl(L):hl(D)}).filter(D=>D!==null),C=_n(b);return{path:p,pathLength:C,color:Ut(i),animationDelay:l*Ht.value,seriesIndex:i}}):[]),uo=e.computed(()=>{if(ae.value!=="line")return[];const t=[];return Pl.value.forEach((s,l)=>{const i=Ce.value===l,p=Ce.value!==null&&Ce.value!==l,g=Pt.value.has(l);s.data.forEach((b,C)=>{b!=null&&t.push({x:sl(C),y:hl(b),color:Ut(l),value:b,label:H.categories[C]||C.toString(),seriesName:s.name,categoryIndex:C,dataIndex:C,animationDelay:(l*s.data.length+C)*(Ht.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),zo=e.computed(()=>{if(!Ll.value)return[];const t=[];return H.series.filter(l=>(l.type||ae.value)==="line").forEach((l,i)=>{const p=H.series.findIndex(D=>D===l),g=Ce.value===p,b=Ce.value!==null&&Ce.value!==p,C=Pt.value.has(p);l.data.forEach((D,L)=>{D!=null&&t.push({x:sl(L),y:hl(D),color:Ut(p),value:D,label:H.categories[L]||L.toString(),seriesName:l.name,categoryIndex:L,dataIndex:L,animationDelay:(i*l.data.length+L)*(Ht.value/8),isHighlighted:g,isDimmed:b,isHidden:C})})}),t}),Pn=e.computed(()=>{if(!al.value)return[];const t=[];return Pl.value.forEach((s,l)=>{if(!s?.data?.length)return;const i=Ce.value,p=i!==null&&i===l,g=i!==null&&i!==l,b=Pt.value.has(l);s.data.forEach((C,D)=>{let L,R,N,K,xe;if(typeof C=="object"&&C!==null&&!Array.isArray(C))L=typeof C.x=="number"?C.x:D,R=typeof C.y=="number"?C.y:0,N=typeof C.size=="number"?C.size:20,K=C.label||H.categories?.[D]||`Point ${D+1}`,xe=C.image||C.imageUrl;else if(Array.isArray(C)&&C.length>=3)L=typeof C[0]=="number"?C[0]:D,R=typeof C[1]=="number"?C[1]:0,N=typeof C[2]=="number"?C[2]:20,K=C[3]||H.categories?.[D]||`Point ${D+1}`,xe=C[4];else if(typeof C=="number")L=D,R=C,N=bo(l,D),K=H.categories?.[D]||`Point ${D+1}`;else return;!isFinite(L)||!isFinite(R)||!isFinite(N)||t.push({x:sl(L),y:hl(R),radius:xo(N),originalX:L,originalY:R,originalSize:N,color:Ut(l),seriesName:s.name||`Series ${l+1}`,label:K,imageUrl:xe,seriesIndex:l,dataIndex:D,categoryIndex:Math.round(L),isHighlighted:p,isDimmed:g,isHidden:b,opacity:Co.value})})}),t}),Yn=e.computed(()=>ae.value!=="area"?[]:Pl.value.map((t,s)=>{const l=[];let i=[];if(t.data.forEach((N,K)=>{N==null?i.length>0&&(l.push([...i]),i=[]):i.push({x:sl(K),y:hl(N),index:K})}),i.length>0&&l.push(i),l.length===0)return{linePath:"",areaPath:"",color:Ut(s),isHidden:Pt.value.has(s)};const p=O.value.bottom+1;let g="",b="";l.forEach((N,K)=>{if(N.length===0)return;let xe=`M ${N[0].x} ${N[0].y}`;ie.value&&N.length>1?xe=Fn(N):N.slice(1).forEach(re=>{xe+=` L ${re.x} ${re.y}`}),g+=(g?" ":"")+xe;let We=`M ${N[0].x} ${p}`;if(We+=` L ${N[0].x} ${N[0].y}`,ie.value&&N.length>1){const re=Fn(N),he=re.substring(re.indexOf("C")||re.indexOf("Q")||re.indexOf("L"));he?We+=" "+he:N.slice(1).forEach(Be=>{We+=` L ${Be.x} ${Be.y}`})}else N.slice(1).forEach(re=>{We+=` L ${re.x} ${re.y}`});We+=` L ${N[N.length-1].x} ${p} Z`,b+=(b?" ":"")+We});const C=Ce.value===s,D=Ce.value!==null&&Ce.value!==s,L=Pt.value.has(s),R=l.reduce((N,K)=>N+_n(K),0);return{linePath:g,areaPath:b,color:Ut(s),pathLength:R,isHighlighted:C,isDimmed:D,isHidden:L}})),o=e.computed(()=>{if(!(["bar"].includes(ae.value)||Ll.value))return[];const t=[],{maxX:s}=jt.value,l=Ll.value?H.series.filter(p=>(p.type||ae.value)==="bar"):Pl.value,i=l.length;if(gl.value){const p=s+1,b=O.value.height/p,C=b*(2/3),D=Math.min(4,C/i*.15),L=C-(i-1)*D,R=Math.max(4,L/i);l.forEach((N,K)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,he=Pt.value.has(xe);N.data.forEach((Be,de)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Le=O.value.top+(de+.5)*b-C/2+K*(R+D),_e=O.value.left,He=Math.abs(ln(Be)-O.value.left);let St="";if(ie.value&&He>0){const Rt=Math.min(ct.value,R/2,He/2);St=[`M ${_e} ${Le}`,`L ${_e+He-Rt} ${Le}`,`Q ${_e+He} ${Le} ${_e+He} ${Le+Rt}`,`L ${_e+He} ${Le+R-Rt}`,`Q ${_e+He} ${Le+R} ${_e+He-Rt} ${Le+R}`,`L ${_e} ${Le+R}`,"Z"].join(" ")}t.push({x:_e,y:Le,width:He,height:R,color:Ut(i===1?de:xe),value:Be,label:H.categories[de]||de.toString(),seriesName:N.name,animationDelay:(K*l.length+de)*(Ht.value/4),isHighlighted:We,isDimmed:re,isHidden:he,barPath:St,isSmooth:ie.value&&He>0})})})}else{const p=s+1,b=O.value.width/p,C=b*.8,D=C/i,L=D*.05,R=D-L;l.forEach((N,K)=>{const xe=H.series.findIndex(Be=>Be===N),We=Ce.value===xe,re=Ce.value!==null&&Ce.value!==xe,he=Pt.value.has(xe);N.data.forEach((Be,de)=>{if(Be==null||typeof Be!="number"||!isFinite(Be))return;const Le=O.value.left+(de+.5)*b-C/2+K*D+L/2,_e=hl(Math.max(0,Be)),He=Math.abs(hl(0)-hl(Be));let St="";if(ie.value&&He>0){const Rt=Math.min(ct.value,R/2,He/2);St=[`M ${Le} ${_e+He}`,`L ${Le} ${_e+Rt}`,`Q ${Le} ${_e} ${Le+Rt} ${_e}`,`L ${Le+R-Rt} ${_e}`,`Q ${Le+R} ${_e} ${Le+R} ${_e+Rt}`,`L ${Le+R} ${_e+He}`,"Z"].join(" ")}t.push({x:Le,y:_e,width:R,height:He,color:Ut(i===1?de:xe),value:Be,label:H.categories[de]||de.toString(),seriesName:N.name,animationDelay:(K*l.length+de)*(Ht.value/4),isHighlighted:We,isDimmed:re,isHidden:he,barPath:St,isSmooth:ie.value&&He>0})})})}return t}),n=e.computed(()=>{if(!vl.value)return[];const t=Pl.value.map((b,C)=>({series:b,originalIndex:C})).filter(({originalIndex:b})=>!Pt.value.has(b));if(t.length===0)return[];let s=ae.value==="semi-radial"?Math.PI:-Math.PI/2;const l=ae.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(b,C,D,L,R,N)=>{const K=b+(C-b)/2,xe=C-b,We=_t.value+Math.cos(b)*il.value,re=Mt.value+Math.sin(b)*il.value,he=_t.value+Math.cos(C)*il.value,Be=Mt.value+Math.sin(C)*il.value,de=_t.value+Math.cos(C)*xt.value,Ke=Mt.value+Math.sin(C)*xt.value,Pe=_t.value+Math.cos(b)*xt.value,Le=Mt.value+Math.sin(b)*xt.value,_e=xe>Math.PI?1:0,He=[`M ${We} ${re}`,`A ${il.value} ${il.value} 0 ${_e} 1 ${he} ${Be}`,`L ${de} ${Ke}`,`A ${xt.value} ${xt.value} 0 ${_e} 0 ${Pe} ${Le}`,"Z"].join(" "),St=N||Ut(D);return{path:He,color:St,strokeWidth:Ge.value,strokeColor:co(i.length,St),value:R,seriesName:L,opacity:.8,isHighlighted:Ce.value===D,isDimmed:Ce.value!==null&&Ce.value!==D,isHidden:!1,startAngle:b,endAngle:C,midAngle:K}};if(Bn.value){const{series:b,originalIndex:C}=t[0],D=Number(b?.data?.[0]??0),L=Number.isFinite(D)?Math.min(Math.max(D,0),100):0,R=I.value,N=Math.min(Math.max(Number(R?.miniRadial?.minVisiblePercent??1),0),100),xe=(L<=0?N:L)/100*l,We=Number(R?.miniRadial?.thresholds?.low??33),re=Number(R?.miniRadial?.thresholds?.medium??66),he=R?.miniRadial?.colors?.low||"#E53E3E",Be=R?.miniRadial?.colors?.medium||"#ED8936",de=R?.miniRadial?.colors?.high||"#38A169",Ke=L<=We?he:L<=re?Be:de,Pe=R?.miniRadial?.trackColor||"#E5E7EB",Le=b?.name||"Score";return i.push(p(s,s+l-.001,C+1,"Track",100,Pe)),i.push(p(s,s+xe,C,Le,L,Ke)),i}if(t.length===1){const{series:b,originalIndex:C}=t[0],D=b.data[0]||0,L=s,R=s+l-.001,N=L+l/2,K=_t.value+Math.cos(L)*il.value,xe=Mt.value+Math.sin(L)*il.value,We=_t.value+Math.cos(R)*il.value,re=Mt.value+Math.sin(R)*il.value,he=_t.value+Math.cos(R)*xt.value,Be=Mt.value+Math.sin(R)*xt.value,de=_t.value+Math.cos(L)*xt.value,Ke=Mt.value+Math.sin(L)*xt.value,Pe=1,Le=[`M ${K} ${xe}`,`A ${il.value} ${il.value} 0 ${Pe} 1 ${We} ${re}`,`L ${he} ${Be}`,`A ${xt.value} ${xt.value} 0 ${Pe} 0 ${de} ${Ke}`,"Z"].join(" "),_e=Ut(C);return i.push({path:Le,color:_e,strokeWidth:Ge.value,strokeColor:co(0,_e),value:D,seriesName:b.name,opacity:.8,isHighlighted:Ce.value===C,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:R,midAngle:N}),i}if(zn.value&&t.length===2){const b=t[0],C=t[1],D=Math.min(100,Math.max(0,b.series.data[0]||0)),L=D/100*l;return i.push(p(s,s+L,b.originalIndex,b.series.name,D)),i.push(p(s,s+l,C.originalIndex,C.series.name,100)),i}const g=t.reduce((b,{series:C})=>b+(C.data[0]||0),0);return g===0?[]:(t.forEach(({series:b,originalIndex:C})=>{const D=b.data[0]||0,L=D/g*l,R=s,N=s+L,K=R+L/2,xe=_t.value+Math.cos(R)*il.value,We=Mt.value+Math.sin(R)*il.value,re=_t.value+Math.cos(N)*il.value,he=Mt.value+Math.sin(N)*il.value,Be=_t.value+Math.cos(N)*xt.value,de=Mt.value+Math.sin(N)*xt.value,Ke=_t.value+Math.cos(R)*xt.value,Pe=Mt.value+Math.sin(R)*xt.value,Le=L>Math.PI?1:0,_e=[`M ${xe} ${We}`,`A ${il.value} ${il.value} 0 ${Le} 1 ${re} ${he}`,`L ${Be} ${de}`,`A ${xt.value} ${xt.value} 0 ${Le} 0 ${Ke} ${Pe}`,"Z"].join(" "),He=Ut(C);i.push({path:_e,color:He,strokeWidth:Ge.value,strokeColor:co(i.length,He),value:D,seriesName:b.name,opacity:.8,isHighlighted:Ce.value===C,isDimmed:Ce.value!==null&&Ce.value!==C,isHidden:!1,startAngle:R,endAngle:N,midAngle:K}),s=N}),i)}),a=e.computed(()=>{const t=n.value;return zn.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(!Ul.value||!vl.value)return[];const t=hn.value,s=yn.value,l=xn.value,i=qn.value,p=15,g=t*1.3,b=.55,C=(N,K)=>{const xe=_t.value+Math.cos(N.midAngle)*xt.value,We=Mt.value+Math.sin(N.midAngle)*xt.value,re=_t.value+Math.cos(N.midAngle)*(xt.value+s),he=Mt.value+Math.sin(N.midAngle)*(xt.value+s),de=re+l*(K?1:-1),Ke=K?re+p:re-p,Pe=he-i,Le=`${N.seriesName}: ${fl(N.value)}`,_e=Le.length*t*b;return{pointerStartX:xe,pointerStartY:We,pointerEndX:re,pointerEndY:he,horizontalEndX:de,horizontalEndY:he,textX:Ke,textY:Pe,text:Le,textWidth:_e,textAnchor:K?"start":"end",isRightSide:K,pointerLineLength:Math.hypot(re-xe,he-We),horizontalLineLength:Math.hypot(de-re,0)}},D=(N,K)=>{const xe=Math.abs(N.textY-K.textY)<g,We=N.isRightSide?N.textX:N.textX-N.textWidth,re=N.isRightSide?N.textX+N.textWidth:N.textX,he=K.isRightSide?K.textX:K.textX-K.textWidth,Be=K.isRightSide?K.textX+K.textWidth:K.textX,de=We<Be&&he<re;return xe&&de},L=n.value.filter(N=>!N.isHidden),R=[];for(let N=0;N<L.length;N++){const K=L[N];let xe=Math.cos(K.midAngle)>=0;if(N>0){const re=R[N-1],he=C(K,xe);D(re,he)&&(xe=!xe)}const We=C(K,xe);R.push({...We,color:K.color,isHighlighted:K.isHighlighted,isDimmed:K.isDimmed})}return R}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||Co.value||.7;return Ce.value===null||Ce.value===void 0?s:Ce.value!==null?t.seriesIndex===Ce.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 Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(Ce.value===t.seriesIndex?Ce.value=null:Ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const l=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:H.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(),On.value=!0,Ce.value=t.seriesIndex,we.value.show=!1,!Xt.value))return;const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const b=200,C=120;p+b>ke.value&&(p=s.clientX-i.left-b-10),g+C>i.height&&(g=s.clientY-i.top-C-10),p<0&&(p=10),g<0&&(g=10);const D=Tn.value,L=An.value,R=D.map(N=>{const K=L[N]||N,xe=h(N,t);return xe?{seriesName:t.seriesName,label:t.label,value:`${K}: ${xe}`,color:t.color}:null}).filter(Boolean);at.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:R,categoryIndex:void 0,spiderAreas:[]}},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=Vn.value[t];if(typeof i=="function")return i(l,s);if(typeof l=="number"){const p=l.toFixed(1);return Lt.value?p+Lt.value:p}return l?.toString()||""},M=()=>{if(!al.value||!we.value.data||we.value.data.length===0)return"Bubbles";const t=[],s=new Set;return we.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"},A=(t,s)=>{t&&(On.value=!1,Ce.value=null,at.value.show=!1,at.value.bubbleData=[])},E=(t,s)=>{const l=s.target.closest(".dss-custom-chart-container");if(!l)return;const i=l.getBoundingClientRect(),p=Zt(t.categoryIndex),g=t.description||t.comment||"";let b=s.clientX-i.left+15,C=s.clientY-i.top-10;const D=200,L=g?80:50;b+D>ke.value&&(b=s.clientX-i.left-D-15),C+L>ge.value&&(C=s.clientY-i.top-L-10),b<0&&(b=10),C<0&&(C=10),Nt.value={show:!0,x:b,y:C,categoryValue:p,description:g}},le=()=>{Nt.value.show=!1},Y=e.computed(()=>H.categories.length||Math.max(...Cn.value.map(t=>t.data.length))),ze=e.computed(()=>{let t=0;return Cn.value.forEach(s=>{s.data.forEach(l=>{typeof l=="number"&&(t=Math.max(t,l))})}),t||100}),Ee=e.computed(()=>{const t=[],s=Y.value;for(let l=0;l<s;l++){const i=l*2*Math.PI/s-Math.PI/2,p=_t.value+Math.cos(i)*xt.value,g=Mt.value+Math.sin(i)*xt.value;t.push({x:p,y:g,angle:i,index:l})}return t}),yt=e.computed(()=>{const t=[],s=Y.value;return Ee.value.forEach((l,i)=>{const p=xt.value+15,g=i*2*Math.PI/s-Math.PI/2,b=_t.value+Math.cos(g)*p,C=Mt.value+Math.sin(g)*p+5;let D="middle",L="middle";Math.abs(Math.cos(g))>.5&&(D=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(L=Math.sin(g)>0?"hanging":"auto"),t.push({x:b,y:C,text:H.categories[i]||`Axis ${i+1}`,anchor:D,baseline:L})}),t}),yl=e.ref(new Set),cl=(t,s,l)=>{const i=`current-${l}`,p=yl.value.has(i);return!p&&Ce.value===null?s.fillOpacity||S.value:s.isHighlighted||p?(s.fillOpacity||S.value)+.15:s.isDimmed?(s.fillOpacity||S.value)*.3:s.fillOpacity||S.value},el=e.computed(()=>{if(!Gl.value)return[];const t=[],s=Y.value;return Pl.value.forEach((l,i)=>{const p=[],g=[],b=[],C=Ce.value===i,D=Ce.value!==null&&Ce.value!==i,L=Pt.value.has(i);for(let R=0;R<s;R++){const N=l.data[R]||0,xe=N/ze.value*xt.value,We=R*2*Math.PI/s-Math.PI/2,re=_t.value+Math.cos(We)*xe,he=Mt.value+Math.sin(We)*xe;p.push(`${re},${he}`),g.push({x:re,y:he}),b.push({x:re,y:he,value:N,label:H.categories[R]||`Axis ${R+1}`,seriesName:l.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:b,color:Ut(i),fillOpacity:S.value,seriesName:l.name,value:`${l.name}: ${l.data.join(", ")}`,isHighlighted:C,isDimmed:D,isHidden:L,seriesIndex:i})}),t}),ul=(t,s)=>{if(!s||s.length<3)return!1;let l=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,b=s[i].y,C=s[p].x,D=s[p].y;b>t.y!=D>t.y&&t.x<(C-g)*(t.y-b)/(D-b)+g&&(l=!l)}return l},dl=t=>{if(!Gl.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const l=s.getBoundingClientRect(),i=T.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,b=el.value.filter(C=>C.isHidden?!1:ul({x:p,y:g},C.polygonPoints));if(b.length>0){b.length,Ce.value=b[0].seriesIndex;const C=t.clientX-l.left+10,D=t.clientY-l.top-10,L=b.length>1?460:260,R=70+Y.value*20;let N=C,K=D;N+L>ke.value&&(N=t.clientX-l.left-L-10),K+R>ge.value&&(K=t.clientY-l.top-R-10),N<0&&(N=10),K<0&&(K=10);const xe=b.map(We=>({seriesName:We.seriesName,color:We.color,points:We.dataPoints.map(re=>({label:re.label,value:fl(re.value)}))}));at.value={show:!0,x:N,y:K,title:"",value:"",bubbleData:[],spiderAreas:xe}}else cn()},Kt=e.computed(()=>{const t=I.value;return t.logos.map((s,l)=>{const i=H.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Pt.value.has(s.seriesIndex))return null;let p,g;if(xl.value){let C=-1,D=null;for(let R=i.data.length-1;R>=0;R--)if(i.data[R]!==null&&i.data[R]!==void 0){C=R,D=i.data[R];break}if(C===-1||D===null)return null;const L=i.data.map((R,N)=>R==null?null:{x:sl(N),y:hl(R),index:N}).filter(R=>R!==null);if(t.animations.enabled&&!ml.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(gt.value.isAnimating||!gt.value.hasAnimated))if(gt.value.isAnimating){const R=gt.value.currentFrame/gt.value.totalFrames,N=Ol(t.animations.easing,Math.min(R,1)),K=sa(L,N);p=K.x+(s.offsetX||0),g=K.y+(s.offsetY||0)}else p=L[0].x+(s.offsetX||0),g=L[0].y+(s.offsetY||0);else p=sl(C)+(s.offsetX||0),g=hl(D)+(s.offsetY||0)}else if(vl.value||Gl.value){const C=Math.PI*2/t.logos.length*l;p=_t.value+Math.cos(C)*(xt.value+30)+(s.offsetX||0),g=Mt.value+Math.sin(C)*(xt.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Ql=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),l=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),l&&(l.style.opacity="1")},vn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Jl=t=>{Pt.value.has(t)?Pt.value.delete(t):Pt.value.add(t)},So=e.computed(()=>{if(!at.value.show&&!(te.value&&we.value.show&&!oe.value.isZooming))return{display:"none"};let t,s;if(te.value&&we.value.show&&!oe.value.isZooming){t=we.value.x+15,s=O.value.top;const l=al.value?200:150;t+l>ke.value&&(t=we.value.x-l-15),t<0&&(t=10),s<10&&(s=10)}else t=at.value.x,s=at.value.y;return{left:t+"px",top:s+"px"}}),rn=(t,s)=>{if(!Xt.value||$n.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const b=200,C=120,D=ke.value,L=ge.value;p+b>D&&(p=s.clientX-i.left-b-10),g+C>L&&(g=s.clientY-i.top-C-10),p<0&&(p=10),g<0&&(g=10);let R;typeof t.categoryIndex=="number"?R=t.categoryIndex:typeof t.dataIndex=="number"?R=t.dataIndex:t.label&&H.categories.includes(t.label)&&(R=H.categories.indexOf(t.label));const N=(gl.value||ae.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";at.value={show:!0,x:p,y:g,title:N,value:fl(t.value)||"",categoryIndex:R,spiderAreas:[]}},mo=e.ref(!1),On=e.ref(!1),cn=()=>{at.value.show=!1,at.value.spiderAreas=[],at.value.bubbleData=[],we.value.show=!1,mo.value||(Ce.value=null)},$n=e.ref(!1),gn=(t,s)=>{$n.value=!0,at.value.show=!1,we.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const b=250;p+b>ke.value&&(p=s.clientX-i.left-b-15),p<0&&(p=10),g<0&&(g=10),Il.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},Ln=()=>{$n.value=!1,Il.value.show=!1},gt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Ol=(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}},ml=e.computed(()=>w.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Po=()=>{if(!Ie.value||ml.value){gt.value.hasAnimated=!0,Bl.value&&(Dl.value=1);return}Bl.value&&(Dl.value=0),gt.value.isAnimating=!0,gt.value.currentFrame=0,gt.value.totalFrames=Math.ceil(It.value/16.67);const t=()=>{const s=gt.value.currentFrame/gt.value.totalFrames,l=Ol(qt.value,Math.min(s,1));ta(l),Bl.value&&(Dl.value=l),s<1?(gt.value.currentFrame++,gt.value.animationId=requestAnimationFrame(t)):la()};gt.value.animationId=requestAnimationFrame(t)},ta=t=>{const s=F.value;s&&s.style.setProperty("--dss-animation-progress",t)},la=()=>{gt.value.isAnimating=!1,gt.value.hasAnimated=!0,Bl.value&&(Dl.value=1),gt.value.animationId&&(cancelAnimationFrame(gt.value.animationId),gt.value.animationId=null)},Oo=e.computed(()=>!vl.value||gt.value.hasAnimated?!0:Bl.value?Dl.value>=1:zl.value?Al.value>=1:!0),Zo=e.computed(()=>Ul.value&&Oo.value),Vo=e.ref(!1);e.watch(Zo,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const na=e.computed(()=>{if(!Ie.value||ml.value||gt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${It.value}ms`,t["--dss-animation-easing"]=oa(qt.value),t["--dss-stagger-delay"]=`${Ht.value}ms`,t}),oa=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",aa=()=>{if(!Ie.value||ml.value)return"";const t=["dss-chart-animated"];return gt.value.hasAnimated||t.push(`dss-animate-${Ct.value}`),gt.value.hasAnimated||(vl.value&&ae.value!=="semi-radial"?t.push("dss-animate-fill"):vl.value||t.push(`dss-animate-${Ct.value}`)),gt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,s)=>{V.value&&s&>.value.hasAnimated&&(gt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Po(),Qt.value)}))},{deep:!0}),e.watch(()=>oe.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{k()},50)}),e.watch(()=>[oe.value.scale,oe.value.offsetX],()=>{!oe.value.isZooming&&!oe.value.isDragging&&k()},{flush:"post"}),e.watch([Ue,it],([t,s])=>{oe.value.minScale=t,oe.value.maxScale=s,(oe.value.scale<t||oe.value.scale>s)&&so()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==$.value&&($.value=t)},{immediate:!0}),e.watch(()=>bt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",ao)}):document.removeEventListener("click",ao)}),e.onMounted(()=>{Ce.value=null,Bl.value&&(!Ie.value||ml.value)&&(Dl.value=1),Jt(),F.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(be&&cancelAnimationFrame(be),be=requestAnimationFrame(()=>{be=null;const{width:l,height:i}=s.contentRect;Qe.value=Math.round(l),pe.value=Math.round(i),X.value&&(pt.value=X.value.offsetHeight||fe)}))}),f.observe(F.value)),Ie.value&&!ml.value?ae.value==="semi-radial"?setTimeout(()=>yo(),Qt.value):setTimeout(()=>Po(),Qt.value):(gt.value.hasAnimated=!0,ae.value==="semi-radial"&&(Al.value=1)),document.addEventListener("mousemove",Uo),document.addEventListener("mouseup",Xo),document.addEventListener("click",oo)}),e.onUnmounted(()=>{be&&cancelAnimationFrame(be),f&&F.value&&(f.unobserve(F.value),f.disconnect(),f=null),gt.value.animationId&&cancelAnimationFrame(gt.value.animationId),an&&(cancelAnimationFrame(an),an=null),oe.value.zoomTimeout&&clearTimeout(oe.value.zoomTimeout),document.removeEventListener("mousemove",Uo),document.removeEventListener("mouseup",Xo),document.removeEventListener("click",oo),document.removeEventListener("click",ao)});const Uo=t=>{if(oe.value.isDragging&&oe.value.scale>1&&xl.value){we.value.show=!1;const s=t.clientX-oe.value.lastMouseX,{minX:l,maxX:i}=jt.value,p=i-l||1,b=s*.8;oe.value.offsetX+=b;const C=p/oe.value.scale,D=p-C,L=0,R=-D/p*O.value.width,N=L;oe.value.offsetX=Math.max(R,Math.min(N,oe.value.offsetX)),oe.value.lastMouseX=t.clientX,oe.value.lastMouseY=t.clientY}},Xo=()=>{oe.value.isDragging&&(oe.value.isDragging=!1,setTimeout(()=>{!oe.value.isDragging&&oe.value.isZooming},100))},sa=(t,s)=>{const l=t.filter(C=>C!=null);if(!l||l.length===0)return{x:0,y:0};if(l.length===1||s<=0)return l[0];if(s>=1)return l[l.length-1];let i=0;const p=[];for(let C=1;C<l.length;C++){const D=l[C].x-l[C-1].x,L=l[C].y-l[C-1].y,R=Math.sqrt(D*D+L*L);p.push(R),i+=R}const g=i*s;let b=0;for(let C=0;C<p.length;C++){const D=b+p[C];if(g<=D){const L=(g-b)/p[C],R=l[C],N=l[C+1];return{x:R.x+(N.x-R.x)*L,y:R.y+(N.y-R.y)*L}}b=D}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",[aa(),{"dss-chart-fill-width":qe.value,"dss-chart-fill-height":Ve.value,"dss-chart-compact":vl.value&&!Je.value}]]),style:e.normalizeStyle({width:qe.value?"100%":ke.value+"px",height:ht.value,...qe.value||Ve.value?{overflow:vl.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...na.value,cursor:Do()}),"data-chart-type":ae.value,ref_key:"containerEl",ref:F,onWheel:fo,onMousedown:vo,onMousemove:jl,onMouseup:Ao,onMouseleave:wl,onDblclick:so,onContextmenu:e.withModifiers(en,["prevent"]),onClick:e.withModifiers(Ot,["left"]),onWheelCapture:fo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",Ja,[$e.value?(e.openBlock(),e.createElementBlock("div",es,e.toDisplayString($e.value),1)):e.createCommentVNode("",!0),rt.value?(e.openBlock(),e.createElementBlock("div",ts,e.toDisplayString(rt.value),1)):e.createCommentVNode("",!0)]),Je.value&<.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.value==="vertical","dss-legend-top":lt.value==="top","dss-legend-bottom":lt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",ns,e.toDisplayString(l.name),1)],46,ls))),128))],2)):e.createCommentVNode("",!0),Je.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(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",as,e.toDisplayString(l.name),1)],46,os))),128))],2)):e.createCommentVNode("",!0)],512),_.showAddMarkerButton&&Se.value&&Ne.value.addMarker&&(xl.value||al.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:po,title:e.unref(B)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Dt.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,rs),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,ss)):e.createCommentVNode("",!0),e.createElementVNode("div",is,[al.value&&Tt.value?(e.openBlock(),e.createElementBlock("div",cs,"Bubble size: "+e.toDisplayString(Tt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ke.value,height:ge.value,class:"dss-chart-svg","data-smooth":ie.value,"data-animated":Ie.value,ref_key:"svgEl",ref:T},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ee.value},[e.createElementVNode("rect",{x:0,y:O.value.top,width:ke.value,height:O.value.height*4},null,8,ms)],8,ds),zl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:on.value},[e.createElementVNode("path",{d:ho.value},null,8,fs)],8,ps)):e.createCommentVNode("",!0),Bl.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:pn.value},[e.createElementVNode("path",{d:Ho.value},null,8,gs)],8,vs)):e.createCommentVNode("",!0)]),xl.value||al.value?(e.openBlock(),e.createElementBlock("g",hs,[Gt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ue.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Io.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:O.value.left,x2:O.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,ks))),128))],8,ys)):e.createCommentVNode("",!0),e.createElementVNode("g",Cs,[e.createElementVNode("line",{x1:O.value.left,x2:O.value.right,y1:O.value.bottom,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,bs),e.createElementVNode("line",{x1:O.value.left,x2:O.value.left,y1:O.value.top,y2:O.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ws)]),e.createElementVNode("g",xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bn.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:l.x,y:l.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(l.text),13,Es))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xn.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,Ss))),128)),tl.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:O.value.left+O.value.width/2,y:O.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(tl.value),9,Vs)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:O.value.top+12+O.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${O.value.top+O.value.height/2})`},e.toDisplayString(Ft.value),9,Ns)):e.createCommentVNode("",!0)]),$l.value.length>0?(e.openBlock(),e.createElementBlock("g",Bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($l.value,l=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${l.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ue.value},[l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,_s)):e.createCommentVNode("",!0),l.hasAuto&&!l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,$s)):e.createCommentVNode("",!0),l.hasAuto&&l.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:l.x,x2:l.x,y1:O.value.bottom,y2:O.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,Ls)):e.createCommentVNode("",!0)],8,Ms),l.hasManual&&l.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:l.x+8,cy:Math.max(15,O.value.top-10),r:"14",fill:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,Ts)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:l.x,cy:Math.max(15,O.value.top-10),r:"14",fill:l.hasManual&&l.hasAuto||l.hasManual?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>gn(l,i),onMouseleave:Ln},null,40,As),e.createElementVNode("text",{x:l.x,y:Math.max(15,O.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,Ds)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ue.value},[Ll.value?(e.openBlock(),e.createElementBlock("g",Rs,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":gl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Is)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Fs))],64))),128))],2),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+2:Ye.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,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+2:Ye.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,Os))),128)),ft.value>0||Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(zo.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,ft.value)+2:q(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,qs))),128)):e.createCommentVNode("",!0)])])):ae.value==="line"?(e.openBlock(),e.createElementBlock("g",Ws,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:l.path,stroke:l.color,"stroke-width":Ye.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":gt.value.hasAnimated}]),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(Hl.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+2:Ye.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,Us))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Eo.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:l.path,stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+2:Ye.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,Xs))),128)),ft.value>0||Ae.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(uo.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:l.x,cy:l.y,r:U(l.isHighlighted?q(l,ft.value)+2:q(l,ft.value)),fill:l.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":l.isHighlighted,"dss-point-dimmed":l.isDimmed,"dss-point-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,Ys))),128)):e.createCommentVNode("",!0)])):ae.value==="area"?(e.openBlock(),e.createElementBlock("g",js,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${_.chartId}`},[e.createElementVNode("rect",{x:O.value.left-10,y:O.value.top-10,width:O.value.width+20,height:O.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${O.value.width+20}px`})},null,12,Gs)],8,Ks))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:l.areaPath,fill:l.color,"fill-opacity":l.isHighlighted?Q.value+.2:Q.value,mask:`url(#area-mask-${i}-${_.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":l.isHighlighted,"dss-series-dimmed":l.isDimmed,"dss-series-hidden":l.isHidden})},null,10,Qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(l,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:l.linePath,stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+1:Ye.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*Ht.value}ms`})},null,14,Js))),128))])):ae.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":gl.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[l.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:l.barPath,fill:l.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,er)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:l.x,y:l.y,width:l.width,height:l.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":l.isHighlighted,"dss-bar-dimmed":l.isDimmed,"dss-bar-hidden":l.isHidden}),style:e.normalizeStyle({fill:l.color,fillOpacity:l.isDimmed?.4:1,animationDelay:`${l.animationDelay}ms`}),onMouseover:p=>rn(l,p),onMouseleave:cn},null,46,tr))],64))),128))],2)):e.createCommentVNode("",!0)],8,Hs),te.value&&we.value.show&&!oe.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ue.value},[e.createElementVNode("line",{x1:we.value.x,x2:we.value.x,y1:O.value.top,y2:O.value.bottom,stroke:Te.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,nr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value.data,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:we.value.x,cy:l.y,r:U(ft.value+2),fill:l.color,stroke:"none",opacity:"0.9"},null,8,or))),128))],8,lr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),al.value?(e.openBlock(),e.createElementBlock("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pn.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[l?(e.openBlock(),e.createElementBlock("g",sr,[e.createElementVNode("circle",{cx:l.x,cy:l.y,r:U(l.radius),fill:l.color,"fill-opacity":c(l),stroke:l.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(l,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>v(l,p),onMouseleave:p=>A(l),onClick:p=>u(l,p)},null,42,rr),l.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:l.x-l.radius*.65,y:l.y-l.radius*.65,width:l.radius*1.3,height:l.radius*1.3,"xlink:href":l.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${l.isHighlighted?"dss-bubble-highlighted":""} ${l.isDimmed?"dss-bubble-dimmed":""} ${l.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${l.radius*.65}px at ${l.radius*.65}px ${l.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:d(l)}),onLoad:p=>Un(i),onError:p=>ro(i),onMouseenter:p=>v(l,p),onMouseleave:p=>A(l),onClick:p=>u(l,p)},null,46,ir)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vl.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:nn.value},[ae.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:_t.value,cy:Mt.value,r:xt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,ur)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ae.value,"clip-path":Ro.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":kn(l.originalIndex),class:e.normalizeClass({"dss-series-highlighted":l.segment.isHighlighted,"dss-series-dimmed":l.segment.isDimmed,"dss-series-hidden":l.segment.isHidden}),onMouseover:p=>rn(l.segment,p),onMouseleave:cn},null,42,mr))),128))],8,dr),Wn.value&&Oo.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Vl.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,fr)),[[e.vShow,l.show]])),128))])):e.createCommentVNode("",!0),En.value&&(Oo.value||zl.value||Bn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Xl.value.x,y:Xl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Rl.value,fill:bl.value,class:"dss-radial-data-center"},e.toDisplayString(Sn.value),9,vr)):e.createCommentVNode("",!0),Zo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":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,gr),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,hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:l.textX,y:l.textY,"text-anchor":l.textAnchor,"font-size":hn.value,"dominant-baseline":"middle"},e.toDisplayString(l.text),9,yr)],6))),128))],2)):e.createCommentVNode("",!0)],8,cr)):e.createCommentVNode("",!0),Gl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:nn.value},[Gt.value?(e.openBlock(),e.createElementBlock("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:_t.value,cy:Mt.value,r:U(l),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,br))),128)),e.createElementVNode("g",wr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:_t.value-16,y:Mt.value-l-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,xr),e.createElementVNode("text",{x:_t.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(Ze(i)),9,Er)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,(l,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:_t.value,x2:l.x,y1:Mt.value,y2:l.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Sr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Vr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value,(l,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:l.x+Math.cos(i*2*Math.PI/Y.value-Math.PI/2)*16,y:l.y+Math.sin(i*2*Math.PI/Y.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,Nr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:dl,onMouseleave:cn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(el.value,(l,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:l.points,fill:l.color,"fill-opacity":cl("current",l,i),stroke:l.color,"stroke-width":l.isHighlighted?Ye.value+1:Ye.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*Ht.value}ms`,transition:"all 0.2s ease"})},null,14,Br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:U(l.isHighlighted?ft.value+1:ft.value>0?ft.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*Ht.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:b=>rn(p,b),onMouseleave:cn},null,46,Mr))),128))]))),128))],32)],8,kr)):e.createCommentVNode("",!0),e.createElementVNode("g",_r,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Kt.value,(l,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:l.x,cy:l.y,r:U(l.width/2),fill:Ut(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(Kt.value,(l,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:l.x-l.width/2,y:l.y-l.height/2,width:l.width,height:l.height,"xlink:href":l.url,onLoad:p=>Ql(i),onError:p=>vn(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${l.width/2}px at ${l.width/2}px ${l.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Lr))),128))])],8,us))]),ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ke.value+"px",height:ge.value+"px",backgroundImage:`url('${Ml.value}')`,backgroundRepeat:"no-repeat",...wt.value,opacity:De.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.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:tt.value+"px",height:tt.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Bt(l),["stop"]),onMouseenter:p=>E(l,p),onMouseleave:le},[e.createElementVNode("img",{src:tn(l),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Ar)],44,Tr)),[[e.vShow,z.value]])),128)),Nt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Nt.value.x+"px",top:Nt.value.y+"px"})},[e.createElementVNode("div",Dr,e.toDisplayString(Nt.value.categoryValue),1),Nt.value.description?(e.openBlock(),e.createElementBlock("div",Hr,e.toDisplayString(Nt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Xt.value&&(at.value.show||te.value&&we.value.show&&!oe.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":te.value&&we.value.show&&!oe.value.isZooming,"dss-spider-tooltip":Gl.value&&at.value.spiderAreas&&at.value.spiderAreas.length>0}]),style:e.normalizeStyle(So.value)},[!te.value||!we.value.show||oe.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Gl.value&&at.value.spiderAreas&&at.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.value.spiderAreas,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",Ir,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createTextVNode(" "+e.toDisplayString(l.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",Fr,e.toDisplayString(p.label),1),e.createElementVNode("span",zr,e.toDisplayString(p.value),1)]))),128))]))),128))])):al.value&&at.value.bubbleData&&at.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Pr,[at.value.title?(e.openBlock(),e.createElementBlock("div",Or,e.toDisplayString(at.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(at.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",Wr,[e.createElementVNode("div",Zr,e.toDisplayString(at.value.title),1),e.createElementVNode("div",Ur,e.toDisplayString(at.value.value),1)])),at.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[kl(at.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Xr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Yr,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(at.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",jr,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(at.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(at.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",ei,[e.createElementVNode("div",ti,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",li,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",ni,[e.createElementVNode("div",oi,e.toDisplayString(al.value?M():_.categories[we.value.categoryIndex]||`Category ${we.value.categoryIndex+1}`),1),al.value?(e.openBlock(),e.createElementBlock("div",ai,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.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(we.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",si,e.toDisplayString(l.seriesName)+":",1),e.createElementVNode("span",ri,e.toDisplayString(fl(l.value)),1)]))),128))]),kl(we.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ii,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ci,e.toDisplayString(e.unref(B)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(we.value.categoryIndex).flagGroups,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ui,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:l.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(l.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",di,[e.createElementVNode("div",mi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),kl(we.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",pi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",fi,e.toDisplayString(e.unref(B)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl(we.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",vi,[e.createElementVNode("div",gi,e.toDisplayString(l.title),1),l.description?(e.openBlock(),e.createElementBlock("div",hi,e.toDisplayString(l.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),xl.value&&Me.value&&oe.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:so},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(oe.value.scale*100))+"% "+e.toDisplayString(e.unref(B)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Qa),Je.value&<.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":$t.value==="horizontal","dss-legend-vertical":$t.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(H.series,(l,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Pt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Jl(i),onMouseenter:p=>Nn(i),onMouseleave:un,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ut(i)})},null,4),e.createElementVNode("span",ki,e.toDisplayString(l.name),1)],46,yi))),128))],2)):e.createCommentVNode("",!0),bt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:bt.value.x+"px",top:bt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Ne.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:To},e.toDisplayString(e.unref(B)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ne.value.addMarker&&(Ne.value.downloadSvg||Ne.value.downloadPng||Ne.value.downloadCsv||At.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ci)):e.createCommentVNode("",!0),Ne.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:dn},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ne.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:_l},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ne.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:no},e.toDisplayString(e.unref(B)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),At.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ne.value.downloadSvg||Ne.value.downloadPng||Ne.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",bi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(At.value,(l,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[l.separator?(e.openBlock(),e.createElementBlock("div",wi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(l)),style:e.normalizeStyle(Zn(l)),onClick:p=>In(l)},[l.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Nl(l),class:"dss-custom-menu-content"},null,8,Ei)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l.icon?(e.openBlock(),e.createElementBlock("span",Si,e.toDisplayString(l.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(l.label),1)],64))],14,xi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Fe.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(Cl.value?e.unref(B)("chart.modalMarker.viewMarker"):Yl.value?e.unref(B)("chart.modalMarker.editMarker"):e.unref(B)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:x},"×")]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Bi,[e.createVNode(Wo,{id:"dss-marker-date",mode:"single",modelValue:Fe.value.date,"onUpdate:modelValue":s[1]||(s[1]=l=>Fe.value.date=l),"min-date":Dn.value,"max-date":Fl.value,disabled:Cl.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Mi,[e.createElementVNode("label",_i,e.toDisplayString(e.unref(B)("chart.modalMarker.description")),1),Cl.value?(e.openBlock(),e.createElementBlock("div",$i,e.toDisplayString(Fe.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=l=>Fe.value.description=l),placeholder:e.unref(B)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Li)),[[e.vModelText,Fe.value.description]])])]),e.createElementVNode("div",Ti,[e.createElementVNode("div",Ai,[Yl.value&&!Cl.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:W},e.toDisplayString(e.unref(B)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Di,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:x},e.toDisplayString(Cl.value?e.unref(B)("chart.modalMarker.close"):e.unref(B)("chart.modalMarker.cancel")),1),Cl.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:y,disabled:!(Fe.value.description&&Fe.value.description.length)},e.toDisplayString(Yl.value?e.unref(B)("chart.modalMarker.save"):e.unref(B)("chart.contextMenu.addMarker")),9,Hi))])])])])):e.createCommentVNode("",!0)],64))}}),Fi={class:"dss-modal-title"},zi={class:"dss-modal-actions"},qo={__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(_,{emit:J}){const B=_,$=J,se=e.ref(null),F=e.ref(null),T=e.computed(()=>{const ee={"max-width":B.width};return B.height!=="auto"&&(ee.height=B.height,ee["min-height"]="0"),ee}),X=e.computed(()=>({}));function Qe(){$("close-modal")}function pe(){B.backDrop&&!se.value&&$("close-modal")}function f(ee){ee.target.tagName==="INPUT"&&(se.value=ee.target.tagName)}function be(){setTimeout(()=>{se.value=null},300)}function fe(){const ee=document.body,ue=document.documentElement;F.value={bodyOverflow:ee.style.overflow,bodyPosition:ee.style.position,bodyTop:ee.style.top,bodyWidth:ee.style.width,htmlOverflow:ue.style.overflow,scrollY:window.scrollY},ee.style.overflow="hidden",ee.style.position="fixed",ee.style.top=`-${F.value.scrollY}px`,ee.style.width="100%",ee.style.left="0",ue.style.overflow="hidden"}function ne(){if(!F.value)return;const ee=document.body,ue=document.documentElement,{bodyOverflow:H,bodyPosition:ye,bodyTop:ve,bodyWidth:Oe,htmlOverflow:ot,scrollY:I}=F.value;ee.style.overflow=H||"",ee.style.position=ye||"",ee.style.top=ve||"",ee.style.width=Oe||"",ee.style.left="",ue.style.overflow=ot||"",window.scrollTo(0,I||0)}return e.watch(()=>B.showModal,ee=>{if(ee)fe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.addEventListener("focusin",f),ue.addEventListener("focusout",be))},100);else{ne(),document.body.classList.remove("dss-modal-open");const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.removeEventListener("focusin",f),ue.removeEventListener("focusout",be))}},{immediate:!0}),e.onUnmounted(()=>{B.showModal&&ne()}),(ee,ue)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:pe},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(T.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ue[0]||(ue[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":_.headerType,"font-size":_.titleSize})},[e.createElementVNode("h1",Fi,[e.renderSlot(ee.$slots,"title",{},()=>[ue[1]||(ue[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(ee.$slots,"title-data"),_.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Qe,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(ee.$slots,"content",{},()=>[ue[2]||(ue[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",zi,[e.renderSlot(ee.$slots,"actions")])])],4),[[e.vShow,_.showModal]])])):e.createCommentVNode("",!0)]))}},Pi={key:0,class:"dss-table-toolbar"},Oi={class:"dss-table-toolbar-left"},qi=["aria-expanded"],Wi={class:"dss-pagination-select-dropdown",role:"listbox"},Zi={class:"dss-table-column-visibility-label"},Ui={class:"dss-table-checkbox-wrapper"},Xi=["checked","onChange"],Yi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},ji={class:"dss-table-column-visibility-text"},Ki={class:"dss-table-toolbar-right"},Gi=["placeholder","aria-label"],Qi=["aria-label"],Ji=["aria-label","aria-expanded"],ec={key:1,class:"dss-table-toolbar-extra"},tc={class:"dss-table-thead"},lc={key:0,class:"dss-table-th dss-table-selection-column"},nc={key:0,class:"dss-table-checkbox-wrapper"},oc=["checked","indeterminate"],ac={key:0,class:"dss-table-checkbox__indeterminate"},sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},rc=["aria-label"],ic=["onClick"],cc={class:"dss-table-th-content"},uc={class:"dss-table-th-text"},dc={key:0},mc={key:1},pc={key:2},fc=["data-filter-column-key","aria-expanded","aria-label","onClick"],vc={class:"dss-table-tbody"},gc=["onClick"],hc={class:"dss-table-checkbox-wrapper"},yc=["type","name","checked","onChange"],kc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Cc={key:1,class:"dss-table-checkbox__dot"},bc=["onClick"],wc=["aria-expanded","aria-label"],xc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},Ec={key:0,class:"dss-table-expansion-row"},Sc=["colspan"],Vc=["colspan"],Nc={key:1,class:"dss-table-pagination"},Bc={class:"dss-table-pagination-left"},Mc={key:0},_c={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},$c={class:"dss-table-pagination-center"},Lc={key:0,class:"dss-pagination-controls"},Tc=["disabled","title"],Ac=["disabled","title"],Dc=["aria-label","onKeydown"],Hc={class:"dss-pagination-of"},Rc=["disabled","title"],Ic=["disabled","title"],Fc={class:"dss-table-pagination-right"},zc={class:"dss-pagination-rows-label"},Pc=["aria-expanded"],Oc=["aria-selected","onClick"],qc={key:0,class:"dss-table-filter-row"},Wc=["value","placeholder"],Zc=["min","max","value"],Uc=["min","max","value"],Xc={class:"dss-table-filter-double-range-values"},Yc={key:2,class:"dss-table-filter-daterange"},jc={class:"dss-table-filter-daterange-row"},Kc={class:"dss-table-filter-daterange-label"},Gc=["value"],Qc={class:"dss-table-filter-daterange-row"},Jc={class:"dss-table-filter-daterange-label"},eu=["value"],tu=["value","placeholder"],lu={class:"dss-table-filter-list"},nu=["checked","onChange"],ou={class:"dss-table-filter-actions"},au={name:"DSSTable"},su=Object.assign(au,{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:_=>typeof _=="object"&&_!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(_,{emit:J}){const{t:B,locale:$}=Gn.useI18n(),se=_,F=J,T={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 X(k,y){const x=Object.assign({},k);return Qe(k)&&Qe(y)&&Object.keys(y).forEach(W=>{Qe(y[W])?W in k?x[W]=X(k[W],y[W]):Object.assign(x,{[W]:y[W]}):Object.assign(x,{[W]:y[W]})}),x}function Qe(k){return k&&typeof k=="object"&&!Array.isArray(k)}const pe=e.computed(()=>X(T,se.options)),f=e.computed(()=>{const k=pe.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),be=e.computed(()=>pe.value.table.height),fe=e.computed(()=>pe.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:fe.value})),ee=e.computed(()=>pe.value.table.expandable===!0),ue=e.computed(()=>pe.value.table.expandableRowData??null),H=e.computed(()=>pe.value.table.expandableRowCondition??null),ye=e.computed(()=>pe.value.table.truncated===!0),ve=e.computed(()=>pe.value.table.striped),Oe=e.computed(()=>pe.value.table.bordered),ot=e.computed(()=>pe.value.table.hoverable),I=e.computed(()=>pe.value.table.size),qe=e.computed(()=>pe.value.table.align||"left");e.computed(()=>pe.value.title.text),e.computed(()=>pe.value.subtitle.text);const Ve=e.computed(()=>pe.value.selection.enabled),ke=e.computed(()=>pe.value.selection.mode),pt=e.computed(()=>pe.value.sorting.enabled),kt=e.computed(()=>pe.value.sorting.mode),ge=e.computed(()=>pe.value.pagination.enabled),ht=e.computed(()=>pe.value.pagination.rows),ae=e.computed(()=>pe.value.pagination.rowsPerPageOptions),Xe=e.computed(()=>pe.value.pagination.showCounter!==!1),$e=e.computed(()=>pe.value.pagination.showControlsGroup),rt=e.computed(()=>$e.value===!1?!1:pe.value.pagination.showControls!==!1),Tt=e.computed(()=>$e.value===!1?!1:pe.value.pagination.showRowsPerPage!==!1),tl=e.computed(()=>ge.value&&(Xe.value||rt.value||Tt.value)),Ft=e.computed(()=>pe.value.scrollable),st=e.computed(()=>pe.value.emptyMessage||B("table.emptyMessage")),Vt=e.computed(()=>pe.value.toolbar?.downloads?.pdf!==!1),ll=e.computed(()=>pe.value.toolbar?.downloads?.excel!==!1),zt=e.computed(()=>pe.value.toolbar?.search!==!1),Gt=e.computed(()=>Vt.value||ll.value||zt.value||Je.value),Je=e.computed(()=>pe.value.toolbar?.columnVisibility!==!1),lt=e.ref(""),$t=e.ref(!1),Xt=e.ref(null);let te=null;function Te(){$t.value?(te&&(clearTimeout(te),te=null),$t.value=!1,lt.value="",F("search",""),Xt.value?.blur()):($t.value=!0,te=setTimeout(()=>{te=null,Xt.value?.focus()},80))}function Me(){lt.value||($t.value=!1)}function Ue(){lt.value="",F("search",""),Xt.value?.focus()}const it=e.computed(()=>({"dss-table-striped":ve.value,"dss-table-bordered":Oe.value,"dss-table-hoverable":ot.value,[`dss-table-${I.value}`]:I.value!=="default","dss-table-truncated":ye.value})),Ye=(k,y)=>k?.field??k?.key??y,Ge=e.ref(new Set);function ft(){const k=new Set;se.columns.forEach((y,x)=>{y?.hidden!==!0&&k.add(Ye(y,x))}),Ge.value=k}const Ae=e.computed(()=>se.columns.filter((k,y)=>Ge.value.has(Ye(k,y)))),q=k=>{const y=se.columns.findIndex(x=>x===k);return Ye(k,y>=0?y:0)},U=(k,y)=>Ge.value.has(Ye(k,y));function Q(k,y){const x=Ye(k,y),W=new Set(Ge.value);W.has(x)?W.delete(x):W.add(x),Ge.value=W}const ie=e.ref(null),Re=e.ref(!1);function ct(k){ie.value&&!ie.value.contains(k.target)&&(Re.value=!1)}const Et=e.computed(()=>Ae.value.length+(Ve.value?1:0)+(ee.value?1:0)),Ie=(k,y)=>k?.id??k?.key??y,Ct=e.ref(new Set),It=e.ref(null),Qt=(k,y)=>Ct.value.has(Ie(k,y)),qt=(k,y)=>{if(!ee.value)return!1;if(typeof H.value=="function")return!!H.value(k,y);if(typeof ue.value=="string"&&ue.value.trim()){const x=Zt(k,ue.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},Ht=(k,y,x)=>{if(x&&x.stopPropagation(),!qt(k,y))return;const W=Ie(k,y),me=new Set(Ct.value);me.has(W)?(me.delete(W),F("row-collapse",{data:k,index:y})):(me.add(W),F("row-expand",{data:k,index:y})),Ct.value=me},V=(k,y)=>{if(!ye.value)return;const x=Ie(k,y);It.value!==x&&(It.value=x)},w=e.ref(null),S=e.ref(0),j=e.ref([]),G=k=>{if(kt.value==="single")return w.value===k.field?S.value:0;{const y=j.value.find(x=>x.field===k.field);return y?y.order:0}},Ze=k=>{const y=G(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},vt=e.ref({}),Se=e.ref(null),Ne=e.ref(null),At=220,Dt=e.ref(null),et=e.computed(()=>Ae.value.find(k=>q(k)===Se.value)??null),tt=e.computed(()=>{if(!et.value||et.value.filter!=="range")return null;const k=et.value,y=Se.value,{min:x,max:W}=Ml(k),me=k.filterMin??x,Bt=k.filterMax??W,mt=Z(y),Jt=mt.min??me,nl=mt.max??Bt,rl=Bt-me,ol=rl===0?0:(Jt-me)/rl*100,Kl=rl===0?100:(nl-me)/rl*100;return{rangeMin:me,rangeMax:Bt,currentMin:Jt,currentMax:nl,minPct:ol,maxPct:Kl}}),Lt=e.ref(null),fl=e.ref("max");function z(k){const y=Lt.value,x=tt.value;if(!y||!x)return;const W=y.getBoundingClientRect(),Bt=(k.clientX-W.left)/W.width*100,mt=(x.minPct+x.maxPct)/2;fl.value=Bt<mt?"min":"max"}function Z(k){return vt.value[k]??{}}function P(k,y){vt.value={...vt.value,[k]:y}}function ce(k){const y=vt.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 De(k){const y={...vt.value};delete y[k],vt.value=y,Se.value=null,Ne.value=null}function ut(){if(!Se.value){Ne.value=null;return}const k=Dt.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Se.value}"]`);if(!y)return;const x=y.getBoundingClientRect();Ne.value={top:x.bottom+6,left:Math.max(8,x.right-At)}}const dt=e.computed(()=>{const k=String(lt.value??"").trim().toLowerCase();return k?se.data.filter(y=>Ae.value.some(x=>wt(tn(y,x)).some(me=>String(me).toLowerCase().includes(k)))):se.data}),je=e.computed(()=>{let k=[...dt.value];const y=(lt.value??"").trim().toLowerCase();return y&&(k=k.filter(x=>se.columns.some(W=>{if(!W||!W.field)return!1;const me=tn(x,W);return String(me??"").toLowerCase().includes(y)}))),Ae.value.forEach(x=>{const W=q(x),me=vt.value[W];if(!me)return;const Bt=x.field;if(Bt){if(me.type==="string"&&me.value?.trim()){const mt=me.value.trim().toLowerCase();k=k.filter(Jt=>{const nl=tn(Jt,x);return String(nl??"").toLowerCase().includes(mt)})}else if(me.type==="range")k=k.filter(mt=>{const Jt=Zt(mt,Bt),nl=Number(Jt);return!(Number.isNaN(nl)||me.min!=null&&nl<me.min||me.max!=null&&nl>me.max)});else if(me.type==="dateRange"){const mt=me.from?new Date(me.from).getTime():null,Jt=me.to?new Date(me.to).getTime():null;k=k.filter(nl=>{const rl=Zt(nl,Bt),ol=rl?new Date(rl).getTime():NaN;return!(Number.isNaN(ol)||mt!=null&&ol<mt||Jt!=null&&ol>Jt)})}else if(me.type==="list"&&me.selected?.length){const mt=new Set(me.selected);k=k.filter(Jt=>wt(tn(Jt,x)).some(rl=>mt.has(rl)))}}}),k});function wt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(wt);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 Wt(k){const y=new Set;return se.data.forEach(x=>{wt(tn(x,k)).forEach(me=>y.add(me))}),Array.from(y).sort((x,W)=>String(x).localeCompare(String(W)))}function kl(k,y){if(Se.value===k){Se.value=null,Ne.value=null;return}if(Se.value=k,y?.currentTarget){const x=y.currentTarget.getBoundingClientRect();Ne.value={top:x.bottom+6,left:Math.max(8,x.right-At)}}else ut()}function Zl(k,y){P(k,{type:"string",value:y})}function Ml(k){const y=k.field;if(!y)return{min:0,max:100};let x=1/0,W=-1/0;return se.data.forEach(me=>{const Bt=Zt(me,y),mt=Number(Bt);Number.isNaN(mt)||(x=Math.min(x,mt),W=Math.max(W,mt))}),{min:x===1/0?0:x,max:W===-1/0?100:W}}function Ul(k,y,x){const W={...Z(k),type:"range"},me=x===""?null:Number(x),Bt=me===null||Number.isNaN(me)?null:me;W[y]=Bt,Bt!=null&&(y==="min"&&W.max!=null&&Bt>W.max&&(W.max=Bt),y==="max"&&W.min!=null&&Bt<W.min&&(W.min=Bt)),P(k,W)}function hn(k,y,x){const W={...Z(k),type:"dateRange"};W[y]=x||"",P(k,W)}const yn=e.reactive({});function xn(k,y){yn[k]=y}function qn(k){const y=q(k),x=(yn[y]??"").trim().toLowerCase(),W=Wt(k);return x?W.filter(me=>String(me).toLowerCase().includes(x)):W}function Wn(k,y){return(Z(k).selected??[]).includes(y!=null?String(y):"")}function to(k,y){const W=[...Z(k).selected??[]],me=y!=null?String(y):"",Bt=W.indexOf(me);Bt>=0?W.splice(Bt,1):W.push(me),P(k,{type:"list",selected:W})}function En(k){Se.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Se.value=null,Ne.value=null)}function Sn(){ut(),$l.value&&El()}const Rl=k=>{if(!(k.sortable===!1||!pt.value))if(kt.value==="single")w.value===k.field?S.value=S.value===1?-1:S.value===-1?0:1:(w.value=k.field,S.value=1),S.value===0&&(w.value=null),F("sort",{field:w.value,order:S.value});else{const y=j.value.findIndex(x=>x.field===k.field);y>=0?j.value[y].order===1?j.value[y].order=-1:j.value.splice(y,1):j.value.push({field:k.field,order:1}),F("sort",{multiSortMeta:j.value})}},Xl=e.computed(()=>{if(!pt.value)return je.value;let k=[...je.value];return kt.value==="single"&&w.value&&S.value!==0?k.sort((y,x)=>{const W=Zt(y,w.value),me=Zt(x,w.value);return W===me?0:W==null?1:me==null?-1:(W<me?-1:W>me?1:0)*S.value}):kt.value==="multiple"&&j.value.length>0&&k.sort((y,x)=>{for(const W of j.value){const me=Zt(y,W.field),Bt=Zt(x,W.field);if(me===Bt)continue;if(me==null)return 1;if(Bt==null)return-1;const mt=me<Bt?-1:me>Bt?1:0;if(mt!==0)return mt*W.order}return 0}),k}),bl=e.ref(0),Vl=e.ref(ht.value),$l=e.ref(!1),Il=e.ref(null),Tn=e.ref(null),An=e.ref("bottom"),Vn=e.ref(null),Pt=k=>{Vl.value=k,$l.value=!1,bl.value=0,F("page",{page:0,rows:Vl.value})};function Ce(k){Il.value&&!Il.value.contains(k.target)&&($l.value=!1)}function El(){const k=Il.value,y=Tn.value;if(!k||!y)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const W=y.getBoundingClientRect(),me=x.offsetHeight||0,mt=(window.innerHeight||document.documentElement.clientHeight)-W.bottom,Jt=W.top;An.value=mt<me+8&&Jt>mt?"top":"bottom",Vn.value={width:`${Math.ceil(W.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const at=e.computed(()=>Xl.value.length),Nt=e.computed(()=>Math.ceil(at.value/Vl.value)),we=e.computed(()=>Math.max(Nt.value,1)),bt=e.computed(()=>at.value===0?0:nt.value+1),oe=e.computed(()=>Fe.value),nt=e.computed(()=>ge.value?bl.value*Vl.value:0),Fe=e.computed(()=>ge.value?Math.min((bl.value+1)*Vl.value,at.value):at.value),Dn=e.computed(()=>{if(!ge.value)return Xl.value;const k=nt.value,y=Fe.value;return Xl.value.slice(k,y)}),Fl=e.ref(new Set),Yl=e.computed(()=>Xl.value.filter((k,y)=>Fl.value.has(Ie(k,y)))),Cl=e.computed(()=>{const k=Xl.value.length;return k>0&&Fl.value.size===k}),Nn=e.computed(()=>{const k=Xl.value.length,y=Fl.value.size;return y>0&&y<k}),un=(k,y)=>Fl.value.has(Ie(k,y)),jl=()=>{if(Cl.value)Fl.value=new Set,F("unselect-all");else{const k=new Set;Xl.value.forEach((y,x)=>k.add(Ie(y,x))),Fl.value=k,F("select-all",Yl.value)}},wl=(k,y)=>{const x=Ie(k,y),W=new Set(Fl.value),me=W.has(x);ke.value==="single"?me?(W.delete(x),F("row-unselect",k)):(W.clear(),W.add(x),F("row-select",k)):me?(W.delete(x),F("row-unselect",k)):(W.add(x),F("row-select",k)),Fl.value=W},en=e.ref("1"),Ot=()=>{const k=Number.parseInt(String(en.value),10);if(!Number.isFinite(k)){en.value=String(bl.value+1);return}const y=Math.min(we.value,Math.max(1,k));y!==bl.value+1?Nl(y-1):en.value=String(y)},Nl=k=>{k<0||k>=Nt.value||(bl.value=k,F("page",{page:k,rows:Vl.value}))},lo=(k,y,x)=>{F("row-click",{data:k,index:y,originalEvent:x}),V(k,nt.value+y)},Zn=(k,y)=>{const x=nt.value+y;return{"dss-table-row-selected":un(k,x),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ye.value,"dss-table-row-truncated-expanded":It.value===Ie(k,x)}},tn=(k,y)=>y.field?Zt(k,y.field):"",Zt=(k,y)=>y.split(".").reduce((x,W)=>x&&x[W],k),Hn=k=>{const y=k.align??qe.value;return{"dss-table-sortable":k.sortable!==!1&&pt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Rn=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(ht,k=>{Vl.value=k,bl.value=0}),e.watch($l,async k=>{k&&(await e.nextTick(),El())}),e.watch(bl,k=>{en.value=String(k+1)},{immediate:!0}),e.watch(lt,k=>{F("search",k??"")}),e.watch(()=>se.columns,()=>{ft()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Ce),document.addEventListener("click",ct),document.addEventListener("click",En),window.addEventListener("resize",Sn),window.addEventListener("scroll",Sn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Ce),document.removeEventListener("click",ct),document.removeEventListener("click",En),window.removeEventListener("resize",Sn),window.removeEventListener("scroll",Sn,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Dt,style:e.normalizeStyle({width:f.value+"px",height:be.value?be.value+"px":"auto"})},[Gt.value?(e.openBlock(),e.createElementBlock("div",Pi,[e.createElementVNode("div",Oi,[Vt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=x=>F("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(B)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),ll.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=x=>F("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(B)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Je.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:ie},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Re.value}]),onClick:y[2]||(y[2]=x=>Re.value=!Re.value),"aria-expanded":Re.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(B)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,qi),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Wi,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,(x,W)=>(e.openBlock(),e.createElementBlock("li",{key:Ye(x,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Zi,[e.createElementVNode("span",Ui,[e.createElementVNode("input",{type:"checkbox",checked:U(x,W),onChange:me=>Q(x,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Xi),U(x,W)?(e.openBlock(),e.createElementBlock("span",Yi,[...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",ji,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Re.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ki,[zt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":$t.value||lt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Xt,"onUpdate:modelValue":y[4]||(y[4]=x=>lt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(B)("table.searchPlaceholder"),"aria-label":e.unref(B)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=x=>$t.value=!0),onBlur:Me},null,40,Gi),[[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(B)("table.clearSearchAriaLabel"),onClick:Ue},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,Qi)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(B)("table.searchAriaLabel"),"aria-expanded":$t.value||!!lt.value,onMousedown:e.withModifiers(Te,["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,Ji)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",ec,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ft.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",it.value])},[e.createElementVNode("thead",tc,[e.createElementVNode("tr",null,[Ve.value?(e.openBlock(),e.createElementBlock("th",lc,[ke.value==="multiple"?(e.openBlock(),e.createElementBlock("span",nc,[e.createElementVNode("input",{type:"checkbox",checked:Cl.value,indeterminate:Nn.value,onChange:jl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,oc),Nn.value?(e.openBlock(),e.createElementBlock("span",ac)):Cl.value?(e.openBlock(),e.createElementBlock("span",sc,[...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),ee.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(B)("table.expandRowAriaLabel")},null,8,rc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(x,W)=>(e.openBlock(),e.createElementBlock("th",{key:q(x),class:e.normalizeClass(["dss-table-th",Hn(x)]),style:e.normalizeStyle(Rn(x)),onClick:me=>Rl(x)},[e.createElementVNode("div",cc,[e.createElementVNode("span",uc,e.toDisplayString(x.header),1),x.sortable!==!1&&pt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ze(x)])},[G(x)===0?(e.openBlock(),e.createElementBlock("span",dc,[...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)])])):G(x)===1?(e.openBlock(),e.createElementBlock("span",mc,[...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)])])):G(x)===-1?(e.openBlock(),e.createElementBlock("span",pc,[...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":Se.value===q(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":ce(q(x))}]),"data-filter-column-key":q(x),"aria-expanded":Se.value===q(x),"aria-label":e.unref(B)("table.filterColumnAriaLabel"),onClick:me=>kl(q(x),me)},[...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,fc)],2)):e.createCommentVNode("",!0)])],14,ic))),128))])]),e.createElementVNode("tbody",vc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(x,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ie(x,nt.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Zn(x,W)]),style:e.normalizeStyle(ne.value),onClick:me=>lo(x,W,me)},[Ve.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",hc,[e.createElementVNode("input",{type:ke.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${_.tableId}`,checked:un(x,nt.value+W),onChange:me=>wl(x,nt.value+W),class:e.normalizeClass(["dss-table-checkbox",ke.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,yc),ke.value==="multiple"&&un(x,nt.value+W)?(e.openBlock(),e.createElementBlock("span",kc,[...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)])])):ke.value==="single"&&un(x,nt.value+W)?(e.openBlock(),e.createElementBlock("span",Cc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(me=>Ht(x,nt.value+W,me),["stop"])},[qt(x,nt.value+W)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":Qt(x,nt.value+W),"aria-label":Qt(x,nt.value+W)?e.unref(B)("table.collapseRowAriaLabel"):e.unref(B)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":Qt(x,nt.value+W)}]),"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,wc)):(e.openBlock(),e.createElementBlock("span",xc))],8,bc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value,(me,Bt)=>(e.openBlock(),e.createElementBlock("td",{key:q(me),class:e.normalizeClass(["dss-table-td",Hn(me)]),style:e.normalizeStyle(Rn(me))},[e.renderSlot(k.$slots,`cell-${me.field}`,{data:x,column:me,rowIndex:W,isExpanded:It.value===Ie(x,nt.value+W)},()=>[e.createTextVNode(e.toDisplayString(tn(x,me)),1)])],6))),128))],14,gc),ee.value&&qt(x,nt.value+W)&&Qt(x,nt.value+W)?(e.openBlock(),e.createElementBlock("tr",Ec,[e.createElementVNode("td",{colspan:Et.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:W})],8,Sc)])):e.createCommentVNode("",!0)],64))),128)),Dn.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:Et.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(st.value),1)])],8,Vc)],4))])],2)],2),tl.value?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("div",Bc,[Xe.value?(e.openBlock(),e.createElementBlock("span",Mc,e.toDisplayString(e.unref(B)("table.showingRange",{start:bt.value,end:oe.value,total:at.value})),1)):(e.openBlock(),e.createElementBlock("span",_c," "))]),e.createElementVNode("div",$c,[rt.value?(e.openBlock(),e.createElementBlock("div",Lc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[8]||(y[8]=x=>Nl(0)),title:e.unref(B)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Tc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value===0,onClick:y[9]||(y[9]=x=>Nl(bl.value-1)),title:e.unref(B)("table.previousPage")}," ‹ ",8,Ac),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=x=>en.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(B)("table.currentPageAriaLabel"),onBlur:Ot,onKeydown:e.withKeys(e.withModifiers(Ot,["prevent"]),["enter"])},null,40,Dc),[[e.vModelText,en.value]]),e.createElementVNode("span",Hc,e.toDisplayString(e.unref(B)("table.ofPages",{total:we.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Nt.value-1,onClick:y[11]||(y[11]=x=>Nl(bl.value+1)),title:e.unref(B)("table.nextPage")}," › ",8,Rc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:bl.value>=Nt.value-1,onClick:y[12]||(y[12]=x=>Nl(Nt.value-1)),title:e.unref(B)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Ic)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fc,[Tt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Il},[e.createElementVNode("span",zc,e.toDisplayString(e.unref(B)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":$l.value}]),onClick:y[13]||(y[13]=x=>$l.value=!$l.value),"aria-expanded":$l.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Tn},[e.createTextVNode(e.toDisplayString(Vl.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Pc),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":An.value==="top"}]),style:e.normalizeStyle(Vn.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===Vl.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===Vl.value}]),onClick:W=>Pt(x)},e.toDisplayString(x),11,Oc))),128))],6),[[e.vShow,$l.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(Ne.value?{top:Ne.value.top+"px",left:Ne.value.left+"px",width:At+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[et.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[et.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",qc,[e.createElementVNode("input",{type:"text",value:Z(Se.value).value??"",onInput:y[14]||(y[14]=x=>Zl(Se.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(B)("table.search")},null,40,Wc)])):et.value.filter==="range"&&tt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":tt.value.minPct+"%","--range-max-pct":tt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Lt,class:"dss-table-filter-double-range-track",onMousemove:z,onMouseenter:z},[e.createElementVNode("input",{type:"range",min:tt.value.rangeMin,max:tt.value.rangeMax,value:tt.value.currentMin,onInput:y[15]||(y[15]=x=>Ul(Se.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:fl.value==="min"?2:1})},null,44,Zc),e.createElementVNode("input",{type:"range",min:tt.value.rangeMin,max:tt.value.rangeMax,value:tt.value.currentMax,onInput:y[16]||(y[16]=x=>Ul(Se.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:fl.value==="max"?2:1})},null,44,Uc)],544),e.createElementVNode("div",Xc,e.toDisplayString(tt.value.currentMin)+" – "+e.toDisplayString(tt.value.currentMax),1)],4)):et.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Yc,[e.createElementVNode("div",jc,[e.createElementVNode("label",Kc,e.toDisplayString(e.unref(B)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:Z(Se.value).from??"",onInput:y[17]||(y[17]=x=>hn(Se.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Gc)]),e.createElementVNode("div",Qc,[e.createElementVNode("label",Jc,e.toDisplayString(e.unref(B)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:Z(Se.value).to??"",onInput:y[18]||(y[18]=x=>hn(Se.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,eu)])])):et.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:yn[Se.value]??"",onInput:y[19]||(y[19]=x=>xn(Se.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(B)("table.search")},null,40,tu),e.createElementVNode("div",lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qn(et.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Wn(Se.value,x),onChange:W=>to(Se.value,x)},null,40,nu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",ou,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=x=>De(Se.value))},e.toDisplayString(e.unref(B)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Se.value&&et.value&&Ne.value]])]),_:1})]))],64))}}),ru="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",iu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",cu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",uu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",du="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",pu={class:"dss-toolbar-left"},fu=["title"],vu=["title"],gu={class:"dss-toolbar-dropdown-wrapper"},hu=["title"],yu=["src"],ku=["src"],Cu=["src"],bu=["src"],wu=["src"],xu=["src"],Eu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Su=["src"],Vu=["src"],Nu=["src"],Bu=["src"],Mu=["src"],_u=["src"],$u=["title"],Lu=["title"],Tu=["title"],Au=["title"],Du=["title"],Hu=["title"],Ru=["title"],Iu=["title"],Fu=["title"],zu={key:2,class:"dss-toolbar-separator"},Pu=["title"],Ou={key:4,class:"dss-toolbar-separator"},qu={key:5,class:"dss-toolbar-dropdown-wrapper"},Wu=["title"],Zu={class:"dss-toolbar-dropdown-ai"},Uu={class:"dss-toolbar-right"},Xu={key:0,class:"dss-toolbar-custom-group"},Yu={key:1,class:"dss-toolbar-separator"},ju={class:"dss-link-modal-content"},Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],ld={class:"dss-image-modal-tabs"},nd={key:0,class:"dss-image-tab-content"},od={class:"dss-link-modal-content"},ad={class:"dss-link-modal-field"},sd={key:0,class:"dss-link-modal-label"},rd=["src"],id={class:"dss-link-modal-field"},cd={class:"dss-link-modal-label"},ud=["placeholder"],dd={class:"dss-link-modal-field"},md={class:"dss-link-modal-label"},pd=["placeholder"],fd={class:"dss-link-modal-field"},vd={class:"dss-link-modal-label"},gd=["placeholder"],hd={key:1,class:"dss-image-tab-content"},yd={class:"dss-link-modal-content"},kd={class:"dss-link-modal-field"},Cd={class:"dss-link-modal-label"},bd=["placeholder"],wd={class:"dss-link-modal-field"},xd={class:"dss-link-modal-label"},Ed=["placeholder"],Sd={class:"dss-link-modal-field"},Vd={class:"dss-link-modal-label"},Nd=["placeholder"],Bd={class:"dss-link-modal-field"},Md={class:"dss-link-modal-label"},_d=["placeholder"],$d={class:"dss-text-editor-title-input-container"},Ld={key:0,class:"dss-text-editor-title-preview"},Td={key:0},Ad={key:1,class:"dss-text-editor-preview-placeholder"},Dd=["value","placeholder","disabled"],Hd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},Rd={class:"dss-text-editor-description-input-container"},Id={key:0,class:"dss-text-editor-description-preview"},Fd={key:0},zd={key:1,class:"dss-text-editor-preview-placeholder"},Pd=["value","placeholder","disabled"],Od={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},qd=["data-comment-id","onMouseenter"],Wd=["onClick"],Zd=["src","alt"],Ud={key:1},Xd=["onClick"],Yd=["src","alt"],jd={key:1},Kd=["data-has-second-user","onClick"],Gd={class:"editor-comment-marker-count"},Qd={key:4,class:"dss-text-editor-textarea-wrapper"},Jd=["value","placeholder","rows","disabled"],e1={class:"dss-text-editor-footer"},t1={class:"dss-text-editor-footer-content"},l1={class:"dss-text-editor-footer-stat"},n1={class:"dss-text-editor-footer-stat"},o1={key:5,class:"dss-text-editor-content-wrapper"},a1={key:0,class:"dss-comment-overlay-body"},s1={class:"dss-comment-selection-wrapper"},r1=["innerHTML"],i1={class:"dss-comment-messages-wrapper"},c1={key:0,class:"dss-comment-avatar-wrapper"},u1={class:"dss-comment-avatar"},d1=["src","alt"],m1={key:1},p1={class:"dss-comment-header"},f1={class:"dss-comment-header-text"},v1={class:"dss-comment-author"},g1={key:0,class:"dss-comment-date"},h1=["onClick","title"],y1={class:"dss-comment-overlay-inner"},k1=["placeholder","onKeydown"],C1={class:"dss-text-editor-footer"},b1={class:"dss-text-editor-footer-content"},w1={class:"dss-text-editor-footer-stat"},x1={class:"dss-text-editor-footer-stat"},E1=["title"],S1=["title"],V1={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:""},N1={class:"dss-image-popup-content"},B1={key:0,class:"dss-image-popup-no-alt-icon"},M1=["title"],_1=["title"],$1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},L1={class:"dss-toolbar-left"},T1=["title"],A1=["title"],D1={class:"dss-toolbar-dropdown-wrapper"},H1=["title"],R1=["src"],I1=["src"],F1=["src"],z1=["src"],P1=["src"],O1=["src"],q1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},W1=["title"],Z1=["title"],U1=["title"],X1=["title"],Y1=["title"],j1=["title"],K1=["title"],G1=["title"],Q1=["title"],J1=["title"],em={key:2,class:"dss-toolbar-separator"},tm={key:3,class:"dss-toolbar-dropdown-wrapper"},lm=["title"],nm={class:"dss-toolbar-dropdown-ai"},om={key:0,class:"dss-toolbar-right"},am={key:0,class:"dss-toolbar-separator"},sm={key:0,class:"dss-toolbar-custom-group"},rm={key:1,class:"dss-toolbar-separator"},im={name:"DSSTextEditor"},cm=Object.assign(im,{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:_=>typeof _=="object"&&_!==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:_=>typeof _=="object"&&_!==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(_,{expose:J,emit:B}){const{t:$,locale:se}=Gn.useI18n(),F={h1:ru,h2:iu,h3:cu,h4:uu,h5:du,h6:mu},T=_,X=B,Qe=e.useSlots(),pe=`<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>`,f=e.ref(null),we=e.ref(null),fe=e.ref(!1),ne=e.ref(!1),ee=e.ref(!1),ce=e.ref(""),H=e.ref({}),ke=e.ref(!1),ve=e.ref(!1),Oe=e.ref(""),ot=e.ref(""),I=e.ref(null),qe=e.ref(null),_e=e.ref(null),Ce=e.ref(null),pt=e.ref(""),ht=e.ref(!1),ge=e.ref({}),he=e.ref(!1),de=e.ref({}),st=e.ref(null),Ye=e.ref(null),xt=e.ref(!1),Rt=e.ref(""),tl=e.ref(null),Ft=e.ref(""),rt=e.ref(""),Vt=e.ref(""),ll=e.ref(null),zt=e.ref(null),Gt=e.ref(null),Je=e.ref(null),lt=e.ref(null),$t=e.ref(!1),Xt=e.ref(""),te=e.ref({}),Te=e.ref(!1),Me=e.ref("upload"),Ue=e.ref(""),it=e.ref(null),Xe=e.ref(null),Ge=e.ref([]),ft=e.ref([]),Ae=e.ref(null),q=e.ref(!1),U=e.ref(""),Q=e.ref(""),re=e.ref(""),Re=e.ref(""),ct=e.ref(""),Et=e.ref(""),Ie=e.ref(null),kt=e.ref(null),It=e.ref(null),Qt=e.ref(!1),qt=e.ref(null),Dt=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),j=e.ref(!1),G=e.ref([]),Ze=e.ref(null),vt=e.ref(null),Ve=e.ref(null),Ne=e.ref(!1),Tt=e.ref(0),At=100,et=e.ref(null),tt=e.computed(()=>({"dss-text-editor-no-border":!T.border,"dss-text-editor-rounded":T.rounded,"dss-text-editor-full-height":T.fullHeight,"dss-comment-overlay-open":mt.value!==null})),Lt=e.computed(()=>({})),fl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),z=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),Z=e.computed(()=>T.richText&&ft.value.length>0),P=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let o=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return T.modelValue}),ie=e.computed(()=>{const o=P.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),De=e.computed(()=>P.value.length),ut=e.computed(()=>Je.value!==null&&Me.value==="upload"&&Ft.value&&Ft.value.startsWith("data:")),dt=e.computed(()=>T.titlePlaceholder||$("textEditor.placeholders.title")),je=e.computed(()=>T.descriptionPlaceholder||$("textEditor.placeholders.description")),bt=e.computed(()=>T.placeholder||$("textEditor.placeholders.startTyping")),Wt=o=>Qe&&Qe[o]!==void 0,kl=o=>{for(let n=o+1;n<T.customToolbarSlots.length;n++)if(Wt(T.customToolbarSlots[n]))return!0;return!1},Zl=o=>{for(let n=o+1;n<T.customToolbarSlots.length;n++){const a=T.customToolbarSlots[n];if(Wt(a)&&Ml(a))return!0}return!1},Ml=o=>T.customToolbarFloatingMap.hasOwnProperty(o)?T.customToolbarFloatingMap[o]===!0:!0,Ul=e.computed(()=>T.customToolbarSlots.some(o=>Wt(o)&&Ml(o))),hn=e.computed(()=>Wt("title-slot")),yn=e.computed(()=>Wt("description-slot")),xn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},qn=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},Wn=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())},to=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""}},En=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"},Sn=o=>{const n=o.target.value;X("update:modelValue",n),X("change",n)},Rl=()=>{if(!Ie.value)return;const o=Ie.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")},Xl=()=>{Dt.value=!0,Rl()},bl=()=>{Dt.value=!1,Vl()},Vl=()=>{if(!Ie.value)return;const o=Ie.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")},$l=o=>{const a=o.target.value;Dt.value&&Rl(),X("update:title",a),X("title-change",a),It.value="title",T.richText&&(q.value||(Q.value=U.value,ct.value=re.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt()},500))},Il=()=>{if(!kt.value)return;const o=kt.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")},Tn=()=>{V.value=!0,Il()},An=()=>{V.value=!1,Vn()},Vn=()=>{if(!kt.value)return;const o=kt.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")},Pt=o=>{const a=o.target.value;V.value&&Il(),X("update:description",a),X("description-change",a),It.value="description",T.richText&&(q.value||(Q.value=U.value,ct.value=re.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt()},500))},be=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},El=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},at=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},Nt=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=T.title||"",r=T.description||"";if(!o&&n===U.value&&a===re.value&&r===Re.value)return;const c={content:Q.value||U.value,title:ct.value!==void 0?ct.value:re.value,description:Et.value!==void 0?Et.value:Re.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),ft.value=[]),U.value=n,re.value=a,Re.value=r,Q.value=n,ct.value=a,Et.value=r},xe=o=>{if(!f.value)return;Ct(),f.value&&Wn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=be(),oe()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&w.value&&(w.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=xn(r);X("update:modelValue",c),X("change",c),It.value="editor",q.value||(Q.value=U.value,ct.value=re.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt(),Pl(),sn()},500),e.nextTick(()=>{n&&El(n),Ct();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&&w.value?.command===h){ge.value[h]=w.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,A=M.nodeType===3?M.parentElement:M;let E=!1;if(A&&((A.tagName==="STRONG"||A.tagName==="B"||A.closest&&A.closest("strong, b"))&&(E=!0),!E&&A.style&&parseInt(A.style.fontWeight)>=600&&(E=!0),!E))try{const le=window.getComputedStyle(A);parseInt(le.fontWeight)>=600&&(E=!0)}catch{}ge.value[h]=E}else ge.value.hasOwnProperty(h)||(ge.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,A=M.nodeType===3?M.parentElement:M,E=A&&(A.tagName==="EM"||A.tagName==="I"||A.closest&&A.closest("em, i"));ge.value[h]=!!E}else{const M=document.queryCommandState(h);ge.value[h]=M}else{const M=document.queryCommandState(h);ge.value[h]=M}}catch{}}),W(),nt(),Cl(),Yt(),nn(),Hl("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>sn(h),0),(h===" "||h===`
|
|
101
|
-
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{Pl()},100)}ne.value=!1})},Ct=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},oe=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},nt=()=>{if(f.value&&!Qt.value){Qt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=pe,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Qt.value=!1}}},Fe=o=>{Pl(),X("blur",o),zl()},Dn=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),Ae.value&&(clearTimeout(Ae.value),Ae.value=null),q.value&&(Nt(),q.value=!1);const o=It.value==="title",n=It.value==="description",a=It.value==="editor";if(Ge.value.length===0){o&&Ie.value?Ie.value.focus():n&&kt.value?kt.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{xe()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};ft.value.push(r);const c=Ge.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,re.value=u,Re.value=m,Q.value=d,ct.value=u,Et.value=m,e.nextTick(()=>{W(),Zt(),Al(),Yt();const v=xn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ie.value){Ie.value.focus();const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}}else if(n){if(kt.value){kt.value.focus();const h=m.length;kt.value.setSelectionRange(h,h)}}else if(a)at();else if(Ie.value&&document.activeElement===Ie.value){const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}else if(kt.value&&document.activeElement===kt.value){const h=m.length;kt.value.setSelectionRange(h,h)}else f.value&&at()},10)})})}},Fl=()=>{if(T.disabled||!T.richText||!f.value)return;Ot();const o=It.value==="title",n=It.value==="description",a=It.value==="editor";if(ft.value.length===0){o&&Ie.value?Ie.value.focus():n&&kt.value?kt.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{xe()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ge.value.push(r);const c=ft.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,re.value=u,Re.value=m,Q.value=d,ct.value=u,Et.value=m,e.nextTick(()=>{W(),Zt(),Al(),Yt();const v=xn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ie.value){Ie.value.focus();const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}}else if(n){if(kt.value){kt.value.focus();const h=m.length;kt.value.setSelectionRange(h,h)}}else if(a)at();else if(Ie.value&&document.activeElement===Ie.value){const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}else if(kt.value&&document.activeElement===kt.value){const h=m.length;kt.value.setSelectionRange(h,h)}else f.value&&at()},10)})})}},Yl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Cl=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Nn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{Cl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Cl()});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(()=>{Cl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Cl()})}return!0},un=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Yl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Yl()});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(()=>{Yl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Yl()})}return!0},jl=(o,n=null)=>{if(T.disabled||!T.richText||!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&on(d)&&(r=be())}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=un();ge.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("bold");ge.value.bold=m})),xe(),Zt(),Yt()});return}if(o==="italic"){const d=Nn();ge.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("italic");ge.value.italic=m})),xe(),Cl(),Zt(),Yt()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&El(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=wl("bold");ge.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=wl("italic");ge.value.italic=u});else{const u=document.queryCommandState(o);ge.value[o]=u}else{const u=document.queryCommandState(o);ge.value[o]=u}}catch{ge.value.hasOwnProperty(o)?ge.value[o]=!ge.value[o]:ge.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}xe(),Zt(),Yt()})},wl=(o,n=null)=>{if(T.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const A=M;if(A.tagName==="STRONG"||A.tagName==="B"){u=!0;break}if(A.style&&parseInt(A.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const A=M;if(A.tagName==="EM"||A.tagName==="I"){u=!0;break}if(A.style&&A.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=d,d)}return ge.value.hasOwnProperty(o)?ge.value[o]:!1}catch{return ge.value.hasOwnProperty(o)?ge.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},en=o=>{T.disabled||!T.richText||(we.value=we.value===o?null:o,o==="askAi"&&(Ye.value=null))},Ot=()=>{we.value=null,it.value=null},Nl=o=>{jl("formatBlock",o),Ot()},lo=o=>{if(!o||!f.value)return o;const n=ze=>{let Se=ze.nodeType===Node.TEXT_NODE?ze.parentElement:ze;for(;Se&&Se!==f.value;){const yt=Se.tagName;if(yt==="P"){const yl=Se.parentElement;if(yl===f.value||yl.tagName==="BLOCKQUOTE")return Se}if(yt==="BLOCKQUOTE")break;Se=Se.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:ze=>{const Se=ze.tagName;if(Se==="P"){const yt=ze.parentElement;if(yt===f.value||yt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Se==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),A=c.slice(h,M+1);if(A.length===0)return o;const E=A[0],le=A[A.length-1],Y=document.createRange();return Y.setStartBefore(E),Y.setEndAfter(le),Y},Zn=()=>{if(T.disabled||!T.richText||!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&on(n)&&(n=lo(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&on(n)&&(a=be());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(E=>{const le=document.createElement("p");E.parentNode.insertBefore(le,E),le.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{a&&El(a),Al(),xe(),Yt()})},tn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const A=M.textContent||"",le=(M.innerHTML||"").trim();return A.trim()===""||le===""||le==="<br>"||le==="<br/>"||le==="<p></p>"||le==="<p><br></p>"||le==="<p><br/></p>"||le==="<p> </p>"||le==="<p><br> </p>"||le==="<div></div>"||le==="<div><br></div>"||le==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const A=r.children[M];if((A.tagName==="P"||A.tagName==="DIV")&&c(A))A.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Al(),xe()})},Zt=()=>{if(!f.value){fe.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");fe.value=!!r}else fe.value=!1}catch{fe.value=!1}},Hn=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ce.value=be();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),Oe.value="",ot.value=a,pt.value="",_e.value=null,ve.value=!0,Ot(),e.nextTick(()=>{I.value&&I.value.focus()})},Rn=()=>{if(!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt();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&&_e.value&&(n=_e.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)}_e.value=null}else jl("unlink");fe.value=!1,Ot(),e.nextTick(()=>{xe(),Zt()})},k=()=>{T.disabled||!T.richText||f.value&&(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{W(),xe(),Yt()}))},y=()=>{T.disabled||!T.richText||f.value&&(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{W(),xe(),Yt()}))},x=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},W=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=x(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},me=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{W(),xe()});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=x(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),W();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{xe(),Yt()})}else document.execCommand("indent",!1),e.nextTick(()=>{W(),xe(),Yt()})},Bt=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{W(),xe()});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(),W();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{xe(),Yt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{W(),xe(),Yt()})},mt=e.ref(null),Jt=e.ref(null),nl=e.ref({}),rl=e.ref(""),ol=e.ref(null),Kl=e.ref("");e.ref("");const dn=e.ref(null);e.ref("");const _l=e.ref([]),no=e.ref(!1),In=e.ref(!1),To=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},po=()=>{if(T.disabled||!T.richText||!f.value)return;if(mt.value!==null){mt.value=null,rl.value="",Kl.value="",dn.value=null,_l.value=[],wn(!0);return}Ot(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!on(n))return;Kl.value=To(n)||"",dn.value=be();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);nl.value={top:`${m}px`,bottom:"auto"},mt.value=Date.now(),e.nextTick(()=>{if(rl.value="",ol.value){const h=ol.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),A=v.getBoundingClientRect(),E=h.getBoundingClientRect(),le=A.bottom-M.top,Y=E.top-M.top,ze=8;if(le>Y-ze){const Se=E.height;nl.value={bottom:`${Se+ze}px`,top:"auto"}}else nl.value={top:`${m}px`,bottom:"auto"}}}})},oo=()=>{if(!rl.value.trim())return;const o=rl.value.trim(),n=new Date,a={text:o,selectionText:Kl.value,selectionRange:dn.value,commentId:mt.value,user:T.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],X("comment-submitted",a),so(a),dn.value&&!fo(dn.value)&&Ao(mt.value,dn.value),rl.value="",e.nextTick(()=>{if(ol.value){const r=ol.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Hl("sendComment")})},ao=(o,n)=>{if(!(!T.commentUser||!o.user||o.user.id!==T.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),mt.value!==null&&f.value){const a=String(mt.value),r=f.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(X("comment-deleted",{comment:o,index:n,commentId:mt.value}),T.comments&&Array.isArray(T.comments)){const a=T.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",a)}e.nextTick(()=>{Hl("deleteComment")})}},fo=o=>{if(!o||!f.value)return!1;try{const n=vo(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},vo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(n.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(n.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Ao=(o,n)=>{if(!(!o||!n||!f.value))try{const a=vo(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,M=a.endOffset,A=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(A===E&&h===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(A.tagName==="P"||A.tagName==="DIV"||A.tagName==="H1"||A.tagName==="H2"||A.tagName==="H3"||A.tagName==="H4"||A.tagName==="H5"||A.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Hl("wrapSelectionWithCommentMarker"),xe()})}catch{}},so=o=>{if(!o||!o.commentId)return;const n=Array.isArray(T.comments)?[...T.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)}no.value=!0,X("update:comments",n)},Do=(o,n=[])=>{if(T.disabled||!T.richText||!f.value)return;const a=f.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)),Kl.value=r.innerHTML||"",dn.value=be();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),A=u.bottom-M.top,le=Math.max(A+8,0);nl.value={top:`${le}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&T.comments&&Array.isArray(T.comments)){const M=T.comments.find(A=>String(A.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const A=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));h.push(...A)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((M,A)=>{const E=ze=>{if(!ze)return 0;const Se=new Date(ze).getTime();return isNaN(Se)?0:Se},le=E(M.createdAt),Y=E(A.createdAt);return le===Y?0:le-Y}),_l.value=h,wn(!0),mt.value=v||null,r&&(Jt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(rl.value="",ol.value){const M=ol.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const A=m.querySelector(".dss-text-editor-footer");if(A){const E=m.getBoundingClientRect(),le=M.getBoundingClientRect(),Y=A.getBoundingClientRect(),ze=le.bottom-E.top,Se=Y.top-E.top,yt=8;if(ze>Se-yt){const yl=Y.height;nl.value={bottom:`${yl+yt}px`,top:"auto"}}}}}Hl("openCommentOverlayForSelector")})},Fn=e.ref(null),Sl=e.ref(0),O=o=>{if(!(T.disabled||!T.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{tn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,A=a.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!h||A.length>E.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(()=>{xe()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Bt():me();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const A=a.startOffset;A<u.length&&(M=u.splitText(A));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(E,h.nextSibling):h.parentNode.appendChild(E);const le=document.createRange();M?le.setStart(M,0):le.setStart(E,0),le.collapse(!0),n.removeAllRanges(),n.addRange(le),e.nextTick(()=>{xe()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const ze=Y.textContent||"",yt=(Y.innerHTML||"").trim(),yl=yt.replace(/<br\s*\/?>/gi,"").trim();return ze.trim()===""||yt===""||yl===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=a.startContainer,A=M.nodeType===3?M.parentElement:M,E=A===c||A&&A.parentElement===c;if(u&&m(u)||h&&E){o.preventDefault(),setTimeout(()=>{tn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Sl.value;if(Fn.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(),me();return}}}}Fn.value=" ",Sl.value=n}else Fn.value=o.key}},xl=o=>{if(T.disabled||!T.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,"")),Nt();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(A=>{if(h>0){const E=v.createElement("p");E.innerHTML=A.innerHTML,A.parentNode.replaceChild(E,A)}else h++}),c){const A=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(le=>A.includes(le.tagName));if(E.length===1){const le=E[0].tagName,Y=c.tagName,ze=c.textContent.trim()===""&&!c.querySelector("img");let Se=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?Se=!0:ze||(le===Y||le==="P")&&(Se=!0),Se)return E[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);xe()},Ll=o=>{if(we.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ot()}if(he.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&zl()}if(Ye.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&ho()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(it.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);j.value=!r.collapsed&&on(r)}else j.value=!1}if(mt.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&&(mt.value=null,rl.value="",Kl.value="",dn.value=null,_l.value=[],wn(!0))}},Bn=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Xe.value&&(clearTimeout(Xe.value),Xe.value=null),it.value=n},vl=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}Xe.value&&clearTimeout(Xe.value),Xe.value=setTimeout(()=>{it.value=null,Xe.value=null},150)},Gl=o=>{it.value=null};let al=0;const gl=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-${++al}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},ln=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{gl(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&&Bn(v,h)},m=vl;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&Bn(h,M)},m=vl;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",Gl)})})})};let Tl=null;const _t=()=>{if(it.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${it.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${it.value}"]`);o&&n&&Yn(o,n)}if(he.value&&Yt(),T.richText){if(Tl!==null)return;Tl=setTimeout(()=>{Tl=null,Hl("handleWindowResize")},150)}},Mt=()=>{if(!T.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(()=>{Dt.value?Rl():Vl(),V.value?Il():Vn()})}),e.nextTick(()=>{wt()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ll),window.addEventListener("resize",_t);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,_t()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,_t()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{ln(),Mt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!T.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),A=v.closest(".dss-image-wrapper");if(M||A&&v===A){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),le=document.createRange();le.setStartAfter(A),le.collapse(!0),E.removeAllRanges(),E.addRange(le)}else A&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const Y=E.getRangeAt(0).commonAncestorContainer,ze=Y.nodeType===3?Y.parentElement:Y;if(A.contains(ze)&&ze!==A.querySelector("img")){const Se=document.createRange();Se.setStartAfter(A),Se.collapse(!0),E.removeAllRanges(),E.addRange(Se)}}else{const le=document.createRange();le.setStartAfter(A),le.collapse(!0),E.addRange(le)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const A=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),A.removeAllRanges(),A.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const A=h.getAttribute("alt")||h.alt||"";if(A){const E=h.getAttribute("src")||h.src||"",le=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=A===E||A===le;(A.startsWith("http://")||A.startsWith("https://")||A.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),nt()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(qt.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{qt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{qt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!qt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=qt.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,A=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){qt.value=null;return}let E=null;const le=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(le,Y);else{const el=window.getSelection();el.rangeCount>0?E=el.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){qt.value=null;return}const ze=E.commonAncestorContainer,Se=ze.nodeType===3?ze.parentElement:ze;if(Se?.closest(".dss-image-wrapper")===A||A&&A.contains(Se)){qt.value=null;return}if(A&&(Se===A||A.contains(Se))){qt.value=null;return}const yl=M.getAttribute("src");let cl=null;A?cl=A.cloneNode(!0):cl=M.cloneNode(!0);try{let el=E.startContainer;if(el.nodeType===3&&(el=el.parentElement),A&&(el===A||A.contains(el))){const Kt=document.createRange();Kt.setStartAfter(A),Kt.collapse(!0),E=Kt}E.insertNode(cl);const ul=document.createRange();ul.setStartAfter(cl),ul.collapse(!0);const dl=window.getSelection();dl.removeAllRanges(),dl.addRange(ul)}catch{if(f.value.childNodes.length===0){const ul=document.createElement("p");ul.appendChild(cl),f.value.appendChild(ul)}else{const ul=f.value.lastChild;if(ul&&ul.nodeType===1)ul.appendChild(cl);else{const dl=document.createElement("p");dl.appendChild(cl),f.value.appendChild(dl)}}}A?A.remove():M.remove(),qt.value=null,e.nextTick(()=>{const el=f.value.querySelectorAll("img");let ul=!1;el.forEach(dl=>{if(dl.getAttribute("src")===yl)if(!ul)ul=!0;else{const Kt=dl.closest(".dss-image-wrapper");Kt?Kt.remove():dl.remove()}}),nt(),xe()})}),f.value.addEventListener("dragend",m=>{qt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(A=>{A.removeAttribute("alt"),A.removeAttribute("data-alt"),A.setAttribute("alt",""),A.setAttribute("data-alt",""),A.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{nt(),Mt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Mt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),T.modelValue){const m=qn(T.modelValue);f.value.innerHTML=m,oe()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=T.title||"",h=T.description||"";U.value=m,re.value=v,Re.value=h,ct.value=v,Et.value=h,W(),nt(),Cl(),nn(),Pn(),Xn()}),Zt(),Al(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ll),window.removeEventListener("resize",_t),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Tl!==null&&(clearTimeout(Tl),Tl=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Ae.value&&clearTimeout(Ae.value),Xe.value&&clearTimeout(Xe.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ze.value&&Ze.value.disconnect(),vt.value!==null&&(cancelAnimationFrame(vt.value),vt.value=null),Ve.value!==null&&(clearTimeout(Ve.value),Ve.value=null),et.value!==null&&(clearTimeout(et.value),et.value=null),wn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const il=o=>{const n=o.target,a=n.closest("a");if(a&&!T.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)}}nt(),Zt(),Al(),Yt(),nn()}):e.nextTick(()=>{nt(),Zt(),Al(),Yt(),nn()})},go=()=>{Ct();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);j.value=!a.collapsed&&on(a),!a.collapsed&&w.value&&(w.value=null)}else j.value=!1;if(nt(),Zt(),Al(),Yt(),nn(),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(),j.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ge.value[a]=m}else{const d=document.queryCommandState(a);ge.value[a]=d}}}catch{}})},nn=()=>{if(!T.richText||T.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},Al=()=>{if(!f.value){ht.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}ht.value=n}catch{ht.value=!1}},on=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},zl=()=>{he.value=!1},Yt=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){he.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){he.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!on(n)){he.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){he.value=!1;return}const r=f.value;if(!r){he.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){he.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;st.value&&(M=st.value.getBoundingClientRect().width);const A=(M||320)/2;let E=c.left+A,le=c.right-A;if(le<E){const Y=c.left+c.width/2;E=Y,le=Y}if(h>0){const Y=A+u,ze=h-A-u;if(E=Math.max(E,Y),le=Math.min(le,ze),le<E){const Se=h/2;E=Se,le=Se}}v<E?v=E:v>le&&(v=le),de.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},he.value=!0},zn=o=>{T.disabled||!T.richText||(Ye.value=Ye.value===o?null:o,o==="askAi"&&(we.value=null))},ho=()=>{Ye.value=null,it.value=null},mn=o=>{Nl(o),ho()};let kn=null,Dl=null,pn=null,Bl=null;const Ho=o=>{if(T.disabled||!T.richText){an(),Mn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(kn&&(clearTimeout(kn),kn=null),pn&&(clearTimeout(pn),pn=null),a&&a!==Dl){Mn(),Dl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),_e.value=a,ce.value=c,ee.value=!0,ke.value=!0,yo(a)}else!a&&Dl?(Dl=null,kn=setTimeout(()=>{ke.value||an()},150)):a&&a===Dl&&yo(a);if(r&&r!==Bl){an(),Bl=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),Je.value=r,Xt.value=c.trim()||$("textEditor.image.noAlt"),$t.value=!0,Te.value=!0,ko(r)}else!r&&Bl?(Bl=null,pn=setTimeout(()=>{Te.value||Mn()},150)):r&&r===Bl&&ko(r)},Ro=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Dl=null,Bl=null,kn&&(clearTimeout(kn),kn=null),pn&&(clearTimeout(pn),pn=null),an(),Mn())},an=()=>{ke.value=!1,setTimeout(()=>{ke.value||(ee.value=!1,ce.value="",ve.value||(_e.value=null))},100)},yo=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Mn=()=>{Te.value=!1,setTimeout(()=>{Te.value||($t.value=!1,Xt.value="",xt.value||(Je.value=null))},100)},ko=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Co=()=>{if(!ce.value||!_e.value)return;let n=_e.value.getAttribute("href")||ce.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},bo=()=>{if(_e.value){const o=_e.value.textContent||"",n=_e.value.getAttribute("href")||"",a=_e.value;Oe.value=n,ot.value=o,pt.value=o,ke.value=!1,ee.value=!1,ce.value="",_e.value=a,ve.value=!0}else if(fe.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")||"";Oe.value=d,ot.value=c,pt.value=c,_e.value=r,ve.value=!0}}}else{Ce.value=be();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),Oe.value="",ot.value=n,pt.value="",_e.value=null,ve.value=!0}e.nextTick(()=>{I.value&&(I.value.focus(),I.value.select())})},Un=()=>{ve.value=!1,Oe.value="",ot.value="",pt.value="",_e.value=null,Ce.value=null},ro=()=>{if(!Oe.value.trim()){Un();return}if(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),ot.value.trim()||(ot.value=Oe.value.trim()),_e.value&&f.value&&f.value.contains(_e.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=_e.value;if(n.setAttribute("href",Oe.value.trim()),ot.value.trim()!==pt.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ot.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),xe()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ce.value&&El(Ce.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=Oe.value.trim(),a.textContent=ot.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,c=r&&n.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Oe.value.trim(),d.textContent=ot.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
100
|
+
</svg>`,f=e.ref(null),be=e.ref(null),fe=e.ref(!1),ne=e.ref(!1),ee=e.ref(!1),ue=e.ref(""),H=e.ref({}),ye=e.ref(!1),ve=e.ref(!1),Oe=e.ref(""),ot=e.ref(""),I=e.ref(null),qe=e.ref(null),Ve=e.ref(null),ke=e.ref(null),pt=e.ref(""),kt=e.ref(!1),ge=e.ref({}),ht=e.ref(!1),ae=e.ref({}),Xe=e.ref(null),$e=e.ref(null),rt=e.ref(!1),Tt=e.ref(""),tl=e.ref(null),Ft=e.ref(""),st=e.ref(""),Vt=e.ref(""),ll=e.ref(null),zt=e.ref(null),Gt=e.ref(null),Je=e.ref(null),lt=e.ref(null),$t=e.ref(!1),Xt=e.ref(""),te=e.ref({}),Te=e.ref(!1),Me=e.ref("upload"),Ue=e.ref(""),it=e.ref(null),Ye=e.ref(null),Ge=e.ref([]),ft=e.ref([]),Ae=e.ref(null),q=e.ref(!1),U=e.ref(""),Q=e.ref(""),ie=e.ref(""),Re=e.ref(""),ct=e.ref(""),Et=e.ref(""),Ie=e.ref(null),Ct=e.ref(null),It=e.ref(null),Qt=e.ref(!1),qt=e.ref(null),Ht=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),j=e.ref(!1),G=e.ref([]),Ze=e.ref(null),vt=e.ref(null),Se=e.ref(null),Ne=e.ref(!1),At=e.ref(0),Dt=100,et=e.ref(null),tt=e.computed(()=>({"dss-text-editor-no-border":!T.border,"dss-text-editor-rounded":T.rounded,"dss-text-editor-full-height":T.fullHeight,"dss-comment-overlay-open":mt.value!==null})),Lt=e.computed(()=>({})),fl=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+24+2}px`,resize:"none",overflowY:"auto"}),z=e.computed(()=>!T.fixedHeight||T.fullHeight?{}:{height:`${1.6*14*T.rows+32}px`,overflowY:"auto"}),Z=e.computed(()=>T.richText&&ft.value.length>0),P=e.computed(()=>{if(!T.modelValue)return"";if(T.richText){let o=T.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /g," "),o=o.replace(/&/g,"&"),o=o.replace(/</g,"<"),o=o.replace(/>/g,">"),o=o.replace(/"/g,'"'),o=o.replace(/'/g,"'"),o=o.replace(/\s+/g," ").trim(),o}return T.modelValue}),ce=e.computed(()=>{const o=P.value.trim();return o?o.split(/\s+/).filter(n=>n.length>0).length:0}),De=e.computed(()=>P.value.length),ut=e.computed(()=>Je.value!==null&&Me.value==="upload"&&Ft.value&&Ft.value.startsWith("data:")),dt=e.computed(()=>T.titlePlaceholder||$("textEditor.placeholders.title")),je=e.computed(()=>T.descriptionPlaceholder||$("textEditor.placeholders.description")),wt=e.computed(()=>T.placeholder||$("textEditor.placeholders.startTyping")),Wt=o=>Qe&&Qe[o]!==void 0,kl=o=>{for(let n=o+1;n<T.customToolbarSlots.length;n++)if(Wt(T.customToolbarSlots[n]))return!0;return!1},Zl=o=>{for(let n=o+1;n<T.customToolbarSlots.length;n++){const a=T.customToolbarSlots[n];if(Wt(a)&&Ml(a))return!0}return!1},Ml=o=>T.customToolbarFloatingMap.hasOwnProperty(o)?T.customToolbarFloatingMap[o]===!0:!0,Ul=e.computed(()=>T.customToolbarSlots.some(o=>Wt(o)&&Ml(o))),hn=e.computed(()=>Wt("title-slot")),yn=e.computed(()=>Wt("description-slot")),xn=o=>{if(!o||o.trim()==="")return"<html></html>";const n=o.trim();return n.startsWith("<html>")&&n.endsWith("</html>")?o:`<html>${o}</html>`},qn=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},Wn=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())},to=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""}},En=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"},Sn=o=>{const n=o.target.value;X("update:modelValue",n),X("change",n)},Rl=()=>{if(!Ie.value)return;const o=Ie.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")},Xl=()=>{Ht.value=!0,Rl()},bl=()=>{Ht.value=!1,Vl()},Vl=()=>{if(!Ie.value)return;const o=Ie.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")},$l=o=>{const a=o.target.value;Ht.value&&Rl(),X("update:title",a),X("title-change",a),It.value="title",T.richText&&(q.value||(Q.value=U.value,ct.value=ie.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt()},500))},Il=()=>{if(!Ct.value)return;const o=Ct.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")},Tn=()=>{V.value=!0,Il()},An=()=>{V.value=!1,Vn()},Vn=()=>{if(!Ct.value)return;const o=Ct.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")},Pt=o=>{const a=o.target.value;V.value&&Il(),X("update:description",a),X("description-change",a),It.value="description",T.richText&&(q.value||(Q.value=U.value,ct.value=ie.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt()},500))},Ce=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const n=o.getRangeAt(0);if(n.startContainer.nodeType===1)return{type:"element",element:n.startContainer,offset:n.startOffset};const a=n.cloneRange();return a.selectNodeContents(f.value),a.setEnd(n.startContainer,n.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+n.toString().length}},El=o=>{if(!(!o||!f.value))try{const n=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),n.removeAllRanges(),n.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}n.removeAllRanges(),n.addRange(a)}catch{f.value.focus()}},at=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),n=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(f.value);if(r.nodeType===3)n.setStart(r,r.length),n.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(n.setStart(c,c.length),n.setEnd(c,c.length)):(n.selectNodeContents(r),n.collapse(!1))}else n.setStart(r,0),n.setEnd(r,0);o.removeAllRanges(),o.addRange(n)},Nt=(o=!1)=>{if(!f.value)return;const n=f.value.innerHTML,a=T.title||"",r=T.description||"";if(!o&&n===U.value&&a===ie.value&&r===Re.value)return;const c={content:Q.value||U.value,title:ct.value!==void 0?ct.value:ie.value,description:Et.value!==void 0?Et.value:Re.value},d=Ge.value.length>0?Ge.value[Ge.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Ge.value.push(c),Ge.value.length>50&&Ge.value.shift(),ft.value=[]),U.value=n,ie.value=a,Re.value=r,Q.value=n,ct.value=a,Et.value=r},we=o=>{if(!f.value)return;bt(),f.value&&Wn(f.value);let n=null;f.value&&(f.value.querySelector("p")||(n=Ce(),oe()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&w.value&&(w.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=xn(r);X("update:modelValue",c),X("change",c),It.value="editor",q.value||(Q.value=U.value,ct.value=ie.value,Et.value=Re.value),Ae.value&&clearTimeout(Ae.value),q.value=!0,Ae.value=setTimeout(()=>{q.value=!1,Nt(),Pl(),sn()},500),e.nextTick(()=>{n&&El(n),bt();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&&w.value?.command===h){ge.value[h]=w.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,A=M.nodeType===3?M.parentElement:M;let E=!1;if(A&&((A.tagName==="STRONG"||A.tagName==="B"||A.closest&&A.closest("strong, b"))&&(E=!0),!E&&A.style&&parseInt(A.style.fontWeight)>=600&&(E=!0),!E))try{const le=window.getComputedStyle(A);parseInt(le.fontWeight)>=600&&(E=!0)}catch{}ge.value[h]=E}else ge.value.hasOwnProperty(h)||(ge.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,A=M.nodeType===3?M.parentElement:M,E=A&&(A.tagName==="EM"||A.tagName==="I"||A.closest&&A.closest("em, i"));ge.value[h]=!!E}else{const M=document.queryCommandState(h);ge.value[h]=M}else{const M=document.queryCommandState(h);ge.value[h]=M}}catch{}}),W(),nt(),Cl(),Yt(),nn(),Hl("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>sn(h),0),(h===" "||h===`
|
|
101
|
+
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{Pl()},100)}ne.value=!1})},bt=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=n.startContainer.nodeType===3?n.startContainer.parentElement:n.startContainer,m=n.endContainer.nodeType===3?n.endContainer.parentElement:n.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},oe=()=>{if(!f.value)return;const o=f.value;if(o.querySelector&&o.querySelector("p"))return;const n=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(n.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},nt=()=>{if(f.value&&!Qt.value){Qt.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=pe,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Qt.value=!1}}},Fe=o=>{Pl(),X("blur",o),zl()},Dn=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),Ae.value&&(clearTimeout(Ae.value),Ae.value=null),q.value&&(Nt(),q.value=!1);const o=It.value==="title",n=It.value==="description",a=It.value==="editor";if(Ge.value.length===0){o&&Ie.value?Ie.value.focus():n&&Ct.value?Ct.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};ft.value.push(r);const c=Ge.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,ie.value=u,Re.value=m,Q.value=d,ct.value=u,Et.value=m,e.nextTick(()=>{W(),Zt(),Al(),Yt();const v=xn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ie.value){Ie.value.focus();const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}}else if(n){if(Ct.value){Ct.value.focus();const h=m.length;Ct.value.setSelectionRange(h,h)}}else if(a)at();else if(Ie.value&&document.activeElement===Ie.value){const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}else if(Ct.value&&document.activeElement===Ct.value){const h=m.length;Ct.value.setSelectionRange(h,h)}else f.value&&at()},10)})})}},Fl=()=>{if(T.disabled||!T.richText||!f.value)return;Ot();const o=It.value==="title",n=It.value==="description",a=It.value==="editor";if(ft.value.length===0){o&&Ie.value?Ie.value.focus():n&&Ct.value?Ct.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{we()});return}const r={content:f.value.innerHTML,title:T.title||"",description:T.description||""};Ge.value.push(r);const c=ft.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,U.value=d,ie.value=u,Re.value=m,Q.value=d,ct.value=u,Et.value=m,e.nextTick(()=>{W(),Zt(),Al(),Yt();const v=xn(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Ie.value){Ie.value.focus();const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}}else if(n){if(Ct.value){Ct.value.focus();const h=m.length;Ct.value.setSelectionRange(h,h)}}else if(a)at();else if(Ie.value&&document.activeElement===Ie.value){const h=u.length;Ie.value.setSelectionRange&&Ie.value.setSelectionRange(h,h),Rl()}else if(Ct.value&&document.activeElement===Ct.value){const h=m.length;Ct.value.setSelectionRange(h,h)}else f.value&&at()},10)})})}},Yl=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Cl=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(n=>{n.style.fontStyle="italic"})},Nn=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{Cl()}),!1;if(n.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Cl()});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(()=>{Cl()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Cl()})}return!0},un=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const n=o.getRangeAt(0);let a=!1;if(n.collapsed){const r=n.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer:n.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof n.intersectsNode=="function"&&!n.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{Yl()}),!1;if(n.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}Yl()});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(()=>{Yl()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Yl()})}return!0},jl=(o,n=null)=>{if(T.disabled||!T.richText||!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&on(d)&&(r=Ce())}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=un();ge.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("bold");ge.value.bold=m})),we(),Zt(),Yt()});return}if(o==="italic"){const d=Nn();ge.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(El(r),e.nextTick(()=>{const m=wl("italic");ge.value.italic=m})),we(),Cl(),Zt(),Yt()});return}let c=!1;try{c=document.execCommand(o,!1,n)}catch{}e.nextTick(()=>{if(r&&El(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=wl("bold");ge.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=wl("italic");ge.value.italic=u});else{const u=document.queryCommandState(o);ge.value[o]=u}else{const u=document.queryCommandState(o);ge.value[o]=u}}catch{ge.value.hasOwnProperty(o)?ge.value[o]=!ge.value[o]:ge.value[o]=!0}if(o==="createLink"&&n){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",n)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",n)})}we(),Zt(),Yt()})},wl=(o,n=null)=>{if(T.disabled||!f.value)return!1;try{if(o==="formatBlock"&&n){const r=document.queryCommandValue("formatBlock");if(n==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===n||r.toLowerCase()===n.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const A=M;if(A.tagName==="STRONG"||A.tagName==="B"){u=!0;break}if(A.style&&parseInt(A.style.fontWeight)>=600){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const A=M;if(A.tagName==="EM"||A.tagName==="I"){u=!0;break}if(A.style&&A.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return ge.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&ge.value.hasOwnProperty(o)?ge.value[o]:(ge.value[o]=d,d)}return ge.value.hasOwnProperty(o)?ge.value[o]:!1}catch{return ge.value.hasOwnProperty(o)?ge.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},en=o=>{T.disabled||!T.richText||(be.value=be.value===o?null:o,o==="askAi"&&($e.value=null))},Ot=()=>{be.value=null,it.value=null},Nl=o=>{jl("formatBlock",o),Ot()},lo=o=>{if(!o||!f.value)return o;const n=ze=>{let Ee=ze.nodeType===Node.TEXT_NODE?ze.parentElement:ze;for(;Ee&&Ee!==f.value;){const yt=Ee.tagName;if(yt==="P"){const yl=Ee.parentElement;if(yl===f.value||yl.tagName==="BLOCKQUOTE")return Ee}if(yt==="BLOCKQUOTE")break;Ee=Ee.parentElement}return null},a=n(o.startContainer),r=n(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:ze=>{const Ee=ze.tagName;if(Ee==="P"){const yt=ze.parentElement;if(yt===f.value||yt.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ee==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),A=c.slice(h,M+1);if(A.length===0)return o;const E=A[0],le=A[A.length-1],Y=document.createRange();return Y.setStartBefore(E),Y.setEndAfter(le),Y},Zn=()=>{if(T.disabled||!T.richText||!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let n=o.getRangeAt(0);!n.collapsed&&on(n)&&(n=lo(n),o.removeAllRanges(),o.addRange(n));let a=null;!n.collapsed&&on(n)&&(a=Ce());const r=n.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(n.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=n.extractContents();u.appendChild(m),n.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(E=>{const le=document.createElement("p");E.parentNode.insertBefore(le,E),le.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{a&&El(a),Al(),we(),Yt()})},tn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const A=M.textContent||"",le=(M.innerHTML||"").trim();return A.trim()===""||le===""||le==="<br>"||le==="<br/>"||le==="<p></p>"||le==="<p><br></p>"||le==="<p><br/></p>"||le==="<p> </p>"||le==="<p><br> </p>"||le==="<div></div>"||le==="<div><br></div>"||le==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const A=r.children[M];if((A.tagName==="P"||A.tagName==="DIV")&&c(A))A.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Al(),we()})},Zt=()=>{if(!f.value){fe.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");fe.value=!!r}else fe.value=!1}catch{fe.value=!1}},Hn=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),ke.value=Ce();const n=window.getSelection();let a="";n.rangeCount>0&&(a=n.getRangeAt(0).toString()),Oe.value="",ot.value=a,pt.value="",Ve.value=null,ve.value=!0,Ot(),e.nextTick(()=>{I.value&&I.value.focus()})},Rn=()=>{if(!f.value)return;q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt();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&&Ve.value&&(n=Ve.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)}Ve.value=null}else jl("unlink");fe.value=!1,Ot(),e.nextTick(()=>{we(),Zt()})},k=()=>{T.disabled||!T.richText||f.value&&(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{W(),we(),Yt()}))},y=()=>{T.disabled||!T.richText||f.value&&(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),Ot(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{W(),we(),Yt()}))},x=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},W=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(n=>{const a=n.parentElement;if(a&&a.tagName==="LI"){const r=x(a);r!==null&&Array.from(n.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},me=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{W(),we()});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=x(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),W();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{we(),Yt()})}else document.execCommand("indent",!1),e.nextTick(()=>{W(),we(),Yt()})},Bt=()=>{if(T.disabled||!T.richText||!f.value)return;Ot(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const n=o.getRangeAt(0),a=n.commonAncestorContainer.nodeType===1?n.commonAncestorContainer.closest("li"):n.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{W(),we()});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(),W();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{we(),Yt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{W(),we(),Yt()})},mt=e.ref(null),Jt=e.ref(null),nl=e.ref({}),rl=e.ref(""),ol=e.ref(null),Kl=e.ref("");e.ref("");const dn=e.ref(null);e.ref("");const _l=e.ref([]),no=e.ref(!1),In=e.ref(!1),To=o=>{if(!o)return"";const n=o.cloneRange(),a=document.createElement("div");return a.appendChild(n.cloneContents()),a.innerHTML},po=()=>{if(T.disabled||!T.richText||!f.value)return;if(mt.value!==null){mt.value=null,rl.value="",Kl.value="",dn.value=null,_l.value=[],wn(!0);return}Ot(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const n=o.getRangeAt(0);if(n.collapsed||!on(n))return;Kl.value=To(n)||"",dn.value=Ce();const a=n.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);nl.value={top:`${m}px`,bottom:"auto"},mt.value=Date.now(),e.nextTick(()=>{if(rl.value="",ol.value){const h=ol.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),A=v.getBoundingClientRect(),E=h.getBoundingClientRect(),le=A.bottom-M.top,Y=E.top-M.top,ze=8;if(le>Y-ze){const Ee=E.height;nl.value={bottom:`${Ee+ze}px`,top:"auto"}}else nl.value={top:`${m}px`,bottom:"auto"}}}})},oo=()=>{if(!rl.value.trim())return;const o=rl.value.trim(),n=new Date,a={text:o,selectionText:Kl.value,selectionRange:dn.value,commentId:mt.value,user:T.commentUser||null,createdAt:n.toISOString()};_l.value=[..._l.value,a],X("comment-submitted",a),so(a),dn.value&&!fo(dn.value)&&Ao(mt.value,dn.value),rl.value="",e.nextTick(()=>{if(ol.value){const r=ol.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Hl("sendComment")})},ao=(o,n)=>{if(!(!T.commentUser||!o.user||o.user.id!==T.commentUser.id)){if(_l.value=_l.value.filter((a,r)=>r!==n),mt.value!==null&&f.value){const a=String(mt.value),r=f.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(X("comment-deleted",{comment:o,index:n,commentId:mt.value}),T.comments&&Array.isArray(T.comments)){const a=T.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",a)}e.nextTick(()=>{Hl("deleteComment")})}},fo=o=>{if(!o||!f.value)return!1;try{const n=vo(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},vo=o=>{if(!o||!f.value)return null;try{const n=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(n.setStart(o.element,o.offset),n.collapse(!0),n):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(n.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(n.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?n:null}catch{return null}},Ao=(o,n)=>{if(!(!o||!n||!f.value))try{const a=vo(n);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,v=a.endContainer,h=a.startOffset,M=a.endOffset,A=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(A===E&&h===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(A.tagName==="P"||A.tagName==="DIV"||A.tagName==="H1"||A.tagName==="H2"||A.tagName==="H3"||A.tagName==="H4"||A.tagName==="H5"||A.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Hl("wrapSelectionWithCommentMarker"),we()})}catch{}},so=o=>{if(!o||!o.commentId)return;const n=Array.isArray(T.comments)?[...T.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)}no.value=!0,X("update:comments",n)},Do=(o,n=[])=>{if(T.disabled||!T.richText||!f.value)return;const a=f.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)),Kl.value=r.innerHTML||"",dn.value=Ce();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),A=u.bottom-M.top,le=Math.max(A+8,0);nl.value={top:`${le}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&T.comments&&Array.isArray(T.comments)){const M=T.comments.find(A=>String(A.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const A=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));h.push(...A)}}h.length===0&&Array.isArray(n)&&n.length>0&&(h=n.slice()),h.sort((M,A)=>{const E=ze=>{if(!ze)return 0;const Ee=new Date(ze).getTime();return isNaN(Ee)?0:Ee},le=E(M.createdAt),Y=E(A.createdAt);return le===Y?0:le-Y}),_l.value=h,wn(!0),mt.value=v||null,r&&(Jt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(rl.value="",ol.value){const M=ol.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const A=m.querySelector(".dss-text-editor-footer");if(A){const E=m.getBoundingClientRect(),le=M.getBoundingClientRect(),Y=A.getBoundingClientRect(),ze=le.bottom-E.top,Ee=Y.top-E.top,yt=8;if(ze>Ee-yt){const yl=Y.height;nl.value={bottom:`${yl+yt}px`,top:"auto"}}}}}Hl("openCommentOverlayForSelector")})},Fn=e.ref(null),Sl=e.ref(0),O=o=>{if(!(T.disabled||!T.richText)){if(o.key==="Escape"){const n=window.getSelection();if(n.rangeCount>0){const r=n.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{tn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const n=window.getSelection();if(n&&n.rangeCount>0){const a=n.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),n.removeAllRanges(),n.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,A=a.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!h||A.length>E.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(()=>{we()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Bt():me();return}if(o.key==="Enter"){const n=window.getSelection();if(n.rangeCount>0){const a=n.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const A=a.startOffset;A<u.length&&(M=u.splitText(A));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(E,h.nextSibling):h.parentNode.appendChild(E);const le=document.createRange();M?le.setStart(M,0):le.setStart(E,0),le.collapse(!0),n.removeAllRanges(),n.addRange(le),e.nextTick(()=>{we()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const ze=Y.textContent||"",yt=(Y.innerHTML||"").trim(),yl=yt.replace(/<br\s*\/?>/gi,"").trim();return ze.trim()===""||yt===""||yl===""||yt==="<br>"||yt==="<br/>"||yt==="<p></p>"||yt==="<p><br></p>"||yt==="<p><br/></p>"||yt==="<p> </p>"||yt==="<p><br> </p>"||yt==="<div></div>"||yt==="<div><br></div>"||yt==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=a.startContainer,A=M.nodeType===3?M.parentElement:M,E=A===c||A&&A.parentElement===c;if(u&&m(u)||h&&E){o.preventDefault(),setTimeout(()=>{tn()},50);return}}}}if(o.key===" "){const n=Date.now(),a=n-Sl.value;if(Fn.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(),me();return}}}}Fn.value=" ",Sl.value=n}else Fn.value=o.key}},xl=o=>{if(T.disabled||!T.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,"")),Nt();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(A=>{if(h>0){const E=v.createElement("p");E.innerHTML=A.innerHTML,A.parentNode.replaceChild(E,A)}else h++}),c){const A=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(le=>A.includes(le.tagName));if(E.length===1){const le=E[0].tagName,Y=c.tagName,ze=c.textContent.trim()===""&&!c.querySelector("img");let Ee=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?Ee=!0:ze||(le===Y||le==="P")&&(Ee=!0),Ee)return E[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);we()},Ll=o=>{if(be.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Ot()}if(ht.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&zl()}if($e.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&ho()}const n=o.target;if(!n.closest(".dss-toolbar-dropdown")&&!n.closest(".dss-toolbar-dropdown-submenu")&&(it.value=null),!f.value||!n.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);j.value=!r.collapsed&&on(r)}else j.value=!1}if(mt.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&&(mt.value=null,rl.value="",Kl.value="",dn.value=null,_l.value=[],wn(!0))}},Bn=(o,n)=>{o&&o.stopPropagation&&o.stopPropagation(),Ye.value&&(clearTimeout(Ye.value),Ye.value=null),it.value=n},vl=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}Ye.value&&clearTimeout(Ye.value),Ye.value=setTimeout(()=>{it.value=null,Ye.value=null},150)},Gl=o=>{it.value=null};let al=0;const gl=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-${++al}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},ln=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(n=>{gl(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&&Bn(v,h)},m=vl;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),n.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&Bn(h,M)},m=vl;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",Gl)})})})};let Tl=null;const _t=()=>{if(it.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${it.value}"]`),n=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${it.value}"]`);o&&n&&Yn(o,n)}if(ht.value&&Yt(),T.richText){if(Tl!==null)return;Tl=setTimeout(()=>{Tl=null,Hl("handleWindowResize")},150)}},Mt=()=>{if(!T.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")})})},xt=()=>{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(()=>{Ht.value?Rl():Vl(),V.value?Il():Vn()})}),e.nextTick(()=>{xt()}),T.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Ll),window.addEventListener("resize",_t);let o=null;const n=()=>{o===null&&(o=setTimeout(()=>{o=null,_t()},150))};window.addEventListener("scroll",n,!0),f.value._windowScrollHandler=n,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,_t()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{ln(),Mt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!T.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),A=v.closest(".dss-image-wrapper");if(M||A&&v===A){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),le=document.createRange();le.setStartAfter(A),le.collapse(!0),E.removeAllRanges(),E.addRange(le)}else A&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const Y=E.getRangeAt(0).commonAncestorContainer,ze=Y.nodeType===3?Y.parentElement:Y;if(A.contains(ze)&&ze!==A.querySelector("img")){const Ee=document.createRange();Ee.setStartAfter(A),Ee.collapse(!0),E.removeAllRanges(),E.addRange(Ee)}}else{const le=document.createRange();le.setStartAfter(A),le.collapse(!0),E.addRange(le)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const A=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),A.removeAllRanges(),A.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const A=h.getAttribute("alt")||h.alt||"";if(A){const E=h.getAttribute("src")||h.src||"",le=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=A===E||A===le;(A.startsWith("http://")||A.startsWith("https://")||A.startsWith("data:")||Y||Y)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),nt()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(qt.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{qt.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{qt.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!qt.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=qt.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,A=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){qt.value=null;return}let E=null;const le=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(le,Y);else{const el=window.getSelection();el.rangeCount>0?E=el.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){qt.value=null;return}const ze=E.commonAncestorContainer,Ee=ze.nodeType===3?ze.parentElement:ze;if(Ee?.closest(".dss-image-wrapper")===A||A&&A.contains(Ee)){qt.value=null;return}if(A&&(Ee===A||A.contains(Ee))){qt.value=null;return}const yl=M.getAttribute("src");let cl=null;A?cl=A.cloneNode(!0):cl=M.cloneNode(!0);try{let el=E.startContainer;if(el.nodeType===3&&(el=el.parentElement),A&&(el===A||A.contains(el))){const Kt=document.createRange();Kt.setStartAfter(A),Kt.collapse(!0),E=Kt}E.insertNode(cl);const ul=document.createRange();ul.setStartAfter(cl),ul.collapse(!0);const dl=window.getSelection();dl.removeAllRanges(),dl.addRange(ul)}catch{if(f.value.childNodes.length===0){const ul=document.createElement("p");ul.appendChild(cl),f.value.appendChild(ul)}else{const ul=f.value.lastChild;if(ul&&ul.nodeType===1)ul.appendChild(cl);else{const dl=document.createElement("p");dl.appendChild(cl),f.value.appendChild(dl)}}}A?A.remove():M.remove(),qt.value=null,e.nextTick(()=>{const el=f.value.querySelectorAll("img");let ul=!1;el.forEach(dl=>{if(dl.getAttribute("src")===yl)if(!ul)ul=!0;else{const Kt=dl.closest(".dss-image-wrapper");Kt?Kt.remove():dl.remove()}}),nt(),we()})}),f.value.addEventListener("dragend",m=>{qt.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(A=>{A.removeAttribute("alt"),A.removeAttribute("data-alt"),A.setAttribute("alt",""),A.setAttribute("data-alt",""),A.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{nt(),Mt(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Mt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),T.modelValue){const m=qn(T.modelValue);f.value.innerHTML=m,oe()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=T.title||"",h=T.description||"";U.value=m,ie.value=v,Re.value=h,ct.value=v,Et.value=h,W(),nt(),Cl(),nn(),Pn(),Xn()}),Zt(),Al(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Ll),window.removeEventListener("resize",_t),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Tl!==null&&(clearTimeout(Tl),Tl=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Ae.value&&clearTimeout(Ae.value),Ye.value&&clearTimeout(Ye.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ze.value&&Ze.value.disconnect(),vt.value!==null&&(cancelAnimationFrame(vt.value),vt.value=null),Se.value!==null&&(clearTimeout(Se.value),Se.value=null),et.value!==null&&(clearTimeout(et.value),et.value=null),wn(!0),f.value&&f.value._scrollHandlers){const{wrapper:n,content:a,handler:r}=f.value._scrollHandlers;n&&n.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const il=o=>{const n=o.target,a=n.closest("a");if(a&&!T.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)}}nt(),Zt(),Al(),Yt(),nn()}):e.nextTick(()=>{nt(),Zt(),Al(),Yt(),nn()})},go=()=>{bt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);j.value=!a.collapsed&&on(a),!a.collapsed&&w.value&&(w.value=null)}else j.value=!1;if(nt(),Zt(),Al(),Yt(),nn(),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(),j.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}ge.value[a]=m}else{const d=document.queryCommandState(a);ge.value[a]=d}}}catch{}})},nn=()=>{if(!T.richText||T.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},Al=()=>{if(!f.value){kt.value=!1;return}try{const o=window.getSelection();let n=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");n=!!(c&&f.value.contains(c))}kt.value=n}catch{kt.value=!1}},on=o=>{if(!o||!f.value)return!1;const n=o.commonAncestorContainer;if(!n)return!1;const a=n.nodeType===3?n.parentElement:n;return a?f.value.contains(a):!1},zl=()=>{ht.value=!1},Yt=()=>{if(!T.floatingToolbar||!T.richText||T.disabled){ht.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ht.value=!1;return}const n=o.getRangeAt(0);if(n.collapsed||!on(n)){ht.value=!1;return}const a=n.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ht.value=!1;return}const r=f.value;if(!r){ht.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ht.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Xe.value&&(M=Xe.value.getBoundingClientRect().width);const A=(M||320)/2;let E=c.left+A,le=c.right-A;if(le<E){const Y=c.left+c.width/2;E=Y,le=Y}if(h>0){const Y=A+u,ze=h-A-u;if(E=Math.max(E,Y),le=Math.min(le,ze),le<E){const Ee=h/2;E=Ee,le=Ee}}v<E?v=E:v>le&&(v=le),ae.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ht.value=!0},zn=o=>{T.disabled||!T.richText||($e.value=$e.value===o?null:o,o==="askAi"&&(be.value=null))},ho=()=>{$e.value=null,it.value=null},mn=o=>{Nl(o),ho()};let kn=null,Dl=null,pn=null,Bl=null;const Ho=o=>{if(T.disabled||!T.richText){an(),Mn();return}const n=o.target,a=n.closest("a"),r=n.closest("img");if(kn&&(clearTimeout(kn),kn=null),pn&&(clearTimeout(pn),pn=null),a&&a!==Dl){Mn(),Dl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Ve.value=a,ue.value=c,ee.value=!0,ye.value=!0,yo(a)}else!a&&Dl?(Dl=null,kn=setTimeout(()=>{ye.value||an()},150)):a&&a===Dl&&yo(a);if(r&&r!==Bl){an(),Bl=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),Je.value=r,Xt.value=c.trim()||$("textEditor.image.noAlt"),$t.value=!0,Te.value=!0,ko(r)}else!r&&Bl?(Bl=null,pn=setTimeout(()=>{Te.value||Mn()},150)):r&&r===Bl&&ko(r)},Ro=o=>{const n=o.relatedTarget;(!n||!n.closest(".dss-text-editor-content")&&!n.closest(".dss-link-popup"))&&(Dl=null,Bl=null,kn&&(clearTimeout(kn),kn=null),pn&&(clearTimeout(pn),pn=null),an(),Mn())},an=()=>{ye.value=!1,setTimeout(()=>{ye.value||(ee.value=!1,ue.value="",ve.value||(Ve.value=null))},100)},yo=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Mn=()=>{Te.value=!1,setTimeout(()=>{Te.value||($t.value=!1,Xt.value="",rt.value||(Je.value=null))},100)},ko=o=>{if(!o||!f.value)return;const n=o.getBoundingClientRect(),c=n.top-32-8,d=n.left+n.width/2;te.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Co=()=>{if(!ue.value||!Ve.value)return;let n=Ve.value.getAttribute("href")||ue.value;!n.startsWith("http://")&&!n.startsWith("https://")&&!n.startsWith("mailto:")&&(n="https://"+n),window.open(n,"_blank","noopener,noreferrer")},bo=()=>{if(Ve.value){const o=Ve.value.textContent||"",n=Ve.value.getAttribute("href")||"",a=Ve.value;Oe.value=n,ot.value=o,pt.value=o,ye.value=!1,ee.value=!1,ue.value="",Ve.value=a,ve.value=!0}else if(fe.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")||"";Oe.value=d,ot.value=c,pt.value=c,Ve.value=r,ve.value=!0}}}else{ke.value=Ce();const o=window.getSelection();let n="";o.rangeCount>0&&(n=o.getRangeAt(0).toString()),Oe.value="",ot.value=n,pt.value="",Ve.value=null,ve.value=!0}e.nextTick(()=>{I.value&&(I.value.focus(),I.value.select())})},Un=()=>{ve.value=!1,Oe.value="",ot.value="",pt.value="",Ve.value=null,ke.value=null},ro=()=>{if(!Oe.value.trim()){Un();return}if(q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt(),ot.value.trim()||(ot.value=Oe.value.trim()),Ve.value&&f.value&&f.value.contains(Ve.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const n=Ve.value;if(n.setAttribute("href",Oe.value.trim()),ot.value.trim()!==pt.value.trim()){for(;n.firstChild;)n.removeChild(n.firstChild);n.textContent=ot.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),we()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),ke.value&&El(ke.value);let n=null;if(o.rangeCount>0&&(n=o.getRangeAt(0)),n&&!n.collapsed){n.toString();const a=document.createElement("a");a.href=Oe.value.trim(),a.textContent=ot.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",n.deleteContents(),n.insertNode(a);const r=document.createTextNode(" ");n.setStartAfter(a),n.insertNode(r),n.setStartAfter(r),n.collapse(!0),o.removeAllRanges(),o.addRange(n)}else{n||(n=document.createRange(),n.selectNodeContents(f.value),n.collapse(!1));const a=n.startContainer,r=a.nodeType===3,c=r&&n.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Oe.value.trim(),d.textContent=ot.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(n.startOffset>0){const h=a.textContent.substring(0,n.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
102
102
|
`){const A=document.createTextNode(" ");n.insertNode(A),n.setStartAfter(A)}}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)}}xe()}e.nextTick(()=>{Zt(),Un()})},Pl=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=be());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const A=M.filter(Y=>{const ze=Y[0],Se=Y.index;if(Se>0&&h[Se-1]==="@"||Se+ze.length<h.length&&h[Se+ze.length]==="@")return!1;const yt=v.parentElement;return!(yt&&yt.closest("a"))});if(A.length===0)continue;if(A.length===1&&A[0][0]===h.trim()){const Y=A[0][0],ze=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,Se=document.createElement("a");Se.href=ze,Se.textContent=Y,Se.style.color="#60afdf",Se.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Se,v),u=!0);continue}let E=0;const le=document.createDocumentFragment();if(A.forEach(Y=>{const ze=Y.index,Se=Y[0];if(ze>E){const cl=h.substring(E,ze);cl&&le.appendChild(document.createTextNode(cl))}const yt=Se.startsWith("http://")||Se.startsWith("https://")?Se:`https://${Se}`,yl=document.createElement("a");yl.href=yt,yl.textContent=Se,yl.style.color="#60afdf",yl.style.textDecoration="underline",le.appendChild(yl),E=ze+Se.length}),E<h.length){const Y=h.substring(E);Y&&le.appendChild(document.createTextNode(Y))}v.parentNode&&le.childNodes.length>0&&(v.parentNode.replaceChild(le,v),u=!0)}u&&n&&e.nextTick(()=>{El(n),Zt()})},Cn=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const A=M.index,E=M[0].startsWith("<u>")?"u":"ins",le=M[1]||M[2]||"";A>v&&h.appendChild(document.createTextNode(u.substring(v,A)));const Y=document.createElement(E);Y.textContent=le,h.appendChild(Y),v=A+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},sn=o=>{if(!f.value||ne.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===f.value||!f.value.contains(c))return;const d=()=>{let cl="",el=0,ul=!1;const dl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ql=>Ql.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Kt=0;for(;dl.nextNode();){const Ql=dl.currentNode,vn=Ql.textContent||"",Jl=Kt;if(Kt+=vn.length,Ql===r.startContainer){cl+=vn.substring(0,r.startOffset),el=Jl+r.startOffset,ul=!0;break}cl+=vn}return ul||(el=cl.length),{textBeforeCursor:cl,cursorCharOffset:el}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],A=u.length-h.length,le=(cl=>{let el=0;const ul=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Kt=>Kt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let dl;for(;dl=ul.nextNode();){const Kt=(dl.textContent||"").length;if(el+Kt>=cl)return{node:dl,offset:cl-el};el+=Kt}return null})(A);if(!le)return;const Y=document.createRange();Y.setStart(le.node,le.offset),Y.setEnd(r.endContainer,r.endOffset);const ze=document.createElement(v);ze.textContent=M,Y.deleteContents(),Y.insertNode(ze);const Se=window.getSelection(),yt=document.createRange();yt.setStartAfter(ze),yt.collapse(!0),Se.removeAllRanges(),Se.addRange(yt);const yl=be();e.nextTick(()=>{xe(),yl&&El(yl)})},jt=()=>{f.value&&(lt.value=be(),Rt.value="",Ft.value="",Ue.value="",rt.value="",Vt.value="",tl.value=null,Je.value=null,Me.value="upload",xt.value=!0,Ot(),e.nextTick(()=>{ll.value&&ll.value.focus(),zt.value&&(zt.value.value="")}))},wo=o=>{const n=o.target?.files?.[0];if(!n){tl.value=null,Ft.value="";return}tl.value=n;const a=new FileReader;a.onload=r=>{Ft.value=r.target?.result||""},a.readAsDataURL(n)},sl=()=>{zt.value&&zt.value.click()},hl=()=>{rt.value&&(Vt.value="")},xo=()=>{Vt.value&&(rt.value="")},Io=()=>{let o=Je.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")||"";Je.value=o,Rt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ue.value=a,Ft.value="",Me.value="url"):(Ft.value=a,Ue.value="",Me.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";rt.value=c.endsWith("px")?c.replace("px",""):c,Vt.value=d.endsWith("px")?d.replace("px",""):d,lt.value=null}else{jt();return}xt.value=!0,Te.value=!1,$t.value=!1,e.nextTick(()=>{Me.value==="url"&&Gt.value?(Gt.value.focus(),Gt.value.select()):ll.value&&(ll.value.focus(),ll.value.select()),zt.value&&(zt.value.value="")})},bn=()=>{xt.value=!1,Rt.value="",Ft.value="",Ue.value="",rt.value="",Vt.value="",tl.value=null,Je.value=null,lt.value=null,Me.value="upload"},fn=()=>{const o=(Rt.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt();const a=Me.value==="url"?Ue.value.trim():Ft.value;if(Je.value&&f.value&&f.value.contains(Je.value)){a&&(Je.value.src=a),Je.value.setAttribute("alt",o),Je.value.setAttribute("data-alt",o),rt.value?(Je.value.style.width=`${rt.value}px`,Je.value.setAttribute("width",rt.value)):(Je.value.style.removeProperty("width"),Je.value.removeAttribute("width")),Vt.value?(Je.value.style.height=`${Vt.value}px`,Je.value.setAttribute("height",Vt.value)):(Je.value.style.removeProperty("height"),Je.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Je.value),c.collapse(!0),r.addRange(c)}xe()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),bn();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(lt.value&&(El(lt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){bn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),rt.value&&(v.style.width=`${rt.value}px`,v.setAttribute("width",rt.value)),Vt.value&&(v.style.height=`${Vt.value}px`,v.setAttribute("height",Vt.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const A=document.createElement("p");f.value.appendChild(A),A.appendChild(v)}else{const A=f.value.lastChild;if(A&&A.nodeType===1)A.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}Je.value=v,xe()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Zt(),Yt(),bn()})};e.watch(()=>T.modelValue,o=>{if(T.richText&&f.value&&!ne.value){const n=qn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(r!==c){const d=be();f.value.innerHTML=n,e.nextTick(()=>{oe();const u=f.value.innerHTML||"",m=T.title||"",v=T.description||"";U.value=u,re.value=m,Re.value=v,Q.value=u,ct.value=m,Et.value=v,Ge.value=[],ft.value=[],Ae.value&&(clearTimeout(Ae.value),Ae.value=null),q.value=!1,d&&El(d),W(),nt(),Cl(),Zt(),Yt(),nn(),Hl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,o=>{o?(Yt(),e.nextTick(()=>{Pn()})):(zl(),G.value=[],Ze.value&&(Ze.value.disconnect(),Ze.value=null)),nn()}),e.watch(()=>T.floatingToolbar,o=>{o?Yt():zl()}),e.watch(()=>T.disabled,o=>{o&&zl(),nn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{V.value?Il():Vn()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{Dt.value?Rl():Vl()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Mt()})},{deep:!0}),e.watch(()=>T.comments,(o,n)=>{if(no.value){no.value=!1;return}In.value||T.richText&&f.value&&e.nextTick(()=>{Xn()})},{deep:!0,immediate:!1});const Xn=()=>{if(!In.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){In.value=!0;try{const o=new Set,n=T.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){_n(h,u),d.add(v);return}try{const M=co(u.selection_range,u.selection_text);if(M&&!M.collapsed){const A=M.commonAncestorContainer,E=A.nodeType===3?A.parentElement:A;if(E){const ze=E.closest("[data-comment], [data-fake-comment]");if(ze){const Se=ze.getAttribute("data-comment")||ze.getAttribute("data-fake-comment");if(String(Se)===String(m)){ze.setAttribute("data-comment",v),ze.removeAttribute("data-fake-comment"),_n(ze,u),d.add(v);return}else return}}const le=f.value.querySelector(`[data-comment="${v}"]`);if(le){_n(le,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),_n(Y,u);try{M.surroundContents(Y),c++,d.add(v)}catch{try{const Se=document.createRange();Se.setStart(M.startContainer,M.startOffset),Se.setEnd(M.endContainer,M.endOffset),Ut(Se),Se.surroundContents(Y),c++,d.add(v)}catch{try{const yt=M.extractContents();Y.appendChild(yt),M.insertNode(Y),c++,d.add(v)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{Hl("restoreCommentsFromModel"),xe(),In.value=!1})}catch{In.value=!1}}},Ut=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&n.includes(u.tagName)&&(r===0&&!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&&!io(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},io=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},co=(o,n)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Ut(a):null}}catch{return null}return null},_n=(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")},Hl=(o="unknown")=>{if(!T.richText||!f.value){G.value=[];return}Date.now()-Tt.value<At&&vt.value!==null||vt.value===null&&(vt.value=requestAnimationFrame(()=>{if(vt.value=null,Tt.value=Date.now(),Ne.value)return;Ne.value=!0;const a={},r=f.value;if(!r){Ne.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Ne.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");le&&E.tagName==="SPAN"&&(m.has(le)||(u.push(E),m.add(le)))}),d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!le||m.has(le)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${le}"], span[data-fake-comment="${le}"]`)||(u.push(E),m.add(le)):E.tagName!=="SPAN"&&(u.push(E),m.add(le)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((E,le)=>{let Y=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const gt=E.textContent?.trim(),Ol=T.comments?.find(ml=>(typeof ml.conversation_id=="string"&&ml.conversation_id.startsWith("comment-")?null:ml.conversation_id)&&ml.selection_text?.trim()===gt);Ol?(Y=String(Ol.conversation_id),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment")):(Y=String(Date.now()),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment"))}const ze=E.getBoundingClientRect(),Se=window.getComputedStyle(E),yt=parseFloat(Se.lineHeight)||parseFloat(Se.fontSize)*1.2,el=ze.top-h.top+yt/2-15,dl=h.top-v.top+el;let Kt=null,Ql=null,vn=0;const Jl=[],So=new Set;if(Y&&T.comments){const gt=T.comments.find(Ol=>String(Ol.conversation_id||Ol.id)===String(Y));if(gt){const Ol=gt.conversation||[];Ol.length>0?(Ol.forEach(ml=>{ml.user&&ml.user.id&&!So.has(ml.user.id)&&(So.add(ml.user.id),Jl.push(ml.user))}),vn=Ol.length):(vn=0,Kt=null,Ql=null),Jl.length>0?Kt=Jl[0]:Kt=null,Jl.length>1?Ql=Jl[1]:Ql=null}}const rn=ze.top+yt/2-15,mo=rn+30,On=5,$n=mo>h.top+On&&rn<h.bottom-On?1:0;G.value.find(gt=>gt.id===Y);let gn=E;if(!gn&&Y&&f.value){const gt=String(Y);gn=f.value.querySelector(`[data-comment="${gt}"], [data-fake-comment="${gt}"]`)}const Ln=Jl.length;a[Y]?(a[Y].top=dl,a[Y].opacity=$n,a[Y].element=gn,a[Y].firstUser=Kt,a[Y].secondUser=Ql,a[Y].totalCount=vn,a[Y].uniqueUserCount=Ln):a[Y]={id:Y,top:dl,opacity:$n,element:gn,firstUser:Kt,secondUser:Ql,totalCount:vn,uniqueUserCount:Ln}});const M=Object.values(a).map(E=>{const le=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const ze=String(E.id);E.element=f.value.querySelector(`[data-comment="${ze}"], [data-fake-comment="${ze}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:le}});(G.value.length!==M.length||M.some((E,le)=>{const Y=G.value[le];if(!Y)return!0;const ze=(Y.firstUser?.id||null)!==(E.firstUser?.id||null),Se=(Y.secondUser?.id||null)!==(E.secondUser?.id||null);return Y.id!==E.id||Math.abs(Y.top-E.top)>1||Y.opacity!==E.opacity||Y.totalCount!==E.totalCount||Y.additionalCount!==E.additionalCount||ze||Se||Y.element!==E.element}))&&(G.value=M),Ne.value=!1}))},Eo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const a=String(o.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(wn(),Jt.value=n,n.classList.add("editor-comment-highlighted"))},wn=(o=!1)=>{!o&&mt.value!==null&&Jt.value&&(Jt.value.getAttribute("data-comment")||Jt.value.getAttribute("data-fake-comment"))===mt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jt.value&&(Jt.value.classList.remove("editor-comment-highlighted"),Jt.value=null))},uo=o=>{if(!o||!o.element)return;wn(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;X("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},zo=()=>{wn()},Pn=()=>{!T.richText||!f.value||(Ze.value&&Ze.value.disconnect(),et.value!==null&&(clearTimeout(et.value),et.value=null),Ze.value=new MutationObserver(()=>{et.value===null&&(et.value=setTimeout(()=>{et.value=null,e.nextTick(()=>{Hl("MutationObserver")})},200))}),Ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Hl("setupCommentMarkersObserver-initial"))},Yn=(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(()=>it.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(()=>{Yn(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(()=>[we.value,Ye.value],()=>{we.value==="askAi"||Ye.value==="askAi"?e.nextTick(()=>{ln()}):(it.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(()=>T.locale,o=>{o&&o!==ae.value&&(ae.value=o)},{immediate:!0}),J({openCommentOverlayForSelector:Do,updateCommentMarkers:Hl,restoreCommentsFromModel:Xn}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",tt.value]),style:e.normalizeStyle(Lt.value)},[_.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",pu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Dn,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,fu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:Fl,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,vu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",gu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>en("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,yu)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ku)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Cu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,bu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,wu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,xu)):(e.openBlock(),e.createElementBlock("svg",Eu,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,hu),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Nl("<h1>"))},[e.createElementVNode("img",{src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Su),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=>Nl("<h2>"))},[e.createElementVNode("img",{src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Vu),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=>Nl("<h3>"))},[e.createElementVNode("img",{src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Nu),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=>Nl("<h4>"))},[e.createElementVNode("img",{src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Bu),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=>Nl("<h5>"))},[e.createElementVNode("img",{src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Mu),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=>Nl("<h6>"))},[e.createElementVNode("img",{src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,_u),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=>Nl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[9]||(n[9]=a=>jl("bold")),title:e.unref($)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[10]||(n[10]=a=>jl("italic")),title:e.unref($)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[11]||(n[11]=a=>jl("underline")),title:e.unref($)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht.value}]),onClick:Zn,title:e.unref($)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Au),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Rn,title:e.unref($)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Hu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Hn,title:e.unref($)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Du)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:k,title:e.unref($)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:y,title:e.unref($)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Iu),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:jt,title:e.unref($)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Fu),j.value?(e.openBlock(),e.createElementBlock("div",zu)):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:po},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Pu)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",Ou)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>en("askAi")),title:e.unref($)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Zu,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,Wu),we.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[13]||(n[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)?(e.openBlock(),e.createElementBlock("div",Xu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&r<_.customToolbarSlots.length-1&&kl(r)?(e.openBlock(),e.createElementBlock("div",Yu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&_.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ot})):e.createCommentVNode("",!0),e.createVNode(qo,{showModal:ve.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ju,[e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:qe,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>ot.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ro,["enter"])},null,40,Qu),[[e.vModelText,ot.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:I,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>Oe.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ro,["enter"])},null,40,td),[[e.vModelText,Oe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ro},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(qo,{showModal:xt.value,width:"500px",height:"80vh",onCloseModal:bn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Je.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="upload"}]),onClick:n[17]||(n[17]=a=>Me.value="upload")},e.toDisplayString(e.unref($)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="url"}]),onClick:n[18]||(n[18]=a=>Me.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Me.value==="upload"?(e.openBlock(),e.createElementBlock("div",nd,[e.createElementVNode("div",od,[e.createElementVNode("div",ad,[ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",sd,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:sl},[e.createElementVNode("img",{src:Ft.value,alt:"Preview",class:"dss-image-preview-image"},null,8,rd),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:zt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:wo},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:zt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:wo},null,544))]),e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:ll,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Rt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,ud),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",dd,[e.createElementVNode("label",md,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>rt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:hl},null,40,pd),[[e.vModelText,rt.value]])]),e.createElementVNode("div",fd,[e.createElementVNode("label",vd,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:xo},null,40,gd),[[e.vModelText,Vt.value]])])])])):e.createCommentVNode("",!0),Me.value==="url"?(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[e.createElementVNode("label",Cd,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Gt,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Ue.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(fn,["enter"])},null,40,bd),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",wd,[e.createElementVNode("label",xd,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Rt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,Ed),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",Sd,[e.createElementVNode("label",Vd,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>rt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:hl},null,40,Nd),[[e.vModelText,rt.value]])]),e.createElementVNode("div",Bd,[e.createElementVNode("label",Md,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:xo},null,40,_d),[[e.vModelText,Vt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:bn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:fn},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":hn.value&&Dt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",$d,[Dt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ld,[_.title?(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(_.title),1)):(e.openBlock(),e.createElementBlock("span",Ad,e.toDisplayString(dt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ie,value:_.title,onInput:$l,onFocus:Xl,onBlur:bl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Dt.value}]),placeholder:dt.value,disabled:_.disabled,rows:"1"},null,42,Dd)])],2),hn.value&&Dt.value?(e.openBlock(),e.createElementBlock("div",Hd,[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":yn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",Rd,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Id,[_.description?(e.openBlock(),e.createElementBlock("span",Fd,e.toDisplayString(_.description),1)):(e.openBlock(),e.createElementBlock("span",zd,e.toDisplayString(je.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:kt,value:_.description,onInput:Pt,onFocus:Tn,onBlur:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:je.value,disabled:_.disabled,rows:"1"},null,42,Pd)])],2),yn.value&&V.value?(e.openBlock(),e.createElementBlock("div",Od,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":mt.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=>Eo(a),onMouseleave:zo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>uo(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Zd)):(e.openBlock(),e.createElementBlock("span",Ud,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Wd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>uo(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Yd)):(e.openBlock(),e.createElementBlock("span",jd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Xd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>uo(a),["stop"])},[e.createElementVNode("span",Gd,"+"+e.toDisplayString(a.additionalCount),1)],12,Kd)):e.createCommentVNode("",!0)],46,qd))),128)),_.richText?(e.openBlock(),e.createElementBlock("div",o1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":_.disabled,"dss-text-editor-fixed-height":_.fixedHeight}]),style:e.normalizeStyle(z.value),onInput:xe,onBlur:Fe,onClick:il,onMouseup:go,onKeyup:go,onKeydown:O,onPaste:xl,onMousemove:Ho,onMouseleave:Ro},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[mt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(nl.value)},[Kl.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",a1,[e.createElementVNode("div",s1,[Kl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Kl.value},null,8,r1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",i1,[(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",c1,[e.createElementVNode("div",u1,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,d1)):(e.openBlock(),e.createElementBlock("span",m1,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",p1,[e.createElementVNode("div",f1,[e.createElementVNode("div",v1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",g1,e.toDisplayString(to(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":En(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),T.commentUser&&a.user&&a.user.id===T.commentUser.id&&!En(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ao(a,r),["stop"]),title:e.unref($)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,h1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:ol,"onUpdate:modelValue":n[26]||(n[26]=a=>rl.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oo,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(ol.value){const a=ol.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,k1),[[e.vModelText,rl.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oo,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",C1,[e.createElementVNode("div",b1,[e.createElementVNode("span",w1,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",x1,e.toDisplayString(De.value)+" "+e.toDisplayString(De.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Qd,[e.createElementVNode("textarea",{value:_.modelValue,onInput:Sn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":_.fixedHeight}]),placeholder:bt.value,rows:_.rows,disabled:_.disabled,style:e.normalizeStyle(fl.value)},null,46,Jd),e.createElementVNode("div",e1,[e.createElementVNode("div",t1,[e.createElementVNode("span",l1,e.toDisplayString(ie.value)+" "+e.toDisplayString(ie.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",n1,e.toDisplayString(De.value)+" "+e.toDisplayString(De.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&ce.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:n[28]||(n[28]=a=>ke.value=!0),onMouseleave:an},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Co,["stop"]),title:ce.value},e.toDisplayString(ce.value),9,E1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bo,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",V1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,S1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$t.value&&Xt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:n[29]||(n[29]=a=>Te.value=!0),onMouseleave:Mn},[e.createElementVNode("div",N1,[Xt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",B1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Xt.value},e.toDisplayString(Xt.value),9,M1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Io,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",$1,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,_1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.floatingToolbar&&_.richText&&he.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:st,class:"dss-floating-toolbar",style:e.normalizeStyle(de.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",L1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Dn,["stop"]),title:e.unref($)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,T1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:e.withModifiers(Fl,["stop"]),title:e.unref($)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,A1),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",D1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>zn("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,R1)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,I1)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,F1)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,z1)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,P1)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,O1)):(e.openBlock(),e.createElementBlock("svg",q1,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,H1),Ye.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>mn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>mn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>mn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>mn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>mn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>mn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>mn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>jl("bold"),["stop"])),title:e.unref($)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,W1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>jl("italic"),["stop"])),title:e.unref($)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Z1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>jl("underline"),["stop"])),title:e.unref($)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,U1),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht.value}]),onClick:e.withModifiers(Zn,["stop"]),title:e.unref($)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,X1),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Rn,["stop"]),title:e.unref($)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,j1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Hn,["stop"]),title:e.unref($)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Y1)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref($)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,K1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:e.withModifiers(y,["stop"]),title:e.unref($)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,G1),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(jt,["stop"]),title:e.unref($)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Q1),n[95]||(n[95]=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(po,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,J1),_.askAi?(e.openBlock(),e.createElementBlock("div",em)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",tm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>zn("askAi"),["stop"])),title:e.unref($)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",nm,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,lm),Ye.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)]),Ul.value?(e.openBlock(),e.createElementBlock("div",om,[_.askAi&&Ul.value?(e.openBlock(),e.createElementBlock("div",am)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)&&Ml(a)?(e.openBlock(),e.createElementBlock("div",sm,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&Ml(a)&&r<_.customToolbarSlots.length-1&&Zl(r)?(e.openBlock(),e.createElementBlock("div",rm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),um={class:"dss-color-picker__section-title"},dm={class:"dss-color-picker__presets-row"},mm=["title","onClick"],pm={key:1,class:"dss-color-picker__section"},fm={class:"dss-color-picker__presets-row"},vm=["title","onClick"],gm={class:"dss-color-picker__section"},hm={class:"dss-color-picker__section-header"},ym={class:"dss-color-picker__presets-row"},km=["title","onClick"],Cm=["onClick"],bm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},wm=["title","onClick"],xm={class:"dss-color-picker__input-row"},Em=["value"],Sm={__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(_,{emit:J}){function B(q){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(q);if(!U)return{h:0,s:0,l:50};const Q=parseInt(U[1],16)/255,re=parseInt(U[2],16)/255,Re=parseInt(U[3],16)/255,ct=Math.max(Q,re,Re),Et=Math.min(Q,re,Re);let Ie=0,kt=0;const It=(ct+Et)/2;if(ct!==Et){const Qt=ct-Et;switch(kt=It>.5?Qt/(2-ct-Et):Qt/(ct+Et),ct){case Q:Ie=((re-Re)/Qt+(re<Re?6:0))/6;break;case re:Ie=((Re-Q)/Qt+2)/6;break;case Re:Ie=((Q-re)/Qt+4)/6;break}}return{h:Ie*360,s:kt*100,l:It*100}}function $(q,U,Q){U/=100,Q/=100;const re=U*Math.min(Q,1-Q),Re=ct=>{const Et=(ct+q/30)%12,Ie=Q-re*Math.max(Math.min(Et-3,9-Et,1),-1);return Math.round(255*Ie).toString(16).padStart(2,"0")};return`#${Re(0)}${Re(8)}${Re(4)}`}function ae(q){const U=q.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let Q=U[1];return Q.length===3&&(Q=Q.split("").map(re=>re+re).join("")),"#"+Q}function F(q,U,Q){U/=100,Q/=100;const re=Q+U*Math.min(Q,1-Q),Re=re===0?0:2-2*Q/re;return{h:q,s:Re*100,v:re*100}}function T(q,U,Q){U/=100,Q/=100;const re=Q*(1-U/2),Re=re===0||re===1?0:(Q-re)/Math.min(re,1-re);return{h:q,s:Re*100,l:re*100}}const X=_,Qe=J,pe=e.ref(!1),f=e.ref(!1),we=e.ref(!1),fe=e.ref(-1),ne=e.ref(-1),ee=e.ref(null),ce=e.ref(null),H=e.ref(null),ke=e.ref(null),ve=e.ref({top:0,left:0}),Oe=e.ref(B(X.modelValue||"#b8a5de")),ot=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),I=e.computed(()=>ot.value?0:X.initialPresetCount!=null?X.initialPresetCount:ne.value<0?null:ne.value),qe=e.computed(()=>{const q=I.value;return q==null?!0:Math.max(0,X.presetColors.length-q)<X.max}),_e=e.computed(()=>!!(f.value||fe.value>=0||!Ce.value&&X.presetColors.length===0));e.computed(()=>{const q=I.value;return q!=null&&X.presetColors.length>q});const Ce=e.computed(()=>ot.value||I.value!=null),pt=e.computed(()=>{const q=I.value;return q==null?[]:X.presetColors.slice(0,q)}),ht=e.computed(()=>{const q=I.value;return q==null?[]:X.presetColors.slice(q)});function ge(q){const U=I.value;return U!=null?U+q:-1}function he(q){const U=I.value;return U!=null&&q>=U}function de(q){he(q)&&(fe.value=q,Oe.value=B(X.presetColors[q]),f.value=!0,e.nextTick(()=>ke.value?.focus()))}function st(q){if(!he(q))return;const U=X.presetColors.filter((Re,ct)=>ct!==q);Qe("update:presetColors",U);const Q=ae(X.modelValue),re=ae(X.presetColors[q]);if(Q&&re&&Q.toLowerCase()===re.toLowerCase()){const Re=U[Math.max(0,q-1)]||U[0];Re&&Qe("update:modelValue",Re)}}function Ye(){we.value=!we.value,we.value||(fe.value=-1,f.value=!1)}function xt(){if(fe.value<0)return;const q=rt.value,U=ae(q);if(U){const Q=[...X.presetColors];Q[fe.value]=U,Qe("update:presetColors",Q),Qe("update:modelValue",U),fe.value=-1,f.value=!1}}function Rt(){X.disabled||(fe.value=-1,f.value=!f.value,f.value&&($t(),e.nextTick(()=>ke.value?.focus())))}function tl(q){const U=ae(q),Q=ae(X.modelValue);return U&&Q&&U.toLowerCase()===Q.toLowerCase()}function Ft(){if(X.disabled||!qe.value)return;const q=rt.value,U=ae(q);if(U){const Q=[...X.presetColors,U];Qe("update:presetColors",Q),Qe("update:modelValue",U);const re=I.value??ne.value;re>=0&&Q.length-re>=X.max&&(f.value=!1)}}const rt=e.computed(()=>{const{h:q,s:U,l:Q}=Oe.value;return $(q,U,Q)}),Vt=e.computed(()=>rt.value.toLowerCase()),ll=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Oe.value.h}, 100%, 50%))`})),zt=e.computed(()=>{const q=F(Oe.value.h,Oe.value.s,Oe.value.l);return{left:`${q.s}%`,bottom:`${q.v}%`,transform:"translate(-50%, 50%)"}}),Gt=e.computed(()=>({left:`${Oe.value.h/360*100}%`,transform:"translateX(-50%)"})),Je=e.computed(()=>({position:"fixed",left:`${ve.value.left}px`,top:`${ve.value.top}px`,zIndex:1002}));function lt(){if(!ee.value||!pe.value)return;const q=ee.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let Q=q.bottom+4;const re=ce.value;re&&Q+re.offsetHeight>U-8&&(Q=q.top-4-re.offsetHeight),ve.value={top:Q,left:q.left}}function $t(){const q=X.modelValue||"#b8a5de";ae(q)&&(Oe.value=B(q))}function Xt(){Qe("update:modelValue",rt.value)}function te(){X.disabled||(pe.value=!pe.value,pe.value&&($t(),e.nextTick(()=>{lt(),ke.value?.focus()})))}function Te(){const q=rt.value,U=ae(q);if(U){if(fe.value>=0){const Q=[...X.presetColors];Q[fe.value]=U,Qe("update:presetColors",Q),Qe("update:modelValue",U)}else if((X.presetColors.length>0||ot.value)&&f.value&&qe.value&&!X.presetColors.some(re=>ae(re)?.toLowerCase()===U.toLowerCase())){const re=[...X.presetColors,U];Qe("update:presetColors",re),Qe("update:modelValue",U)}}pe.value=!1,f.value=!1,we.value=!1,fe.value=-1}function Me(q){if(!H.value)return;const U=H.value.getBoundingClientRect(),Q=re=>{const Re=Math.max(0,Math.min(1,(re.clientX-U.left)/U.width)),ct=Math.max(0,Math.min(1,1-(re.clientY-U.top)/U.height)),Et={h:Oe.value.h,s:Re*100,v:ct*100};Oe.value=T(Et.h,Et.s,Et.v)};Q(q),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),Xt()},{once:!0})}function Ue(q){if(!q.currentTarget)return;const Q=q.currentTarget.getBoundingClientRect(),re=Re=>{const ct=Math.max(0,Math.min(1,(Re.clientX-Q.left)/Q.width));Oe.value={...Oe.value,h:ct*360}};re(q),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),Xt()},{once:!0})}function it(q){const U=q.target.value,Q=ae(U);Q&&(Oe.value=B(Q),Qe("update:modelValue",Q))}function Xe(q){if(X.disabled)return;const U=ae(q);U&&(Oe.value=B(U),Qe("update:modelValue",U))}let Ge=null,ft=null;function Ae(){Ge&&(document.removeEventListener("keydown",Ge),Ge=null),ft&&(window.removeEventListener("resize",ft),ft=null)}return e.watch(pe,q=>{if(Ae(),q){if(!ot.value&&X.initialPresetCount==null){const U=X.presetColors.length;U>0&&(ne.value<0||U<ne.value)&&(ne.value=U)}Ge=U=>{U.key==="Escape"&&Te()},ft=lt,document.addEventListener("keydown",Ge),window.addEventListener("resize",ft)}}),e.watch(()=>X.modelValue,()=>{pe.value&&$t()},{immediate:!1}),e.watch(ht,q=>{q.length===0&&(we.value=!1,fe.value=-1,f.value=!1)}),e.onBeforeUnmount(Ae),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":_.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:ee,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":pe.value}]),onClick:te},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:rt.value})},[...U[0]||(U[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"},[pe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Te,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ce,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Je.value)},[Ce.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ot.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.presetGroups,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",um,e.toDisplayString(Q.title),1),e.createElementVNode("div",dm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Re,ct)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+ct,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Re)}]),style:e.normalizeStyle({backgroundColor:Re}),title:Re,onClick:e.withModifiers(Et=>Xe(Re),["stop"])},null,14,mm))),128))])]))),128)):pt.value.length?(e.openBlock(),e.createElementBlock("div",pm,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(Re=>Xe(Q),["stop"])},null,14,vm))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",gm,[e.createElementVNode("div",hm,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),ht.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":we.value}]),title:"Manage custom colors",onClick:e.withModifiers(Ye,["stop"])},[...U[2]||(U[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",ym,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":we.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!we.value&&tl(Q),"dss-color-picker__preset-bubble--editing":we.value&&fe.value===ge(re)}]),style:e.normalizeStyle({backgroundColor:fe.value===ge(re)?rt.value:Q}),title:fe.value===ge(re)?rt.value:Q,onClick:e.withModifiers(Re=>we.value?de(ge(re)):Xe(Q),["stop"])},null,14,km),we.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(Re=>st(ge(re)),["stop"])},[...U[4]||(U[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,Cm)):e.createCommentVNode("",!0)],2))),128)),qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Rt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):_.presetColors.length?(e.openBlock(),e.createElementBlock("div",bm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.presetColors,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(Re=>Xe(Q),["stop"])},null,14,wm))),128)),qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Rt,["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:H,onMousedown:Me},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ll.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(zt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ue},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Gt.value)},null,4)],32),e.createElementVNode("div",xm,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ke,type:"text",class:"dss-color-picker__hex-input",value:Vt.value,onInput:it},null,40,Em)]),Ce.value&&(_.presetColors.length||ot.value)&&qe.value&&fe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),Ce.value&&fe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:xt}," Save color ")):e.createCommentVNode("",!0),Ce.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Te}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Vm={key:0,class:"dss-loader"},Nm={key:0,class:"dss-loader-label"},Bm={key:1,class:"dss-loader"},Mm={key:0,class:"dss-loader-label"},_m={key:2,class:"dss-loader"},$m={key:0,class:"dss-loader-label"},Lm={key:3,class:"dss-loader"},Tm={key:0,class:"dss-loader-label"},Am={key:4,class:"dss-loader"},Dm={key:0,class:"dss-loader-label"},Hm={key:5,class:"dss-loader dss-loader--inline"},Rm={class:"dss-loader-inline-text"},Im={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(_){const J=_,B=e.computed(()=>J.size==="small"?"dss-loaders--size-small":J.size==="large"?"dss-loaders--size-large":J.size==="medium"||J.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>{const ae={};if(!(J.size==="small"||J.size==="medium"||J.size==="large"||J.size==null)){const F=typeof J.size=="number"?`${J.size}px`:String(J.size);ae["--dss-loader-size"]=F}return J.color&&(ae["--dss-loader-accent"]=J.color,ae["--dss-loader-accent-soft"]=`color-mix(in srgb, ${J.color} 30%, white)`),ae});return(ae,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",B.value]),style:e.normalizeStyle($.value)},[_.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Vm,[F[0]||(F[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",Nm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="dots"?(e.openBlock(),e.createElementBlock("div",Bm,[F[1]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Mm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="battery"?(e.openBlock(),e.createElementBlock("div",_m,[F[2]||(F[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",$m,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Lm,[F[3]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Tm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="bars"?(e.openBlock(),e.createElementBlock("div",Am,[F[4]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Dm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="inline"?(e.openBlock(),e.createElementBlock("div",Hm,[F[5]||(F[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Rm,[e.renderSlot(ae.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])])])):e.createCommentVNode("",!0)],6))}},jo="dss-skeleton-item",Fm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:_=>["single","multiple"].includes(_)},targetClass:{type:String,default:jo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(_){const J=_,B=e.computed(()=>{const F={"dss-skeleton--loading":J.loading,"dss-skeleton--static":!J.shimmer,"dss-skeleton--multiple":J.mode==="multiple","dss-skeleton--dark":J.darkMode};return J.mode==="multiple"&&J.targetClass!==jo&&(F[`dss-skeleton--target-${J.targetClass}`]=!0),F}),$=e.computed(()=>{const F={};return J.borderRadius&&(F.borderRadius=J.borderRadius),F}),ae=e.computed(()=>{const F={};return J.borderRadius&&(F["--dss-skeleton-border-radius"]=J.borderRadius),J.darkMode?(F["--dss-skeleton-bg"]=J.bgDark||"#322c3f",F["--dss-skeleton-shimmer"]=J.shimmerDark||"#3e3f41",F):(J.bgColor&&(F["--dss-skeleton-bg"]=J.bgColor),J.shimmerColor&&(F["--dss-skeleton-shimmer"]=J.shimmerColor),F)});return(F,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",B.value]),style:e.normalizeStyle(ae.value)},[_.loading&&_.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":_.loading&&_.mode==="single"}])},[e.renderSlot(F.$slots,"default")],2)],6))}},zm={key:0,class:"dss-dnd-column-header"},Pm={class:"dss-dnd-column-title"},Om={class:"dss-dnd-column-count"},qm=["data-column"],Wm={key:0,class:"dss-dnd-indicator"},Zm=["onPointerdown"],Um=["onPointerdown"],Xm={class:"dss-dnd-item-content"},Ym={class:"dss-dnd-item-default"},jm={key:0,class:"dss-dnd-empty"},Km={name:"DSSDnd"},Gm=Object.assign(Km,{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(_,{emit:J}){const B=_,$=J,ae=e.useSlots(),F=e.computed(()=>!!ae["delete-zone"]),T={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},X=e.computed(()=>({...T,...B.options})),Qe=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function pe(te){if(!X.value.ColColor||!te)return{};const Te=te.background||te.color;return Te?{background:Te}:{}}const f=e.ref(null),we=e.ref(null),fe=e.ref(!1),ne=e.ref(-1),ee=e.ref(null);let ce=null,H=null,ke=null,ve=null,Oe=0,ot=0,I="",qe=null;const _e=5,Ce=e.computed(()=>{const te={};for(const Te of B.columns)te[Te.value]=B.items.filter(Me=>Me[B.columnKey]===Te.value).sort((Me,Ue)=>(Me[B.positionKey]??0)-(Ue[B.positionKey]??0));return te}),pt=e.computed(()=>{const te={},Te=!!f.value,Me=f.value?.[B.itemKey],Ue=we.value,it=ne.value;for(const Xe of B.columns){const Ge=Ce.value[Xe.value]||[],ft=[],Ae=Ue==Xe.value;let q=0;for(let U=0;U<Ge.length;U++){const Q=Ge[U],re=Te&&Q[B.itemKey]===Me;!re&&Ae&&it===q&&ft.push({type:"indicator",key:`ind-${q}`}),re||q++,ft.push({type:"item",item:Q,isDragged:re,key:`item-${Q[B.itemKey]}`})}Ae&&it>=q&&ft.push({type:"indicator",key:"ind-end"}),te[Xe.value]=ft}return te});function ht(te,Te){const Ue=(Ce.value[te]||[]).filter(Ge=>Ge[B.itemKey]!==f.value?.[B.itemKey]);if(Ue.length===0)return 1;if(Te<=0){const Ge=Ue[0][B.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(Te>=Ue.length){const Ge=Ue[Ue.length-1][B.positionKey];return(Ge??0)+1}const it=Ue[Te-1][B.positionKey]??0,Xe=Ue[Te][B.positionKey]??0;return(it+Xe)/2}function ge(te,Te,Me){ke&&ke.remove();const Ue=te.getBoundingClientRect(),it=te.cloneNode(!0);it.classList.add("dss-dnd-ghost"),it.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)}}we()}e.nextTick(()=>{Zt(),Un()})},Pl=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let n=null;o&&o.rangeCount>0&&(n=Ce());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const M=[...h.matchAll(a)];if(M.length===0)continue;const A=M.filter(Y=>{const ze=Y[0],Ee=Y.index;if(Ee>0&&h[Ee-1]==="@"||Ee+ze.length<h.length&&h[Ee+ze.length]==="@")return!1;const yt=v.parentElement;return!(yt&&yt.closest("a"))});if(A.length===0)continue;if(A.length===1&&A[0][0]===h.trim()){const Y=A[0][0],ze=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,Ee=document.createElement("a");Ee.href=ze,Ee.textContent=Y,Ee.style.color="#60afdf",Ee.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ee,v),u=!0);continue}let E=0;const le=document.createDocumentFragment();if(A.forEach(Y=>{const ze=Y.index,Ee=Y[0];if(ze>E){const cl=h.substring(E,ze);cl&&le.appendChild(document.createTextNode(cl))}const yt=Ee.startsWith("http://")||Ee.startsWith("https://")?Ee:`https://${Ee}`,yl=document.createElement("a");yl.href=yt,yl.textContent=Ee,yl.style.color="#60afdf",yl.style.textDecoration="underline",le.appendChild(yl),E=ze+Ee.length}),E<h.length){const Y=h.substring(E);Y&&le.appendChild(document.createTextNode(Y))}v.parentNode&&le.childNodes.length>0&&(v.parentNode.replaceChild(le,v),u=!0)}u&&n&&e.nextTick(()=>{El(n),Zt()})},Cn=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,n=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=n.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const A=M.index,E=M[0].startsWith("<u>")?"u":"ins",le=M[1]||M[2]||"";A>v&&h.appendChild(document.createTextNode(u.substring(v,A)));const Y=document.createElement(E);Y.textContent=le,h.appendChild(Y),v=A+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},sn=o=>{if(!f.value||ne.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===f.value||!f.value.contains(c))return;const d=()=>{let cl="",el=0,ul=!1;const dl=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Ql=>Ql.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Kt=0;for(;dl.nextNode();){const Ql=dl.currentNode,vn=Ql.textContent||"",Jl=Kt;if(Kt+=vn.length,Ql===r.startContainer){cl+=vn.substring(0,r.startOffset),el=Jl+r.startOffset,ul=!0;break}cl+=vn}return ul||(el=cl.length),{textBeforeCursor:cl,cursorCharOffset:el}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],A=u.length-h.length,le=(cl=>{let el=0;const ul=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Kt=>Kt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let dl;for(;dl=ul.nextNode();){const Kt=(dl.textContent||"").length;if(el+Kt>=cl)return{node:dl,offset:cl-el};el+=Kt}return null})(A);if(!le)return;const Y=document.createRange();Y.setStart(le.node,le.offset),Y.setEnd(r.endContainer,r.endOffset);const ze=document.createElement(v);ze.textContent=M,Y.deleteContents(),Y.insertNode(ze);const Ee=window.getSelection(),yt=document.createRange();yt.setStartAfter(ze),yt.collapse(!0),Ee.removeAllRanges(),Ee.addRange(yt);const yl=Ce();e.nextTick(()=>{we(),yl&&El(yl)})},jt=()=>{f.value&&(lt.value=Ce(),Tt.value="",Ft.value="",Ue.value="",st.value="",Vt.value="",tl.value=null,Je.value=null,Me.value="upload",rt.value=!0,Ot(),e.nextTick(()=>{ll.value&&ll.value.focus(),zt.value&&(zt.value.value="")}))},wo=o=>{const n=o.target?.files?.[0];if(!n){tl.value=null,Ft.value="";return}tl.value=n;const a=new FileReader;a.onload=r=>{Ft.value=r.target?.result||""},a.readAsDataURL(n)},sl=()=>{zt.value&&zt.value.click()},hl=()=>{st.value&&(Vt.value="")},xo=()=>{Vt.value&&(st.value="")},Io=()=>{let o=Je.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")||"";Je.value=o,Tt.value=n.trim()===""||n.trim()==="Image"?"":n;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(Ue.value=a,Ft.value="",Me.value="url"):(Ft.value=a,Ue.value="",Me.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";st.value=c.endsWith("px")?c.replace("px",""):c,Vt.value=d.endsWith("px")?d.replace("px",""):d,lt.value=null}else{jt();return}rt.value=!0,Te.value=!1,$t.value=!1,e.nextTick(()=>{Me.value==="url"&&Gt.value?(Gt.value.focus(),Gt.value.select()):ll.value&&(ll.value.focus(),ll.value.select()),zt.value&&(zt.value.value="")})},bn=()=>{rt.value=!1,Tt.value="",Ft.value="",Ue.value="",st.value="",Vt.value="",tl.value=null,Je.value=null,lt.value=null,Me.value="upload"},fn=()=>{const o=(Tt.value||"").trim(),n=f.value?._mutationObserver;n&&n.disconnect(),q.value?(Ae.value&&(clearTimeout(Ae.value),Ae.value=null),Nt(),q.value=!1):Nt();const a=Me.value==="url"?Ue.value.trim():Ft.value;if(Je.value&&f.value&&f.value.contains(Je.value)){a&&(Je.value.src=a),Je.value.setAttribute("alt",o),Je.value.setAttribute("data-alt",o),st.value?(Je.value.style.width=`${st.value}px`,Je.value.setAttribute("width",st.value)):(Je.value.style.removeProperty("width"),Je.value.removeAttribute("width")),Vt.value?(Je.value.style.height=`${Vt.value}px`,Je.value.setAttribute("height",Vt.value)):(Je.value.style.removeProperty("height"),Je.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(Je.value),c.collapse(!0),r.addRange(c)}we()}else{if(!a){n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),bn();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(lt.value&&(El(lt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){bn();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),st.value&&(v.style.width=`${st.value}px`,v.setAttribute("width",st.value)),Vt.value&&(v.style.height=`${Vt.value}px`,v.setAttribute("height",Vt.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const A=document.createElement("p");f.value.appendChild(A),A.appendChild(v)}else{const A=f.value.lastChild;if(A&&A.nodeType===1)A.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}Je.value=v,we()}}e.nextTick(()=>{n&&f.value&&n.observe(f.value,{childList:!0,subtree:!0}),Zt(),Yt(),bn()})};e.watch(()=>T.modelValue,o=>{if(T.richText&&f.value&&!ne.value){const n=qn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=n.replace(/ |\u00A0/g," ");if(r!==c){const d=Ce();f.value.innerHTML=n,e.nextTick(()=>{oe();const u=f.value.innerHTML||"",m=T.title||"",v=T.description||"";U.value=u,ie.value=m,Re.value=v,Q.value=u,ct.value=m,Et.value=v,Ge.value=[],ft.value=[],Ae.value&&(clearTimeout(Ae.value),Ae.value=null),q.value=!1,d&&El(d),W(),nt(),Cl(),Zt(),Yt(),nn(),Hl("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>T.richText,o=>{o?(Yt(),e.nextTick(()=>{Pn()})):(zl(),G.value=[],Ze.value&&(Ze.value.disconnect(),Ze.value=null)),nn()}),e.watch(()=>T.floatingToolbar,o=>{o?Yt():zl()}),e.watch(()=>T.disabled,o=>{o&&zl(),nn()}),e.watch(()=>T.description,()=>{e.nextTick(()=>{V.value?Il():Vn()})}),e.watch(()=>T.title,()=>{e.nextTick(()=>{Ht.value?Rl():Vl()})}),e.watch(()=>T.customToolbarSlots,()=>{e.nextTick(()=>{Mt()})},{deep:!0}),e.watch(()=>T.comments,(o,n)=>{if(no.value){no.value=!1;return}In.value||T.richText&&f.value&&e.nextTick(()=>{Xn()})},{deep:!0,immediate:!1});const Xn=()=>{if(!In.value&&!(!T.comments||!Array.isArray(T.comments)||T.comments.length===0)&&!(!T.richText||!f.value)){In.value=!0;try{const o=new Set,n=T.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;n.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){_n(h,u),d.add(v);return}try{const M=co(u.selection_range,u.selection_text);if(M&&!M.collapsed){const A=M.commonAncestorContainer,E=A.nodeType===3?A.parentElement:A;if(E){const ze=E.closest("[data-comment], [data-fake-comment]");if(ze){const Ee=ze.getAttribute("data-comment")||ze.getAttribute("data-fake-comment");if(String(Ee)===String(m)){ze.setAttribute("data-comment",v),ze.removeAttribute("data-fake-comment"),_n(ze,u),d.add(v);return}else return}}const le=f.value.querySelector(`[data-comment="${v}"]`);if(le){_n(le,u),d.add(v);return}const Y=document.createElement("span");Y.setAttribute("data-comment",v),_n(Y,u);try{M.surroundContents(Y),c++,d.add(v)}catch{try{const Ee=document.createRange();Ee.setStart(M.startContainer,M.startOffset),Ee.setEnd(M.endContainer,M.endOffset),Ut(Ee),Ee.surroundContents(Y),c++,d.add(v)}catch{try{const yt=M.extractContents();Y.appendChild(yt),M.insertNode(Y),c++,d.add(v)}catch(yt){console.warn("Failed to create comment marker:",yt)}}}}}catch{}}),e.nextTick(()=>{Hl("restoreCommentsFromModel"),we(),In.value=!1})}catch{In.value=!1}}},Ut=o=>{if(!o||!f.value)return o;try{const n=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&n.includes(u.tagName)&&(r===0&&!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&&!io(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},io=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},co=(o,n)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Ut(a):null}}catch{return null}return null},_n=(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")},Hl=(o="unknown")=>{if(!T.richText||!f.value){G.value=[];return}Date.now()-At.value<Dt&&vt.value!==null||vt.value===null&&(vt.value=requestAnimationFrame(()=>{if(vt.value=null,At.value=Date.now(),Ne.value)return;Ne.value=!0;const a={},r=f.value;if(!r){Ne.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Ne.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");le&&E.tagName==="SPAN"&&(m.has(le)||(u.push(E),m.add(le)))}),d.forEach(E=>{const le=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!le||m.has(le)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${le}"], span[data-fake-comment="${le}"]`)||(u.push(E),m.add(le)):E.tagName!=="SPAN"&&(u.push(E),m.add(le)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((E,le)=>{let Y=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const gt=E.textContent?.trim(),Ol=T.comments?.find(ml=>(typeof ml.conversation_id=="string"&&ml.conversation_id.startsWith("comment-")?null:ml.conversation_id)&&ml.selection_text?.trim()===gt);Ol?(Y=String(Ol.conversation_id),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment")):(Y=String(Date.now()),E.setAttribute("data-comment",Y),E.removeAttribute("data-fake-comment"))}const ze=E.getBoundingClientRect(),Ee=window.getComputedStyle(E),yt=parseFloat(Ee.lineHeight)||parseFloat(Ee.fontSize)*1.2,el=ze.top-h.top+yt/2-15,dl=h.top-v.top+el;let Kt=null,Ql=null,vn=0;const Jl=[],So=new Set;if(Y&&T.comments){const gt=T.comments.find(Ol=>String(Ol.conversation_id||Ol.id)===String(Y));if(gt){const Ol=gt.conversation||[];Ol.length>0?(Ol.forEach(ml=>{ml.user&&ml.user.id&&!So.has(ml.user.id)&&(So.add(ml.user.id),Jl.push(ml.user))}),vn=Ol.length):(vn=0,Kt=null,Ql=null),Jl.length>0?Kt=Jl[0]:Kt=null,Jl.length>1?Ql=Jl[1]:Ql=null}}const rn=ze.top+yt/2-15,mo=rn+30,On=5,$n=mo>h.top+On&&rn<h.bottom-On?1:0;G.value.find(gt=>gt.id===Y);let gn=E;if(!gn&&Y&&f.value){const gt=String(Y);gn=f.value.querySelector(`[data-comment="${gt}"], [data-fake-comment="${gt}"]`)}const Ln=Jl.length;a[Y]?(a[Y].top=dl,a[Y].opacity=$n,a[Y].element=gn,a[Y].firstUser=Kt,a[Y].secondUser=Ql,a[Y].totalCount=vn,a[Y].uniqueUserCount=Ln):a[Y]={id:Y,top:dl,opacity:$n,element:gn,firstUser:Kt,secondUser:Ql,totalCount:vn,uniqueUserCount:Ln}});const M=Object.values(a).map(E=>{const le=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const ze=String(E.id);E.element=f.value.querySelector(`[data-comment="${ze}"], [data-fake-comment="${ze}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:le}});(G.value.length!==M.length||M.some((E,le)=>{const Y=G.value[le];if(!Y)return!0;const ze=(Y.firstUser?.id||null)!==(E.firstUser?.id||null),Ee=(Y.secondUser?.id||null)!==(E.secondUser?.id||null);return Y.id!==E.id||Math.abs(Y.top-E.top)>1||Y.opacity!==E.opacity||Y.totalCount!==E.totalCount||Y.additionalCount!==E.additionalCount||ze||Ee||Y.element!==E.element}))&&(G.value=M),Ne.value=!1}))},Eo=o=>{if(!o)return;let n=o.element;if(!n&&o.id&&f.value){const a=String(o.id);n=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}n&&(wn(),Jt.value=n,n.classList.add("editor-comment-highlighted"))},wn=(o=!1)=>{!o&&mt.value!==null&&Jt.value&&(Jt.value.getAttribute("data-comment")||Jt.value.getAttribute("data-fake-comment"))===mt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jt.value&&(Jt.value.classList.remove("editor-comment-highlighted"),Jt.value=null))},uo=o=>{if(!o||!o.element)return;wn(!0);const n=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!n)return;const a=`[data-comment="${n}"], [data-fake-comment="${n}"]`;X("comment-marker-clicked",{commentId:n,selector:a,element:o.element})},zo=()=>{wn()},Pn=()=>{!T.richText||!f.value||(Ze.value&&Ze.value.disconnect(),et.value!==null&&(clearTimeout(et.value),et.value=null),Ze.value=new MutationObserver(()=>{et.value===null&&(et.value=setTimeout(()=>{et.value=null,e.nextTick(()=>{Hl("MutationObserver")})},200))}),Ze.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Hl("setupCommentMarkersObserver-initial"))},Yn=(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(()=>it.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(()=>{Yn(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(()=>[be.value,$e.value],()=>{be.value==="askAi"||$e.value==="askAi"?e.nextTick(()=>{ln()}):(it.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(()=>T.locale,o=>{o&&o!==se.value&&(se.value=o)},{immediate:!0}),J({openCommentOverlayForSelector:Do,updateCommentMarkers:Hl,restoreCommentsFromModel:Xn}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",tt.value]),style:e.normalizeStyle(Lt.value)},[_.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:n[14]||(n[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",pu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Dn,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,fu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:Fl,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,vu),n[61]||(n[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",gu,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[0]||(n[0]=a=>en("paragraph")),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,yu)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,ku)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Cu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,bu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,wu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,xu)):(e.openBlock(),e.createElementBlock("svg",Eu,[...n[47]||(n[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[48]||(n[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,hu),be.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[8]||(n[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[1]||(n[1]=a=>Nl("<h1>"))},[e.createElementVNode("img",{src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Su),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=>Nl("<h2>"))},[e.createElementVNode("img",{src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Vu),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=>Nl("<h3>"))},[e.createElementVNode("img",{src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Nu),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=>Nl("<h4>"))},[e.createElementVNode("img",{src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Bu),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=>Nl("<h5>"))},[e.createElementVNode("img",{src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Mu),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=>Nl("<h6>"))},[e.createElementVNode("img",{src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,_u),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=>Nl("<p>"))},[n[49]||(n[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[9]||(n[9]=a=>jl("bold")),title:e.unref($)("textEditor.toolbar.bold")},[...n[50]||(n[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,$u),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[10]||(n[10]=a=>jl("italic")),title:e.unref($)("textEditor.toolbar.italic")},[...n[51]||(n[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[11]||(n[11]=a=>jl("underline")),title:e.unref($)("textEditor.toolbar.underline")},[...n[52]||(n[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kt.value}]),onClick:Zn,title:e.unref($)("textEditor.toolbar.citation")},[...n[53]||(n[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Au),n[62]||(n[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Rn,title:e.unref($)("textEditor.toolbar.removeLink")},[...n[55]||(n[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,Hu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Hn,title:e.unref($)("textEditor.toolbar.insertLink")},[...n[54]||(n[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Du)),n[63]||(n[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:k,title:e.unref($)("textEditor.toolbar.bulletList")},[...n[56]||(n[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,Ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:y,title:e.unref($)("textEditor.toolbar.numberList")},[...n[57]||(n[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,Iu),n[64]||(n[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:jt,title:e.unref($)("textEditor.toolbar.image")},[...n[58]||(n[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Fu),j.value?(e.openBlock(),e.createElementBlock("div",zu)):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref($)("textEditor.toolbar.comment"),onClick:po},[...n[59]||(n[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,Pu)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",Ou)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",qu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:n[12]||(n[12]=a=>en("askAi")),title:e.unref($)("textEditor.toolbar.askAi")},[n[60]||(n[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",Zu,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,Wu),be.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",Uu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)?(e.openBlock(),e.createElementBlock("div",Xu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&r<_.customToolbarSlots.length-1&&kl(r)?(e.openBlock(),e.createElementBlock("div",Yu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(be.value==="paragraph"||be.value==="askAi")&&_.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Ot})):e.createCommentVNode("",!0),e.createVNode(qo,{showModal:ve.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref($)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ju,[e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref($)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:qe,type:"text","onUpdate:modelValue":n[15]||(n[15]=a=>ot.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ro,["enter"])},null,40,Qu),[[e.vModelText,ot.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref($)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:I,type:"text","onUpdate:modelValue":n[16]||(n[16]=a=>Oe.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ro,["enter"])},null,40,td),[[e.vModelText,Oe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref($)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ro},e.toDisplayString(e.unref($)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(qo,{showModal:rt.value,width:"500px",height:"80vh",onCloseModal:bn},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(Je.value?e.unref($)("textEditor.image.editImage"):e.unref($)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ld,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="upload"}]),onClick:n[17]||(n[17]=a=>Me.value="upload")},e.toDisplayString(e.unref($)("textEditor.image.upload")),3),n[65]||(n[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="url"}]),onClick:n[18]||(n[18]=a=>Me.value="url")},e.toDisplayString(e.unref($)("textEditor.image.imageLink")),3)]),Me.value==="upload"?(e.openBlock(),e.createElementBlock("div",nd,[e.createElementVNode("div",od,[e.createElementVNode("div",ad,[ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",sd,e.toDisplayString(e.unref($)("textEditor.image.uploadImage")),1)),ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:sl},[e.createElementVNode("img",{src:Ft.value,alt:"Preview",class:"dss-image-preview-image"},null,8,rd),n[66]||(n[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:zt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:wo},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:zt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:wo},null,544))]),e.createElementVNode("div",id,[e.createElementVNode("label",cd,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:ll,type:"text","onUpdate:modelValue":n[19]||(n[19]=a=>Tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,ud),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",dd,[e.createElementVNode("label",md,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[20]||(n[20]=a=>st.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:hl},null,40,pd),[[e.vModelText,st.value]])]),e.createElementVNode("div",fd,[e.createElementVNode("label",vd,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[21]||(n[21]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:xo},null,40,gd),[[e.vModelText,Vt.value]])])])])):e.createCommentVNode("",!0),Me.value==="url"?(e.openBlock(),e.createElementBlock("div",hd,[e.createElementVNode("div",yd,[e.createElementVNode("div",kd,[e.createElementVNode("label",Cd,e.toDisplayString(e.unref($)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Gt,type:"text","onUpdate:modelValue":n[22]||(n[22]=a=>Ue.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(fn,["enter"])},null,40,bd),[[e.vModelText,Ue.value]])]),e.createElementVNode("div",wd,[e.createElementVNode("label",xd,e.toDisplayString(e.unref($)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":n[23]||(n[23]=a=>Tt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.enterAltText"),onKeyup:e.withKeys(fn,["enter"])},null,40,Ed),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",Sd,[e.createElementVNode("label",Vd,e.toDisplayString(e.unref($)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[24]||(n[24]=a=>st.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:hl},null,40,Nd),[[e.vModelText,st.value]])]),e.createElementVNode("div",Bd,[e.createElementVNode("label",Md,e.toDisplayString(e.unref($)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":n[25]||(n[25]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref($)("textEditor.image.auto"),onKeyup:e.withKeys(fn,["enter"]),onInput:xo},null,40,_d),[[e.vModelText,Vt.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:bn},e.toDisplayString(e.unref($)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:fn},e.toDisplayString(e.unref($)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":hn.value&&Ht.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.title")),1),e.createElementVNode("div",$d,[Ht.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ld,[_.title?(e.openBlock(),e.createElementBlock("span",Td,e.toDisplayString(_.title),1)):(e.openBlock(),e.createElementBlock("span",Ad,e.toDisplayString(dt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Ie,value:_.title,onInput:$l,onFocus:Xl,onBlur:bl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Ht.value}]),placeholder:dt.value,disabled:_.disabled,rows:"1"},null,42,Dd)])],2),hn.value&&Ht.value?(e.openBlock(),e.createElementBlock("div",Hd,[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":yn.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.labels.description")),1),e.createElementVNode("div",Rd,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Id,[_.description?(e.openBlock(),e.createElementBlock("span",Fd,e.toDisplayString(_.description),1)):(e.openBlock(),e.createElementBlock("span",zd,e.toDisplayString(je.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:Ct,value:_.description,onInput:Pt,onFocus:Tn,onBlur:An,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:je.value,disabled:_.disabled,rows:"1"},null,42,Pd)])],2),yn.value&&V.value?(e.openBlock(),e.createElementBlock("div",Od,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(G.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":mt.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=>Eo(a),onMouseleave:zo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>uo(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,Zd)):(e.openBlock(),e.createElementBlock("span",Ud,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,Wd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>uo(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Yd)):(e.openBlock(),e.createElementBlock("span",jd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Xd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>uo(a),["stop"])},[e.createElementVNode("span",Gd,"+"+e.toDisplayString(a.additionalCount),1)],12,Kd)):e.createCommentVNode("",!0)],46,qd))),128)),_.richText?(e.openBlock(),e.createElementBlock("div",o1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":_.disabled,"dss-text-editor-fixed-height":_.fixedHeight}]),style:e.normalizeStyle(z.value),onInput:we,onBlur:Fe,onClick:il,onMouseup:go,onKeyup:go,onKeydown:O,onPaste:xl,onMousemove:Ho,onMouseleave:Ro},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[mt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(nl.value)},[Kl.value||_l.value.length>0?(e.openBlock(),e.createElementBlock("div",a1,[e.createElementVNode("div",s1,[Kl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:Kl.value},null,8,r1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",i1,[(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",c1,[e.createElementVNode("div",u1,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,d1)):(e.openBlock(),e.createElementBlock("span",m1,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",p1,[e.createElementVNode("div",f1,[e.createElementVNode("div",v1,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",g1,e.toDisplayString(to(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":En(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),T.commentUser&&a.user&&a.user.id===T.commentUser.id&&!En(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>ao(a,r),["stop"]),title:e.unref($)("textEditor.comment.delete")||"Delete comment"},[...n[68]||(n[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,h1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",y1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:ol,"onUpdate:modelValue":n[26]||(n[26]=a=>rl.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref($)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(oo,["prevent","stop"]),["enter"]),onInput:n[27]||(n[27]=()=>{if(ol.value){const a=ol.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,k1),[[e.vModelText,rl.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(oo,["stop"])},[...n[69]||(n[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",C1,[e.createElementVNode("div",b1,[e.createElementVNode("span",w1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[70]||(n[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",x1,e.toDisplayString(De.value)+" "+e.toDisplayString(De.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Qd,[e.createElementVNode("textarea",{value:_.modelValue,onInput:Sn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":_.fixedHeight}]),placeholder:wt.value,rows:_.rows,disabled:_.disabled,style:e.normalizeStyle(fl.value)},null,46,Jd),e.createElementVNode("div",e1,[e.createElementVNode("div",t1,[e.createElementVNode("span",l1,e.toDisplayString(ce.value)+" "+e.toDisplayString(ce.value===1?e.unref($)("textEditor.footer.word"):e.unref($)("textEditor.footer.words")),1),n[67]||(n[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",n1,e.toDisplayString(De.value)+" "+e.toDisplayString(De.value===1?e.unref($)("textEditor.footer.character"):e.unref($)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ee.value&&ue.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:n[28]||(n[28]=a=>ye.value=!0),onMouseleave:an},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Co,["stop"]),title:ue.value},e.toDisplayString(ue.value),9,E1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(bo,["stop"]),title:e.unref($)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",V1,[...n[71]||(n[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,S1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[$t.value&&Xt.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(te.value),onMouseenter:n[29]||(n[29]=a=>Te.value=!0),onMouseleave:Mn},[e.createElementVNode("div",N1,[Xt.value===e.unref($)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",B1,[...n[72]||(n[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Xt.value},e.toDisplayString(Xt.value),9,M1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Io,["stop"]),title:e.unref($)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",$1,[...n[73]||(n[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,_1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_.floatingToolbar&&_.richText&&ht.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Xe,class:"dss-floating-toolbar",style:e.normalizeStyle(ae.value),onMousedown:n[44]||(n[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",L1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Dn,["stop"]),title:e.unref($)("textEditor.toolbar.undo")},[...n[74]||(n[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,T1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!Z.value}]),onClick:e.withModifiers(Fl,["stop"]),title:e.unref($)("textEditor.toolbar.redo")},[...n[75]||(n[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,A1),n[89]||(n[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",D1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:n[30]||(n[30]=e.withModifiers(a=>zn("paragraph"),["stop"])),title:e.unref($)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:F.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,R1)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:F.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,I1)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:F.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,F1)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:F.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,z1)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:F.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,P1)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:F.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,O1)):(e.openBlock(),e.createElementBlock("svg",q1,[...n[76]||(n[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),n[77]||(n[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,H1),$e.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:n[38]||(n[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[31]||(n[31]=a=>mn("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[32]||(n[32]=a=>mn("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[33]||(n[33]=a=>mn("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[34]||(n[34]=a=>mn("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[35]||(n[35]=a=>mn("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[36]||(n[36]=a=>mn("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref($)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:n[37]||(n[37]=a=>mn("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref($)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),n[90]||(n[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("bold")}]),onClick:n[39]||(n[39]=e.withModifiers(a=>jl("bold"),["stop"])),title:e.unref($)("textEditor.toolbar.bold")},[...n[78]||(n[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,W1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("italic")}]),onClick:n[40]||(n[40]=e.withModifiers(a=>jl("italic"),["stop"])),title:e.unref($)("textEditor.toolbar.italic")},[...n[79]||(n[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Z1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("underline")}]),onClick:n[41]||(n[41]=e.withModifiers(a=>jl("underline"),["stop"])),title:e.unref($)("textEditor.toolbar.underline")},[...n[80]||(n[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,U1),n[91]||(n[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":kt.value}]),onClick:e.withModifiers(Zn,["stop"]),title:e.unref($)("textEditor.toolbar.citation")},[...n[81]||(n[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,X1),n[92]||(n[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Rn,["stop"]),title:e.unref($)("textEditor.toolbar.removeLink")},[...n[83]||(n[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,j1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Hn,["stop"]),title:e.unref($)("textEditor.toolbar.insertLink")},[...n[82]||(n[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,Y1)),n[93]||(n[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref($)("textEditor.toolbar.bulletList")},[...n[84]||(n[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,K1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":wl("insertOrderedList")}]),onClick:e.withModifiers(y,["stop"]),title:e.unref($)("textEditor.toolbar.numberList")},[...n[85]||(n[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,G1),n[94]||(n[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(jt,["stop"]),title:e.unref($)("textEditor.toolbar.image")},[...n[86]||(n[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,Q1),n[95]||(n[95]=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(po,["stop"])},[...n[87]||(n[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,J1),_.askAi?(e.openBlock(),e.createElementBlock("div",em)):e.createCommentVNode("",!0),_.askAi?(e.openBlock(),e.createElementBlock("div",tm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:n[42]||(n[42]=e.withModifiers(a=>zn("askAi"),["stop"])),title:e.unref($)("textEditor.toolbar.askAi")},[n[88]||(n[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",nm,e.toDisplayString(e.unref($)("textEditor.toolbar.askAi")),1)],8,lm),$e.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)]),Ul.value?(e.openBlock(),e.createElementBlock("div",om,[_.askAi&&Ul.value?(e.openBlock(),e.createElementBlock("div",am)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Wt(a)&&Ml(a)?(e.openBlock(),e.createElementBlock("div",sm,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),Wt(a)&&Ml(a)&&r<_.customToolbarSlots.length-1&&Zl(r)?(e.openBlock(),e.createElementBlock("div",rm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),um={class:"dss-color-picker__section-title"},dm={class:"dss-color-picker__presets-row"},mm=["title","onClick"],pm={key:1,class:"dss-color-picker__section"},fm={class:"dss-color-picker__presets-row"},vm=["title","onClick"],gm={class:"dss-color-picker__section"},hm={class:"dss-color-picker__section-header"},ym={class:"dss-color-picker__presets-row"},km=["title","onClick"],Cm=["onClick"],bm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},wm=["title","onClick"],xm={class:"dss-color-picker__input-row"},Em=["value"],Sm={__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(_,{emit:J}){function B(q){const U=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(q);if(!U)return{h:0,s:0,l:50};const Q=parseInt(U[1],16)/255,ie=parseInt(U[2],16)/255,Re=parseInt(U[3],16)/255,ct=Math.max(Q,ie,Re),Et=Math.min(Q,ie,Re);let Ie=0,Ct=0;const It=(ct+Et)/2;if(ct!==Et){const Qt=ct-Et;switch(Ct=It>.5?Qt/(2-ct-Et):Qt/(ct+Et),ct){case Q:Ie=((ie-Re)/Qt+(ie<Re?6:0))/6;break;case ie:Ie=((Re-Q)/Qt+2)/6;break;case Re:Ie=((Q-ie)/Qt+4)/6;break}}return{h:Ie*360,s:Ct*100,l:It*100}}function $(q,U,Q){U/=100,Q/=100;const ie=U*Math.min(Q,1-Q),Re=ct=>{const Et=(ct+q/30)%12,Ie=Q-ie*Math.max(Math.min(Et-3,9-Et,1),-1);return Math.round(255*Ie).toString(16).padStart(2,"0")};return`#${Re(0)}${Re(8)}${Re(4)}`}function se(q){const U=q.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!U)return null;let Q=U[1];return Q.length===3&&(Q=Q.split("").map(ie=>ie+ie).join("")),"#"+Q}function F(q,U,Q){U/=100,Q/=100;const ie=Q+U*Math.min(Q,1-Q),Re=ie===0?0:2-2*Q/ie;return{h:q,s:Re*100,v:ie*100}}function T(q,U,Q){U/=100,Q/=100;const ie=Q*(1-U/2),Re=ie===0||ie===1?0:(Q-ie)/Math.min(ie,1-ie);return{h:q,s:Re*100,l:ie*100}}const X=_,Qe=J,pe=e.ref(!1),f=e.ref(!1),be=e.ref(!1),fe=e.ref(-1),ne=e.ref(-1),ee=e.ref(null),ue=e.ref(null),H=e.ref(null),ye=e.ref(null),ve=e.ref({top:0,left:0}),Oe=e.ref(B(X.modelValue||"#b8a5de")),ot=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),I=e.computed(()=>ot.value?0:X.initialPresetCount!=null?X.initialPresetCount:ne.value<0?null:ne.value),qe=e.computed(()=>{const q=I.value;return q==null?!0:Math.max(0,X.presetColors.length-q)<X.max}),Ve=e.computed(()=>!!(f.value||fe.value>=0||!ke.value&&X.presetColors.length===0));e.computed(()=>{const q=I.value;return q!=null&&X.presetColors.length>q});const ke=e.computed(()=>ot.value||I.value!=null),pt=e.computed(()=>{const q=I.value;return q==null?[]:X.presetColors.slice(0,q)}),kt=e.computed(()=>{const q=I.value;return q==null?[]:X.presetColors.slice(q)});function ge(q){const U=I.value;return U!=null?U+q:-1}function ht(q){const U=I.value;return U!=null&&q>=U}function ae(q){ht(q)&&(fe.value=q,Oe.value=B(X.presetColors[q]),f.value=!0,e.nextTick(()=>ye.value?.focus()))}function Xe(q){if(!ht(q))return;const U=X.presetColors.filter((Re,ct)=>ct!==q);Qe("update:presetColors",U);const Q=se(X.modelValue),ie=se(X.presetColors[q]);if(Q&&ie&&Q.toLowerCase()===ie.toLowerCase()){const Re=U[Math.max(0,q-1)]||U[0];Re&&Qe("update:modelValue",Re)}}function $e(){be.value=!be.value,be.value||(fe.value=-1,f.value=!1)}function rt(){if(fe.value<0)return;const q=st.value,U=se(q);if(U){const Q=[...X.presetColors];Q[fe.value]=U,Qe("update:presetColors",Q),Qe("update:modelValue",U),fe.value=-1,f.value=!1}}function Tt(){X.disabled||(fe.value=-1,f.value=!f.value,f.value&&($t(),e.nextTick(()=>ye.value?.focus())))}function tl(q){const U=se(q),Q=se(X.modelValue);return U&&Q&&U.toLowerCase()===Q.toLowerCase()}function Ft(){if(X.disabled||!qe.value)return;const q=st.value,U=se(q);if(U){const Q=[...X.presetColors,U];Qe("update:presetColors",Q),Qe("update:modelValue",U);const ie=I.value??ne.value;ie>=0&&Q.length-ie>=X.max&&(f.value=!1)}}const st=e.computed(()=>{const{h:q,s:U,l:Q}=Oe.value;return $(q,U,Q)}),Vt=e.computed(()=>st.value.toLowerCase()),ll=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Oe.value.h}, 100%, 50%))`})),zt=e.computed(()=>{const q=F(Oe.value.h,Oe.value.s,Oe.value.l);return{left:`${q.s}%`,bottom:`${q.v}%`,transform:"translate(-50%, 50%)"}}),Gt=e.computed(()=>({left:`${Oe.value.h/360*100}%`,transform:"translateX(-50%)"})),Je=e.computed(()=>({position:"fixed",left:`${ve.value.left}px`,top:`${ve.value.top}px`,zIndex:1002}));function lt(){if(!ee.value||!pe.value)return;const q=ee.value.getBoundingClientRect(),U=window.innerHeight||document.documentElement.clientHeight;let Q=q.bottom+4;const ie=ue.value;ie&&Q+ie.offsetHeight>U-8&&(Q=q.top-4-ie.offsetHeight),ve.value={top:Q,left:q.left}}function $t(){const q=X.modelValue||"#b8a5de";se(q)&&(Oe.value=B(q))}function Xt(){Qe("update:modelValue",st.value)}function te(){X.disabled||(pe.value=!pe.value,pe.value&&($t(),e.nextTick(()=>{lt(),ye.value?.focus()})))}function Te(){const q=st.value,U=se(q);if(U){if(fe.value>=0){const Q=[...X.presetColors];Q[fe.value]=U,Qe("update:presetColors",Q),Qe("update:modelValue",U)}else if((X.presetColors.length>0||ot.value)&&f.value&&qe.value&&!X.presetColors.some(ie=>se(ie)?.toLowerCase()===U.toLowerCase())){const ie=[...X.presetColors,U];Qe("update:presetColors",ie),Qe("update:modelValue",U)}}pe.value=!1,f.value=!1,be.value=!1,fe.value=-1}function Me(q){if(!H.value)return;const U=H.value.getBoundingClientRect(),Q=ie=>{const Re=Math.max(0,Math.min(1,(ie.clientX-U.left)/U.width)),ct=Math.max(0,Math.min(1,1-(ie.clientY-U.top)/U.height)),Et={h:Oe.value.h,s:Re*100,v:ct*100};Oe.value=T(Et.h,Et.s,Et.v)};Q(q),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),Xt()},{once:!0})}function Ue(q){if(!q.currentTarget)return;const Q=q.currentTarget.getBoundingClientRect(),ie=Re=>{const ct=Math.max(0,Math.min(1,(Re.clientX-Q.left)/Q.width));Oe.value={...Oe.value,h:ct*360}};ie(q),document.addEventListener("mousemove",ie),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ie),Xt()},{once:!0})}function it(q){const U=q.target.value,Q=se(U);Q&&(Oe.value=B(Q),Qe("update:modelValue",Q))}function Ye(q){if(X.disabled)return;const U=se(q);U&&(Oe.value=B(U),Qe("update:modelValue",U))}let Ge=null,ft=null;function Ae(){Ge&&(document.removeEventListener("keydown",Ge),Ge=null),ft&&(window.removeEventListener("resize",ft),ft=null)}return e.watch(pe,q=>{if(Ae(),q){if(!ot.value&&X.initialPresetCount==null){const U=X.presetColors.length;U>0&&(ne.value<0||U<ne.value)&&(ne.value=U)}Ge=U=>{U.key==="Escape"&&Te()},ft=lt,document.addEventListener("keydown",Ge),window.addEventListener("resize",ft)}}),e.watch(()=>X.modelValue,()=>{pe.value&&$t()},{immediate:!1}),e.watch(kt,q=>{q.length===0&&(be.value=!1,fe.value=-1,f.value=!1)}),e.onBeforeUnmount(Ae),(q,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":_.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:ee,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":pe.value}]),onClick:te},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:st.value})},[...U[0]||(U[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"},[pe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(Te,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Je.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ot.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(_.presetGroups,(Q,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ie,class:"dss-color-picker__section"},[e.createElementVNode("span",um,e.toDisplayString(Q.title),1),e.createElementVNode("div",dm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(Re,ct)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ie+"-"+ct,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Re)}]),style:e.normalizeStyle({backgroundColor:Re}),title:Re,onClick:e.withModifiers(Et=>Ye(Re),["stop"])},null,14,mm))),128))])]))),128)):pt.value.length?(e.openBlock(),e.createElementBlock("div",pm,[U[1]||(U[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",fm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(Q,ie)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(Re=>Ye(Q),["stop"])},null,14,vm))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",gm,[e.createElementVNode("div",hm,[U[3]||(U[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),kt.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":be.value}]),title:"Manage custom colors",onClick:e.withModifiers($e,["stop"])},[...U[2]||(U[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",ym,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,(Q,ie)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ie,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":be.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!be.value&&tl(Q),"dss-color-picker__preset-bubble--editing":be.value&&fe.value===ge(ie)}]),style:e.normalizeStyle({backgroundColor:fe.value===ge(ie)?st.value:Q}),title:fe.value===ge(ie)?st.value:Q,onClick:e.withModifiers(Re=>be.value?ae(ge(ie)):Ye(Q),["stop"])},null,14,km),be.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(Re=>Xe(ge(ie)),["stop"])},[...U[4]||(U[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,Cm)):e.createCommentVNode("",!0)],2))),128)),qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):_.presetColors.length?(e.openBlock(),e.createElementBlock("div",bm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.presetColors,(Q,ie)=>(e.openBlock(),e.createElementBlock("button",{key:ie,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":tl(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(Re=>Ye(Q),["stop"])},null,14,wm))),128)),qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ve.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Me},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(ll.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(zt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ue},[U[5]||(U[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Gt.value)},null,4)],32),e.createElementVNode("div",xm,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:ye,type:"text",class:"dss-color-picker__hex-input",value:Vt.value,onInput:it},null,40,Em)]),ke.value&&(_.presetColors.length||ot.value)&&qe.value&&fe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),ke.value&&fe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:rt}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Te}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Vm={key:0,class:"dss-loader"},Nm={key:0,class:"dss-loader-label"},Bm={key:1,class:"dss-loader"},Mm={key:0,class:"dss-loader-label"},_m={key:2,class:"dss-loader"},$m={key:0,class:"dss-loader-label"},Lm={key:3,class:"dss-loader"},Tm={key:0,class:"dss-loader-label"},Am={key:4,class:"dss-loader"},Dm={key:0,class:"dss-loader-label"},Hm={key:5,class:"dss-loader dss-loader--inline"},Rm={class:"dss-loader-inline-text"},Im={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(_){const J=_,B=e.computed(()=>J.size==="small"?"dss-loaders--size-small":J.size==="large"?"dss-loaders--size-large":J.size==="medium"||J.size==null?"dss-loaders--size-medium":null),$=e.computed(()=>{const se={};if(!(J.size==="small"||J.size==="medium"||J.size==="large"||J.size==null)){const F=typeof J.size=="number"?`${J.size}px`:String(J.size);se["--dss-loader-size"]=F}return J.color&&(se["--dss-loader-accent"]=J.color,se["--dss-loader-accent-soft"]=`color-mix(in srgb, ${J.color} 30%, white)`),se});return(se,F)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",B.value]),style:e.normalizeStyle($.value)},[_.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Vm,[F[0]||(F[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",Nm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="dots"?(e.openBlock(),e.createElementBlock("div",Bm,[F[1]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Mm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="battery"?(e.openBlock(),e.createElementBlock("div",_m,[F[2]||(F[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),_.label?(e.openBlock(),e.createElementBlock("span",$m,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Lm,[F[3]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Tm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="bars"?(e.openBlock(),e.createElementBlock("div",Am,[F[4]||(F[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)),_.label?(e.openBlock(),e.createElementBlock("span",Dm,e.toDisplayString(_.label),1)):e.createCommentVNode("",!0)])):_.type==="inline"?(e.openBlock(),e.createElementBlock("div",Hm,[F[5]||(F[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",Rm,[e.renderSlot(se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])])])):e.createCommentVNode("",!0)],6))}},jo="dss-skeleton-item",Fm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:_=>["single","multiple"].includes(_)},targetClass:{type:String,default:jo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(_){const J=_,B=e.computed(()=>{const F={"dss-skeleton--loading":J.loading,"dss-skeleton--static":!J.shimmer,"dss-skeleton--multiple":J.mode==="multiple","dss-skeleton--dark":J.darkMode};return J.mode==="multiple"&&J.targetClass!==jo&&(F[`dss-skeleton--target-${J.targetClass}`]=!0),F}),$=e.computed(()=>{const F={};return J.borderRadius&&(F.borderRadius=J.borderRadius),F}),se=e.computed(()=>{const F={};return J.borderRadius&&(F["--dss-skeleton-border-radius"]=J.borderRadius),J.darkMode?(F["--dss-skeleton-bg"]=J.bgDark||"#322c3f",F["--dss-skeleton-shimmer"]=J.shimmerDark||"#3e3f41",F):(J.bgColor&&(F["--dss-skeleton-bg"]=J.bgColor),J.shimmerColor&&(F["--dss-skeleton-shimmer"]=J.shimmerColor),F)});return(F,T)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",B.value]),style:e.normalizeStyle(se.value)},[_.loading&&_.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":_.loading&&_.mode==="single"}])},[e.renderSlot(F.$slots,"default")],2)],6))}},zm={key:0,class:"dss-dnd-column-header"},Pm={class:"dss-dnd-column-title"},Om={class:"dss-dnd-column-count"},qm=["data-column"],Wm={key:0,class:"dss-dnd-indicator"},Zm=["onPointerdown"],Um=["onPointerdown"],Xm={class:"dss-dnd-item-content"},Ym={class:"dss-dnd-item-default"},jm={key:0,class:"dss-dnd-empty"},Km={name:"DSSDnd"},Gm=Object.assign(Km,{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(_,{emit:J}){const B=_,$=J,se=e.useSlots(),F=e.computed(()=>!!se["delete-zone"]),T={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},X=e.computed(()=>({...T,...B.options})),Qe=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function pe(te){if(!X.value.ColColor||!te)return{};const Te=te.background||te.color;return Te?{background:Te}:{}}const f=e.ref(null),be=e.ref(null),fe=e.ref(!1),ne=e.ref(-1),ee=e.ref(null);let ue=null,H=null,ye=null,ve=null,Oe=0,ot=0,I="",qe=null;const Ve=5,ke=e.computed(()=>{const te={};for(const Te of B.columns)te[Te.value]=B.items.filter(Me=>Me[B.columnKey]===Te.value).sort((Me,Ue)=>(Me[B.positionKey]??0)-(Ue[B.positionKey]??0));return te}),pt=e.computed(()=>{const te={},Te=!!f.value,Me=f.value?.[B.itemKey],Ue=be.value,it=ne.value;for(const Ye of B.columns){const Ge=ke.value[Ye.value]||[],ft=[],Ae=Ue==Ye.value;let q=0;for(let U=0;U<Ge.length;U++){const Q=Ge[U],ie=Te&&Q[B.itemKey]===Me;!ie&&Ae&&it===q&&ft.push({type:"indicator",key:`ind-${q}`}),ie||q++,ft.push({type:"item",item:Q,isDragged:ie,key:`item-${Q[B.itemKey]}`})}Ae&&it>=q&&ft.push({type:"indicator",key:"ind-end"}),te[Ye.value]=ft}return te});function kt(te,Te){const Ue=(ke.value[te]||[]).filter(Ge=>Ge[B.itemKey]!==f.value?.[B.itemKey]);if(Ue.length===0)return 1;if(Te<=0){const Ge=Ue[0][B.positionKey];return Ge!=null&&Ge>0?Ge/2:.5}if(Te>=Ue.length){const Ge=Ue[Ue.length-1][B.positionKey];return(Ge??0)+1}const it=Ue[Te-1][B.positionKey]??0,Ye=Ue[Te][B.positionKey]??0;return(it+Ye)/2}function ge(te,Te,Me){ye&&ye.remove();const Ue=te.getBoundingClientRect(),it=te.cloneNode(!0);it.classList.add("dss-dnd-ghost"),it.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
105
|
left: ${Te-Oe}px;
|
|
106
106
|
top: ${Me-ot}px;
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
background-color: ${X.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(it),ke=it}function he(te,Te){ke&&(ke.style.left=`${te-Oe}px`,ke.style.top=`${Te-ot}px`)}function de(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=X.value.dragSourceBackground,te.style.borderColor=X.value.dragSourceBorder,te.style.transform="scale(0.97)"}function st(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function Ye(te,Te){return document.elementFromPoint(te,Te)?.closest(".dss-dnd-column-body")??null}function xt(te,Te){return!!document.elementFromPoint(te,Te)?.closest("[data-dss-dnd-delete-zone]")}function Rt(te,Te){if(F.value&&xt(te,Te)){fe.value=!0,we.value=null,ne.value=-1;return}fe.value=!1;const Me=Ye(te,Te),Ue=Me?.getAttribute("data-column")??null;if(!Ue){we.value=null,ne.value=-1;return}we.value=Ue;const it=Me.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Xe=it.length;for(let Ge=0;Ge<it.length;Ge++){const ft=it[Ge].getBoundingClientRect();if(Te<ft.top+ft.height/2){Xe=Ge;break}}ne.value=Xe}function tl(te){te.preventDefault(),he(te.clientX,te.clientY),!ce&&(ce=requestAnimationFrame(()=>{ce=null,Rt(te.clientX,te.clientY)}))}function Ft(te){window.removeEventListener("pointermove",tl),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),ve?.releasePointerCapture?.(te.pointerId),st(ve),ve=null;const Te=F.value&&xt(te.clientX,te.clientY);if(f.value&&Te)$("delete",{item:f.value});else{const Ue=Ye(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(f.value&&Ue){const it=f.value[B.columnKey],Xe=Ue,ft=(Ce.value[Xe]||[]).filter(Q=>Q[B.itemKey]!==f.value[B.itemKey]),Ae=Math.max(0,Math.min(ne.value,ft.length)),q=ht(Xe,Ae),U=f.value[B.itemKey];$("move",{item:f.value,from:it,to:Xe,position:q,index:Ae}),H&&clearTimeout(H),ee.value={id:U,from:it,to:Xe},H=setTimeout(()=>{ee.value=null},3500)}}ke&&(ke.remove(),ke=null),I!==null&&(document.body.style.cursor=I,I=""),Xt()}function rt(te,Te){te.preventDefault();const Me=te.target.closest(".dss-dnd-item");if(!Me)return;const Ue=Me.getBoundingClientRect();Oe=te.clientX-Ue.left,ot=te.clientY-Ue.top,I=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=Te,ve=Me,ge(Me,te.clientX,te.clientY),requestAnimationFrame(()=>de(Me)),Me.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",tl),window.addEventListener("pointerup",Ft,{once:!0}),window.addEventListener("pointercancel",Ft,{once:!0})}function Vt(){qe&&(window.removeEventListener("pointermove",ll),window.removeEventListener("pointerup",zt),window.removeEventListener("pointercancel",zt),qe=null)}function ll(te){if(!qe||te.pointerId!==qe.pointerId)return;const Te=te.clientX-qe.startX,Me=te.clientY-qe.startY;if(Math.abs(Te)>=_e||Math.abs(Me)>=_e){const Ue=qe.item;Vt(),rt(te,Ue)}}function zt(te){!qe||te.pointerId!==qe.pointerId||Vt()}function Gt(te,Te){Vt(),qe={item:Te,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",ll),window.addEventListener("pointerup",zt),window.addEventListener("pointercancel",zt)}function Je(te,Te){X.value.useHandle||Gt(te,Te)}function lt(te,Te){Gt(te,Te)}function $t(){ce&&(cancelAnimationFrame(ce),ce=null)}function Xt(){$t(),f.value=null,we.value=null,fe.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{$t(),Vt(),H&&clearTimeout(H),ke&&(ke.remove(),ke=null)}),(te,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(Qe.value)},[F.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":fe.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!f.value,isOver:fe.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,Me=>(e.openBlock(),e.createElementBlock("div",{key:Me.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Me.value},Me.class||""]]),style:e.normalizeStyle(pe(Me))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",zm,[e.renderSlot(te.$slots,"column-header",{column:Me,items:Ce.value[Me.value]||[]},()=>[e.createElementVNode("span",Pm,e.toDisplayString(Me.title||Me.value),1),e.createElementVNode("span",Om,e.toDisplayString((Ce.value[Me.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value[Me.value],Ue=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ue.key},[Ue.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Wm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ue.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:it=>Je(it,Ue.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(it=>lt(it,Ue.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[Te[0]||(Te[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Um)):e.createCommentVNode("",!0),e.createElementVNode("div",Xm,[e.renderSlot(te.$slots,"item",{item:Ue.item,column:Me,justDropped:ee.value?.id===Ue.item[_.itemKey],droppedFrom:ee.value?.id===Ue.item[_.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Ue.item[_.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",Ym,e.toDisplayString(Ue.item[_.itemKey]),1)])])],42,Zm))],64))),128)),(Ce.value[Me.value]||[]).length===0&&we.value!=Me.value?(e.openBlock(),e.createElementBlock("div",jm,[e.renderSlot(te.$slots,"empty",{column:Me},()=>[Te[1]||(Te[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,qm)],6))),128))],6))}}),Qm={name:"DSSConfetti"},Jm=Object.assign(Qm,{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(_){const J=_,B=e.ref(null),$=e.ref(!1);let ae=[],F=null,T=null;function X(ne,ee){const ce=[];for(let H=0;H<J.count;H++)ce.push(Qe(ne));return ce}function Qe(ne,ee){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:J.colors[Math.floor(Math.random()*J.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function pe(ne,ee,ce,H){ne.clearRect(0,0,ee,ce);for(const ke of ae)ne.save(),ne.globalAlpha=ke.opacity*H,ne.beginPath(),ne.lineWidth=ke.r,ne.strokeStyle=ke.color,ne.moveTo(ke.x+ke.tilt+ke.r/2,ke.y),ne.lineTo(ke.x+ke.tilt,ke.y+ke.tilt+ke.r/2),ne.stroke(),ne.restore()}function f(ne,ee,ce){const H=.3+ce*.7;for(let ke=0;ke<ae.length;ke++){const ve=ae[ke];ve.tiltAngle+=ve.tiltInc,ve.y+=ve.speed*H,ve.x+=Math.sin(ve.d)*.5*H,ve.tilt=Math.sin(ve.tiltAngle)*15,ce>=.99&&ve.y>ee+20&&(ae[ke]=Qe(ne))}}function we(){$.value=!0,e.nextTick(()=>{const ne=B.value;if(!ne)return;const ee=ne.getContext("2d"),ce=ne.parentElement;if(!ce)return;const H=ce.getBoundingClientRect();ne.width=H.width,ne.height=H.height,ae=X(ne.width,ne.height);const ke=Date.now(),ve=ke+J.duration,Oe=()=>{const ot=Date.now(),I=ot-ke;if(ot<ve){let qe=1;I>J.fadeStart&&(qe=1-(I-J.fadeStart)/(J.duration-J.fadeStart)),pe(ee,ne.width,ne.height,qe),f(ne.width,ne.height,qe),F=requestAnimationFrame(Oe)}else fe()};Oe()})}function fe(){F&&(cancelAnimationFrame(F),F=null),ae=[],$.value=!1}return e.watch(()=>J.trigger,ne=>{ne&&(T&&clearTimeout(T),T=setTimeout(we,J.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{fe(),T&&clearTimeout(T)}),(ne,ee)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:B,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),e2={class:"dss-filter-global-inner"},t2=["placeholder","value"],l2=["title"],n2={key:0,class:"dss-filter-funnel-badge"},o2={key:1,class:"dss-filter-sortby"},a2=["value"],s2=["value"],r2=["disabled","title"],i2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d2={class:"dss-filter-panel"},m2={key:0,class:"dss-filter-empty"},p2={class:"dss-filter-row-prefix"},f2={class:"dss-filter-cell"},v2=["onClick"],g2={class:"dss-filter-trigger-text"},h2=["placeholder"],y2={class:"dss-filter-popup-list"},k2=["onClick"],C2={key:0,class:"dss-filter-popup-empty"},b2={key:0,class:"dss-filter-cell"},w2=["onClick"],x2={class:"dss-filter-trigger-text"},E2={class:"dss-filter-popup-list"},S2=["onClick"],V2={key:1,class:"dss-filter-cell dss-filter-cell--value"},N2=["placeholder","onUpdate:modelValue"],B2={key:1,class:"dss-filter-date-wrap"},M2=["placeholder","onUpdate:modelValue"],_2=["placeholder","value","onInput","step"],$2={key:4,class:"dss-filter-between"},L2=["placeholder","value","onInput","step"],T2={class:"dss-filter-between-sep"},A2=["placeholder","value","onInput","step"],D2={key:5,class:"dss-filter-multiselect"},H2=["onClick"],R2={class:"dss-filter-trigger-text"},I2=["placeholder"],F2={class:"dss-filter-popup-list dss-filter-popup-list--check"},z2=["onClick"],P2=["checked"],O2={key:0,class:"dss-filter-popup-empty"},q2=["onClick"],W2={class:"dss-filter-foot"},Z2={class:"dss-filter-cell"},U2=["placeholder"],X2={class:"dss-filter-popup-list"},Y2=["onClick"],j2={key:0,class:"dss-filter-popup-divider"},K2=["onClick"],G2=["placeholder"],Q2={class:"dss-filter-popup-list"},J2=["onClick"],e0={key:0,class:"dss-filter-popup-empty"},t0=["placeholder"],l0={class:"dss-filter-popup-list"},n0=["onClick"],o0={key:0,class:"dss-filter-popup-empty"},a0={name:"DSSFilter"},s0=Object.assign(a0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{expose:J,emit:B}){const{t:$}=Gn.useI18n(),ae=_,F=B,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...T,...ae.options})),Qe={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"}]},pe=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),fe=e.ref([]),ne=e.ref(null),ee=e.ref(!1),ce=e.ref(null),H=e.ref(""),ke=e.ref(null),ve=e.ref(""),Oe=e.ref("asc");let ot=1;function I(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function qe(V,w){const S=w.filter(j=>j!=null&&j!=="NULL");if(S.length===0)return null;if(S.every(j=>Array.isArray(j))){const j=S.flatMap(Ze=>Ze).filter(Ze=>Ze!=null);return j.length===0?null:typeof j.find(Ze=>Ze!=null)=="object"?"arraySelect":"arrayText"}return S.every(j=>typeof j=="boolean")?"boolean":S.every(j=>typeof j=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(j=>typeof j=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(j=>typeof j=="object"&&!Array.isArray(j))?null:"text"}const _e=e.computed(()=>{if(!ae.data?.length)return[];const V=new Set;for(const G of ae.data)if(G&&typeof G=="object")for(const Ze of Object.keys(G))V.add(Ze);const w=new Set(ae.exclude),S=[];for(const G of V){if(w.has(G))continue;const Ze=ae.config[G]||{},vt=ae.data.map(et=>et?.[G]),Ve=Ze.type||qe(G,vt);if(!Ve)continue;const Ne=Ze.filterMode||"contain",Tt=Ne==="date"?"date":Ne==="string"?"text":Ve,At={key:G,label:Ze.label||qt(G),type:Tt,filterMode:Ne};if(Ve==="select"){const et=vt.filter(tt=>tt!=null&&tt!=="NULL");At.uniqueValues=[...new Set(et)].sort((tt,Lt)=>typeof tt=="number"&&typeof Lt=="number"?tt-Lt:String(tt).localeCompare(String(Lt)))}else if(Ve==="range"||Ve==="int"){const et=vt.filter(tt=>typeof tt=="number");At.min=Math.min(...et),At.max=Math.max(...et)}else if(Ve==="arraySelect"){const et=Ze.displayKey||I(vt.flatMap(tt=>Array.isArray(tt)?tt:[]));if(At.displayKey=et,Array.isArray(Ze.uniqueValues)&&Ze.uniqueValues.length>0)At.uniqueValues=Ze.uniqueValues.map(tt=>String(tt));else{const tt=vt.flatMap(Lt=>Array.isArray(Lt)?Lt:[]).filter(Lt=>Lt!=null).map(Lt=>et&&typeof Lt=="object"?Lt[et]:String(Lt)).filter(Lt=>Lt!=null&&Lt!=="");At.uniqueValues=[...new Set(tt)].sort((Lt,fl)=>String(Lt).localeCompare(String(fl)))}}S.push(At)}const j=ae.config._order;return j&&S.sort((G,Ze)=>{const vt=j.indexOf(G.key),Ve=j.indexOf(Ze.key);return vt===-1&&Ve===-1?0:vt===-1?1:Ve===-1?-1:vt-Ve}),S}),Ce=e.computed(()=>{const V={};for(const w of _e.value)V[w.key]=w;return V}),pt=e.computed(()=>Array.isArray(ae.config.groups)&&ae.config.groups.length>0),ht=e.computed(()=>{if(!pt.value)return[];const V=new Set(_e.value.map(w=>w.key));return ae.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),ge=e.computed(()=>{if(!pt.value)return[];const V=new Set(ae.config.groups.flatMap(w=>w.keys));return _e.value.filter(w=>!V.has(w.key))}),he=e.computed(()=>{if(!ke.value)return[];const V=new Set(ke.value.keys),w=_e.value.filter(j=>V.has(j.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(j=>j.label.toLowerCase().includes(S))}),de=e.computed(()=>{if(!H.value)return _e.value;const V=H.value.toLowerCase();return _e.value.filter(w=>w.label.toLowerCase().includes(V))}),st=e.computed(()=>_e.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),Ye=e.computed(()=>ve.value?Oe.value==="asc"?"Ascending":"Descending":"No sort selected");function xt(V){ne.value===V?Rt():(ne.value=V,H.value="",ke.value=null)}function Rt(){ne.value=null,H.value="",ke.value=null}function tl(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Rt(),ee.value&&ce.value&&!ce.value.contains(V.target)&&(w||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",tl)),e.onBeforeUnmount(()=>document.removeEventListener("click",tl));function Ft(V){return Ce.value[V]?.label||qt(V)}function rt(V){return Ce.value[V.key]?.filterMode||"contain"}function Vt(V){return $(`filter.operators.${V}`)}function ll(V){const w=Ce.value[V.key];return(Qe[w?.type]||Qe.text).map(S=>({...S,label:$(`filter.operators.${S.value}`)}))}function zt(V){return pe.has(V)}function Gt(V){const w=Ce.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function Je(V){return Qe[V]?.[0]?.value||"contains"}function lt(V,w){return pe.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function $t(V){return Ce.value[V.key]?.uniqueValues||[]}function Xt(V){const w=$t(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(j=>String(j).toLowerCase().includes(S))}function te(V){const w=V.value;return!w||w.length===0?$("filter.select"):w.length<=2?w.join(", "):$("filter.selectedCount",{count:w.length})}function Te(V){const w=Ce.value[V],S=w?.filterMode||"contain",j=w?.type||"text",G=S==="string"?"contains":Je(j);fe.value.push(e.reactive({id:ot++,key:V,operator:G,value:lt(j,G)})),Rt()}function Me(V){fe.value=fe.value.filter(w=>w.id!==V)}function Ue(V,w){const j=Ce.value[w]?.type||"text";V.key=w,V.operator=Je(j),V.value=lt(j,V.operator),Rt()}function it(V,w){const S=Gt(V);V.operator=w;const j=Gt(V);if(S!==j||pe.has(w)){const G=Ce.value[V.key];V.value=lt(G?.type||"text",w)}Rt()}function Xe(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function Ge(V,w,S){const j=S.target.value,G=j===""?null:Number(j);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(G)?null:G}}function ft(V,w){const S=V.value||[],j=S.indexOf(w);V.value=j>=0?S.filter(G=>G!==w):[...S,w]}function Ae(){fe.value=[],we.value="",Rt()}function q(V){we.value=V.target.value}function U(V){ve.value=V.target.value}function Q(){Oe.value=Oe.value==="asc"?"desc":"asc"}const re=e.computed(()=>{if(!ae.data)return[];let V=ae.data;if(we.value){const w=we.value.toLowerCase();V=V.filter(S=>{for(const j of Object.keys(S)){const G=S[j];if(typeof G=="string"&&G.toLowerCase().includes(w)||typeof G=="number"&&String(G).includes(w)||Array.isArray(G)&&G.some(Ze=>Ze!=null&&(typeof Ze=="string"?Ze.toLowerCase().includes(w):typeof Ze=="object"?Object.values(Ze).some(vt=>typeof vt=="string"&&vt.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of fe.value){if(!Et(w))continue;const S=Ce.value[w.key];S&&(V=V.filter(j=>Ie(j,w,S)))}if(ae.showSortBy&&ve.value){const w=ve.value,S=Oe.value==="asc"?1:-1;V=[...V].sort((j,G)=>Re(j?.[w],G?.[w])*S)}return V});function Re(V,w){const S=ct(V),j=ct(w);return S==null&&j==null?0:S==null?1:j==null?-1:typeof S=="number"&&typeof j=="number"?S-j:String(S).localeCompare(String(j),void 0,{numeric:!0,sensitivity:"base"})}function ct(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function Et(V){return pe.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Ie(V,w,S){const j=V?.[w.key],G=w.value,Ze=w.operator;if(Ze==="is_empty")return Qt(j);if(Ze==="is_not_empty")return!Qt(j);const vt=S.type;if(vt==="text"||vt==="arrayText"){const Ve=vt==="arrayText"&&Array.isArray(j)?j.filter(At=>At!=null).map(String).join(" "):j!=null?String(j):"",Ne=String(G).toLowerCase(),Tt=Ve.toLowerCase();switch(Ze){case"contains":return Tt.includes(Ne);case"not_contains":return!Tt.includes(Ne);case"equals":return Tt===Ne;case"not_equals":return Tt!==Ne;case"starts_with":return Tt.startsWith(Ne);case"ends_with":return Tt.endsWith(Ne);default:return!0}}if(vt==="select")switch(Ze){case"is_any_of":return G.includes(j);case"is_none_of":return!G.includes(j);default:return!0}if(vt==="range"||vt==="int"){const Ve=typeof j=="number"?j:Number(j);if(typeof Ve!="number"||isNaN(Ve))return!1;if(Ze==="between"){const Tt=G?.min!=null?Number(G.min):null,At=G?.max!=null?Number(G.max):null,et=Tt!=null&&!isNaN(Tt)?Tt:null,tt=At!=null&&!isNaN(At)?At:null;return(et==null||Ve>=et)&&(tt==null||Ve<=tt)}const Ne=typeof G=="number"&&!isNaN(G)?G:Number(G);if(Ze==="contains"||Ze==="not_contains"){const Tt=String(Ve),At=String(G??"").toLowerCase(),et=Tt.toLowerCase().includes(At);return Ze==="contains"?et:!et}if(typeof Ne!="number"||isNaN(Ne))return!1;switch(Ze){case"eq":return Ve===Ne;case"neq":return Ve!==Ne;case"gt":return Ve>Ne;case"gte":return Ve>=Ne;case"lt":return Ve<Ne;case"lte":return Ve<=Ne;default:return!0}}if(vt==="arraySelect"){if(!Array.isArray(j))return!1;const Ve=j.filter(Ne=>Ne!=null).map(Ne=>S.displayKey&&typeof Ne=="object"?Ne[S.displayKey]:String(Ne));switch(Ze){case"contains_any":return Ve.some(Ne=>G.includes(Ne));case"contains_all":return G.every(Ne=>Ve.includes(Ne));case"not_contains_any":return!Ve.some(Ne=>G.includes(Ne));default:return!0}}if(vt==="date"){const Ve=kt(G);if(!Ve||isNaN(Ve.getTime()))return!1;const Ne=kt(j);if(!Ne||isNaN(Ne.getTime()))return!1;const Tt=It(Ne),At=It(Ve);switch(Ze){case"eq":return Tt===At;case"before":return Tt<At;case"after":return Tt>At;default:return!0}}if(vt==="boolean"){const Ve=j===!0||j==="true"||j===1,Ne=j===!1||j==="false"||j===0;switch(Ze){case"is_true":return Ve;case"is_false":return Ne;default:return!0}}return!0}function kt(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function It(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),j=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${j}`}function Qt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(re,V=>F("update:modelValue",V),{immediate:!0}),e.watch(()=>ae.data,()=>{fe.value=[],we.value="",ee.value=!1,ve.value="",Oe.value="asc",Rt()});function qt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Dt(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const j of Object.keys(w))S[j]=V(w[j]);return S}return w};return{globalSearch:we.value,rows:fe.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:Ce.value[w.key]?.type,defFilterMode:Ce.value[w.key]?.filterMode})),filteredCount:re.value?.length??0}}return J({getDebugState:Dt}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ce},[e.createElementVNode("div",e2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref($)("filter.searchAcrossFields"),value:we.value,onInput:q},null,40,t2),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||fe.value.length>0,"dss-filter-funnel-btn--with-sort":ae.showSortBy}]),onClick:w[1]||(w[1]=S=>ee.value=!ee.value),type:"button",title:ee.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),fe.value.length>0?(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(fe.value.length),1)):e.createCommentVNode("",!0)],10,l2),ae.showSortBy?(e.openBlock(),e.createElementBlock("div",o2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:ve.value,onChange:U},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,s2))),128))],40,a2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Q,disabled:!ve.value,title:Ye.value},[ve.value?Oe.value==="asc"?(e.openBlock(),e.createElementBlock("svg",c2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",u2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",i2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,r2)])):e.createCommentVNode("",!0)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",d2,[fe.value.length===0?(e.openBlock(),e.createElementBlock("div",m2,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(S,j)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",p2,e.toDisplayString(j===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",f2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>xt(`${S.id}:field`),["stop"])},[e.createElementVNode("span",g2,e.toDisplayString(Ft(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,v2),ne.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=G=>H.value=G),placeholder:e.unref($)("filter.searchAttributes")},null,8,h2),[[e.vModelText,H.value]]),e.createElementVNode("ul",y2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,G=>(e.openBlock(),e.createElementBlock("li",{key:G.key,class:"dss-filter-popup-item",onClick:Ze=>Ue(S,G.key)},e.toDisplayString(G.label),9,k2))),128)),de.value.length===0?(e.openBlock(),e.createElementBlock("li",C2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),rt(S)==="contain"||rt(S)==="date"?(e.openBlock(),e.createElementBlock("div",b2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>xt(`${S.id}:op`),["stop"])},[e.createElementVNode("span",x2,e.toDisplayString(Vt(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,w2),ne.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",E2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ll(S),G=>(e.openBlock(),e.createElementBlock("li",{key:G.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===G.value}]),onClick:Ze=>it(S,G.value)},e.toDisplayString(G.label),11,S2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",V2,[rt(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":G=>S.value=G},null,8,N2)),[[e.vModelText,S.value]]):rt(S)==="date"?(e.openBlock(),e.createElementBlock("div",B2,[e.createVNode(Wo,{mode:"single",modelValue:S.value,"onUpdate:modelValue":G=>S.value=G},null,8,["modelValue","onUpdate:modelValue"])])):Gt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":G=>S.value=G},null,8,M2)),[[e.vModelText,S.value]]):Gt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:S.value,onInput:G=>Xe(S,G),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,_2)):Gt(S)==="between"?(e.openBlock(),e.createElementBlock("div",$2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:S.value?.min,onInput:G=>Ge(S,"min",G),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,L2),e.createElementVNode("span",T2,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:S.value?.max,onInput:G=>Ge(S,"max",G),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,A2)])):Gt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>xt(`${S.id}:val`),["stop"])},[e.createElementVNode("span",R2,e.toDisplayString(te(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,H2),ne.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[$t(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=G=>H.value=G),placeholder:e.unref($)("filter.search")},null,8,I2)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",F2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt(S),G=>(e.openBlock(),e.createElementBlock("li",{key:G,class:"dss-filter-popup-item",onClick:Ze=>ft(S,G)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(G),tabindex:"-1"},null,8,P2),e.createElementVNode("span",null,e.toDisplayString(G),1)],8,z2))),128)),Xt(S).length===0?(e.openBlock(),e.createElementBlock("li",O2,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:G=>Me(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,q2)]))),128)),e.createElementVNode("div",W2,[e.createElementVNode("div",Z2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>xt("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:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[pt.value&&!ke.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,U2),[[e.vModelText,H.value]]),e.createElementVNode("ul",X2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:j=>ke.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,Y2))),128)),ge.value.length>0?(e.openBlock(),e.createElementBlock("li",j2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,K2))),128))])],64)):ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>ke.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ke.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,G2),[[e.vModelText,H.value]]),e.createElementVNode("ul",Q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,J2))),128)),he.value.length===0?(e.openBlock(),e.createElementBlock("li",e0,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":w[11]||(w[11]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,t0),[[e.vModelText,H.value]]),e.createElementVNode("ul",l0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,n0))),128)),de.value.length===0?(e.openBlock(),e.createElementBlock("li",o0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),fe.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ae},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),r0={class:"dss-pill-field__pills"},i0=["disabled"],c0={class:"dss-pill-field__pill-text"},u0={key:0,class:"dss-pill-field__pill-actions"},d0=["onClick"],m0=["onClick"],p0=["placeholder","disabled"],f0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{emit:J}){const B=_,$=J,ae=e.ref(""),F=e.ref([...B.modelValue]),T=e.ref(null);let X=null;const Qe=e.ref(null),pe=e.ref(""),f=e.ref(null),we=e.computed(()=>new Set(F.value.map(I=>I.trim()).filter(Boolean)));function fe(I){T.value=I,X&&clearTimeout(X),X=setTimeout(()=>{T.value=null,X=null},900)}function ne(I){const qe=I.trim();return qe?we.value.has(qe)?(fe(qe),!1):(F.value=[...F.value,qe],$("update:modelValue",[...F.value]),!0):!1}function ee(I){const qe=I.split(/\r?\n/g).map(ht=>ht.trim()).filter(Boolean);if(!qe.length)return;const _e=new Set(F.value.map(ht=>ht.trim()).filter(Boolean)),Ce=[...F.value];let pt=null;for(const ht of qe){if(_e.has(ht)){pt??=ht;continue}_e.add(ht),Ce.push(ht)}Ce.length!==F.value.length&&(F.value=Ce,$("update:modelValue",[...F.value])),pt&&fe(pt)}function ce(I){B.disabled||(Qe.value===I&&(Qe.value=null,pe.value=""),F.value=F.value.filter((qe,_e)=>_e!==I),$("update:modelValue",[...F.value]))}async function H(I){B.disabled||(Qe.value=I,pe.value=F.value[I]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function ke(){Qe.value=null,pe.value=""}function ve(){if(B.disabled||Qe.value===null)return;const I=Qe.value,qe=F.value[I]??"",_e=pe.value.trim();if(Qe.value=null,pe.value="",_e!==qe&&we.value.has(_e)){fe(_e);return}if(!_e){F.value=F.value.filter((pt,ht)=>ht!==I),$("update:modelValue",[...F.value]);return}const Ce=F.value.map((pt,ht)=>ht===I?_e:pt);F.value=Ce,$("update:modelValue",[...F.value])}function Oe(I){I.preventDefault(),!B.disabled&&(ne(ae.value),ae.value="")}function ot(I){if(B.disabled)return;const qe=I.clipboardData?.getData("text")??"";!qe.includes(`
|
|
118
|
-
`)&&!qe.includes("\r")||(I.preventDefault(),ee(qe),ae.value="")}return e.watch(()=>B.modelValue,I=>{F.value=Array.isArray(I)?[...I]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(I,qe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":I.disabled}])},[e.createElementVNode("div",r0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(_e,Ce)=>(e.openBlock(),e.createElementBlock("span",{key:_e,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===_e}])},[Qe.value===Ce?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":qe[0]||(qe[0]=pt=>pe.value=pt),class:"dss-pill-field__pill-edit",type:"text",disabled:I.disabled,onKeydown:[e.withKeys(ve,["enter"]),e.withKeys(ke,["esc"])],onBlur:ve},null,40,i0)),[[e.vModelText,pe.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",c0,e.toDisplayString(_e),1),I.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",u0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:pt=>H(Ce)},[...qe[2]||(qe[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,d0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:pt=>ce(Ce)}," × ",8,m0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":qe[1]||(qe[1]=_e=>ae.value=_e),class:"dss-pill-field__input",type:"text",placeholder:F.value.length?"":I.placeholder,disabled:I.disabled,onPaste:ot,onKeydown:e.withKeys(Oe,["enter"])},null,40,p0),[[e.vModelText,ae.value]])])],2))}}),v0={class:"dss-step-bar__header"},g0={class:"dss-step-bar__label"},h0={key:0,class:"dss-step-bar__counter"},y0={class:"dss-step-bar__track-wrapper"},k0=["aria-valuemax","aria-valuenow","aria-label"],C0=["onMouseenter"],b0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:_=>["input","desc","asc"].includes(_)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1}},setup(_){const J=_,B=e.computed(()=>Math.max(1,Number(J.steps)||1)),$=e.computed(()=>Math.min(B.value,Math.max(0,Number(J.currentStep)||0))),ae=e.computed(()=>Array.isArray(J.segments)&&J.segments.length>0),F=e.computed(()=>{if(!ae.value)return[];const he=J.segments.map((de,st)=>{const Ye=Number(de?.value);return{label:de?.label||`Step ${st+1}`,value:Number.isFinite(Ye)&&Ye>0?Ye:0,color:de?.color||J.activeColor}});return J.segmentOrder==="desc"?[...he].sort((de,st)=>st.value-de.value):J.segmentOrder==="asc"?[...he].sort((de,st)=>de.value-st.value):he}),T=e.computed(()=>ae.value?F.value.reduce((he,de)=>he+de.value,0):$.value),X=e.computed(()=>ae.value?Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0?Number(J.totalValue):Math.max(1,T.value):B.value),Qe=e.computed(()=>ae.value&&Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0),pe=e.computed(()=>Qe.value?Math.max(0,Number(J.totalValue)-T.value):0),f=e.computed(()=>typeof J.remainderLabel=="string"&&J.remainderLabel.trim().length>0),we=e.computed(()=>pe.value>0),fe=e.computed(()=>F.value.reduce((he,de)=>Math.max(he,Number(de.value)||0),0)),ne=e.computed(()=>F.value.filter(he=>he.value>0).map(he=>`${he.label}: ${he.value}`).join(" | ")),ee=e.computed(()=>ae.value?Qe.value?F.value.filter(he=>he.value>0):F.value:[]),ce=e.computed(()=>{if(!J.counterAsPercentage)return`${T.value} / ${X.value}`;const he=Number(X.value);if(!Number.isFinite(he)||he<=0)return"0%";const de=Math.round(Number(T.value)/he*100);return`${Math.min(Math.max(de,0),100)}%`}),H=e.computed(()=>T.value),ke=e.computed(()=>X.value),ve=e.reactive({visible:!1,x:0,content:""}),Oe=e.computed(()=>({left:`${ve.x}px`})),ot=he=>{const de=he?.parentElement;return de?de.offsetLeft+de.offsetWidth/2:0},I=he=>{if(Qe.value){const Ye=Math.max(0,Number(he.value)||0);return{flex:`${Ye} 0 0`,minWidth:Ye>0?"6px":"0",backgroundColor:he.color}}const de=T.value;return{flex:`${he.value>0?he.value:de>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:he.color}},qe=he=>Number(he?.value||0)>0&&Number(he?.value||0)===fe.value,_e=e.computed(()=>({flex:`${pe.value} 0 0`,minWidth:pe.value>0?"6px":"0",backgroundColor:J.inactiveColor})),Ce=(he,de)=>{if(!he||!de?.currentTarget)return;const st=de.currentTarget;if(J.remainderTooltipSummary){ve.x=ot(st),ve.content=ne.value,ve.visible=!!ve.content;return}ve.x=st.offsetLeft+st.offsetWidth/2,ve.content=`${he.label}: ${he.value}`,ve.visible=!0},pt=he=>{if(!pe.value||!he?.currentTarget)return;const de=he.currentTarget;if(J.remainderTooltipSummary){ve.x=ot(de),ve.content=ne.value,ve.visible=!!ve.content;return}ve.x=de.offsetLeft+de.offsetWidth/2,f.value&&(ve.content=`${J.remainderLabel}: ${pe.value}`,ve.visible=!0)},ht=()=>{ve.visible=!1},ge=e.computed(()=>({"--dss-step-bar-label-color":J.labelColor??void 0,"--dss-step-bar-counter-color":J.counterColor??void 0,"--dss-step-bar-active-color":J.activeColor,"--dss-step-bar-inactive-color":J.inactiveColor}));return(he,de)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(ge.value)},[e.createElementVNode("div",v0,[e.createElementVNode("span",g0,[e.renderSlot(he.$slots,"label",{label:_.label},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])]),_.showCounter?(e.openBlock(),e.createElementBlock("span",h0,[e.renderSlot(he.$slots,"counter",{counterDisplay:ce.value},()=>[e.createTextVNode(e.toDisplayString(ce.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",y0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":ke.value,"aria-valuenow":H.value,"aria-label":_.label},[ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,(st,Ye)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Ye}-${st.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":qe(st)}]),style:e.normalizeStyle(I(st)),onMouseenter:xt=>Ce(st,xt),onMouseleave:ht},null,46,C0))),128)),we.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(_e.value),onMouseenter:de[0]||(de[0]=st=>pt(st)),onMouseleave:ht},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,st=>(e.openBlock(),e.createElementBlock("div",{key:st,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":st<=$.value}])},null,2))),128))],8,k0),ve.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Oe.value)},e.toDisplayString(ve.content),5)):e.createCommentVNode("",!0)])],4))}},w0={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"}},x0={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"},E0={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"}},S0={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"}},V0={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"}},Qn={chart:w0,table:x0,filter:E0,datepicker:S0,textEditor:V0},N0={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"}},B0={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"},M0={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"}},_0={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"}},$0={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"}},Jn={chart:N0,table:B0,filter:M0,datepicker:_0,textEditor:$0},L0={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"}},T0={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"},A0={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"}},D0={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"}},H0={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"}},eo={chart:L0,table:T0,filter:A0,datepicker:D0,textEditor:H0},Bo={en:Qn,fr:Jn,nl:eo};function Ko(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Bo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Bo[B])})}const Mo={en:{textEditor:Qn.textEditor},fr:{textEditor:Jn.textEditor},nl:{textEditor:eo.textEditor}};function Go(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Mo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Mo[B])})}const _o={en:{table:Qn.table},fr:{table:Jn.table},nl:{table:eo.table}};function Qo(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(_o).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,_o[B])})}const $o={en:{datepicker:Qn.datepicker},fr:{datepicker:Jn.datepicker},nl:{datepicker:eo.datepicker}};function Jo(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys($o).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,$o[B])})}const Lo={en:{filter:Qn.filter},fr:{filter:Jn.filter},nl:{filter:eo.filter}};function ea(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Lo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Lo[B])})}const R0={chart:Bo,textEditor:Mo,table:_o,datepicker:$o,filter:Lo};function I0(_){!_||!_.global||(Ko(_),Go(_),Qo(_),Jo(_),ea(_))}const F0={en:{...Qn},fr:{...Jn},nl:{...eo}};Gn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F0});exports.DSSChart=Ii;exports.DSSChartMessages=Bo;exports.DSSColorPicker=Sm;exports.DSSConfetti=Jm;exports.DSSDatepicker=Wo;exports.DSSDatepickerMessages=$o;exports.DSSDnd=Gm;exports.DSSFilter=s0;exports.DSSFilterMessages=Lo;exports.DSSLoader=Im;exports.DSSMessages=R0;exports.DSSModal=qo;exports.DSSPillField=f0;exports.DSSSkeleton=Fm;exports.DSSStepBar=b0;exports.DSSTable=su;exports.DSSTableMessages=_o;exports.DSSTextEditor=cm;exports.DSSTextEditorMessages=Mo;exports.addDSSChartTranslations=Ko;exports.addDSSDatepickerTranslations=Jo;exports.addDSSFilterTranslations=ea;exports.addDSSTableTranslations=Qo;exports.addDSSTextEditorTranslations=Go;exports.addDSSTranslations=I0;
|
|
117
|
+
`,document.body.appendChild(it),ye=it}function ht(te,Te){ye&&(ye.style.left=`${te-Oe}px`,ye.style.top=`${Te-ot}px`)}function ae(te){te.classList.add("dss-dnd-item--dragging"),te.style.background=X.value.dragSourceBackground,te.style.borderColor=X.value.dragSourceBorder,te.style.transform="scale(0.97)"}function Xe(te){te.classList.remove("dss-dnd-item--dragging"),te.style.background="",te.style.borderColor="",te.style.transform=""}function $e(te,Te){return document.elementFromPoint(te,Te)?.closest(".dss-dnd-column-body")??null}function rt(te,Te){return!!document.elementFromPoint(te,Te)?.closest("[data-dss-dnd-delete-zone]")}function Tt(te,Te){if(F.value&&rt(te,Te)){fe.value=!0,be.value=null,ne.value=-1;return}fe.value=!1;const Me=$e(te,Te),Ue=Me?.getAttribute("data-column")??null;if(!Ue){be.value=null,ne.value=-1;return}be.value=Ue;const it=Me.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ye=it.length;for(let Ge=0;Ge<it.length;Ge++){const ft=it[Ge].getBoundingClientRect();if(Te<ft.top+ft.height/2){Ye=Ge;break}}ne.value=Ye}function tl(te){te.preventDefault(),ht(te.clientX,te.clientY),!ue&&(ue=requestAnimationFrame(()=>{ue=null,Tt(te.clientX,te.clientY)}))}function Ft(te){window.removeEventListener("pointermove",tl),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),ve?.releasePointerCapture?.(te.pointerId),Xe(ve),ve=null;const Te=F.value&&rt(te.clientX,te.clientY);if(f.value&&Te)$("delete",{item:f.value});else{const Ue=$e(te.clientX,te.clientY)?.getAttribute("data-column")??null;if(f.value&&Ue){const it=f.value[B.columnKey],Ye=Ue,ft=(ke.value[Ye]||[]).filter(Q=>Q[B.itemKey]!==f.value[B.itemKey]),Ae=Math.max(0,Math.min(ne.value,ft.length)),q=kt(Ye,Ae),U=f.value[B.itemKey];$("move",{item:f.value,from:it,to:Ye,position:q,index:Ae}),H&&clearTimeout(H),ee.value={id:U,from:it,to:Ye},H=setTimeout(()=>{ee.value=null},3500)}}ye&&(ye.remove(),ye=null),I!==null&&(document.body.style.cursor=I,I=""),Xt()}function st(te,Te){te.preventDefault();const Me=te.target.closest(".dss-dnd-item");if(!Me)return;const Ue=Me.getBoundingClientRect();Oe=te.clientX-Ue.left,ot=te.clientY-Ue.top,I=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=Te,ve=Me,ge(Me,te.clientX,te.clientY),requestAnimationFrame(()=>ae(Me)),Me.setPointerCapture?.(te.pointerId),window.addEventListener("pointermove",tl),window.addEventListener("pointerup",Ft,{once:!0}),window.addEventListener("pointercancel",Ft,{once:!0})}function Vt(){qe&&(window.removeEventListener("pointermove",ll),window.removeEventListener("pointerup",zt),window.removeEventListener("pointercancel",zt),qe=null)}function ll(te){if(!qe||te.pointerId!==qe.pointerId)return;const Te=te.clientX-qe.startX,Me=te.clientY-qe.startY;if(Math.abs(Te)>=Ve||Math.abs(Me)>=Ve){const Ue=qe.item;Vt(),st(te,Ue)}}function zt(te){!qe||te.pointerId!==qe.pointerId||Vt()}function Gt(te,Te){Vt(),qe={item:Te,startX:te.clientX,startY:te.clientY,pointerId:te.pointerId},window.addEventListener("pointermove",ll),window.addEventListener("pointerup",zt),window.addEventListener("pointercancel",zt)}function Je(te,Te){X.value.useHandle||Gt(te,Te)}function lt(te,Te){Gt(te,Te)}function $t(){ue&&(cancelAnimationFrame(ue),ue=null)}function Xt(){$t(),f.value=null,be.value=null,fe.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{$t(),Vt(),H&&clearTimeout(H),ye&&(ye.remove(),ye=null)}),(te,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(Qe.value)},[F.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":fe.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(te.$slots,"delete-zone",{isDragging:!!f.value,isOver:fe.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.columns,Me=>(e.openBlock(),e.createElementBlock("div",{key:Me.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":be.value==Me.value},Me.class||""]]),style:e.normalizeStyle(pe(Me))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",zm,[e.renderSlot(te.$slots,"column-header",{column:Me,items:ke.value[Me.value]||[]},()=>[e.createElementVNode("span",Pm,e.toDisplayString(Me.title||Me.value),1),e.createElementVNode("span",Om,e.toDisplayString((ke.value[Me.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value[Me.value],Ue=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ue.key},[Ue.type==="indicator"?(e.openBlock(),e.createElementBlock("div",Wm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ue.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:it=>Je(it,Ue.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(it=>lt(it,Ue.item),["stop"])},[e.renderSlot(te.$slots,"handle",{},()=>[Te[0]||(Te[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,Um)):e.createCommentVNode("",!0),e.createElementVNode("div",Xm,[e.renderSlot(te.$slots,"item",{item:Ue.item,column:Me,justDropped:ee.value?.id===Ue.item[_.itemKey],droppedFrom:ee.value?.id===Ue.item[_.itemKey]?ee.value.from:null,droppedTo:ee.value?.id===Ue.item[_.itemKey]?ee.value.to:null},()=>[e.createElementVNode("div",Ym,e.toDisplayString(Ue.item[_.itemKey]),1)])])],42,Zm))],64))),128)),(ke.value[Me.value]||[]).length===0&&be.value!=Me.value?(e.openBlock(),e.createElementBlock("div",jm,[e.renderSlot(te.$slots,"empty",{column:Me},()=>[Te[1]||(Te[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,qm)],6))),128))],6))}}),Qm={name:"DSSConfetti"},Jm=Object.assign(Qm,{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(_){const J=_,B=e.ref(null),$=e.ref(!1);let se=[],F=null,T=null;function X(ne,ee){const ue=[];for(let H=0;H<J.count;H++)ue.push(Qe(ne));return ue}function Qe(ne,ee){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:J.colors[Math.floor(Math.random()*J.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function pe(ne,ee,ue,H){ne.clearRect(0,0,ee,ue);for(const ye of se)ne.save(),ne.globalAlpha=ye.opacity*H,ne.beginPath(),ne.lineWidth=ye.r,ne.strokeStyle=ye.color,ne.moveTo(ye.x+ye.tilt+ye.r/2,ye.y),ne.lineTo(ye.x+ye.tilt,ye.y+ye.tilt+ye.r/2),ne.stroke(),ne.restore()}function f(ne,ee,ue){const H=.3+ue*.7;for(let ye=0;ye<se.length;ye++){const ve=se[ye];ve.tiltAngle+=ve.tiltInc,ve.y+=ve.speed*H,ve.x+=Math.sin(ve.d)*.5*H,ve.tilt=Math.sin(ve.tiltAngle)*15,ue>=.99&&ve.y>ee+20&&(se[ye]=Qe(ne))}}function be(){$.value=!0,e.nextTick(()=>{const ne=B.value;if(!ne)return;const ee=ne.getContext("2d"),ue=ne.parentElement;if(!ue)return;const H=ue.getBoundingClientRect();ne.width=H.width,ne.height=H.height,se=X(ne.width,ne.height);const ye=Date.now(),ve=ye+J.duration,Oe=()=>{const ot=Date.now(),I=ot-ye;if(ot<ve){let qe=1;I>J.fadeStart&&(qe=1-(I-J.fadeStart)/(J.duration-J.fadeStart)),pe(ee,ne.width,ne.height,qe),f(ne.width,ne.height,qe),F=requestAnimationFrame(Oe)}else fe()};Oe()})}function fe(){F&&(cancelAnimationFrame(F),F=null),se=[],$.value=!1}return e.watch(()=>J.trigger,ne=>{ne&&(T&&clearTimeout(T),T=setTimeout(be,J.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{fe(),T&&clearTimeout(T)}),(ne,ee)=>$.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:B,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),e2={class:"dss-filter-global-inner"},t2=["placeholder","value"],l2=["title"],n2={key:0,class:"dss-filter-funnel-badge"},o2={key:1,class:"dss-filter-sortby"},a2=["value"],s2=["value"],r2=["disabled","title"],i2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},u2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d2={class:"dss-filter-panel"},m2={key:0,class:"dss-filter-empty"},p2={class:"dss-filter-row-prefix"},f2={class:"dss-filter-cell"},v2=["onClick"],g2={class:"dss-filter-trigger-text"},h2=["placeholder"],y2={class:"dss-filter-popup-list"},k2=["onClick"],C2={key:0,class:"dss-filter-popup-empty"},b2={key:0,class:"dss-filter-cell"},w2=["onClick"],x2={class:"dss-filter-trigger-text"},E2={class:"dss-filter-popup-list"},S2=["onClick"],V2={key:1,class:"dss-filter-cell dss-filter-cell--value"},N2=["placeholder","onUpdate:modelValue"],B2={key:1,class:"dss-filter-date-wrap"},M2=["placeholder","onUpdate:modelValue"],_2=["placeholder","value","onInput","step"],$2={key:4,class:"dss-filter-between"},L2=["placeholder","value","onInput","step"],T2={class:"dss-filter-between-sep"},A2=["placeholder","value","onInput","step"],D2={key:5,class:"dss-filter-multiselect"},H2=["onClick"],R2={class:"dss-filter-trigger-text"},I2=["placeholder"],F2={class:"dss-filter-popup-list dss-filter-popup-list--check"},z2=["onClick"],P2=["checked"],O2={key:0,class:"dss-filter-popup-empty"},q2=["onClick"],W2={class:"dss-filter-foot"},Z2={class:"dss-filter-cell"},U2=["placeholder"],X2={class:"dss-filter-popup-list"},Y2=["onClick"],j2={key:0,class:"dss-filter-popup-divider"},K2=["onClick"],G2=["placeholder"],Q2={class:"dss-filter-popup-list"},J2=["onClick"],e0={key:0,class:"dss-filter-popup-empty"},t0=["placeholder"],l0={class:"dss-filter-popup-list"},n0=["onClick"],o0={key:0,class:"dss-filter-popup-empty"},a0={name:"DSSFilter"},s0=Object.assign(a0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{expose:J,emit:B}){const{t:$}=Gn.useI18n(),se=_,F=B,T={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...T,...se.options})),Qe={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"}]},pe=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],be=e.ref(""),fe=e.ref([]),ne=e.ref(null),ee=e.ref(!1),ue=e.ref(null),H=e.ref(""),ye=e.ref(null),ve=e.ref(""),Oe=e.ref("asc");let ot=1;function I(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function qe(V,w){const S=w.filter(j=>j!=null&&j!=="NULL");if(S.length===0)return null;if(S.every(j=>Array.isArray(j))){const j=S.flatMap(Ze=>Ze).filter(Ze=>Ze!=null);return j.length===0?null:typeof j.find(Ze=>Ze!=null)=="object"?"arraySelect":"arrayText"}return S.every(j=>typeof j=="boolean")?"boolean":S.every(j=>typeof j=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(j=>typeof j=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(j=>typeof j=="object"&&!Array.isArray(j))?null:"text"}const Ve=e.computed(()=>{if(!se.data?.length)return[];const V=new Set;for(const G of se.data)if(G&&typeof G=="object")for(const Ze of Object.keys(G))V.add(Ze);const w=new Set(se.exclude),S=[];for(const G of V){if(w.has(G))continue;const Ze=se.config[G]||{},vt=se.data.map(et=>et?.[G]),Se=Ze.type||qe(G,vt);if(!Se)continue;const Ne=Ze.filterMode||"contain",At=Ne==="date"?"date":Ne==="string"?"text":Se,Dt={key:G,label:Ze.label||qt(G),type:At,filterMode:Ne};if(Se==="select"){const et=vt.filter(tt=>tt!=null&&tt!=="NULL");Dt.uniqueValues=[...new Set(et)].sort((tt,Lt)=>typeof tt=="number"&&typeof Lt=="number"?tt-Lt:String(tt).localeCompare(String(Lt)))}else if(Se==="range"||Se==="int"){const et=vt.filter(tt=>typeof tt=="number");Dt.min=Math.min(...et),Dt.max=Math.max(...et)}else if(Se==="arraySelect"){const et=Ze.displayKey||I(vt.flatMap(tt=>Array.isArray(tt)?tt:[]));if(Dt.displayKey=et,Array.isArray(Ze.uniqueValues)&&Ze.uniqueValues.length>0)Dt.uniqueValues=Ze.uniqueValues.map(tt=>String(tt));else{const tt=vt.flatMap(Lt=>Array.isArray(Lt)?Lt:[]).filter(Lt=>Lt!=null).map(Lt=>et&&typeof Lt=="object"?Lt[et]:String(Lt)).filter(Lt=>Lt!=null&&Lt!=="");Dt.uniqueValues=[...new Set(tt)].sort((Lt,fl)=>String(Lt).localeCompare(String(fl)))}}S.push(Dt)}const j=se.config._order;return j&&S.sort((G,Ze)=>{const vt=j.indexOf(G.key),Se=j.indexOf(Ze.key);return vt===-1&&Se===-1?0:vt===-1?1:Se===-1?-1:vt-Se}),S}),ke=e.computed(()=>{const V={};for(const w of Ve.value)V[w.key]=w;return V}),pt=e.computed(()=>Array.isArray(se.config.groups)&&se.config.groups.length>0),kt=e.computed(()=>{if(!pt.value)return[];const V=new Set(Ve.value.map(w=>w.key));return se.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),ge=e.computed(()=>{if(!pt.value)return[];const V=new Set(se.config.groups.flatMap(w=>w.keys));return Ve.value.filter(w=>!V.has(w.key))}),ht=e.computed(()=>{if(!ye.value)return[];const V=new Set(ye.value.keys),w=Ve.value.filter(j=>V.has(j.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(j=>j.label.toLowerCase().includes(S))}),ae=e.computed(()=>{if(!H.value)return Ve.value;const V=H.value.toLowerCase();return Ve.value.filter(w=>w.label.toLowerCase().includes(V))}),Xe=e.computed(()=>Ve.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),$e=e.computed(()=>ve.value?Oe.value==="asc"?"Ascending":"Descending":"No sort selected");function rt(V){ne.value===V?Tt():(ne.value=V,H.value="",ye.value=null)}function Tt(){ne.value=null,H.value="",ye.value=null}function tl(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Tt(),ee.value&&ue.value&&!ue.value.contains(V.target)&&(w||(ee.value=!1))}e.onMounted(()=>document.addEventListener("click",tl)),e.onBeforeUnmount(()=>document.removeEventListener("click",tl));function Ft(V){return ke.value[V]?.label||qt(V)}function st(V){return ke.value[V.key]?.filterMode||"contain"}function Vt(V){return $(`filter.operators.${V}`)}function ll(V){const w=ke.value[V.key];return(Qe[w?.type]||Qe.text).map(S=>({...S,label:$(`filter.operators.${S.value}`)}))}function zt(V){return pe.has(V)}function Gt(V){const w=ke.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function Je(V){return Qe[V]?.[0]?.value||"contains"}function lt(V,w){return pe.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function $t(V){return ke.value[V.key]?.uniqueValues||[]}function Xt(V){const w=$t(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(j=>String(j).toLowerCase().includes(S))}function te(V){const w=V.value;return!w||w.length===0?$("filter.select"):w.length<=2?w.join(", "):$("filter.selectedCount",{count:w.length})}function Te(V){const w=ke.value[V],S=w?.filterMode||"contain",j=w?.type||"text",G=S==="string"?"contains":Je(j);fe.value.push(e.reactive({id:ot++,key:V,operator:G,value:lt(j,G)})),Tt()}function Me(V){fe.value=fe.value.filter(w=>w.id!==V)}function Ue(V,w){const j=ke.value[w]?.type||"text";V.key=w,V.operator=Je(j),V.value=lt(j,V.operator),Tt()}function it(V,w){const S=Gt(V);V.operator=w;const j=Gt(V);if(S!==j||pe.has(w)){const G=ke.value[V.key];V.value=lt(G?.type||"text",w)}Tt()}function Ye(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function Ge(V,w,S){const j=S.target.value,G=j===""?null:Number(j);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(G)?null:G}}function ft(V,w){const S=V.value||[],j=S.indexOf(w);V.value=j>=0?S.filter(G=>G!==w):[...S,w]}function Ae(){fe.value=[],be.value="",Tt()}function q(V){be.value=V.target.value}function U(V){ve.value=V.target.value}function Q(){Oe.value=Oe.value==="asc"?"desc":"asc"}const ie=e.computed(()=>{if(!se.data)return[];let V=se.data;if(be.value){const w=be.value.toLowerCase();V=V.filter(S=>{for(const j of Object.keys(S)){const G=S[j];if(typeof G=="string"&&G.toLowerCase().includes(w)||typeof G=="number"&&String(G).includes(w)||Array.isArray(G)&&G.some(Ze=>Ze!=null&&(typeof Ze=="string"?Ze.toLowerCase().includes(w):typeof Ze=="object"?Object.values(Ze).some(vt=>typeof vt=="string"&&vt.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of fe.value){if(!Et(w))continue;const S=ke.value[w.key];S&&(V=V.filter(j=>Ie(j,w,S)))}if(se.showSortBy&&ve.value){const w=ve.value,S=Oe.value==="asc"?1:-1;V=[...V].sort((j,G)=>Re(j?.[w],G?.[w])*S)}return V});function Re(V,w){const S=ct(V),j=ct(w);return S==null&&j==null?0:S==null?1:j==null?-1:typeof S=="number"&&typeof j=="number"?S-j:String(S).localeCompare(String(j),void 0,{numeric:!0,sensitivity:"base"})}function ct(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function Et(V){return pe.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Ie(V,w,S){const j=V?.[w.key],G=w.value,Ze=w.operator;if(Ze==="is_empty")return Qt(j);if(Ze==="is_not_empty")return!Qt(j);const vt=S.type;if(vt==="text"||vt==="arrayText"){const Se=vt==="arrayText"&&Array.isArray(j)?j.filter(Dt=>Dt!=null).map(String).join(" "):j!=null?String(j):"",Ne=String(G).toLowerCase(),At=Se.toLowerCase();switch(Ze){case"contains":return At.includes(Ne);case"not_contains":return!At.includes(Ne);case"equals":return At===Ne;case"not_equals":return At!==Ne;case"starts_with":return At.startsWith(Ne);case"ends_with":return At.endsWith(Ne);default:return!0}}if(vt==="select")switch(Ze){case"is_any_of":return G.includes(j);case"is_none_of":return!G.includes(j);default:return!0}if(vt==="range"||vt==="int"){const Se=typeof j=="number"?j:Number(j);if(typeof Se!="number"||isNaN(Se))return!1;if(Ze==="between"){const At=G?.min!=null?Number(G.min):null,Dt=G?.max!=null?Number(G.max):null,et=At!=null&&!isNaN(At)?At:null,tt=Dt!=null&&!isNaN(Dt)?Dt:null;return(et==null||Se>=et)&&(tt==null||Se<=tt)}const Ne=typeof G=="number"&&!isNaN(G)?G:Number(G);if(Ze==="contains"||Ze==="not_contains"){const At=String(Se),Dt=String(G??"").toLowerCase(),et=At.toLowerCase().includes(Dt);return Ze==="contains"?et:!et}if(typeof Ne!="number"||isNaN(Ne))return!1;switch(Ze){case"eq":return Se===Ne;case"neq":return Se!==Ne;case"gt":return Se>Ne;case"gte":return Se>=Ne;case"lt":return Se<Ne;case"lte":return Se<=Ne;default:return!0}}if(vt==="arraySelect"){if(!Array.isArray(j))return!1;const Se=j.filter(Ne=>Ne!=null).map(Ne=>S.displayKey&&typeof Ne=="object"?Ne[S.displayKey]:String(Ne));switch(Ze){case"contains_any":return Se.some(Ne=>G.includes(Ne));case"contains_all":return G.every(Ne=>Se.includes(Ne));case"not_contains_any":return!Se.some(Ne=>G.includes(Ne));default:return!0}}if(vt==="date"){const Se=Ct(G);if(!Se||isNaN(Se.getTime()))return!1;const Ne=Ct(j);if(!Ne||isNaN(Ne.getTime()))return!1;const At=It(Ne),Dt=It(Se);switch(Ze){case"eq":return At===Dt;case"before":return At<Dt;case"after":return At>Dt;default:return!0}}if(vt==="boolean"){const Se=j===!0||j==="true"||j===1,Ne=j===!1||j==="false"||j===0;switch(Ze){case"is_true":return Se;case"is_false":return Ne;default:return!0}}return!0}function Ct(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function It(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),j=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${j}`}function Qt(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(ie,V=>F("update:modelValue",V),{immediate:!0}),e.watch(()=>se.data,()=>{fe.value=[],be.value="",ee.value=!1,ve.value="",Oe.value="asc",Tt()});function qt(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Ht(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const j of Object.keys(w))S[j]=V(w[j]);return S}return w};return{globalSearch:be.value,rows:fe.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:ke.value[w.key]?.type,defFilterMode:ke.value[w.key]?.filterMode})),filteredCount:ie.value?.length??0}}return J({getDebugState:Ht}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ue},[e.createElementVNode("div",e2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref($)("filter.searchAcrossFields"),value:be.value,onInput:q},null,40,t2),be.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>be.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ee.value||fe.value.length>0,"dss-filter-funnel-btn--with-sort":se.showSortBy}]),onClick:w[1]||(w[1]=S=>ee.value=!ee.value),type:"button",title:ee.value?e.unref($)("filter.closeAdvancedFilter"):e.unref($)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),fe.value.length>0?(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(fe.value.length),1)):e.createCommentVNode("",!0)],10,l2),se.showSortBy?(e.openBlock(),e.createElementBlock("div",o2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:ve.value,onChange:U},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,s2))),128))],40,a2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:Q,disabled:!ve.value,title:$e.value},[ve.value?Oe.value==="asc"?(e.openBlock(),e.createElementBlock("svg",c2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",u2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",i2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,r2)])):e.createCommentVNode("",!0)]),ee.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",d2,[fe.value.length===0?(e.openBlock(),e.createElementBlock("div",m2,e.toDisplayString(e.unref($)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(S,j)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",p2,e.toDisplayString(j===0?e.unref($)("filter.where"):e.unref($)("filter.and")),1),e.createElementVNode("div",f2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>rt(`${S.id}:field`),["stop"])},[e.createElementVNode("span",g2,e.toDisplayString(Ft(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,v2),ne.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=G=>H.value=G),placeholder:e.unref($)("filter.searchAttributes")},null,8,h2),[[e.vModelText,H.value]]),e.createElementVNode("ul",y2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,G=>(e.openBlock(),e.createElementBlock("li",{key:G.key,class:"dss-filter-popup-item",onClick:Ze=>Ue(S,G.key)},e.toDisplayString(G.label),9,k2))),128)),ae.value.length===0?(e.openBlock(),e.createElementBlock("li",C2,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),st(S)==="contain"||st(S)==="date"?(e.openBlock(),e.createElementBlock("div",b2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>rt(`${S.id}:op`),["stop"])},[e.createElementVNode("span",x2,e.toDisplayString(Vt(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,w2),ne.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",E2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ll(S),G=>(e.openBlock(),e.createElementBlock("li",{key:G.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===G.value}]),onClick:Ze=>it(S,G.value)},e.toDisplayString(G.label),11,S2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",V2,[st(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":G=>S.value=G},null,8,N2)),[[e.vModelText,S.value]]):st(S)==="date"?(e.openBlock(),e.createElementBlock("div",B2,[e.createVNode(Wo,{mode:"single",modelValue:S.value,"onUpdate:modelValue":G=>S.value=G},null,8,["modelValue","onUpdate:modelValue"])])):Gt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),"onUpdate:modelValue":G=>S.value=G},null,8,M2)),[[e.vModelText,S.value]]):Gt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.enterValue"),value:S.value,onInput:G=>Ye(S,G),step:ke.value[S.key]?.type==="int"?1:void 0},null,40,_2)):Gt(S)==="between"?(e.openBlock(),e.createElementBlock("div",$2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.min"),value:S.value?.min,onInput:G=>Ge(S,"min",G),step:ke.value[S.key]?.type==="int"?1:void 0},null,40,L2),e.createElementVNode("span",T2,e.toDisplayString(e.unref($)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref($)("filter.max"),value:S.value?.max,onInput:G=>Ge(S,"max",G),step:ke.value[S.key]?.type==="int"?1:void 0},null,40,A2)])):Gt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",D2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(G=>rt(`${S.id}:val`),["stop"])},[e.createElementVNode("span",R2,e.toDisplayString(te(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,H2),ne.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[$t(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=G=>H.value=G),placeholder:e.unref($)("filter.search")},null,8,I2)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",F2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt(S),G=>(e.openBlock(),e.createElementBlock("li",{key:G,class:"dss-filter-popup-item",onClick:Ze=>ft(S,G)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(G),tabindex:"-1"},null,8,P2),e.createElementVNode("span",null,e.toDisplayString(G),1)],8,z2))),128)),Xt(S).length===0?(e.openBlock(),e.createElementBlock("li",O2,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:G=>Me(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,q2)]))),128)),e.createElementVNode("div",W2,[e.createElementVNode("div",Z2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>rt("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:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[pt.value&&!ye.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,U2),[[e.vModelText,H.value]]),e.createElementVNode("ul",X2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:j=>ye.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,Y2))),128)),ge.value.length>0?(e.openBlock(),e.createElementBlock("li",j2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,K2))),128))])],64)):ye.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>ye.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(ye.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,G2),[[e.vModelText,H.value]]),e.createElementVNode("ul",Q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,J2))),128)),ht.value.length===0?(e.openBlock(),e.createElementBlock("li",e0,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":w[11]||(w[11]=S=>H.value=S),placeholder:e.unref($)("filter.searchAttributes")},null,8,t0),[[e.vModelText,H.value]]),e.createElementVNode("ul",l0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:j=>Te(S.key)},e.toDisplayString(S.label),9,n0))),128)),ae.value.length===0?(e.openBlock(),e.createElementBlock("li",o0,e.toDisplayString(e.unref($)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),fe.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ae},e.toDisplayString(e.unref($)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),r0={class:"dss-pill-field__pills"},i0=["disabled"],c0={class:"dss-pill-field__pill-text"},u0={key:0,class:"dss-pill-field__pill-actions"},d0=["onClick"],m0=["onClick"],p0=["placeholder","disabled"],f0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(_,{emit:J}){const B=_,$=J,se=e.ref(""),F=e.ref([...B.modelValue]),T=e.ref(null);let X=null;const Qe=e.ref(null),pe=e.ref(""),f=e.ref(null),be=e.computed(()=>new Set(F.value.map(I=>I.trim()).filter(Boolean)));function fe(I){T.value=I,X&&clearTimeout(X),X=setTimeout(()=>{T.value=null,X=null},900)}function ne(I){const qe=I.trim();return qe?be.value.has(qe)?(fe(qe),!1):(F.value=[...F.value,qe],$("update:modelValue",[...F.value]),!0):!1}function ee(I){const qe=I.split(/\r?\n/g).map(kt=>kt.trim()).filter(Boolean);if(!qe.length)return;const Ve=new Set(F.value.map(kt=>kt.trim()).filter(Boolean)),ke=[...F.value];let pt=null;for(const kt of qe){if(Ve.has(kt)){pt??=kt;continue}Ve.add(kt),ke.push(kt)}ke.length!==F.value.length&&(F.value=ke,$("update:modelValue",[...F.value])),pt&&fe(pt)}function ue(I){B.disabled||(Qe.value===I&&(Qe.value=null,pe.value=""),F.value=F.value.filter((qe,Ve)=>Ve!==I),$("update:modelValue",[...F.value]))}async function H(I){B.disabled||(Qe.value=I,pe.value=F.value[I]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function ye(){Qe.value=null,pe.value=""}function ve(){if(B.disabled||Qe.value===null)return;const I=Qe.value,qe=F.value[I]??"",Ve=pe.value.trim();if(Qe.value=null,pe.value="",Ve!==qe&&be.value.has(Ve)){fe(Ve);return}if(!Ve){F.value=F.value.filter((pt,kt)=>kt!==I),$("update:modelValue",[...F.value]);return}const ke=F.value.map((pt,kt)=>kt===I?Ve:pt);F.value=ke,$("update:modelValue",[...F.value])}function Oe(I){I.preventDefault(),!B.disabled&&(ne(se.value),se.value="")}function ot(I){if(B.disabled)return;const qe=I.clipboardData?.getData("text")??"";!qe.includes(`
|
|
118
|
+
`)&&!qe.includes("\r")||(I.preventDefault(),ee(qe),se.value="")}return e.watch(()=>B.modelValue,I=>{F.value=Array.isArray(I)?[...I]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(I,qe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":I.disabled}])},[e.createElementVNode("div",r0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(Ve,ke)=>(e.openBlock(),e.createElementBlock("span",{key:Ve,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":T.value===Ve}])},[Qe.value===ke?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":qe[0]||(qe[0]=pt=>pe.value=pt),class:"dss-pill-field__pill-edit",type:"text",disabled:I.disabled,onKeydown:[e.withKeys(ve,["enter"]),e.withKeys(ye,["esc"])],onBlur:ve},null,40,i0)),[[e.vModelText,pe.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",c0,e.toDisplayString(Ve),1),I.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",u0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:pt=>H(ke)},[...qe[2]||(qe[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,d0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:pt=>ue(ke)}," × ",8,m0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":qe[1]||(qe[1]=Ve=>se.value=Ve),class:"dss-pill-field__input",type:"text",placeholder:F.value.length?"":I.placeholder,disabled:I.disabled,onPaste:ot,onKeydown:e.withKeys(Oe,["enter"])},null,40,p0),[[e.vModelText,se.value]])])],2))}}),v0={class:"dss-step-bar__header"},g0={class:"dss-step-bar__label"},h0={key:0,class:"dss-step-bar__counter"},y0={class:"dss-step-bar__track-wrapper"},k0=["aria-valuemax","aria-valuenow","aria-label"],C0=["onMouseenter"],b0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:_=>["input","desc","asc"].includes(_)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1}},setup(_){const J=_,B=e.computed(()=>Math.max(1,Number(J.steps)||1)),$=e.computed(()=>Math.min(B.value,Math.max(0,Number(J.currentStep)||0))),se=e.computed(()=>Array.isArray(J.segments)&&J.segments.length>0),F=e.computed(()=>{if(!se.value)return[];const ae=J.segments.map((Xe,$e)=>{const rt=Number(Xe?.value);return{label:Xe?.label||`Step ${$e+1}`,value:Number.isFinite(rt)&&rt>0?rt:0,color:Xe?.color||J.activeColor}});return J.segmentOrder==="desc"?[...ae].sort((Xe,$e)=>$e.value-Xe.value):J.segmentOrder==="asc"?[...ae].sort((Xe,$e)=>Xe.value-$e.value):ae}),T=e.computed(()=>se.value?F.value.reduce((ae,Xe)=>ae+Xe.value,0):$.value),X=e.computed(()=>se.value?Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0?Number(J.totalValue):Math.max(1,T.value):B.value),Qe=e.computed(()=>se.value&&Number.isFinite(Number(J.totalValue))&&Number(J.totalValue)>0),pe=e.computed(()=>Qe.value?Math.max(0,Number(J.totalValue)-T.value):0),f=e.computed(()=>typeof J.remainderLabel=="string"&&J.remainderLabel.trim().length>0),be=e.computed(()=>pe.value>0),fe=e.computed(()=>F.value.reduce((ae,Xe)=>Math.max(ae,Number(Xe.value)||0),0)),ne=e.computed(()=>F.value.filter(ae=>ae.value>0).map(ae=>`${ae.label}: ${Ve(ae.value)}`).join(" | ")),ee=e.computed(()=>se.value?Qe.value?F.value.filter(ae=>ae.value>0):F.value:[]),ue=e.computed(()=>{if(!J.counterAsPercentage)return`${T.value} / ${X.value}`;const ae=Number(X.value);if(!Number.isFinite(ae)||ae<=0)return"0%";const Xe=Math.round(Number(T.value)/ae*100);return`${Math.min(Math.max(Xe,0),100)}%`}),H=e.computed(()=>T.value),ye=e.computed(()=>X.value),ve=e.reactive({visible:!1,x:0,content:""}),Oe=e.computed(()=>({left:`${ve.x}px`})),ot=ae=>{const Xe=ae?.parentElement;return Xe?Xe.offsetLeft+Xe.offsetWidth/2:0},I=ae=>{if(Qe.value){const rt=Math.max(0,Number(ae.value)||0);return{flex:`${rt} 0 0`,minWidth:rt>0?"6px":"0",backgroundColor:ae.color}}const Xe=T.value;return{flex:`${ae.value>0?ae.value:Xe>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:ae.color}},qe=ae=>Number(ae?.value||0)>0&&Number(ae?.value||0)===fe.value,Ve=ae=>`${ae}${J.valueLabel}`,ke=e.computed(()=>({flex:`${pe.value} 0 0`,minWidth:pe.value>0?"6px":"0",backgroundColor:J.inactiveColor})),pt=(ae,Xe)=>{if(!ae||!Xe?.currentTarget)return;const $e=Xe.currentTarget;if(J.remainderTooltipSummary){ve.x=ot($e),ve.content=ne.value,ve.visible=!!ve.content;return}ve.x=$e.offsetLeft+$e.offsetWidth/2,ve.content=`${ae.label}: ${Ve(ae.value)}`,ve.visible=!0},kt=ae=>{if(!pe.value||!ae?.currentTarget)return;const Xe=ae.currentTarget;if(J.remainderTooltipSummary){ve.x=ot(Xe),ve.content=ne.value,ve.visible=!!ve.content;return}ve.x=Xe.offsetLeft+Xe.offsetWidth/2,f.value&&(ve.content=`${J.remainderLabel}: ${Ve(pe.value)}`,ve.visible=!0)},ge=()=>{ve.visible=!1},ht=e.computed(()=>({"--dss-step-bar-label-color":J.labelColor??void 0,"--dss-step-bar-counter-color":J.counterColor??void 0,"--dss-step-bar-active-color":J.activeColor,"--dss-step-bar-inactive-color":J.inactiveColor}));return(ae,Xe)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(ht.value)},[e.createElementVNode("div",v0,[e.createElementVNode("span",g0,[e.renderSlot(ae.$slots,"label",{label:_.label},()=>[e.createTextVNode(e.toDisplayString(_.label),1)])]),_.showCounter?(e.openBlock(),e.createElementBlock("span",h0,[e.renderSlot(ae.$slots,"counter",{counterDisplay:ue.value},()=>[e.createTextVNode(e.toDisplayString(ue.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",y0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":ye.value,"aria-valuenow":H.value,"aria-label":_.label},[se.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ee.value,($e,rt)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${rt}-${$e.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":qe($e)}]),style:e.normalizeStyle(I($e)),onMouseenter:Tt=>pt($e,Tt),onMouseleave:ge},null,46,C0))),128)),be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(ke.value),onMouseenter:Xe[0]||(Xe[0]=$e=>kt($e)),onMouseleave:ge},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(B.value,$e=>(e.openBlock(),e.createElementBlock("div",{key:$e,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":$e<=$.value}])},null,2))),128))],8,k0),ve.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Oe.value)},e.toDisplayString(ve.content),5)):e.createCommentVNode("",!0)])],4))}},w0={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"}},x0={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"},E0={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"}},S0={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"}},V0={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"}},Qn={chart:w0,table:x0,filter:E0,datepicker:S0,textEditor:V0},N0={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"}},B0={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"},M0={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"}},_0={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"}},$0={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"}},Jn={chart:N0,table:B0,filter:M0,datepicker:_0,textEditor:$0},L0={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"}},T0={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"},A0={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"}},D0={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"}},H0={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"}},eo={chart:L0,table:T0,filter:A0,datepicker:D0,textEditor:H0},Bo={en:Qn,fr:Jn,nl:eo};function Ko(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Bo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Bo[B])})}const Mo={en:{textEditor:Qn.textEditor},fr:{textEditor:Jn.textEditor},nl:{textEditor:eo.textEditor}};function Go(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Mo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Mo[B])})}const _o={en:{table:Qn.table},fr:{table:Jn.table},nl:{table:eo.table}};function Qo(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(_o).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,_o[B])})}const $o={en:{datepicker:Qn.datepicker},fr:{datepicker:Jn.datepicker},nl:{datepicker:eo.datepicker}};function Jo(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys($o).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,$o[B])})}const Lo={en:{filter:Qn.filter},fr:{filter:Jn.filter},nl:{filter:eo.filter}};function ea(_){if(!_||!_.global)return;const J=_.global.availableLocales||[];Object.keys(Lo).forEach(B=>{J.includes(B)&&_.global.mergeLocaleMessage(B,Lo[B])})}const R0={chart:Bo,textEditor:Mo,table:_o,datepicker:$o,filter:Lo};function I0(_){!_||!_.global||(Ko(_),Go(_),Qo(_),Jo(_),ea(_))}const F0={en:{...Qn},fr:{...Jn},nl:{...eo}};Gn.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:F0});exports.DSSChart=Ii;exports.DSSChartMessages=Bo;exports.DSSColorPicker=Sm;exports.DSSConfetti=Jm;exports.DSSDatepicker=Wo;exports.DSSDatepickerMessages=$o;exports.DSSDnd=Gm;exports.DSSFilter=s0;exports.DSSFilterMessages=Lo;exports.DSSLoader=Im;exports.DSSMessages=R0;exports.DSSModal=qo;exports.DSSPillField=f0;exports.DSSSkeleton=Fm;exports.DSSStepBar=b0;exports.DSSTable=su;exports.DSSTableMessages=_o;exports.DSSTextEditor=cm;exports.DSSTextEditorMessages=Mo;exports.addDSSChartTranslations=Ko;exports.addDSSDatepickerTranslations=Jo;exports.addDSSFilterTranslations=ea;exports.addDSSTableTranslations=Qo;exports.addDSSTextEditorTranslations=Go;exports.addDSSTranslations=I0;
|