dsp-semactic 0.6.25 → 0.6.26
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/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +25 -25
- package/dist/index.es.js +2907 -2897
- 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"),Jl=require("vue-i18n"),na={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},la=["value"],oa=["placeholder","value","disabled"],aa=["placeholder","value"],sa={key:0,class:"dss-datepicker__double-wrap"},ra={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ia=["onClick"],ca={class:"dss-datepicker__double-calendars"},ua={class:"dss-datepicker__double-calendar"},da={class:"dss-datepicker__calendar-header"},ma=["aria-label"],pa={class:"dss-datepicker__month-year-row"},va=["aria-label"],fa={class:"dss-datepicker__weekdays"},ga={class:"dss-datepicker__grid"},ha=["disabled","onClick","onMouseenter"],ya={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ca={class:"dss-datepicker__double-calendar"},ka={class:"dss-datepicker__calendar-header"},ba=["aria-label"],wa={class:"dss-datepicker__month-year-row"},xa=["aria-label"],Ea={class:"dss-datepicker__weekdays"},Va={class:"dss-datepicker__grid"},Na=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ba={class:"dss-datepicker__calendar-header"},Ma=["aria-label"],_a={class:"dss-datepicker__month-year-row"},$a=["aria-label"],Ta={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ha=["disabled","onClick","onMouseenter"],Aa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Da={class:"dss-datepicker__calendar-header"},Ra={class:"dss-datepicker__month-year-row"},Fa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ia={class:"dss-datepicker__months-grid"},za=["onClick"],Pa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Oa={class:"dss-datepicker__month-year"},Za={class:"dss-datepicker__years-grid"},Wa=["data-year","onClick"],Uo=27,Po={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:R=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(R)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(R,{emit:be}){const I=R,A=be,{t:Se,locale:b}=Jl.useI18n(),Be=e.ref(!1),ce=e.ref("days"),pt=new Date,p=e.computed(()=>I.minDate instanceof Date?I.minDate:pt),me=e.ref(p.value.getMonth()),Ce=e.ref(p.value.getFullYear()),pe=e.ref(p.value.getMonth()),oe=e.ref(p.value.getFullYear()),ee=e.ref(p.value.getMonth()),le=e.ref(p.value.getFullYear()),L=e.ref("start"),Fe=e.ref(null),Re=e.ref(null);function Oe(){const D=p.value,q=D.getMonth(),F=D.getFullYear(),se=q===11?0:q+1,Ne=q===11?F+1:F;return{left:{month:q,year:F},right:{month:se,year:Ne}}}const ut=e.ref(null),O=e.ref(null),Ze=e.ref(null),xt=e.ref(null),Je=e.ref(null),Ht=e.ref(null),$e=new Date().getFullYear(),We=e.computed(()=>["single","singleFromAvailable"].includes(I.mode)),Et=e.computed(()=>["range","rangeFromAvailable"].includes(I.mode)),Ie=e.computed(()=>{if(I.mode!=="single"&&I.mode!=="singleFromAvailable")return null;const D=I.modelValue;return D instanceof Date?D:null}),$t=e.computed(()=>{if(!Et.value)return{start:null,end:null};const D=I.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function at(D){if(!D||!(D instanceof Date))return"";const q=D.getDate(),F=D.getMonth()+1,se=D.getFullYear(),Ne=tt=>String(tt).padStart(2,"0");return`${Ne(q)}/${Ne(F)}/${se}`}const Vt=e.computed(()=>at(Ie.value)),an=e.computed(()=>{const{start:D,end:q}=$t.value;if(!D&&!q)return"";const F=!q||D&&D<=q?D:q,se=!D||q&&q>=D?q:D;return U(F,se)?at(F):`${at(F)} - ${at(se)}`}),Mt=e.computed(()=>{if(I.mode!=="readonly")return"—";const D=I.modelValue;if(D instanceof Date)return at(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const q=D.start instanceof Date?D.start:null,F=D.end instanceof Date?D.end:null;if(!q&&!F)return"—";const se=!F||q&&q<=F?q:F,Ne=!q||F&&F>=q?F:q;return U(se,Ne)?at(se):`${at(se)} - ${at(Ne)}`}return"—"});e.computed(()=>{const D=new Date(Ce.value,me.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const nt=e.computed(()=>Re.value==="left"?pe.value:Re.value==="right"?ee.value:me.value),ze=e.computed(()=>Re.value==="left"?oe.value:Re.value==="right"?le.value:Ce.value),At=e.computed(()=>{const D=new Date(Ce.value,me.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),Tt=e.computed(()=>{const D=new Date(ze.value,nt.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),sn=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{month:"short"});return Array.from({length:12},(q,F)=>D.format(new Date(2024,F,1)))}),vt=e.computed(()=>{const q=(Re.value?ze.value:Ce.value)-Math.floor(Uo/2);return Array.from({length:Uo},(F,se)=>q+se)}),Bt=e.computed(()=>{const D=vt.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),Ct=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{weekday:"short"}),q=new Date(2024,0,1),F=[];for(let se=0;se<7;se++){const Ne=new Date(q);Ne.setDate(q.getDate()+se),F.push(D.format(Ne).slice(0,2))}return F});function _t(D,q){const F=new Date(D,q,1),se=new Date(D,q+1,0),Ne=F.getDay(),tt=se.getDate(),ot=[];for(let qe=0;qe<Ne;qe++)ot.push(null);for(let qe=1;qe<=tt;qe++)ot.push(new Date(D,q,qe));return ot}const ne=e.computed(()=>_t(Ce.value,me.value)),Ve=e.computed(()=>_t(oe.value,pe.value)),he=e.computed(()=>_t(le.value,ee.value));e.computed(()=>{const D=new Date(oe.value,pe.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(le.value,ee.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const ye=e.computed(()=>{const D=new Date(oe.value,pe.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),lt=e.computed(()=>{const D=new Date(le.value,ee.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),kt=e.computed(()=>I.availableDates&&I.availableDates.length>0),Le=e.computed(()=>kt.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"}]),dt=e.ref({top:0,left:0});function ve(){if(!xt.value||!Be.value)return;const D=xt.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,F=window.innerHeight||document.documentElement.clientHeight;let se=D.left,Ne=D.bottom+4;const tt=Je.value;if(tt){const ot=tt.offsetWidth,qe=tt.offsetHeight;if(se+ot>q-8&&(se=D.right-ot,se<8&&(se=8)),Ne+qe>F-8){const st=D.top-4-qe;st>=8?Ne=st:Ne=Math.max(8,F-qe-8)}}dt.value={top:Ne,left:se}}const je=e.computed(()=>!xt.value||!Be.value?{}:{position:"fixed",left:`${dt.value.left}px`,top:`${dt.value.top}px`,zIndex:1002});function U(D,q){return!D||!q?!1:D.getFullYear()===q.getFullYear()&&D.getMonth()===q.getMonth()&&D.getDate()===q.getDate()}function W(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function K(D){return!I.availableDates||!I.availableDates.length?!0:I.availableDates.some(q=>q instanceof Date&&U(q,D))}function ae(D){const q=W(D);return!(I.minDate instanceof Date&&q<W(I.minDate)||I.maxDate instanceof Date&&q>W(I.maxDate))}function x(D){return!I.exceptDates||!I.exceptDates.length?!1:I.exceptDates.some(q=>q instanceof Date&&U(q,D))}function k(D){return x(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(I.mode)?K(D):ae(D)}function V(D){const q=Ie.value,F=$t.value,se=W(D),Ne=Et.value&&F.start&&F.end&&se>W(F.start)&&se<W(F.end),tt=Et.value&&F.start&&U(D,F.start),ot=Et.value&&F.end&&U(D,F.end),qe=tt&&ot,st=We.value&&q&&U(D,q)||tt||ot;let mn=!1;if(Et.value&&F.start&&!F.end&&Fe.value){const en=W(F.start),pn=W(Fe.value),Fn=Math.min(en,pn),hn=Math.max(en,pn);mn=se>Fn&&se<hn}return{"dss-datepicker__day--selected":st&&!qe,"dss-datepicker__day--range-start":tt&&!qe,"dss-datepicker__day--range-end":ot&&!qe,"dss-datepicker__day--range-single":qe,"dss-datepicker__day--in-range":Ne&&!tt&&!ot,"dss-datepicker__day--in-range-preview":mn&&!tt&&!ot&&!Ne,"dss-datepicker__day--disabled":!k(D)}}function P(D){if(!Et.value)return;const q=$t.value;if(!q.start||q.end){Fe.value=null;return}if(!k(D)){Fe.value=null;return}Fe.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function X(){Fe.value=null}function He(){if(!I.doubleCalendar||!Et.value)return;const D=$t.value,{start:q,end:F}=D;if(q&&F){const tt=q<=F?q:F,ot=q<=F?F:q,qe=tt.getMonth(),st=tt.getFullYear(),mn=ot.getMonth(),en=ot.getFullYear();if(qe!==mn||st!==en){const pn=pe.value===qe&&oe.value===st,Fn=ee.value===mn&&le.value===en;if(pn&&Fn)return;pe.value=qe,oe.value=st,ee.value=mn,le.value=en}else{const pn=qe===0?11:qe-1,Fn=qe===0?st-1:st;pe.value===pn&&oe.value===Fn&&ee.value===qe&&le.value===st||(pe.value=qe,oe.value=st,qe===11?(ee.value=0,le.value=st+1):(ee.value=qe+1,le.value=st))}return}const se=q||F;if(se){const tt=se.getMonth(),ot=se.getFullYear(),qe=pe.value===tt&&oe.value===ot,st=ee.value===tt&&le.value===ot;if(qe||st)return;pe.value=tt,oe.value=ot,tt===11?(ee.value=0,le.value=ot+1):(ee.value=tt+1,le.value=ot);return}const Ne=Oe();pe.value=Ne.left.month,oe.value=Ne.left.year,ee.value=Ne.right.month,le.value=Ne.right.year}function Xe(D="start"){if(I.mode==="readonly")return;L.value=D;const q=Ie.value,F=$t.value;if(We.value&&q)me.value=q.getMonth(),Ce.value=q.getFullYear();else if(Et.value)if(I.doubleCalendar)He();else{const se=D==="start"&&F.start?F.start:F.end||F.start;se&&(me.value=se.getMonth(),Ce.value=se.getFullYear())}xt.value=We.value?ut.value?.closest(".dss-datepicker__input-wrap"):O.value,ce.value="days",Re.value=null,Be.value=!0,e.nextTick(()=>{ve()})}function Me(){ce.value="days",Re.value=null,Fe.value=null,Be.value=!1}function te(D,q){Re.value=D,ce.value=q}function et(){ce.value="days",Re.value=null}function Ke(D){const q=new Date,F=q.getFullYear(),se=q.getMonth(),Ne=q.getDate();let tt,ot;if(kt.value){const qe=[...I.availableDates].filter(st=>st instanceof Date).map(st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()));if(qe.sort((st,mn)=>st.getTime()-mn.getTime()),qe.length===0)return;if(D==="all")tt=qe[0],ot=qe[qe.length-1];else{const st=parseInt(D.replace("last",""),10);if(st<2||st>5)return;const mn=qe.slice(-st);tt=mn[0],ot=mn[mn.length-1]}}else{const qe=new Date(F,se,Ne);switch(D){case"today":tt=qe,ot=qe;break;case"lastWeek":tt=new Date(F,se,Ne-6),ot=qe;break;case"last15Days":tt=new Date(F,se,Ne-14),ot=qe;break;case"last30Days":tt=new Date(F,se,Ne-29),ot=qe;break;case"thisMonth":tt=new Date(F,se,1),ot=qe;break;case"last3Months":tt=new Date(F,se-3,1),ot=new Date(F,se,0);break;case"last6Months":tt=new Date(F,se-6,1),ot=new Date(F,se,0);break;case"last12Months":tt=new Date(F,se-12,1),ot=new Date(F,se,0);break;case"lastYear":tt=new Date(F-1,0,1),ot=new Date(F-1,11,31);break;default:return}}A("update:modelValue",{start:tt,end:ot}),He()}function yt(D){Re.value==="left"?pe.value=D:Re.value==="right"?ee.value=D:me.value=D,et()}function ht(D){Re.value==="left"?oe.value=D:Re.value==="right"?le.value=D:Ce.value=D,et()}function Ye(){me.value===0?(me.value=11,Ce.value--):me.value--}function Cn(){me.value===11?(me.value=0,Ce.value++):me.value++}function Yn(){pe.value===0?(pe.value=11,oe.value--):pe.value--}function Rn(){pe.value===11?(pe.value=0,oe.value++):pe.value++}function Dt(){ee.value===0?(ee.value=11,le.value--):ee.value--}function Zn(){ee.value===11?(ee.value=0,le.value++):ee.value++}function un(D){if(!k(D))return;const q=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(We.value){A("update:modelValue",q),Me();return}const F=$t.value;if(!F.start&&!F.end){A("update:modelValue",{start:q,end:null}),L.value="end";return}if(F.start&&F.end){A("update:modelValue",{start:q,end:null}),L.value="end";return}if(L.value==="start"){let se=q,Ne=F.end;se&&Ne&&se>Ne&&([se,Ne]=[Ne,se]),A("update:modelValue",{start:se||Ne,end:Ne||se}),L.value="end"}else{let se=F.start,Ne=q;se&&Ne&&Ne<se&&([se,Ne]=[Ne,se]),A("update:modelValue",{start:se||Ne,end:Ne||se}),L.value="start"}}e.watch($t,()=>{I.doubleCalendar&&Et.value&&Be.value&&He()},{deep:!0});let Bn=null,dn=null,Mn=null;function Nn(){Bn&&(document.removeEventListener("keydown",Bn),Bn=null),dn&&(window.removeEventListener("resize",dn),dn=null),Mn&&(window.removeEventListener("scroll",Mn,!0),Mn=null)}return e.watch(ce,D=>{D==="years"&&e.nextTick(()=>{Ht.value?.querySelector(`[data-year="${ze.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Be,D=>{Nn(),D&&(Bn=q=>{q.key==="Escape"&&(ce.value==="years"||ce.value==="months"?et():Me())},dn=()=>{ve()},Mn=()=>{ve()},document.addEventListener("keydown",Bn),window.addEventListener("resize",dn),window.addEventListener("scroll",Mn,!0))}),e.onBeforeUnmount(()=>{Nn()}),(D,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":R.mode==="readonly"}])},[R.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",na,[q[10]||(q[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:Mt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,la)])):We.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=F=>Xe("start"))},[q[11]||(q[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:ut,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Se)("datepicker.selectDate"),value:Vt.value,readonly:"",disabled:R.mode==="readonly"},null,8,oa)])):Et.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:O,onClick:q[1]||(q[1]=F=>Xe("start"))},[q[12]||(q[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:Ze,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Se)("datepicker.selectRange"),value:an.value,readonly:""},null,8,aa)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Me,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Je,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":R.doubleCalendar&&Et.value&&ce.value==="days","dss-datepicker__dropdown--quick-select":R.doubleCalendar&&Et.value&&ce.value==="days"&&R.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(je.value)},[ce.value==="days"&&R.doubleCalendar&&Et.value?(e.openBlock(),e.createElementBlock("div",sa,[R.quickSelect?(e.openBlock(),e.createElementBlock("nav",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:se=>Ke(F.id)},e.toDisplayString(e.unref(Se)(F.labelKey)),9,ia))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ca,[e.createElementVNode("div",ua,[e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:Yn}," ‹ ",8,ma),e.createElementVNode("div",pa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=F=>te("left","months"))},e.toDisplayString(ye.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=F=>te("left","years"))},e.toDisplayString(oe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Rn}," › ",8,va)]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,ha)):(e.openBlock(),e.createElementBlock("span",ya))],64))),128))])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:Dt}," ‹ ",8,ba),e.createElementVNode("div",wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=F=>te("right","months"))},e.toDisplayString(lt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=F=>te("right","years"))},e.toDisplayString(le.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Zn}," › ",8,xa)]),e.createElementVNode("div",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,Na)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])])])])):ce.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:Ye}," ‹ ",8,Ma),e.createElementVNode("div",_a,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=F=>ce.value="months")},e.toDisplayString(At.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=F=>ce.value="years")},e.toDisplayString(Ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Cn}," › ",8,$a)]),e.createElementVNode("div",Ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ne.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,Ha)):(e.openBlock(),e.createElementBlock("span",Aa))],64))),128))])],64)):ce.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Da,[e.createElementVNode("div",Ra,[e.createElementVNode("span",Fa,e.toDisplayString(Tt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=F=>ce.value="years")},e.toDisplayString(ze.value),1)])]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.value,(F,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===nt.value}]),onClick:Ne=>yt(se)},e.toDisplayString(F),11,za))),128))])],64)):ce.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Pa,[e.createElementVNode("span",Oa,e.toDisplayString(Bt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Ht},[e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":F===ze.value,"dss-datepicker__year-cell--current":F===e.unref($e)}]),"data-year":F,onClick:se=>ht(F)},e.toDisplayString(F),11,Wa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},qa=["data-chart-type"],Ua={class:"dss-chart-header-titles"},Xa={key:0,class:"dss-chart-title"},Ya={key:1,class:"dss-chart-subtitle"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["onClick","onMouseenter"],Qa={class:"dss-legend-text"},Ja=["title"],es=["src"],ts={class:"dss-chart-area-wrapper"},ns={key:0,class:"dss-chart-z-axis-label"},ls=["width","height","data-smooth","data-animated"],os=["id"],as=["y","width","height"],ss=["id"],rs=["d"],is=["id"],cs=["d"],us={key:0},ds=["clip-path"],ms=["x1","x2","y1","y2"],ps={class:"dss-axes"},vs=["x1","x2","y1","y2"],fs=["x1","x2","y1","y2"],gs={class:"dss-axis-labels"},hs=["x","y"],ys=["x","y"],Cs=["x","y"],ks=["y","transform"],bs={key:1,class:"dss-flag-markers"},ws=["clip-path"],xs=["x1","x2","y1","y2","onMouseover"],Es=["x1","x2","y1","y2","onMouseover"],Vs=["x1","x2","y1","y2","onMouseover"],Ns=["cx","cy","onMouseover"],Ss=["cx","cy","fill","onMouseover"],Bs=["x","y"],Ms=["clip-path"],_s={key:0},$s=["d","onMouseover"],Ts=["x","y","width","height","fill","onMouseover"],Ls={class:"dss-line-chart"},Hs=["d","stroke","stroke-width"],As=["d","stroke","stroke-width","opacity"],Ds=["cx","cy","r","fill","onMouseover"],Rs={key:1},Fs=["d","stroke","stroke-width"],Is=["d","stroke","stroke-width"],zs=["d","stroke","stroke-width","opacity"],Ps=["cx","cy","r","fill","onMouseover"],Os={key:2},Zs=["id"],Ws=["x","y","width","height"],qs=["d","fill","fill-opacity","mask"],Us=["d","stroke","stroke-width"],Xs=["d","fill","onMouseover"],Ys=["x","y","width","height","onMouseover"],js=["clip-path"],Ks=["x1","x2","y1","y2","stroke"],Gs=["cx","cy","r","fill"],Qs={key:1,class:"dss-bubble-chart"},Js={key:0,class:"dss-bubble-group"},er=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],tr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],nr=["transform"],lr=["cx","cy","r"],or=["data-chart-type","clip-path"],ar=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],sr={key:1,class:"dss-radial-segment-data-labels"},rr=["x","y"],ir=["x","y","font-size","fill"],cr=["x1","y1","x2","y2","stroke"],ur=["x1","y1","x2","y2","stroke"],dr=["x","y","text-anchor","font-size"],mr=["transform"],pr={key:0,class:"dss-spider-grid"},vr=["cx","cy","r"],fr={class:"dss-spider-grid-labels"},gr=["x","y"],hr=["x","y"],yr=["x1","x2","y1","y2"],Cr={class:"dss-spider-labels"},kr=["x","y","text-anchor","dominant-baseline"],br=["points","fill","fill-opacity","stroke","stroke-width"],wr=["cx","cy","r","fill","onMouseover"],xr={class:"dss-chart-logos"},Er=["cx","cy","r","fill"],Vr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Nr=["onClick","onMouseenter"],Sr=["src"],Br={class:"dss-marker-tooltip-category"},Mr={key:0,class:"dss-marker-tooltip-description"},_r={key:0,class:"dss-tooltip-section"},$r={key:0,class:"dss-tooltip-title"},Tr={class:"dss-tooltip-series-name"},Lr={class:"dss-tooltip-series-value"},Hr={key:1,class:"dss-tooltip-section"},Ar={key:0,class:"dss-tooltip-title"},Dr={class:"dss-bubble-tooltip-data"},Rr={key:2,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-title"},Ir={class:"dss-tooltip-value"},zr={key:0,class:"dss-tooltip-section"},Pr={class:"dss-tooltip-section-title"},Or={class:"dss-tooltip-group-header"},Zr={class:"dss-tooltip-item-content"},Wr={class:"dss-tooltip-item-text"},qr={key:1,class:"dss-tooltip-section"},Ur={class:"dss-tooltip-section-title"},Xr={class:"dss-tooltip-item-content"},Yr={class:"dss-tooltip-item-title"},jr={key:0,class:"dss-tooltip-item-description"},Kr={class:"dss-tooltip-section"},Gr={class:"dss-tooltip-title"},Qr={key:0,class:"dss-bubble-tooltip-data"},Jr={class:"dss-tooltip-series-name"},ei={class:"dss-tooltip-series-value"},ti={key:0,class:"dss-tooltip-section"},ni={class:"dss-tooltip-section-title"},li={class:"dss-tooltip-group-header"},oi={class:"dss-tooltip-item-content"},ai={class:"dss-tooltip-item-text"},si={key:1,class:"dss-tooltip-section"},ri={class:"dss-tooltip-section-title"},ii={class:"dss-tooltip-item-content"},ci={class:"dss-tooltip-item-title"},ui={key:0,class:"dss-tooltip-item-description"},di=["onClick","onMouseenter"],mi={class:"dss-legend-text"},pi={key:1,class:"dss-context-menu-separator"},vi={key:0,class:"dss-context-menu-separator"},fi={key:0,class:"dss-context-menu-separator"},gi=["onClick"],hi=["innerHTML"],yi={key:0,class:"dss-context-menu-icon"},Ci={class:"dss-marker-modal-header"},ki={class:"dss-marker-modal-body"},bi={class:"dss-form-group"},wi={class:"dss-form-group"},xi={for:"dss-marker-description"},Ei={key:0,class:"dss-form-text-display"},Vi=["placeholder"],Ni={class:"dss-marker-modal-footer"},Si={class:"modal-footer-left"},Bi={class:"dss-modal-footer-right"},Mi=["disabled"],_i={name:"DSSChart"},$i=Object.assign(_i,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(R,{emit:be}){const{t:I,locale:A}=Jl.useI18n(),Se=be,b=e.ref(null),Be=e.ref(null),ce=e.ref(null),pt=e.ref(0),p=e.ref(0);let me=null,Ce=null;const pe=20,oe=e.computed(()=>{if(p.value,pt.value,!b.value||!Be.value)return 0;try{const t=b.value.getBoundingClientRect();return Be.value.getBoundingClientRect().top-t.top}catch{return 0}}),ee=e.computed(()=>`chart-clip-${L.chartId}`),le=e.computed(()=>`url(#${ee.value})`),L=R,Fe={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},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 Re(t,s){const n=Object.assign({},t);return ut(t)&&ut(s)&&Object.keys(s).forEach(i=>{ut(s[i])?i in t?n[i]=Re(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Oe=()=>{let t=20,s=0,n=0;if(at.value&&(t+=30),Vt.value&&(t+=25),Bt.value&&L.series.length>0){const i=L.series.filter((v,g)=>!ft.value.has(g)).length;if(Ct.value==="top"||Ct.value==="bottom"){if(_t.value==="horizontal"){const g=Math.floor(Je.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function ut(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>Re(Fe,L.options)),Ze=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),xt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Je=e.computed(()=>{const t=O.value;return Ze.value?pt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ht=e.ref(pe),$e=e.computed(()=>{if(xt.value){const t=$e.value;return t??Math.max(0,(p.value||400)-Ht.value*5)}}),We=e.computed(()=>{const t=O.value;if(xt.value){const s=$e.value;return s??Math.max(0,(p.value||400)-Ht.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Et=e.computed(()=>{if(xt.value&&Ie.value==="semi-radial"&&$e.value!=null)return Ht.value+We.value+"px";if(xt.value)return"100%";if(cn.value)return Ht.value+We.value+"px";if(Bt.value&&Ct.value==="bottom"){const t=Oe();return We.value+(t.legendHeight||35)+"px"}return We.value+(Bt.value?20:0)+"px"}),Ie=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),$t=e.computed(()=>{const t=L.series.map(s=>s.type||Ie.value);return new Set(t).size>1}),at=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),Vt=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),an=e.computed(()=>{const t=O.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Mt=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),nt=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),ze=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.min;return typeof s=="number"||s===nl?s:nl}),At=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.max;return typeof s=="number"||s===nl?s:nl}),Tt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),sn=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),vt=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),Bt=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),Ct=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),_t=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),ne=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Ve=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),he=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),ye=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),lt=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),kt=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Le=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),dt=e.computed(()=>{if(!cn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ve=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),je=e.computed(()=>{const{maxX:t}=zt.value;return t===0}),U=(t,s)=>je.value&&s===0?5:s,W=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},K=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ae=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),x=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),k=e.computed(()=>{const t=O.value;return ae.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=O.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),X=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),He=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Xe=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Me=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),te=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),et=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ke=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),yt=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ht=e.computed(()=>O.value?.spider?.gridSteps||5),Ye=e.computed(()=>{const t=[],s=ht.value;for(let n=1;n<=s;n++)t.push(gt.value/s*n);return t}),Cn=t=>{const s=Yn.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=Ye.value[t];return Math.round(n/gt.value*100)+"%"},Yn=e.computed(()=>O.value?.spider?.gridLabels||null),Rn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Dt=e.computed(()=>{const t=O.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Zn=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),un=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:pn.value}),Bn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),dn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Mn=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),Nn=t=>{const s=Mn.value;if(t==null)return"";const n=String(t);return s?n+s:n},D=e.computed(()=>!j.value.isZooming);e.computed(()=>Zt.value.map(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=qt(t.categoryIndex),n=oe.value+z.value.bottom-dn.value/2;return{...t,x:s,y:n}}return t}));function q(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,w]=t.split("-"),T=Number(w?.length===2?`20${w}`:w);n=new Date(T,Number(E)-1,Number(g))}else return 0;let i=0,v=1/0;return s.forEach((g,E)=>{const[w,T,$]=g.split("-"),H=Number($?.length===2?`20${$}`:$),B=new Date(H,Number(T)-1,Number(w)),G=Math.abs(B-n);G<v&&(v=G,i=E)}),i}const F=e.computed(()=>{const t=L.markers.map(n=>{const i=q(n.marker_date,L.categories),v=qt(i),g=oe.value+z.value.bottom-dn.value/2;return{...n,x:v,y:g,categoryIndex:i,source:"props"}}),s=Zt.value.map(n=>{if(n.categoryIndex!==void 0&&(rn.value||Wt.value)){const i=qt(n.categoryIndex),v=oe.value+z.value.bottom-dn.value/2;return{...n,x:i,y:v,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),se=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),Ne=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),tt=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ot=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),qe=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let s,n;const i=String(tt.value);if(i.includes("%")){const v=parseFloat(i)/100;s=t.width*v,n=s*(96/499)}else{const v=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(v/25),n=s*(96/499)}return{width:s,height:n,area:t}}),st=e.computed(()=>{const{width:t,height:s}=qe.value,n=ot.value;let i,v;const g=z.value.left,E=z.value.right,w=z.value.top,T=z.value.bottom,$=z.value.width,H=z.value.height;switch(n){case"center":i=g+($-t)/2,v=w+(H-s)/2;break;case"top-left":i=g+15,v=w+5;break;case"top-right":i=E-t-15,v=w+5;break;case"bottom-left":i=g+15,v=T-s-5;break;case"bottom-right":default:i=E-t-15,v=T-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:v+"px",backgroundSize:`${t}px ${s}px`}}),mn=t=>!L.flags||!L.flags.length?[]:L.flags.filter(s=>s.categoryIndex===t),en=t=>{const s=mn(t),n=so(t),i=s.filter(E=>E.manual),v=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:I("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(E=>({text:E.text,color:"#047395"}))}),v.length>0&&g.push({type:I("chart.tooltip.autoFlags"),color:"#0dbf89",flags:v.map(E=>({text:E.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(E=>({title:E.title,description:E.description,type:I("chart.tooltip.markers"),color:E.color||"#FF6B6B"}))}},pn=e.computed(()=>{const t=L.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"),Jl=require("vue-i18n"),na={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},la=["value"],oa=["placeholder","value","disabled"],aa=["placeholder","value"],sa={key:0,class:"dss-datepicker__double-wrap"},ra={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},ia=["onClick"],ca={class:"dss-datepicker__double-calendars"},ua={class:"dss-datepicker__double-calendar"},da={class:"dss-datepicker__calendar-header"},ma=["aria-label"],pa={class:"dss-datepicker__month-year-row"},va=["aria-label"],fa={class:"dss-datepicker__weekdays"},ga={class:"dss-datepicker__grid"},ha=["disabled","onClick","onMouseenter"],ya={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ca={class:"dss-datepicker__double-calendar"},ka={class:"dss-datepicker__calendar-header"},ba=["aria-label"],wa={class:"dss-datepicker__month-year-row"},xa=["aria-label"],Ea={class:"dss-datepicker__weekdays"},Va={class:"dss-datepicker__grid"},Na=["disabled","onClick","onMouseenter"],Sa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ba={class:"dss-datepicker__calendar-header"},Ma=["aria-label"],_a={class:"dss-datepicker__month-year-row"},$a=["aria-label"],Ta={class:"dss-datepicker__weekdays"},La={class:"dss-datepicker__grid"},Ha=["disabled","onClick","onMouseenter"],Aa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Da={class:"dss-datepicker__calendar-header"},Ra={class:"dss-datepicker__month-year-row"},Fa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Ia={class:"dss-datepicker__months-grid"},za=["onClick"],Pa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Oa={class:"dss-datepicker__month-year"},Za={class:"dss-datepicker__years-grid"},Wa=["data-year","onClick"],Uo=27,Po={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:R=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(R)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(R,{emit:be}){const I=R,A=be,{t:Se,locale:b}=Jl.useI18n(),Be=e.ref(!1),ce=e.ref("days"),vt=new Date,v=e.computed(()=>I.minDate instanceof Date?I.minDate:vt),ue=e.ref(v.value.getMonth()),Ce=e.ref(v.value.getFullYear()),he=e.ref(v.value.getMonth()),ae=e.ref(v.value.getFullYear()),te=e.ref(v.value.getMonth()),oe=e.ref(v.value.getFullYear()),H=e.ref("start"),Ve=e.ref(null),Ae=e.ref(null);function Oe(){const D=v.value,q=D.getMonth(),F=D.getFullYear(),se=q===11?0:q+1,Ne=q===11?F+1:F;return{left:{month:q,year:F},right:{month:se,year:Ne}}}const mt=e.ref(null),Z=e.ref(null),Te=e.ref(null),Bt=e.ref(null),Ue=e.ref(null),Lt=e.ref(null),Le=new Date().getFullYear(),Ze=e.computed(()=>["single","singleFromAvailable"].includes(I.mode)),wt=e.computed(()=>["range","rangeFromAvailable"].includes(I.mode)),ze=e.computed(()=>{if(I.mode!=="single"&&I.mode!=="singleFromAvailable")return null;const D=I.modelValue;return D instanceof Date?D:null}),Mt=e.computed(()=>{if(!wt.value)return{start:null,end:null};const D=I.modelValue;return!D||typeof D!="object"?{start:null,end:null}:{start:D.start instanceof Date?D.start:null,end:D.end instanceof Date?D.end:null}});function at(D){if(!D||!(D instanceof Date))return"";const q=D.getDate(),F=D.getMonth()+1,se=D.getFullYear(),Ne=lt=>String(lt).padStart(2,"0");return`${Ne(q)}/${Ne(F)}/${se}`}const Ct=e.computed(()=>at(ze.value)),cn=e.computed(()=>{const{start:D,end:q}=Mt.value;if(!D&&!q)return"";const F=!q||D&&D<=q?D:q,se=!D||q&&q>=D?q:D;return U(F,se)?at(F):`${at(F)} - ${at(se)}`}),_t=e.computed(()=>{if(I.mode!=="readonly")return"—";const D=I.modelValue;if(D instanceof Date)return at(D)||"—";if(D&&typeof D=="object"&&("start"in D||"end"in D)){const q=D.start instanceof Date?D.start:null,F=D.end instanceof Date?D.end:null;if(!q&&!F)return"—";const se=!F||q&&q<=F?q:F,Ne=!q||F&&F>=q?F:q;return U(se,Ne)?at(se):`${at(se)} - ${at(Ne)}`}return"—"});e.computed(()=>{const D=new Date(Ce.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const Qe=e.computed(()=>Ae.value==="left"?he.value:Ae.value==="right"?te.value:ue.value),je=e.computed(()=>Ae.value==="left"?ae.value:Ae.value==="right"?oe.value:Ce.value),$t=e.computed(()=>{const D=new Date(Ce.value,ue.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),Ht=e.computed(()=>{const D=new Date(je.value,Qe.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),Yt=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{month:"short"});return Array.from({length:12},(q,F)=>D.format(new Date(2024,F,1)))}),pt=e.computed(()=>{const q=(Ae.value?je.value:Ce.value)-Math.floor(Uo/2);return Array.from({length:Uo},(F,se)=>q+se)}),Nt=e.computed(()=>{const D=pt.value;return D.length?`${D[0]} – ${D[D.length-1]}`:""}),xt=e.computed(()=>{const D=new Intl.DateTimeFormat(b.value,{weekday:"short"}),q=new Date(2024,0,1),F=[];for(let se=0;se<7;se++){const Ne=new Date(q);Ne.setDate(q.getDate()+se),F.push(D.format(Ne).slice(0,2))}return F});function St(D,q){const F=new Date(D,q,1),se=new Date(D,q+1,0),Ne=F.getDay(),lt=se.getDate(),ot=[];for(let We=0;We<Ne;We++)ot.push(null);for(let We=1;We<=lt;We++)ot.push(new Date(D,q,We));return ot}const jt=e.computed(()=>St(Ce.value,ue.value)),Q=e.computed(()=>St(ae.value,he.value)),ve=e.computed(()=>St(oe.value,te.value));e.computed(()=>{const D=new Date(ae.value,he.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)}),e.computed(()=>{const D=new Date(oe.value,te.value,1);return new Intl.DateTimeFormat(b.value,{month:"long",year:"numeric"}).format(D)});const fe=e.computed(()=>{const D=new Date(ae.value,he.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),_e=e.computed(()=>{const D=new Date(oe.value,te.value,1);return new Intl.DateTimeFormat(b.value,{month:"long"}).format(D)}),rt=e.computed(()=>I.availableDates&&I.availableDates.length>0),Ie=e.computed(()=>rt.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"}]),Ke=e.ref({top:0,left:0});function de(){if(!Bt.value||!Be.value)return;const D=Bt.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,F=window.innerHeight||document.documentElement.clientHeight;let se=D.left,Ne=D.bottom+4;const lt=Ue.value;if(lt){const ot=lt.offsetWidth,We=lt.offsetHeight;if(se+ot>q-8&&(se=D.right-ot,se<8&&(se=8)),Ne+We>F-8){const st=D.top-4-We;st>=8?Ne=st:Ne=Math.max(8,F-We-8)}}Ke.value={top:Ne,left:se}}const Ge=e.computed(()=>!Bt.value||!Be.value?{}:{position:"fixed",left:`${Ke.value.left}px`,top:`${Ke.value.top}px`,zIndex:1002});function U(D,q){return!D||!q?!1:D.getFullYear()===q.getFullYear()&&D.getMonth()===q.getMonth()&&D.getDate()===q.getDate()}function W(D){return new Date(D.getFullYear(),D.getMonth(),D.getDate()).getTime()}function j(D){return!I.availableDates||!I.availableDates.length?!0:I.availableDates.some(q=>q instanceof Date&&U(q,D))}function ne(D){const q=W(D);return!(I.minDate instanceof Date&&q<W(I.minDate)||I.maxDate instanceof Date&&q>W(I.maxDate))}function x(D){return!I.exceptDates||!I.exceptDates.length?!1:I.exceptDates.some(q=>q instanceof Date&&U(q,D))}function k(D){return x(D)?!1:["singleFromAvailable","rangeFromAvailable"].includes(I.mode)?j(D):ne(D)}function V(D){const q=ze.value,F=Mt.value,se=W(D),Ne=wt.value&&F.start&&F.end&&se>W(F.start)&&se<W(F.end),lt=wt.value&&F.start&&U(D,F.start),ot=wt.value&&F.end&&U(D,F.end),We=lt&&ot,st=Ze.value&&q&&U(D,q)||lt||ot;let mn=!1;if(wt.value&&F.start&&!F.end&&Ve.value){const tn=W(F.start),pn=W(Ve.value),Fn=Math.min(tn,pn),hn=Math.max(tn,pn);mn=se>Fn&&se<hn}return{"dss-datepicker__day--selected":st&&!We,"dss-datepicker__day--range-start":lt&&!We,"dss-datepicker__day--range-end":ot&&!We,"dss-datepicker__day--range-single":We,"dss-datepicker__day--in-range":Ne&&!lt&&!ot,"dss-datepicker__day--in-range-preview":mn&&!lt&&!ot&&!Ne,"dss-datepicker__day--disabled":!k(D)}}function P(D){if(!wt.value)return;const q=Mt.value;if(!q.start||q.end){Ve.value=null;return}if(!k(D)){Ve.value=null;return}Ve.value=new Date(D.getFullYear(),D.getMonth(),D.getDate())}function X(){Ve.value=null}function De(){if(!I.doubleCalendar||!wt.value)return;const D=Mt.value,{start:q,end:F}=D;if(q&&F){const lt=q<=F?q:F,ot=q<=F?F:q,We=lt.getMonth(),st=lt.getFullYear(),mn=ot.getMonth(),tn=ot.getFullYear();if(We!==mn||st!==tn){const pn=he.value===We&&ae.value===st,Fn=te.value===mn&&oe.value===tn;if(pn&&Fn)return;he.value=We,ae.value=st,te.value=mn,oe.value=tn}else{const pn=We===0?11:We-1,Fn=We===0?st-1:st;he.value===pn&&ae.value===Fn&&te.value===We&&oe.value===st||(he.value=We,ae.value=st,We===11?(te.value=0,oe.value=st+1):(te.value=We+1,oe.value=st))}return}const se=q||F;if(se){const lt=se.getMonth(),ot=se.getFullYear(),We=he.value===lt&&ae.value===ot,st=te.value===lt&&oe.value===ot;if(We||st)return;he.value=lt,ae.value=ot,lt===11?(te.value=0,oe.value=ot+1):(te.value=lt+1,oe.value=ot);return}const Ne=Oe();he.value=Ne.left.month,ae.value=Ne.left.year,te.value=Ne.right.month,oe.value=Ne.right.year}function Xe(D="start"){if(I.mode==="readonly")return;H.value=D;const q=ze.value,F=Mt.value;if(Ze.value&&q)ue.value=q.getMonth(),Ce.value=q.getFullYear();else if(wt.value)if(I.doubleCalendar)De();else{const se=D==="start"&&F.start?F.start:F.end||F.start;se&&(ue.value=se.getMonth(),Ce.value=se.getFullYear())}Bt.value=Ze.value?mt.value?.closest(".dss-datepicker__input-wrap"):Z.value,ce.value="days",Ae.value=null,Be.value=!0,e.nextTick(()=>{de()})}function Me(){ce.value="days",Ae.value=null,Ve.value=null,Be.value=!1}function le(D,q){Ae.value=D,ce.value=q}function nt(){ce.value="days",Ae.value=null}function Je(D){const q=new Date,F=q.getFullYear(),se=q.getMonth(),Ne=q.getDate();let lt,ot;if(rt.value){const We=[...I.availableDates].filter(st=>st instanceof Date).map(st=>new Date(st.getFullYear(),st.getMonth(),st.getDate()));if(We.sort((st,mn)=>st.getTime()-mn.getTime()),We.length===0)return;if(D==="all")lt=We[0],ot=We[We.length-1];else{const st=parseInt(D.replace("last",""),10);if(st<2||st>5)return;const mn=We.slice(-st);lt=mn[0],ot=mn[mn.length-1]}}else{const We=new Date(F,se,Ne);switch(D){case"today":lt=We,ot=We;break;case"lastWeek":lt=new Date(F,se,Ne-6),ot=We;break;case"last15Days":lt=new Date(F,se,Ne-14),ot=We;break;case"last30Days":lt=new Date(F,se,Ne-29),ot=We;break;case"thisMonth":lt=new Date(F,se,1),ot=We;break;case"last3Months":lt=new Date(F,se-3,1),ot=new Date(F,se,0);break;case"last6Months":lt=new Date(F,se-6,1),ot=new Date(F,se,0);break;case"last12Months":lt=new Date(F,se-12,1),ot=new Date(F,se,0);break;case"lastYear":lt=new Date(F-1,0,1),ot=new Date(F-1,11,31);break;default:return}}A("update:modelValue",{start:lt,end:ot}),De()}function yt(D){Ae.value==="left"?he.value=D:Ae.value==="right"?te.value=D:ue.value=D,nt()}function ht(D){Ae.value==="left"?ae.value=D:Ae.value==="right"?oe.value=D:Ce.value=D,nt()}function Ye(){ue.value===0?(ue.value=11,Ce.value--):ue.value--}function Cn(){ue.value===11?(ue.value=0,Ce.value++):ue.value++}function Yn(){he.value===0?(he.value=11,ae.value--):he.value--}function Rn(){he.value===11?(he.value=0,ae.value++):he.value++}function At(){te.value===0?(te.value=11,oe.value--):te.value--}function Zn(){te.value===11?(te.value=0,oe.value++):te.value++}function un(D){if(!k(D))return;const q=new Date(D.getFullYear(),D.getMonth(),D.getDate());if(Ze.value){A("update:modelValue",q),Me();return}const F=Mt.value;if(!F.start&&!F.end){A("update:modelValue",{start:q,end:null}),H.value="end";return}if(F.start&&F.end){A("update:modelValue",{start:q,end:null}),H.value="end";return}if(H.value==="start"){let se=q,Ne=F.end;se&&Ne&&se>Ne&&([se,Ne]=[Ne,se]),A("update:modelValue",{start:se||Ne,end:Ne||se}),H.value="end"}else{let se=F.start,Ne=q;se&&Ne&&Ne<se&&([se,Ne]=[Ne,se]),A("update:modelValue",{start:se||Ne,end:Ne||se}),H.value="start"}}e.watch(Mt,()=>{I.doubleCalendar&&wt.value&&Be.value&&De()},{deep:!0});let Bn=null,dn=null,Mn=null;function Nn(){Bn&&(document.removeEventListener("keydown",Bn),Bn=null),dn&&(window.removeEventListener("resize",dn),dn=null),Mn&&(window.removeEventListener("scroll",Mn,!0),Mn=null)}return e.watch(ce,D=>{D==="years"&&e.nextTick(()=>{Lt.value?.querySelector(`[data-year="${je.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Be,D=>{Nn(),D&&(Bn=q=>{q.key==="Escape"&&(ce.value==="years"||ce.value==="months"?nt():Me())},dn=()=>{de()},Mn=()=>{de()},document.addEventListener("keydown",Bn),window.addEventListener("resize",dn),window.addEventListener("scroll",Mn,!0))}),e.onBeforeUnmount(()=>{Nn()}),(D,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":R.mode==="readonly"}])},[R.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",na,[q[10]||(q[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:_t.value,readonly:"",disabled:"",tabindex:"-1"},null,8,la)])):Ze.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=F=>Xe("start"))},[q[11]||(q[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:mt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Se)("datepicker.selectDate"),value:Ct.value,readonly:"",disabled:R.mode==="readonly"},null,8,oa)])):wt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:Z,onClick:q[1]||(q[1]=F=>Xe("start"))},[q[12]||(q[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:Te,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Se)("datepicker.selectRange"),value:cn.value,readonly:""},null,8,aa)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Be.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Me,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ue,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":R.doubleCalendar&&wt.value&&ce.value==="days","dss-datepicker__dropdown--quick-select":R.doubleCalendar&&wt.value&&ce.value==="days"&&R.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ge.value)},[ce.value==="days"&&R.doubleCalendar&&wt.value?(e.openBlock(),e.createElementBlock("div",sa,[R.quickSelect?(e.openBlock(),e.createElementBlock("nav",ra,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ie.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:se=>Je(F.id)},e.toDisplayString(e.unref(Se)(F.labelKey)),9,ia))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",ca,[e.createElementVNode("div",ua,[e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:Yn}," ‹ ",8,ma),e.createElementVNode("div",pa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=F=>le("left","months"))},e.toDisplayString(fe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=F=>le("left","years"))},e.toDisplayString(ae.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Rn}," › ",8,va)]),e.createElementVNode("div",fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",ga,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,ha)):(e.openBlock(),e.createElementBlock("span",ya))],64))),128))])]),e.createElementVNode("div",Ca,[e.createElementVNode("div",ka,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:At}," ‹ ",8,ba),e.createElementVNode("div",wa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=F=>le("right","months"))},e.toDisplayString(_e.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=F=>le("right","years"))},e.toDisplayString(oe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Zn}," › ",8,xa)]),e.createElementVNode("div",Ea,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",Va,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,Na)):(e.openBlock(),e.createElementBlock("span",Sa))],64))),128))])])])])):ce.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ba,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.prevMonth"),onClick:Ye}," ‹ ",8,Ma),e.createElementVNode("div",_a,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=F=>ce.value="months")},e.toDisplayString($t.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=F=>ce.value="years")},e.toDisplayString(Ce.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Se)("datepicker.nextMonth"),onClick:Cn}," › ",8,$a)]),e.createElementVNode("div",Ta,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,F=>(e.openBlock(),e.createElementBlock("span",{key:F,class:"dss-datepicker__weekday"},e.toDisplayString(F),1))),128))]),e.createElementVNode("div",La,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,(F,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[F?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(F)]),disabled:!k(F),onClick:Ne=>un(F),onMouseenter:Ne=>P(F),onMouseleave:X},e.toDisplayString(F.getDate()),43,Ha)):(e.openBlock(),e.createElementBlock("span",Aa))],64))),128))])],64)):ce.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",Da,[e.createElementVNode("div",Ra,[e.createElementVNode("span",Fa,e.toDisplayString(Ht.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=F=>ce.value="years")},e.toDisplayString(je.value),1)])]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt.value,(F,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===Qe.value}]),onClick:Ne=>yt(se)},e.toDisplayString(F),11,za))),128))])],64)):ce.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Pa,[e.createElementVNode("span",Oa,e.toDisplayString(Nt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:Lt},[e.createElementVNode("div",Za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,F=>(e.openBlock(),e.createElementBlock("button",{key:F,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":F===je.value,"dss-datepicker__year-cell--current":F===e.unref(Le)}]),"data-year":F,onClick:se=>ht(F)},e.toDisplayString(F),11,Wa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},qa=["data-chart-type"],Ua={class:"dss-chart-header-titles"},Xa={key:0,class:"dss-chart-title"},Ya={key:1,class:"dss-chart-subtitle"},ja=["onClick","onMouseenter"],Ka={class:"dss-legend-text"},Ga=["onClick","onMouseenter"],Qa={class:"dss-legend-text"},Ja=["title"],es=["src"],ts={class:"dss-chart-area-wrapper"},ns={key:0,class:"dss-chart-z-axis-label"},ls=["width","height","data-smooth","data-animated"],os=["id"],as=["y","width","height"],ss=["id"],rs=["d"],is=["id"],cs=["d"],us={key:0},ds=["clip-path"],ms=["x1","x2","y1","y2"],ps={class:"dss-axes"},vs=["x1","x2","y1","y2"],fs=["x1","x2","y1","y2"],gs={class:"dss-axis-labels"},hs=["x","y"],ys=["x","y"],Cs=["x","y"],ks=["y","transform"],bs={key:1,class:"dss-flag-markers"},ws=["clip-path"],xs=["x1","x2","y1","y2","onMouseover"],Es=["x1","x2","y1","y2","onMouseover"],Vs=["x1","x2","y1","y2","onMouseover"],Ns=["cx","cy","onMouseover"],Ss=["cx","cy","fill","onMouseover"],Bs=["x","y"],Ms=["clip-path"],_s={key:0},$s=["d","onMouseover"],Ts=["x","y","width","height","fill","onMouseover"],Ls={class:"dss-line-chart"},Hs=["d","stroke","stroke-width"],As=["d","stroke","stroke-width","opacity"],Ds=["cx","cy","r","fill","onMouseover"],Rs={key:1},Fs=["d","stroke","stroke-width"],Is=["d","stroke","stroke-width"],zs=["d","stroke","stroke-width","opacity"],Ps=["cx","cy","r","fill","onMouseover"],Os={key:2},Zs=["id"],Ws=["x","y","width","height"],qs=["d","fill","fill-opacity","mask"],Us=["d","stroke","stroke-width"],Xs=["d","fill","onMouseover"],Ys=["x","y","width","height","onMouseover"],js=["clip-path"],Ks=["x1","x2","y1","y2","stroke"],Gs=["cx","cy","r","fill"],Qs={key:1,class:"dss-bubble-chart"},Js={key:0,class:"dss-bubble-group"},er=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],tr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],nr=["transform"],lr=["cx","cy","r"],or=["data-chart-type","clip-path"],ar=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],sr={key:1,class:"dss-radial-segment-data-labels"},rr=["x","y"],ir=["x","y","font-size","fill"],cr=["x1","y1","x2","y2","stroke"],ur=["x1","y1","x2","y2","stroke"],dr=["x","y","text-anchor","font-size"],mr=["transform"],pr={key:0,class:"dss-spider-grid"},vr=["cx","cy","r"],fr={class:"dss-spider-grid-labels"},gr=["x","y"],hr=["x","y"],yr=["x1","x2","y1","y2"],Cr={class:"dss-spider-labels"},kr=["x","y","text-anchor","dominant-baseline"],br=["points","fill","fill-opacity","stroke","stroke-width"],wr=["cx","cy","r","fill","onMouseover"],xr={class:"dss-chart-logos"},Er=["cx","cy","r","fill"],Vr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Nr=["onClick","onMouseenter"],Sr=["src"],Br={class:"dss-marker-tooltip-category"},Mr={key:0,class:"dss-marker-tooltip-description"},_r={key:0,class:"dss-tooltip-section"},$r={key:0,class:"dss-tooltip-title"},Tr={class:"dss-tooltip-series-name"},Lr={class:"dss-tooltip-series-value"},Hr={key:1,class:"dss-tooltip-section"},Ar={key:0,class:"dss-tooltip-title"},Dr={class:"dss-bubble-tooltip-data"},Rr={key:2,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-title"},Ir={class:"dss-tooltip-value"},zr={key:0,class:"dss-tooltip-section"},Pr={class:"dss-tooltip-section-title"},Or={class:"dss-tooltip-group-header"},Zr={class:"dss-tooltip-item-content"},Wr={class:"dss-tooltip-item-text"},qr={key:1,class:"dss-tooltip-section"},Ur={class:"dss-tooltip-section-title"},Xr={class:"dss-tooltip-item-content"},Yr={class:"dss-tooltip-item-title"},jr={key:0,class:"dss-tooltip-item-description"},Kr={class:"dss-tooltip-section"},Gr={class:"dss-tooltip-title"},Qr={key:0,class:"dss-bubble-tooltip-data"},Jr={class:"dss-tooltip-series-name"},ei={class:"dss-tooltip-series-value"},ti={key:0,class:"dss-tooltip-section"},ni={class:"dss-tooltip-section-title"},li={class:"dss-tooltip-group-header"},oi={class:"dss-tooltip-item-content"},ai={class:"dss-tooltip-item-text"},si={key:1,class:"dss-tooltip-section"},ri={class:"dss-tooltip-section-title"},ii={class:"dss-tooltip-item-content"},ci={class:"dss-tooltip-item-title"},ui={key:0,class:"dss-tooltip-item-description"},di=["onClick","onMouseenter"],mi={class:"dss-legend-text"},pi={key:1,class:"dss-context-menu-separator"},vi={key:0,class:"dss-context-menu-separator"},fi={key:0,class:"dss-context-menu-separator"},gi=["onClick"],hi=["innerHTML"],yi={key:0,class:"dss-context-menu-icon"},Ci={class:"dss-marker-modal-header"},ki={class:"dss-marker-modal-body"},bi={class:"dss-form-group"},wi={class:"dss-form-group"},xi={for:"dss-marker-description"},Ei={key:0,class:"dss-form-text-display"},Vi=["placeholder"],Ni={class:"dss-marker-modal-footer"},Si={class:"modal-footer-left"},Bi={class:"dss-modal-footer-right"},Mi=["disabled"],_i={name:"DSSChart"},$i=Object.assign(_i,{props:{series:{type:Array,required:!0,default:()=>[]},categories:{type:Array,default:()=>[]},flags:{type:Array,default:()=>[]},markers:{type:Array,default:()=>[]},showAddMarkerButton:{type:Boolean,default:!0},chartId:{type:String,default:()=>"chart-"+Math.random().toString(36).substring(2,9)},i18n:{type:Object,default:null},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(R,{emit:be}){const{t:I,locale:A}=Jl.useI18n(),Se=be,b=e.ref(null),Be=e.ref(null),ce=e.ref(null),vt=e.ref(0),v=e.ref(0);let ue=null,Ce=null;const he=20,ae=e.computed(()=>{if(v.value,vt.value,!b.value||!Be.value)return 0;try{const t=b.value.getBoundingClientRect();return Be.value.getBoundingClientRect().top-t.top}catch{return 0}}),te=e.computed(()=>`chart-clip-${H.chartId}`),oe=e.computed(()=>`url(#${te.value})`),H=R,Ve={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Ae(t,s){const n=Object.assign({},t);return mt(t)&&mt(s)&&Object.keys(s).forEach(i=>{mt(s[i])?i in t?n[i]=Ae(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Oe=()=>{let t=20,s=0,n=0;if(at.value&&(t+=30),Ct.value&&(t+=25),Nt.value&&H.series.length>0){const i=H.series.filter((p,g)=>!ft.value.has(g)).length;if(xt.value==="top"||xt.value==="bottom"){if(St.value==="horizontal"){const g=Math.floor(Ue.value/100);s=Math.ceil(i/g)*25+10}else s=i*25+10;t+=s}else n=150}return{height:t,legendHeight:s,legendWidth:n}};function mt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const Z=e.computed(()=>Ae(Ve,H.options)),Te=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.width==="auto"}),Bt=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.height==="auto"}),Ue=e.computed(()=>{const t=Z.value;return Te.value?vt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Lt=e.ref(he),Le=e.computed(()=>{if(Bt.value){const t=Le.value;return t??Math.max(0,(v.value||400)-Lt.value*5)}}),Ze=e.computed(()=>{const t=Z.value;if(Bt.value){const s=Le.value;return s??Math.max(0,(v.value||400)-Lt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),wt=e.computed(()=>{if(Bt.value&&ze.value==="semi-radial"&&Le.value!=null)return Lt.value+Ze.value+"px";if(Bt.value)return"100%";if(rn.value)return Lt.value+Ze.value+"px";if(Nt.value&&xt.value==="bottom"){const t=Oe();return Ze.value+(t.legendHeight||35)+"px"}return Ze.value+(Nt.value?20:0)+"px"}),ze=e.computed(()=>{const t=Z.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Mt=e.computed(()=>{const t=H.series.map(s=>s.type||ze.value);return new Set(t).size>1}),at=e.computed(()=>{const t=Z.value;return t&&t.title&&t.title.text?t.title.text:""}),Ct=e.computed(()=>{const t=Z.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),cn=e.computed(()=>{const t=Z.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),_t=e.computed(()=>{const t=Z.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Qe=e.computed(()=>{const t=Z.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),je=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.min;return typeof s=="number"||s===nl?s:nl}),$t=e.computed(()=>{const t=Z.value;if(!t||!t.yAxis)return nl;const s=t.yAxis.max;return typeof s=="number"||s===nl?s:nl}),Ht=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Yt=e.computed(()=>{const t=Z.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),pt=e.computed(()=>{const t=Z.value;return t&&t.grid&&t.grid.show!==!1}),Nt=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.show!==!1}),xt=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),St=e.computed(()=>{const t=Z.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),jt=e.computed(()=>{const t=Z.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),Q=e.computed(()=>{const t=Z.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),ve=e.computed(()=>{const t=Z.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),fe=e.computed(()=>{const t=Z.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),_e=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),rt=e.computed(()=>{const t=Z.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),Ie=e.computed(()=>{const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Ke=e.computed(()=>{if(!rn.value)return 0;const t=Z.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),de=e.computed(()=>{const t=Z.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),Ge=e.computed(()=>{const{maxX:t}=It.value;return t===0}),U=(t,s)=>Ge.value&&s===0?5:s,W=t=>{const s=Number(t);return!Number.isFinite(s)||s<=0?0:s},j=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),ne=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),x=e.computed(()=>{const t=Z.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),k=e.computed(()=>{const t=Z.value;return ne.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),V=e.computed(()=>{const t=Z.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),P=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.enabled!==!1}),X=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),De=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),Xe=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Me=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),le=e.computed(()=>{const t=Z.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),nt=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Je=e.computed(()=>{const t=Z.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),yt=e.computed(()=>{const t=Z.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),ht=e.computed(()=>Z.value?.spider?.gridSteps||5),Ye=e.computed(()=>{const t=[],s=ht.value;for(let n=1;n<=s;n++)t.push(gt.value/s*n);return t}),Cn=t=>{const s=Yn.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=Ye.value[t];return Math.round(n/gt.value*100)+"%"},Yn=e.computed(()=>Z.value?.spider?.gridLabels||null),Rn=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),At=e.computed(()=>{const t=Z.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Zn=e.computed(()=>{const t=Z.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),un=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.icon?t.markers.icon:pn.value}),Bn=e.computed(()=>{const t=Z.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),dn=e.computed(()=>{const t=Z.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),Mn=e.computed(()=>{const s=Z.value?.valueFormat?.extension;return typeof s=="string"?s:""}),Nn=t=>{const s=Mn.value;if(t==null)return"";const n=String(t);return s?n+s:n},D=e.computed(()=>!K.value.isZooming);e.computed(()=>Ot.value.map(t=>{if(t.categoryIndex!==void 0&&(sn.value||Zt.value)){const s=Wt(t.categoryIndex),n=ae.value+z.value.bottom-dn.value/2;return{...t,x:s,y:n}}return t}));function q(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,E,w]=t.split("-"),T=Number(w?.length===2?`20${w}`:w);n=new Date(T,Number(E)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,E)=>{const[w,T,$]=g.split("-"),L=Number($?.length===2?`20${$}`:$),B=new Date(L,Number(T)-1,Number(w)),G=Math.abs(B-n);G<p&&(p=G,i=E)}),i}const F=e.computed(()=>{const t=H.markers.map(n=>{const i=q(n.marker_date,H.categories),p=Wt(i),g=ae.value+z.value.bottom-dn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),s=Ot.value.map(n=>{if(n.categoryIndex!==void 0&&(sn.value||Zt.value)){const i=Wt(n.categoryIndex),p=ae.value+z.value.bottom-dn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),se=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.enabled===!0}),Ne=e.computed(()=>{const t=Z.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),lt=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ot=e.computed(()=>{const t=Z.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),We=e.computed(()=>{const t={left:z.value.left,top:z.value.top,width:z.value.width,height:z.value.height};let s,n;const i=String(lt.value);if(i.includes("%")){const p=parseFloat(i)/100;s=t.width*p,n=s*(96/499)}else{const p=parseFloat(i)||25;s=Math.min(t.width*.25,200)*(p/25),n=s*(96/499)}return{width:s,height:n,area:t}}),st=e.computed(()=>{const{width:t,height:s}=We.value,n=ot.value;let i,p;const g=z.value.left,E=z.value.right,w=z.value.top,T=z.value.bottom,$=z.value.width,L=z.value.height;switch(n){case"center":i=g+($-t)/2,p=w+(L-s)/2;break;case"top-left":i=g+15,p=w+5;break;case"top-right":i=E-t-15,p=w+5;break;case"bottom-left":i=g+15,p=T-s-5;break;case"bottom-right":default:i=E-t-15,p=T-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),mn=t=>!H.flags||!H.flags.length?[]:H.flags.filter(s=>s.categoryIndex===t),tn=t=>{const s=mn(t),n=so(t),i=s.filter(E=>E.manual),p=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:I("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(E=>({text:E.text,color:"#047395"}))}),p.length>0&&g.push({type:I("chart.tooltip.autoFlags"),color:"#0dbf89",flags:p.map(E=>({text:E.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(E=>({title:E.title,description:E.description,type:I("chart.tooltip.markers"),color:E.color||"#FF6B6B"}))}},pn=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"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Fn=e.computed(()=>{const t=
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Fn=e.computed(()=>{const t=H.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),hn=e.computed(()=>{const t=
|
|
45
|
-
`)}})}),pl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Sl=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),jn=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),zl=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),ft=e.ref(new Set),de=e.ref(null),_n=e.ref(!1),Ae=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),mt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Pe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Qe=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),j=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Zt=e.ref([]),h=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 Bn.value&&t.push(...Object.keys(Bn.value)),t}),e.computed(()=>{if(!L.categories||L.categories.length===0){const{maxX:t}=zt.value;return Array.from({length:t+1},(s,n)=>I("chart.fallback.item",{number:n+1}))}return L.categories});const C=e.computed(()=>{if(!L.categories||L.categories.length===0)return null;const t=L.categories[0],[s,n,i]=String(t).split("-"),v=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!v?null:new Date(v,E,g)}),S=e.computed(()=>{if(!L.categories||L.categories.length===0)return null;const t=L.categories[L.categories.length-1],[s,n,i]=String(t).split("-"),v=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!v?null:new Date(v,E,g)}),Z=e.computed(()=>h.value.editingMarkerId!==null),re=e.computed(()=>h.value.readonly),rt=t=>{ft.value.has(t)||(Ql.value=!0,de.value=t)},Ge=()=>{Ql.value=!1,de.value=null},Lt=t=>{if(xl.value||$l.value){Pe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,v=t.clientY-n.top,g=Wt.value?i>=z.value.left-50&&i<=z.value.right+50&&v>=z.value.top-50&&v<=z.value.bottom+100:i>=z.value.left&&i<=z.value.right&&v>=z.value.top&&v<=z.value.bottom;if(_n.value=g,Wt.value){if(!Ve.value||!g||j.value.isDragging||j.value.isZooming){Pe.value.show=!1;return}if(_l.value.find(J=>!J||J.isHidden?!1:Math.sqrt(Math.pow(J.x-i,2)+Math.pow(J.y-v,2))<=J.radius+3))Pe.value.show=!1;else{const J=_l.value.filter(ge=>!ge||ge.isHidden?!1:Math.sqrt(Math.pow(ge.x-i,2)+Math.pow(ge.y-v,2))<=250);if(J.length>0){let ge=J[0],ke=Math.sqrt(Math.pow(ge.x-i,2)+Math.pow(ge.y-v,2));J.forEach(we=>{const xe=Math.sqrt(Math.pow(we.x-i,2)+Math.pow(we.y-v,2));xe<ke&&(ke=xe,ge=we)});const ie=30,Ue=_l.value.filter(we=>!we||we.isHidden?!1:Math.abs(we.x-ge.x)<=ie).sort((we,xe)=>we.y-xe.y);Pe.value={show:!0,x:ge.x,categoryIndex:Math.round(ge.originalX),data:(()=>{const we=Sl.value,xe=jn.value,De=[];return Ue.forEach(Te=>{we.forEach(bt=>{const wt=xe[bt]||bt,Vn=y(bt,Te);Vn&&De.push({seriesName:Te.seriesName,label:Te.label,value:`${wt}: ${Vn}`,color:Te.color,y:Te.y})})}),De})()}}else Pe.value.show=!1}return}if(j.value.isDragging&&j.value.scale>1&&rn.value&&ye.value){Pe.value.show=!1;const Ee=t.clientX-j.value.lastMouseX,{minX:J,maxX:ge}=zt.value,ke=ge-J||1,Ue=Ee*.8;j.value.offsetX+=Ue;const we=ke/j.value.scale,xe=ke-we,De=0,Te=-xe/ke*z.value.width,bt=De;j.value.offsetX=Math.max(Te,Math.min(bt,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY;return}if(!Ve.value||!rn.value||j.value.isDragging||j.value.isZooming||!g){Pe.value.show=!1;return}const{minX:E,maxX:w}=zt.value,T=w-E||1,$=T/j.value.scale,H=E-j.value.offsetX/z.value.width*T,B=(i-z.value.left)/z.value.width,G=H+B*$,ue=Math.round(G);if(ue>=0&&ue<=w){const Ee=qt(ue),J=fl.value.map((ge,ke)=>{const ie=L.series.findIndex(we=>we===ge),Ue=ge.data[ue];return{seriesName:ge.name,value:Ue!==void 0?Ue:null,color:Ft(ie),y:Ue!==void 0?ln(Ue):null}}).filter(ge=>ge.value!==null);Pe.value={show:!0,x:Ee,categoryIndex:ue,data:J}}},fn=()=>{Pe.value.show=!1,_n.value=!1,$l.value=!1,xl.value||(pl.value.show=!1),j.value.isDragging&&(j.value.isDragging=!1),j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1,setTimeout(()=>{de.value=null,Ae.value.show=!1},150)},Rt=t=>{if(t.preventDefault(),t.stopPropagation(),!Rn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(cn.value){Qe.value.show=!1,e.nextTick(()=>{Qe.value.show=!0,Qe.value.x=t.clientX,Qe.value.y=t.clientY,Qe.value.categoryIndex=null});return}const v=Math.max(0,z.value.left-20),g=z.value.right,E=z.value.top,w=z.value.bottom+80;n>=v&&n<=g&&i>=E&&i<=w&&(Qe.value.show=!1,e.nextTick(()=>{Qe.value.show=!0,Qe.value.x=t.clientX,Qe.value.y=t.clientY,Qe.value.categoryIndex=null;const T=Math.max(z.value.left,Math.min(n,z.value.right))-z.value.left,H=z.value.width/gl.value.length,B=Math.floor(T/H);B>=0&&B<gl.value.length&&(Qe.value.categoryIndex=B)}))},Ut=t=>{if(!(t&&t.button===2)){if(Qe.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}Qe.value.show=!1}},Pl=t=>{if(typeof t.template=="function"){const s={series:L.series,categories:L.categories,markers:Zt.value},n={chartX:Qe.value.chartX,chartY:Qe.value.chartY,dataX:Qe.value.mouseDataX,dataY:Qe.value.mouseDataY,categoryIndex:Qe.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},oo=t=>t.style||{},bn=t=>t.type&&Bn.value[t.type]?Bn.value[t.type]:t.customIcon?t.customIcon:un.value,ao=t=>t==null?"":L.categories&&L.categories[t]?L.categories[t]:"",so=t=>Zt.value.length?Zt.value.filter(s=>s.categoryIndex===t):[],ro=t=>{if(!rn.value&&!Wt.value)return{x:0,y:0};const s=qt(t),n=oe.value+z.value.bottom-dn.value/2;return{x:s,y:n}},Ol=()=>{Zt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=ro(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(h.value.description&&h.value.description.length&&h.value.date){if(Z.value){const t=Zt.value.findIndex(s=>s.id===h.value.editingMarkerId);t!==-1?(Zt.value[t].description=h.value.description||"",Zt.value[t].color=h.value.color||"",Zt.value[t].type=h.value.type||"default",Se("update-marker",Zt.value[t])):Se("update-marker",{id:h.value.editingMarkerId,description:h.value.description||"",color:h.value.color||"",type:h.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=q(h.value.date,L.categories||[]);if(Wt.value){const{maxX:E}=zt.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else rn.value&&(s=Math.max(0,Math.min(s,zt.value.maxX)));const n=qt(s),i=oe.value+z.value.bottom-dn.value/2,v=Array.isArray(L.categories)?L.categories[s]:null,g={id:t,title:"",description:h.value.description||"",color:h.value.color||"",type:h.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:v||null};h.value.categoryIndex=s,Zt.value.push(g),Se("add-marker",g)}jt(),Kn()}},jt=()=>{h.value.show=!1,h.value.title="",h.value.description="",h.value.color="#FF6B6B",h.value.type="default",h.value.editingMarkerId=null,h.value.readonly=!1,h.value.categoryIndex=null,h.value.fromButton=!1,h.value.date=null},co=()=>{Z.value&&(Vo(h.value.editingMarkerId),jt())},Vo=t=>{const s=Zt.value.findIndex(n=>n.id===t);s!==-1&&(Zt.value.splice(s,1),Kn()),Se("delete-marker",t)},gn=t=>{if(h.value.show=!0,h.value.title=t?.title??t?.comment??"",h.value.description=t?.description??t?.comment??"",h.value.color=t?.color??"",h.value.type=t?.type??"default",h.value.editingMarkerId=t?.id??t?.marker_id??null,h.value.readonly=t?.readonly??!1,h.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),v=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;g&&n&&v?h.value.date=new Date(v,E,g):h.value.date=null}else h.value.date=null},Kn=()=>{try{const t=`dss-chart-markers-${L.chartId}`;localStorage.setItem(t,JSON.stringify(Zt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},kl=()=>{try{const t=`dss-chart-markers-${L.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Zt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Zt.value=[]}},$n=t=>{const s=at.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},qn=()=>{const t=Pe.value.show,s=Ae.value.show;return Pe.value.show=!1,Ae.value.show=!1,{originalCrosshair:t,originalTooltip:s}},wn=t=>{Pe.value.show=t.originalCrosshair,Ae.value.show=t.originalTooltip},al=async(t,s=32,n=32)=>new Promise((i,v)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(E);try{const w=document.createElement("canvas"),T=w.getContext("2d");w.width=s,w.height=n,T.fillStyle="#fafafa",T.fillRect(0,0,s,n),T.drawImage(g,0,0,s,n);const $=w.toDataURL("image/png");i($)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(E),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),Sn=async()=>{try{const t=qn();setTimeout(async()=>{try{const s=Be.value;if(!s){console.error("Chart SVG element not found"),wn(t);return}const n=Oe(),i=Je.value,v=We.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ie=>ie.remove());const w=g.querySelectorAll("image"),T=Array.from(w).map(async ie=>{const Ue=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(Ue&&!Ue.startsWith("data:"))try{const we=await al(Ue,32,32);ie.setAttribute("xlink:href",we),ie.setAttribute("href",we)}catch(we){console.warn("Failed to convert logo to base64:",we)}});await Promise.all(T);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",G=30;if(at.value&&(B+=`
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),hn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),nn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const yn=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),In=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Vl=e.computed(()=>{const t=Z.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Tl=e.computed(()=>{const s=Z.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Nl=e.computed(()=>{const s=Z.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),yl=e.computed(()=>{const s=Z.value?.radialBar?.dataCenter;return zn.value&&s&&(s.show===!0||s.enabled===!0)}),kn=e.computed(()=>{if(!yl.value||!l.value.length)return"";const n=Z.value?.radialBar?.dataCenter?.showValueOnly===!0?l.value[0]?.value??0:l.value.reduce((i,p)=>i+(p.value??0),0);return Nn(n)}),vn=e.computed(()=>{const s=Z.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),Ll=e.computed(()=>({x:Et.value,y:Vt.value-vn.value/2})),Cl=e.computed(()=>{const s=Z.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),Wn=e.computed(()=>{if(!Tl.value||!rn.value||!l.value.length)return[];const t=Nl.value*Math.PI/180,s=(Ut.value+gt.value)/2;return l.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Et.value+Math.cos(n.midAngle)*s,E=Vt.value+Math.sin(n.midAngle)*s;return{value:Nn(n.value),x:g,y:E,show:p,color:n.color,contrastColor:To(n.color)}})}),ml=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(s=>{const n=s.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(s)}),Array.from(t.entries()).map(([s,n])=>{const i=Wt(s),p=n.filter(E=>E.manual),g=n.filter(E=>!E.manual);return{categoryIndex:parseInt(s),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(E=>E.text).join(`
|
|
45
|
+
`)}})}),pl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Sl=e.computed(()=>Z.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),jn=e.computed(()=>{const t=Z.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),zl=e.computed(()=>Z.value?.bubbles?.tooltip?.formatters||{}),ft=e.ref(new Set),pe=e.ref(null),_n=e.ref(!1),Re=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),dt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Pe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),tt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),K=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Ot=e.ref([]),h=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 Bn.value&&t.push(...Object.keys(Bn.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=It.value;return Array.from({length:t+1},(s,n)=>I("chart.fallback.item",{number:n+1}))}return H.categories});const C=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),S=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;return!g||!n||!p?null:new Date(p,E,g)}),O=e.computed(()=>h.value.editingMarkerId!==null),re=e.computed(()=>h.value.readonly),it=t=>{ft.value.has(t)||(Ql.value=!0,pe.value=t)},et=()=>{Ql.value=!1,pe.value=null},Tt=t=>{if(xl.value||$l.value){Pe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=Zt.value?i>=z.value.left-50&&i<=z.value.right+50&&p>=z.value.top-50&&p<=z.value.bottom+100:i>=z.value.left&&i<=z.value.right&&p>=z.value.top&&p<=z.value.bottom;if(_n.value=g,Zt.value){if(!Q.value||!g||K.value.isDragging||K.value.isZooming){Pe.value.show=!1;return}if(_l.value.find(ee=>!ee||ee.isHidden?!1:Math.sqrt(Math.pow(ee.x-i,2)+Math.pow(ee.y-p,2))<=ee.radius+3))Pe.value.show=!1;else{const ee=_l.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(ee.length>0){let ye=ee[0],ke=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));ee.forEach(we=>{const xe=Math.sqrt(Math.pow(we.x-i,2)+Math.pow(we.y-p,2));xe<ke&&(ke=xe,ye=we)});const ie=30,qe=_l.value.filter(we=>!we||we.isHidden?!1:Math.abs(we.x-ye.x)<=ie).sort((we,xe)=>we.y-xe.y);Pe.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const we=Sl.value,xe=jn.value,Fe=[];return qe.forEach(He=>{we.forEach(kt=>{const bt=xe[kt]||kt,Vn=y(kt,He);Vn&&Fe.push({seriesName:He.seriesName,label:He.label,value:`${bt}: ${Vn}`,color:He.color,y:He.y})})}),Fe})()}}else Pe.value.show=!1}return}if(K.value.isDragging&&K.value.scale>1&&sn.value&&fe.value){Pe.value.show=!1;const Ee=t.clientX-K.value.lastMouseX,{minX:ee,maxX:ye}=It.value,ke=ye-ee||1,qe=Ee*.8;K.value.offsetX+=qe;const we=ke/K.value.scale,xe=ke-we,Fe=0,He=-xe/ke*z.value.width,kt=Fe;K.value.offsetX=Math.max(He,Math.min(kt,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY;return}if(!Q.value||!sn.value||K.value.isDragging||K.value.isZooming||!g){Pe.value.show=!1;return}const{minX:E,maxX:w}=It.value,T=w-E||1,$=T/K.value.scale,L=E-K.value.offsetX/z.value.width*T,B=(i-z.value.left)/z.value.width,G=L+B*$,me=Math.round(G);if(me>=0&&me<=w){const Ee=Wt(me),ee=fl.value.map((ye,ke)=>{const ie=H.series.findIndex(we=>we===ye),qe=ye.data[me];return{seriesName:ye.name,value:qe!==void 0?qe:null,color:Rt(ie),y:qe!==void 0?on(qe):null}}).filter(ye=>ye.value!==null);Pe.value={show:!0,x:Ee,categoryIndex:me,data:ee}}},fn=()=>{Pe.value.show=!1,_n.value=!1,$l.value=!1,xl.value||(pl.value.show=!1),K.value.isDragging&&(K.value.isDragging=!1),K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1,setTimeout(()=>{pe.value=null,Re.value.show=!1},150)},Dt=t=>{if(t.preventDefault(),t.stopPropagation(),!Rn.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(rn.value){tt.value.show=!1,e.nextTick(()=>{tt.value.show=!0,tt.value.x=t.clientX,tt.value.y=t.clientY,tt.value.categoryIndex=null});return}const p=Math.max(0,z.value.left-20),g=z.value.right,E=z.value.top,w=z.value.bottom+80;n>=p&&n<=g&&i>=E&&i<=w&&(tt.value.show=!1,e.nextTick(()=>{tt.value.show=!0,tt.value.x=t.clientX,tt.value.y=t.clientY,tt.value.categoryIndex=null;const T=Math.max(z.value.left,Math.min(n,z.value.right))-z.value.left,L=z.value.width/gl.value.length,B=Math.floor(T/L);B>=0&&B<gl.value.length&&(tt.value.categoryIndex=B)}))},qt=t=>{if(!(t&&t.button===2)){if(tt.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}tt.value.show=!1}},Pl=t=>{if(typeof t.template=="function"){const s={series:H.series,categories:H.categories,markers:Ot.value},n={chartX:tt.value.chartX,chartY:tt.value.chartY,dataX:tt.value.mouseDataX,dataY:tt.value.mouseDataY,categoryIndex:tt.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},lo=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},oo=t=>t.style||{},bn=t=>t.type&&Bn.value[t.type]?Bn.value[t.type]:t.customIcon?t.customIcon:un.value,ao=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",so=t=>Ot.value.length?Ot.value.filter(s=>s.categoryIndex===t):[],ro=t=>{if(!sn.value&&!Zt.value)return{x:0,y:0};const s=Wt(t),n=ae.value+z.value.bottom-dn.value/2;return{x:s,y:n}},Ol=()=>{Ot.value.forEach(t=>{if(t.categoryIndex!==void 0&&(sn.value||Zt.value)){const s=ro(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(h.value.description&&h.value.description.length&&h.value.date){if(O.value){const t=Ot.value.findIndex(s=>s.id===h.value.editingMarkerId);t!==-1?(Ot.value[t].description=h.value.description||"",Ot.value[t].color=h.value.color||"",Ot.value[t].type=h.value.type||"default",Se("update-marker",Ot.value[t])):Se("update-marker",{id:h.value.editingMarkerId,description:h.value.description||"",color:h.value.color||"",type:h.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=q(h.value.date,H.categories||[]);if(Zt.value){const{maxX:E}=It.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else sn.value&&(s=Math.max(0,Math.min(s,It.value.maxX)));const n=Wt(s),i=ae.value+z.value.bottom-dn.value/2,p=Array.isArray(H.categories)?H.categories[s]:null,g={id:t,title:"",description:h.value.description||"",color:h.value.color||"",type:h.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:p||null};h.value.categoryIndex=s,Ot.value.push(g),Se("add-marker",g)}Kt(),Kn()}},Kt=()=>{h.value.show=!1,h.value.title="",h.value.description="",h.value.color="#FF6B6B",h.value.type="default",h.value.editingMarkerId=null,h.value.readonly=!1,h.value.categoryIndex=null,h.value.fromButton=!1,h.value.date=null},co=()=>{O.value&&(Vo(h.value.editingMarkerId),Kt())},Vo=t=>{const s=Ot.value.findIndex(n=>n.id===t);s!==-1&&(Ot.value.splice(s,1),Kn()),Se("delete-marker",t)},gn=t=>{if(h.value.show=!0,h.value.title=t?.title??t?.comment??"",h.value.description=t?.description??t?.comment??"",h.value.color=t?.color??"",h.value.type=t?.type??"default",h.value.editingMarkerId=t?.id??t?.marker_id??null,h.value.readonly=t?.readonly??!1,h.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),E=Number(n)-1;g&&n&&p?h.value.date=new Date(p,E,g):h.value.date=null}else h.value.date=null},Kn=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(Ot.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},kl=()=>{try{const t=`dss-chart-markers-${H.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Ot.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Ot.value=[]}},$n=t=>{const s=at.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${s.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},qn=()=>{const t=Pe.value.show,s=Re.value.show;return Pe.value.show=!1,Re.value.show=!1,{originalCrosshair:t,originalTooltip:s}},wn=t=>{Pe.value.show=t.originalCrosshair,Re.value.show=t.originalTooltip},al=async(t,s=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const E=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(E);try{const w=document.createElement("canvas"),T=w.getContext("2d");w.width=s,w.height=n,T.fillStyle="#fafafa",T.fillRect(0,0,s,n),T.drawImage(g,0,0,s,n);const $=w.toDataURL("image/png");i($)}catch(w){console.warn("Canvas conversion failed:",w),i(t)}},g.onerror=w=>{clearTimeout(E),console.warn("Failed to load image:",t,w),i(t)},g.src=t}),Sn=async()=>{try{const t=qn();setTimeout(async()=>{try{const s=Be.value;if(!s){console.error("Chart SVG element not found"),wn(t);return}const n=Oe(),i=Ue.value,p=Ze.value+n.height,g=s.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(ie=>ie.remove());const w=g.querySelectorAll("image"),T=Array.from(w).map(async ie=>{const qe=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(qe&&!qe.startsWith("data:"))try{const we=await al(qe,32,32);ie.setAttribute("xlink:href",we),ie.setAttribute("href",we)}catch(we){console.warn("Failed to convert logo to base64:",we)}});await Promise.all(T);const L=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",G=30;if(at.value&&(B+=`
|
|
46
46
|
<text x="24" y="${G}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
51
|
${at.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
-
</text>`,G+=30),
|
|
52
|
+
</text>`,G+=30),Ct.value&&(B+=`
|
|
53
53
|
<text x="24" y="${G}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,G+=25),
|
|
57
|
+
${Ct.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),Nt.value&&H.series.length>0){let ie=i-200,qe=at.value||Ct.value?35:25;const we=Math.floor((i-250)/120);let xe=0;H.series.forEach((Fe,He)=>{if(!ft.value.has(He)){const kt=Rt(He),bt=Fe.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");B+=`<circle cx="${ie+6}" cy="${qe-4}" r="6" fill="${kt}"/>`,B+=`<text x="${ie+18}" y="${qe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${bt}</text>`,xe++,xe%we===0?(ie=i-200,qe+=20):ie+=Math.min(120,bt.length*8+35)}})}let me="";if(se.value)try{const{width:ie,height:qe}=We.value,we=ot.value,xe=z.value.left,Fe=z.value.right,He=z.value.top,kt=z.value.bottom,bt=z.value.width,Vn=z.value.height;let Xt,dl;switch(we){case"center":Xt=xe+(bt-ie)/2,dl=He+(Vn-qe)/2;break;case"top-left":Xt=xe+15,dl=He+5;break;case"top-right":Xt=Fe-ie-5,dl=He+5;break;case"bottom-left":Xt=xe+15,dl=kt-qe-5;break;case"bottom-right":default:Xt=Fe-ie-5,dl=kt-qe-5;break}me=`
|
|
59
59
|
<g opacity="${Ne.value}">
|
|
60
|
-
<g transform="translate(${
|
|
60
|
+
<g transform="translate(${Xt}, ${dl}) scale(${ie/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(ie){console.warn("Watermark processing failed, skipping watermark in SVG:",ie),
|
|
76
|
-
<svg width="${i}" height="${
|
|
75
|
+
</g>`}catch(ie){console.warn("Watermark processing failed, skipping watermark in SVG:",ie),me=""}const Ee=`<?xml version="1.0" encoding="UTF-8"?>
|
|
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">
|
|
79
79
|
<defs>
|
|
@@ -86,26 +86,26 @@
|
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
87
|
${B}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
|
-
${
|
|
90
|
-
${
|
|
89
|
+
${L}
|
|
90
|
+
${me}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
92
|
+
</svg>`,ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ee),ke=document.createElement("a");ke.href=ye,ke.download=$n("svg"),document.body.appendChild(ke),ke.click(),document.body.removeChild(ke),URL.revokeObjectURL(ye),wn(t),qt()}catch(s){console.error("Error downloading SVG:",s),wn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},Zl=async()=>{try{const t=qn();b.value&&b.value.offsetHeight,await new Promise(ie=>setTimeout(ie,300));const s=Oe(),n=Ue.value,i=Ze.value+s.height,p=document.createElement("canvas"),g=p.getContext("2d"),E=2;p.width=n*E,p.height=i*E,p.style.width=n+"px",p.style.height=i+"px",g.scale(E,E),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let w=30;if(at.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(at.value,24,w),w+=30),Ct.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Ct.value,24,w),w+=25),Nt.value&&H.series.length>0){let ie=n-200,qe=at.value||Ct.value?35:25;const we=Math.floor((n-250)/120);let xe=0;g.font="12px Arial, sans-serif",H.series.forEach((Fe,He)=>{if(!ft.value.has(He)){const kt=Rt(He);g.beginPath(),g.arc(ie+6,qe-4,6,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.fillStyle="#333",g.fillText(Fe.name,ie+18,qe),xe++,xe%we===0?(ie=n-200,qe+=20):ie+=Math.min(120,Fe.name.length*8+35)}})}const $=Be.value.cloneNode(!0),L=$.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=$.querySelectorAll(".dss-crosshair"),G=$.querySelectorAll('[class*="tooltip"]');L.forEach(ie=>ie.remove()),B.forEach(ie=>ie.remove()),G.forEach(ie=>ie.remove()),$.querySelectorAll("image").forEach((ie,qe)=>{const we=ie.getAttribute("xlink:href")||ie.getAttribute("href");if(we&&!we.startsWith("data:")){const xe=zt.value[qe],Fe=xe?Rt(xe.seriesIndex):"#3B82F6",He=ie.getAttribute("x")||0,kt=ie.getAttribute("y")||0,bt=ie.getAttribute("width")||32,Vn=ie.getAttribute("height")||32,Xt=document.createElementNS("http://www.w3.org/2000/svg","circle");Xt.setAttribute("cx",parseFloat(He)+parseFloat(bt)/2),Xt.setAttribute("cy",parseFloat(kt)+parseFloat(Vn)/2),Xt.setAttribute("r",Math.min(parseFloat(bt),parseFloat(Vn))/2-1),Xt.setAttribute("fill",Fe),Xt.setAttribute("stroke","#fafafa"),Xt.setAttribute("stroke-width","2"),ie.parentNode.replaceChild(Xt,ie)}});const Ee=new XMLSerializer().serializeToString($),ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),ye=URL.createObjectURL(ee),ke=new Image;return new Promise((ie,qe)=>{ke.onload=async()=>{try{if(g.drawImage(ke,0,s.height),zt.value.forEach(we=>{const xe=we.x,Fe=we.y+s.height,He=(we.width||32)/2,kt=Rt(we.seriesIndex);g.save(),g.beginPath(),g.arc(xe,Fe,He-1,0,2*Math.PI),g.fillStyle=kt,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),se.value){const we=new Image,xe=()=>{const{width:He,height:kt}=We.value,bt=ot.value,Vn=z.value.left,Xt=z.value.right,dl=z.value.top,qo=z.value.bottom,ea=z.value.width,ta=z.value.height;let Fl,Il;switch(bt){case"center":Fl=Vn+(ea-He)/2,Il=dl+s.height+(ta-kt)/2;break;case"top-left":Fl=Vn+15,Il=dl+s.height+10;break;case"top-right":Fl=Xt-He-5,Il=dl+s.height+10;break;case"bottom-left":Fl=Vn+15,Il=qo+s.height-kt-5;break;case"bottom-right":default:Fl=Xt-He-5,Il=qo+s.height-kt-5;break}g.globalAlpha=Ne.value,g.drawImage(we,Fl,Il,He,kt),g.globalAlpha=1,Fe()},Fe=()=>{p.toBlob(He=>{const kt=URL.createObjectURL(He),bt=document.createElement("a");bt.href=kt,bt.download=$n("png"),document.body.appendChild(bt),bt.click(),document.body.removeChild(bt),URL.revokeObjectURL(kt),URL.revokeObjectURL(ye),wn(t),qt(),ie()},"image/png")};we.onload=xe,we.onerror=Fe,we.src=Fn.value}else p.toBlob(we=>{const xe=URL.createObjectURL(we),Fe=document.createElement("a");Fe.href=xe,Fe.download=$n("png"),document.body.appendChild(Fe),Fe.click(),document.body.removeChild(Fe),URL.revokeObjectURL(xe),URL.revokeObjectURL(ye),wn(t),qt(),ie()},"image/png")}catch(we){URL.revokeObjectURL(ye),wn(t),qe(we)}},ke.onerror=()=>{URL.revokeObjectURL(ye),wn(t),qe(new Error("Failed to load SVG image"))},ke.src=ye})}catch(t){console.error("Error downloading PNG:",t)}},Bl=()=>{try{let t="";at.value&&(t+=`# ${I("chart.csv.chartTitle")}: ${at.value}
|
|
93
|
+
`),Ct.value&&(t+=`# ${I("chart.csv.chartSubtitle")}: ${Ct.value}
|
|
94
94
|
`),t+=`# ${I("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
|
-
`,t+="Category",
|
|
97
|
-
`;const s=Math.max(...
|
|
98
|
-
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),v=document.createElement("a");v.href=i,v.download=$n("csv"),document.body.appendChild(v),v.click(),document.body.removeChild(v),URL.revokeObjectURL(i),Ut()}catch(t){console.error("Error downloading CSV:",t)}},No=t=>{if(typeof t.action=="function"){const s={series:L.series,categories:L.categories,markers:Zt.value},n={chartX:Qe.value.chartX,chartY:Qe.value.chartY,dataX:Qe.value.mouseDataX,dataY:Qe.value.mouseDataY,categoryIndex:clampedCategoryIndex||Qe.value.categoryIndex};t.action(s,n)}Ut()},uo=()=>{jt(),h.value.show=!0,h.value.categoryIndex=Qe.value.categoryIndex,h.value.fromButton=!1,Ut()},mo=()=>{jt(),h.value.show=!0,h.value.categoryIndex=0,h.value.fromButton=!0},po=t=>{if(Qe.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(Qe.value.show=!1)}},Wl=t=>{Qe.value.show&&!t.target.closest(".context-menu")&&(Qe.value.show=!1)},ql=t=>{if(!rn.value||!ye.value)return;t.preventDefault(),t.stopPropagation(),j.value.isZooming=!0,Pe.value.show=!1,j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,v=t.clientY-n.top;if(i<z.value.left-50||i>z.value.right+50||v<z.value.top-50||v>z.value.bottom+100){j.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(j.value.minScale,Math.min(j.value.maxScale,j.value.scale*g));if(E!==j.value.scale){const{minX:w,maxX:T}=zt.value,$=T-w||1,H=$/j.value.scale,B=w-j.value.offsetX/z.value.width*$,G=(i-z.value.left)/z.value.width,ue=B+G*H;j.value.scale=E;const Ee=$/j.value.scale,J=ue-G*Ee;j.value.offsetX=-(J-w)/$*z.value.width,j.value.scale<=1.01&&(j.value.scale=1,j.value.offsetX=0)}j.value.zoomTimeout=setTimeout(()=>{j.value.isZooming=!1,j.value.zoomTimeout=null},300)},So=t=>{if(!rn.value||!ye.value||j.value.scale<=1)return;Pe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,j.value.isDragging=!0,j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY,t.preventDefault()},Bo=()=>{j.value.isDragging=!1},Ul=()=>{!rn.value||!ye.value||(j.value.scale=1,j.value.offsetX=0,j.value.isDragging=!1,j.value.zoomTimeout&&(clearTimeout(j.value.zoomTimeout),j.value.zoomTimeout=null),j.value.isZooming=!1)},Xl=()=>!rn.value||!_n.value||!ye.value?"default":j.value.isDragging?"grabbing":j.value.scale>1?"grab":"dss-crosshair",Hl=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],v=t[n],g=t[n+1],E=t[Math.min(n+2,t.length-1)],w=v.x+(g.x-i.x)/6*x.value,T=v.y+(g.y-i.y)/6*x.value,$=g.x-(E.x-v.x)/6*x.value,H=g.y-(E.y-v.y)/6*x.value;s+=` C ${w} ${T} ${$} ${H} ${g.x} ${g.y}`}return s},xn=e.computed(()=>{const s=O.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,v=50;let g=v+(Mt.value?30:0)+60;if(Gn.value){const B={left:v+40,top:v+40,right:v+40,bottom:v+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(cn.value){const B=!Bt.value,G=hn.value,ue=G?yn.value+In.value+Math.max(24,tn.value+16):0,Ee=B?12:v;let J=0;at.value&&(J+=B?8:15),Vt.value&&(J+=B?6:10);const ge=Oe();let ke=Ee+(B?4:16)+(G?ue:0),ie=Ee+(G?ue:0);Bt.value&&Ct.value==="left"?ke+=ge.legendWidth||150:Bt.value&&Ct.value==="right"&&(ie+=ge.legendWidth||150);const we=Ie.value==="semi-radial"?G?ue:8:G?ue:B?8:v+80,xe=G?14:0,De=Ee+J+xe,Te={left:ke,top:De,right:ie,bottom:we};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Te.left,top:i.top??Te.top,right:i.right??Te.right,bottom:i.bottom??Te.bottom}:Te}let E=0;at.value&&(E+=15),Vt.value&&(E+=10);const w=Oe();let T=v+16,$=v;Bt.value&&Ct.value==="left"?T+=w.legendWidth||150:Bt.value&&Ct.value==="right"&&($+=w.legendWidth||150);const H={left:T,top:v+E,right:$,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??H.left,top:i.top??H.top,right:i.right??H.right,bottom:i.bottom??H.bottom}:H}),z=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:Je.value-xn.value.right,bottom:We.value-xn.value.bottom,width:Je.value-(xn.value.left+xn.value.right),height:We.value-(xn.value.top+xn.value.bottom)})),rn=e.computed(()=>["line","area","bar"].includes(Ie.value)||$t.value),Tn=e.computed(()=>$t.value),cn=e.computed(()=>["radial","semi-radial"].includes(Ie.value)),Gn=e.computed(()=>Ie.value==="spider"),Wt=e.computed(()=>Ie.value==="bubble"),nn=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(Ie.value==="bar"||Tn.value)),Qn=t=>{const{minY:s,maxY:n}=zt.value,i=n-s||1;return z.value.left+(t-s)/i*z.value.width},Ln=t=>{const{maxX:s}=zt.value,n=s+1,v=z.value.height/n;return z.value.top+(t+.5)*v},Nt=e.computed(()=>cn.value?xn.value.left+(Je.value-xn.value.left-xn.value.right)/2:Je.value/2),St=e.computed(()=>Gn.value?We.value/2-40:cn.value?xn.value.top+(We.value-xn.value.top-xn.value.bottom)/2:We.value/2),gt=e.computed(()=>{if(Gn.value){const t=z.value.width-80,s=z.value.height-80;return Math.min(t,s)/2}return Math.min(z.value.width,z.value.height)/2}),Xt=e.computed(()=>{const t=O.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return gt.value*n}),vo=e.computed(()=>{const t=O.value,s=typeof L.innerSize=="number"?L.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(cn.value||Gn.value)?1:1+s/100}),Jn=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const s=Nt.value,n=St.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Hn=e.ref(0),el=e.computed(()=>`semi-radial-fill-clip-${L.chartId}`),zn=e.computed(()=>Ie.value==="semi-radial"),It=e.computed(()=>zn.value&&P.value&&!Jt.value),Ml=e.computed(()=>zn.value&&P.value&&!Jt.value&&X.value==="fill"),fo=e.computed(()=>{const t=It.value?Hn.value:1,s=Nt.value,n=St.value,i=Xt.value,v=gt.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const w=s+v*Math.cos(g),T=n+v*Math.sin(g),$=s+v*Math.cos(E),H=n+v*Math.sin(E),B=s+i*Math.cos(E),G=n+i*Math.sin(E),ue=s+i*Math.cos(g),Ee=n+i*Math.sin(g),J=t>.5?1:0;return`M ${s} ${n} L ${w} ${T} A ${v} ${v} 0 ${J} 1 ${$} ${H} L ${B} ${G} A ${i} ${i} 0 ${J} 1 ${ue} ${Ee} Z`}),sl=e.computed(()=>{if(!(!zn.value||!It.value)&&!Ml.value)return`url(#${el.value})`}),vl=t=>{if(!(!Ml.value||t!==0))return`url(#${el.value})`},An=e.ref(0),rl=e.computed(()=>`radial-reveal-clip-${L.chartId}`),En=e.computed(()=>Ie.value==="radial"),Mo=e.computed(()=>{const t=En.value?An.value:1,s=Nt.value,n=St.value,i=Math.max(gt.value*1.5,Je.value,We.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const B=s-i,G=s+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const v=-Math.PI/2,g=v+t*Math.PI*2,E=s+i*Math.cos(v),w=n+i*Math.sin(v),T=s+i*Math.cos(g),$=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${E} ${w} A ${i} ${i} 0 ${H} 1 ${T} ${$} Z`}),_o=e.computed(()=>{if(sl.value)return sl.value;if(En.value)return`url(#${rl.value})`});let tl=null;const go=()=>{if(!It.value)return;Hn.value=0;const t=He.value,s=performance.now(),n=i=>{const v=i-s,g=Math.min(1,v/t);Hn.value=On(Me.value,g),g<1&&(tl=requestAnimationFrame(n))};tl=requestAnimationFrame(n)},bl=e.computed(()=>O.value?.bubbles?.minSize||8),ho=e.computed(()=>O.value?.bubbles?.maxSize||50),yo=e.computed(()=>O.value?.bubbles?.opacity||.7),Co=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,v=1+Math.sin(s*.5)*.2;return Math.max(5,i*v)},Al=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Yl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Pn=e.computed(()=>L.series),fl=e.computed(()=>L.series.filter((t,s)=>!ft.value.has(s))),nl="auto",zt=e.computed(()=>{if(Wt.value)return ko();if(!fl.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;fl.value.forEach(w=>{w.data&&w.data.length&&(n=Math.max(n,w.data.length-1),w.data.forEach(T=>{typeof T=="number"&&(t=Math.min(t,T),s=Math.max(s,T))}))}),L.categories.length>0&&(n=Math.max(n,L.categories.length-1)),t===1/0&&(t=0,s=100);const i=ze.value,v=At.value;let g,E;if(i===nl){const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}else if(typeof i=="number")g=i;else{const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}if(v===nl){const w=s-t,T=w>0?w*.1:2;E=s+T}else if(typeof v=="number")E=v;else{const w=s-t,T=w>0?w*.1:2;E=s+T}return{minX:0,maxX:n,minY:g,maxY:E}}),ko=()=>{if(!fl.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,v=1/0,g=-1/0,E=!1;if(fl.value.forEach((ue,Ee)=>{ue?.data?.length&&ue.data.forEach((J,ge)=>{let ke,ie,Ue;if(typeof J=="object"&&J!==null&&!Array.isArray(J))ke=typeof J.x=="number"?J.x:ge,ie=typeof J.y=="number"?J.y:0,Ue=typeof J.size=="number"?J.size:20;else if(Array.isArray(J)&&J.length>=3)ke=typeof J[0]=="number"?J[0]:ge,ie=typeof J[1]=="number"?J[1]:0,Ue=typeof J[2]=="number"?J[2]:20;else if(typeof J=="number")ke=ge,ie=J,Ue=Co(Ee,ge);else return;isFinite(ke)&&isFinite(ie)&&isFinite(Ue)&&(t=Math.min(t,ke),s=Math.max(s,ke),n=Math.min(n,ie),i=Math.max(i,ie),v=Math.min(v,Ue),g=Math.max(g,Ue),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,L.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const w=s-t,T=i-n;let $,H,B,G;return Tt.value!==null?$=Tt.value:$=t-w*.1,sn.value!==null?H=sn.value:H=s+w*.1,ze.value!==null&&typeof ze.value=="number"?B=ze.value:B=Math.max(0,n-T*.1),At.value!==null&&typeof At.value=="number"?G=At.value:G=i+T*.1,{minX:$,maxX:H,minY:B,maxY:G,minSize:v,maxSize:g}},qt=t=>{if(Wt.value){const{minX:w,maxX:T}=zt.value,$=T-w||1;return z.value.left+(t-w)/$*z.value.width}const{minX:s,maxX:n}=zt.value,i=n-s;if(n===0||i===0)return z.value.left+z.value.width/2;const v=i/j.value.scale,g=s-j.value.offsetX/z.value.width*i,E=(t-g)/v;return z.value.left+E*z.value.width},ln=t=>{const{minY:s,maxY:n}=zt.value,i=n-s||1;return z.value.bottom-(t-s)/i*z.value.height},bo=t=>{if(!Wt.value)return ve.value||4;const{maxSize:s}=zt.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return bl.value+i*(ho.value-bl.value)},$o=e.computed(()=>Dl.value.map(t=>({y:t.y}))),gl=e.computed(()=>{if(Wt.value)return il();if(Ie.value==="bar"){if(nn.value){const we=[],{minY:xe,maxY:De}=zt.value,Te=5,bt=De-xe||1;for(let wt=0;wt<=Te;wt++){const Vn=xe+bt*(wt/Te),Yt=Qn(Vn);we.push({x:Yt,y:z.value.bottom+20,text:Nn(Math.round(Vn))})}return we}const Ee=[],{maxX:J}=zt.value,ge=J+1,ke=5,Ue=(z.value.width-ke*2)/ge;for(let we=0;we<=J;we++){const xe=z.value.left+ke+(we+.5)*Ue;Ee.push({x:xe,y:z.value.bottom+20,text:L.categories[we]||I("chart.fallback.item",{number:we+1})})}return Ee}const t=[],{minX:s,maxX:n}=zt.value,i=n-s||1,v=i/j.value.scale,g=s-j.value.offsetX/z.value.width*i,E=g+v,w=Math.max(0,Math.floor(g-2)),T=Math.min(n,Math.ceil(E+2)),$=T-w,H=z.value.width,G=Math.floor(H/60);let ue=1;$>G&&(ue=Math.ceil($/G));for(let Ee=w;Ee<=T;Ee+=ue)if(Ee>=0&&Ee<=n){const J=qt(Ee);J>=z.value.left-100&&J<=z.value.right+100&&t.push({x:J,y:z.value.bottom+20,text:L.categories[Ee]||`Item ${Ee+1}`})}return t}),il=()=>{const t=[],{minX:s,maxX:n}=zt.value,i=n-s||1,v=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let g=0;g<=v;g++){const E=s+i*g/v,w=qt(E);if(w>=z.value.left-10&&w<=z.value.right+10){const T=Math.round(E),$=L.categories?.[T];t.push({x:w,y:z.value.bottom+20,text:$||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Dl=e.computed(()=>{if(nn.value){const v=[],{maxX:g}=zt.value;for(let E=0;E<=g;E++)v.push({x:z.value.left-10,y:Ln(E),text:L.categories[E]||`Item ${E+1}`});return v}const t=[],{minY:s,maxY:n}=zt.value,i=5;for(let v=0;v<=i;v++){const g=s+(n-s)*(v/i),E=Math.round(g);t.push({x:z.value.left-10,y:ln(g),text:Nn(E)})}return t}),Ft=t=>{const s=V.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},To=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,v=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,v=Number(g[3])/255;else{const w=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,i=Number(w[2])/255,v=Number(w[3])/255;else{const T=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(T){let $=T[1];$.length===3&&($=$[0]+$[0]+$[1]+$[1]+$[2]+$[2]),n=parseInt($.slice(0,2),16)/255,i=parseInt($.slice(2,4),16)/255,v=parseInt($.slice(4,6),16)/255}else if(typeof document<"u"){const $=document.createElement("span");$.style.color=s,$.style.display="none",document.body.appendChild($);const H=getComputedStyle($).color;document.body.removeChild($);const B=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,v=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*v>.5?"#3a3a3a":"#fafafa"},jl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),E=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${w})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),E=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${w}, ${i[4]})`}const v=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(v){let g=v[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),T=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,w,T].map($=>$.toString(16).padStart(2,"0")).join("")}`}return s},Kl=(t,s)=>{const i=O.value?.stroke?.color;return i==null?jl(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??jl(s):jl(s)},wl=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,v=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+v*v)}return s},Dn=e.computed(()=>Ie.value==="line"||Tn.value?(Tn.value?L.series.filter(s=>(s.type||Ie.value)==="line"):Pn.value).map((s,n)=>{const i=L.series.findIndex(B=>B===s),v=[];let g=[];s.data.forEach((B,G)=>{B==null?g.length>0&&(v.push([...g]),g=[]):g.push({x:nn.value?Qn(B):qt(G),y:nn.value?Ln(G):ln(B),index:G})}),g.length>0&&v.push(g);let E="";v.forEach(B=>{if(B.length>0){let G="";ae.value?G=Hl(B):G=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(ue=>` L ${ue.x} ${ue.y}`).join(""),E+=(E?" ":"")+G}});const w=v.reduce((B,G)=>B+wl(G),0),T=ft.value.has(i),$=de.value===i,H=de.value!==null&&de.value!==i;return{path:E,color:Ft(i),pathLength:w,seriesIndex:i,animationDelay:n*te.value,isHighlighted:$,isDimmed:H,isHidden:T}}):[]),wo=e.computed(()=>{if(!(Ie.value==="line"||Tn.value))return[];const t=Tn.value?L.series.filter(n=>(n.type||Ie.value)==="line"):Pn.value,s=[];return t.forEach((n,i)=>{const v=L.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let w=-1,T=0;for(let $=g+1;$<n.data.length;$++){const H=n.data[$];if(H==null)T++;else{w=$;break}}if(T>0&&w!==-1){const $=n.data[w],H=nn.value?Qn(E):qt(g),B=nn.value?Ln(g):ln(E),G=nn.value?Qn($):qt(w),ue=nn.value?Ln(w):ln($),Ee=ft.value.has(v),J=de.value===v,ge=de.value!==null&&de.value!==v;s.push({path:`M ${H} ${B} L ${G} ${ue}`,color:Ft(v),seriesIndex:v,animationDelay:i*te.value,isHighlighted:J,isDimmed:ge,isHidden:Ee,gapSize:T}),g=w-1}}}}),s}),hl=e.computed(()=>Ie.value==="line"||Tn.value?!P.value||Jt.value||it.value.hasAnimated?[]:(Tn.value?L.series.filter(s=>(s.type||Ie.value)==="line"):Pn.value).map((s,n)=>{const i=L.series.findIndex(T=>T===s);let v="",g=null;s.data.forEach((T,$)=>{if(T!=null){const H={x:nn.value?Qn(T):qt($),y:nn.value?Ln($):ln(T)};g===null?v+=`M ${H.x} ${H.y}`:v+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((B,G)=>G>$&&B!==null&&B!==void 0);if(H!==-1){const B={x:nn.value?Qn(s.data[H]):qt(H),y:nn.value?Ln(H):ln(s.data[H])};v+=` L ${B.x} ${B.y}`,g=B}}});const E=s.data.map((T,$)=>T==null?null:{x:nn.value?Qn(T):qt($),y:nn.value?Ln($):ln(T)}).filter(T=>T!==null),w=wl(E);return{path:v,pathLength:w,color:Ft(i),animationDelay:n*te.value,seriesIndex:i}}):[]),Gl=e.computed(()=>{if(Ie.value!=="line")return[];const t=[];return Pn.value.forEach((s,n)=>{const i=de.value===n,v=de.value!==null&&de.value!==n,g=ft.value.has(n);s.data.forEach((E,w)=>{E!=null&&t.push({x:qt(w),y:ln(E),color:Ft(n),value:E,label:L.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(n*s.data.length+w)*(te.value/8),isHighlighted:i,isDimmed:v,isHidden:g})})}),t}),Lo=e.computed(()=>{if(!Tn.value)return[];const t=[];return L.series.filter(n=>(n.type||Ie.value)==="line").forEach((n,i)=>{const v=L.series.findIndex(T=>T===n),g=de.value===v,E=de.value!==null&&de.value!==v,w=ft.value.has(v);n.data.forEach((T,$)=>{T!=null&&t.push({x:qt($),y:ln(T),color:Ft(v),value:T,label:L.categories[$]||$.toString(),seriesName:n.name,categoryIndex:$,dataIndex:$,animationDelay:(i*n.data.length+$)*(te.value/8),isHighlighted:g,isDimmed:E,isHidden:w})})}),t}),_l=e.computed(()=>{if(!Wt.value)return[];const t=[];return Pn.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=de.value,v=i!==null&&i===n,g=i!==null&&i!==n,E=ft.value.has(n);s.data.forEach((w,T)=>{let $,H,B,G,ue;if(typeof w=="object"&&w!==null&&!Array.isArray(w))$=typeof w.x=="number"?w.x:T,H=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,G=w.label||L.categories?.[T]||`Point ${T+1}`,ue=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)$=typeof w[0]=="number"?w[0]:T,H=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,G=w[3]||L.categories?.[T]||`Point ${T+1}`,ue=w[4];else if(typeof w=="number")$=T,H=w,B=Co(n,T),G=L.categories?.[T]||`Point ${T+1}`;else return;!isFinite($)||!isFinite(H)||!isFinite(B)||t.push({x:qt($),y:ln(H),radius:bo(B),originalX:$,originalY:H,originalSize:B,color:Ft(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:ue,seriesIndex:n,dataIndex:T,categoryIndex:Math.round($),isHighlighted:v,isDimmed:g,isHidden:E,opacity:yo.value})})}),t}),Rl=e.computed(()=>Ie.value!=="area"?[]:Pn.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((B,G)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:qt(G),y:ln(B),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Ft(s),isHidden:ft.value.has(s)};const v=z.value.bottom+1;let g="",E="";n.forEach((B,G)=>{if(B.length===0)return;let ue=`M ${B[0].x} ${B[0].y}`;ae.value&&B.length>1?ue=Hl(B):B.slice(1).forEach(J=>{ue+=` L ${J.x} ${J.y}`}),g+=(g?" ":"")+ue;let Ee=`M ${B[0].x} ${v}`;if(Ee+=` L ${B[0].x} ${B[0].y}`,ae.value&&B.length>1){const J=Hl(B),ge=J.substring(J.indexOf("C")||J.indexOf("Q")||J.indexOf("L"));ge?Ee+=" "+ge:B.slice(1).forEach(ke=>{Ee+=` L ${ke.x} ${ke.y}`})}else B.slice(1).forEach(J=>{Ee+=` L ${J.x} ${J.y}`});Ee+=` L ${B[B.length-1].x} ${v} Z`,E+=(E?" ":"")+Ee});const w=de.value===s,T=de.value!==null&&de.value!==s,$=ft.value.has(s),H=n.reduce((B,G)=>B+wl(G),0);return{linePath:g,areaPath:E,color:Ft(s),pathLength:H,isHighlighted:w,isDimmed:T,isHidden:$}})),o=e.computed(()=>{if(!(["bar"].includes(Ie.value)||Tn.value))return[];const t=[],{maxX:s}=zt.value,n=Tn.value?L.series.filter(v=>(v.type||Ie.value)==="bar"):Pn.value,i=n.length;if(nn.value){const v=s+1,E=z.value.height/v,w=E*(2/3),T=Math.min(4,w/i*.15),$=w-(i-1)*T,H=Math.max(4,$/i);n.forEach((B,G)=>{const ue=L.series.findIndex(ke=>ke===B),Ee=de.value===ue,J=de.value!==null&&de.value!==ue,ge=ft.value.has(ue);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const xe=z.value.top+(ie+.5)*E-w/2+G*(H+T),De=z.value.left,Te=Math.abs(Qn(ke)-z.value.left);let bt="";if(ae.value&&Te>0){const wt=Math.min(k.value,H/2,Te/2);bt=[`M ${De} ${xe}`,`L ${De+Te-wt} ${xe}`,`Q ${De+Te} ${xe} ${De+Te} ${xe+wt}`,`L ${De+Te} ${xe+H-wt}`,`Q ${De+Te} ${xe+H} ${De+Te-wt} ${xe+H}`,`L ${De} ${xe+H}`,"Z"].join(" ")}t.push({x:De,y:xe,width:Te,height:H,color:Ft(i===1?ie:ue),value:ke,label:L.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(te.value/4),isHighlighted:Ee,isDimmed:J,isHidden:ge,barPath:bt,isSmooth:ae.value&&Te>0})})})}else{const v=s+1,E=z.value.width/v,w=E*.8,T=w/i,$=T*.05,H=T-$;n.forEach((B,G)=>{const ue=L.series.findIndex(ke=>ke===B),Ee=de.value===ue,J=de.value!==null&&de.value!==ue,ge=ft.value.has(ue);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const xe=z.value.left+(ie+.5)*E-w/2+G*T+$/2,De=ln(Math.max(0,ke)),Te=Math.abs(ln(0)-ln(ke));let bt="";if(ae.value&&Te>0){const wt=Math.min(k.value,H/2,Te/2);bt=[`M ${xe} ${De+Te}`,`L ${xe} ${De+wt}`,`Q ${xe} ${De} ${xe+wt} ${De}`,`L ${xe+H-wt} ${De}`,`Q ${xe+H} ${De} ${xe+H} ${De+wt}`,`L ${xe+H} ${De+Te}`,"Z"].join(" ")}t.push({x:xe,y:De,width:H,height:Te,color:Ft(i===1?ie:ue),value:ke,label:L.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(te.value/4),isHighlighted:Ee,isDimmed:J,isHidden:ge,barPath:bt,isSmooth:ae.value&&Te>0})})})}return t}),l=e.computed(()=>{if(!cn.value)return[];const t=Pn.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!ft.value.has(g));if(t.length===0)return[];let s=Ie.value==="semi-radial"?Math.PI:-Math.PI/2;const n=Ie.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],w=g.data[0]||0,T=s,$=s+n-.001,H=T+n/2,B=Nt.value+Math.cos(T)*Xt.value,G=St.value+Math.sin(T)*Xt.value,ue=Nt.value+Math.cos($)*Xt.value,Ee=St.value+Math.sin($)*Xt.value,J=Nt.value+Math.cos($)*gt.value,ge=St.value+Math.sin($)*gt.value,ke=Nt.value+Math.cos(T)*gt.value,ie=St.value+Math.sin(T)*gt.value,Ue=1,we=[`M ${B} ${G}`,`A ${Xt.value} ${Xt.value} 0 ${Ue} 1 ${ue} ${Ee}`,`L ${J} ${ge}`,`A ${gt.value} ${gt.value} 0 ${Ue} 0 ${ke} ${ie}`,"Z"].join(" "),xe=Ft(E);return i.push({path:we,color:xe,strokeWidth:dt.value,strokeColor:Kl(0,xe),value:w,seriesName:g.name,opacity:.8,isHighlighted:de.value===E,isDimmed:!1,isHidden:!1,startAngle:T,endAngle:$,midAngle:H}),i}if(Ml.value&&t.length===2){const g=t[0],E=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),T=w/100*n,$=(H,B,G,ue,Ee)=>{const J=H+(B-H)/2,ge=B-H,ke=Nt.value+Math.cos(H)*Xt.value,ie=St.value+Math.sin(H)*Xt.value,Ue=Nt.value+Math.cos(B)*Xt.value,we=St.value+Math.sin(B)*Xt.value,xe=Nt.value+Math.cos(B)*gt.value,De=St.value+Math.sin(B)*gt.value,Te=Nt.value+Math.cos(H)*gt.value,bt=St.value+Math.sin(H)*gt.value,wt=ge>Math.PI?1:0,Vn=[`M ${ke} ${ie}`,`A ${Xt.value} ${Xt.value} 0 ${wt} 1 ${Ue} ${we}`,`L ${xe} ${De}`,`A ${gt.value} ${gt.value} 0 ${wt} 0 ${Te} ${bt}`,"Z"].join(" "),Yt=Ft(ue);return{path:Vn,color:Yt,strokeWidth:dt.value,strokeColor:Kl(i.length,Yt),value:Ee,seriesName:G.name,opacity:.8,isHighlighted:de.value===ue,isDimmed:de.value!==null&&de.value!==ue,isHidden:!1,startAngle:H,endAngle:B,midAngle:J}};return i.push($(s,s+T,g.series,g.originalIndex,w)),i.push($(s,s+n,E.series,E.originalIndex,100)),i}const v=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return v===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const w=g.data[0]||0,T=w/v*n,$=s,H=s+T,B=$+T/2,G=Nt.value+Math.cos($)*Xt.value,ue=St.value+Math.sin($)*Xt.value,Ee=Nt.value+Math.cos(H)*Xt.value,J=St.value+Math.sin(H)*Xt.value,ge=Nt.value+Math.cos(H)*gt.value,ke=St.value+Math.sin(H)*gt.value,ie=Nt.value+Math.cos($)*gt.value,Ue=St.value+Math.sin($)*gt.value,we=T>Math.PI?1:0,xe=[`M ${G} ${ue}`,`A ${Xt.value} ${Xt.value} 0 ${we} 1 ${Ee} ${J}`,`L ${ge} ${ke}`,`A ${gt.value} ${gt.value} 0 ${we} 0 ${ie} ${Ue}`,"Z"].join(" "),De=Ft(E);i.push({path:xe,color:De,strokeWidth:dt.value,strokeColor:Kl(i.length,De),value:w,seriesName:g.name,opacity:.8,isHighlighted:de.value===E,isDimmed:de.value!==null&&de.value!==E,isHidden:!1,startAngle:$,endAngle:H,midAngle:B}),s=H}),i)}),a=e.computed(()=>{const t=l.value;return Ml.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),r=e.computed(()=>{if(!hn.value||!cn.value)return[];const t=tn.value,s=yn.value,n=In.value,i=Vl.value,v=15,g=t*1.3,E=.55,w=(B,G)=>{const ue=Nt.value+Math.cos(B.midAngle)*gt.value,Ee=St.value+Math.sin(B.midAngle)*gt.value,J=Nt.value+Math.cos(B.midAngle)*(gt.value+s),ge=St.value+Math.sin(B.midAngle)*(gt.value+s),ie=J+n*(G?1:-1),Ue=G?J+v:J-v,we=ge-i,xe=`${B.seriesName}: ${Nn(B.value)}`,De=xe.length*t*E;return{pointerStartX:ue,pointerStartY:Ee,pointerEndX:J,pointerEndY:ge,horizontalEndX:ie,horizontalEndY:ge,textX:Ue,textY:we,text:xe,textWidth:De,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(J-ue,ge-Ee),horizontalLineLength:Math.hypot(ie-J,0)}},T=(B,G)=>{const ue=Math.abs(B.textY-G.textY)<g,Ee=B.isRightSide?B.textX:B.textX-B.textWidth,J=B.isRightSide?B.textX+B.textWidth:B.textX,ge=G.isRightSide?G.textX:G.textX-G.textWidth,ke=G.isRightSide?G.textX+G.textWidth:G.textX,ie=Ee<ke&&ge<J;return ue&&ie},$=l.value.filter(B=>!B.isHidden),H=[];for(let B=0;B<$.length;B++){const G=$[B];let ue=Math.cos(G.midAngle)>=0;if(B>0){const J=H[B-1],ge=w(G,ue);T(J,ge)&&(ue=!ue)}const Ee=w(G,ue);H.push({...Ee,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return H}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||yo.value||.7;return de.value===null||de.value===void 0?s:de.value!==null?t.seriesIndex===de.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 de.value!==null?t.seriesIndex===de.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(de.value===t.seriesIndex?de.value=null:de.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:L.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},m=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},f=(t,s)=>{if(!t||(s.stopPropagation(),$l.value=!0,de.value=t.seriesIndex,Pe.value.show=!1,!ne.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let v=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120;v+E>Je.value&&(v=s.clientX-i.left-E-10),g+w>i.height&&(g=s.clientY-i.top-w-10),v<0&&(v=10),g<0&&(g=10);const T=Sl.value,$=jn.value,H=T.map(B=>{const G=$[B]||B,ue=y(B,t);return ue?{seriesName:t.seriesName,label:t.label,value:`${G}: ${ue}`,color:t.color}:null}).filter(Boolean);Ae.value={show:!0,x:v,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},y=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=zl.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const v=n.toFixed(1);return Mn.value?v+Mn.value:v}return n?.toString()||""},M=()=>{if(!Wt.value||!Pe.value.data||Pe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Pe.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_=(t,s)=>{t&&($l.value=!1,de.value=null,Ae.value.show=!1,Ae.value.bubbleData=[])},N=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),v=ao(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,w=s.clientY-i.top-10;const T=200,$=g?80:50;E+T>Je.value&&(E=s.clientX-i.left-T-15),w+$>We.value&&(w=s.clientY-i.top-$-10),E<0&&(E=10),w<0&&(w=10),mt.value={show:!0,x:E,y:w,categoryValue:v,description:g}},Q=()=>{mt.value.show=!1},Y=e.computed(()=>L.categories.length||Math.max(...fl.value.map(t=>t.data.length))),_e=e.computed(()=>{let t=0;return fl.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),fe=e.computed(()=>{const t=[],s=Y.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,v=Nt.value+Math.cos(i)*gt.value,g=St.value+Math.sin(i)*gt.value;t.push({x:v,y:g,angle:i,index:n})}return t}),ct=e.computed(()=>{const t=[],s=Y.value;return fe.value.forEach((n,i)=>{const v=gt.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Nt.value+Math.cos(g)*v,w=St.value+Math.sin(g)*v+5;let T="middle",$="middle";Math.abs(Math.cos(g))>.5&&(T=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&($=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:w,text:L.categories[i]||`Axis ${i+1}`,anchor:T,baseline:$})}),t}),on=e.ref(new Set),Kt=(t,s,n)=>{const i=`current-${n}`,v=on.value.has(i);return!v&&de.value===null?s.fillOpacity||yt.value:s.isHighlighted||v?(s.fillOpacity||yt.value)+.15:s.isDimmed?(s.fillOpacity||yt.value)*.3:s.fillOpacity||yt.value},Ot=e.computed(()=>{if(!Gn.value)return[];const t=[],s=Y.value;return Pn.value.forEach((n,i)=>{const v=[],g=[],E=[],w=de.value===i,T=de.value!==null&&de.value!==i,$=ft.value.has(i);for(let H=0;H<s;H++){const B=n.data[H]||0,ue=B/_e.value*gt.value,Ee=H*2*Math.PI/s-Math.PI/2,J=Nt.value+Math.cos(Ee)*ue,ge=St.value+Math.sin(Ee)*ue;v.push(`${J},${ge}`),g.push({x:J,y:ge}),E.push({x:J,y:ge,value:B,label:L.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:v.join(" "),polygonPoints:g,dataPoints:E,color:Ft(i),fillOpacity:yt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:w,isDimmed:T,isHidden:$,seriesIndex:i})}),t}),Gt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,v=s.length-1;i<s.length;v=i++){const g=s[i].x,E=s[i].y,w=s[v].x,T=s[v].y;E>t.y!=T>t.y&&t.x<(w-g)*(t.y-E)/(T-E)+g&&(n=!n)}return n},Qt=t=>{if(!Gn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Be.value?.getBoundingClientRect();if(!i)return;const v=t.clientX-i.left,g=t.clientY-i.top,E=Ot.value.filter(w=>w.isHidden?!1:Gt({x:v,y:g},w.polygonPoints));if(E.length>0){E.length,de.value=E[0].seriesIndex;const w=t.clientX-n.left+10,T=t.clientY-n.top-10,$=200,H=50+E.length*25;let B=w,G=T;B+$>Je.value&&(B=t.clientX-n.left-$-10),G+H>We.value&&(G=t.clientY-n.top-H-10),B<0&&(B=10),G<0&&(G=10);const ue=E.map(Ee=>{let J=Ee.dataPoints[0],ge=1/0;return Ee.dataPoints.forEach(ke=>{const ie=Math.sqrt(Math.pow(ke.x-v,2)+Math.pow(ke.y-g,2));ie<ge&&(ge=ie,J=ke)}),{seriesName:Ee.seriesName,color:Ee.color,value:Nn(J.value!==void 0?J.value:Ee.value)}});Ae.value={show:!0,x:B,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ue}}else ol()},Pt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=L.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||ft.value.has(s.seriesIndex))return null;let v,g;if(rn.value){let w=-1,T=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){w=H,T=i.data[H];break}if(w===-1||T===null)return null;const $=i.data.map((H,B)=>H==null?null:{x:qt(B),y:ln(H),index:B}).filter(H=>H!==null);if(t.animations.enabled&&!Jt.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(it.value.isAnimating||!it.value.hasAnimated))if(it.value.isAnimating){const H=it.value.currentFrame/it.value.totalFrames,B=On(t.animations.easing,Math.min(H,1)),G=Jo($,B);v=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else v=$[0].x+(s.offsetX||0),g=$[0].y+(s.offsetY||0);else v=qt(w)+(s.offsetX||0),g=ln(T)+(s.offsetY||0)}else if(cn.value||Gn.value){const w=Math.PI*2/t.logos.length*n;v=Nt.value+Math.cos(w)*(gt.value+30)+(s.offsetX||0),g=St.value+Math.sin(w)*(gt.value+30)+(s.offsetY||0)}return{...s,x:v,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Un=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},cl=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Xn=t=>{ft.value.has(t)?ft.value.delete(t):ft.value.add(t)},xo=e.computed(()=>{if(!Ae.value.show&&!(Ve.value&&Pe.value.show&&!j.value.isZooming))return{display:"none"};let t,s;if(Ve.value&&Pe.value.show&&!j.value.isZooming){t=Pe.value.x+15,s=z.value.top;const n=Wt.value?200:150;t+n>Je.value&&(t=Pe.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Ae.value.x,s=Ae.value.y;return{left:t+"px",top:s+"px"}}),ll=(t,s)=>{if(!ne.value||xl.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120,T=Je.value,$=We.value;v+E>T&&(v=s.clientX-i.left-E-10),g+w>$&&(g=s.clientY-i.top-w-10),v<0&&(v=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&L.categories.includes(t.label)&&(H=L.categories.indexOf(t.label));const B=(nn.value||Ie.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Ae.value={show:!0,x:v,y:g,title:B,value:Nn(t.value)||"",categoryIndex:H,spiderSeries:[]}},Ql=e.ref(!1),$l=e.ref(!1),ol=()=>{Ae.value.show=!1,Ae.value.spiderSeries=[],Ae.value.bubbleData=[],Pe.value.show=!1,Ql.value||(de.value=null)},xl=e.ref(!1),ul=(t,s)=>{xl.value=!0,Ae.value.show=!1,Pe.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let v=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;v+E>Je.value&&(v=s.clientX-i.left-E-15),v<0&&(v=10),g<0&&(g=10),pl.value={show:!0,x:v,y:g,content:t.texts,count:t.totalCount}},El=()=>{xl.value=!1,pl.value.show=!1},it=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),On=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},Jt=e.computed(()=>Ke.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ho=()=>{if(!P.value||Jt.value){it.value.hasAnimated=!0,En.value&&(An.value=1);return}En.value&&(An.value=0),it.value.isAnimating=!0,it.value.currentFrame=0,it.value.totalFrames=Math.ceil(He.value/16.67);const t=()=>{const s=it.value.currentFrame/it.value.totalFrames,n=On(Me.value,Math.min(s,1));Yo(n),En.value&&(An.value=n),s<1?(it.value.currentFrame++,it.value.animationId=requestAnimationFrame(t)):jo()};it.value.animationId=requestAnimationFrame(t)},Yo=t=>{const s=b.value;s&&s.style.setProperty("--dss-animation-progress",t)},jo=()=>{it.value.isAnimating=!1,it.value.hasAnimated=!0,En.value&&(An.value=1),it.value.animationId&&(cancelAnimationFrame(it.value.animationId),it.value.animationId=null)},Ao=e.computed(()=>!cn.value||it.value.hasAnimated?!0:En.value?An.value>=1:zn.value?Hn.value>=1:!0),Oo=e.computed(()=>hn.value&&Ao.value),Eo=e.ref(!1);e.watch(Oo,t=>{t?(Eo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Eo.value=!0})})):Eo.value=!1},{immediate:!0});const Ko=e.computed(()=>{if(!P.value||Jt.value||it.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${He.value}ms`,t["--dss-animation-easing"]=Go(Me.value),t["--dss-stagger-delay"]=`${te.value}ms`,t}),Go=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Qo=()=>{if(!P.value||Jt.value)return"";const t=["dss-chart-animated"];return it.value.hasAnimated||t.push(`dss-animate-${X.value}`),it.value.hasAnimated||(cn.value&&Ie.value!=="semi-radial"?t.push("dss-animate-fill"):cn.value||t.push(`dss-animate-${X.value}`)),it.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>L.series,(t,s)=>{et.value&&s&&it.value.hasAnimated&&(it.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ho(),Xe.value)}))},{deep:!0}),e.watch(()=>j.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Ol()},50)}),e.watch(()=>[j.value.scale,j.value.offsetX],()=>{!j.value.isZooming&&!j.value.isDragging&&Ol()},{flush:"post"}),e.watch([lt,kt],([t,s])=>{j.value.minScale=t,j.value.maxScale=s,(j.value.scale<t||j.value.scale>s)&&Ul()},{immediate:!0}),e.watch(()=>L.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>Qe.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Wl)}):document.removeEventListener("click",Wl)}),e.onMounted(()=>{de.value=null,En.value&&(!P.value||Jt.value)&&(An.value=1),kl(),b.value&&typeof ResizeObserver<"u"&&(me=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(Ce&&cancelAnimationFrame(Ce),Ce=requestAnimationFrame(()=>{Ce=null;const{width:n,height:i}=s.contentRect;pt.value=Math.round(n),p.value=Math.round(i),ce.value&&(Ht.value=ce.value.offsetHeight||pe)}))}),me.observe(b.value)),P.value&&!Jt.value?Ie.value==="semi-radial"?setTimeout(()=>go(),Xe.value):setTimeout(()=>Ho(),Xe.value):(it.value.hasAnimated=!0,Ie.value==="semi-radial"&&(Hn.value=1)),document.addEventListener("mousemove",Zo),document.addEventListener("mouseup",Wo),document.addEventListener("click",po)}),e.onUnmounted(()=>{Ce&&cancelAnimationFrame(Ce),me&&b.value&&(me.unobserve(b.value),me.disconnect(),me=null),it.value.animationId&&cancelAnimationFrame(it.value.animationId),tl&&(cancelAnimationFrame(tl),tl=null),j.value.zoomTimeout&&clearTimeout(j.value.zoomTimeout),document.removeEventListener("mousemove",Zo),document.removeEventListener("mouseup",Wo),document.removeEventListener("click",po),document.removeEventListener("click",Wl)});const Zo=t=>{if(j.value.isDragging&&j.value.scale>1&&rn.value){Pe.value.show=!1;const s=t.clientX-j.value.lastMouseX,{minX:n,maxX:i}=zt.value,v=i-n||1,E=s*.8;j.value.offsetX+=E;const w=v/j.value.scale,T=v-w,$=0,H=-T/v*z.value.width,B=$;j.value.offsetX=Math.max(H,Math.min(B,j.value.offsetX)),j.value.lastMouseX=t.clientX,j.value.lastMouseY=t.clientY}},Wo=()=>{j.value.isDragging&&(j.value.isDragging=!1,setTimeout(()=>{!j.value.isDragging&&j.value.isZooming},100))},Jo=(t,s)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const v=[];for(let w=1;w<n.length;w++){const T=n[w].x-n[w-1].x,$=n[w].y-n[w-1].y,H=Math.sqrt(T*T+$*$);v.push(H),i+=H}const g=i*s;let E=0;for(let w=0;w<v.length;w++){const T=E+v[w];if(g<=T){const $=(g-E)/v[w],H=n[w],B=n[w+1];return{x:H.x+(B.x-H.x)*$,y:H.y+(B.y-H.y)*$}}E=T}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Qo(),{"dss-chart-fill-width":Ze.value,"dss-chart-fill-height":xt.value,"dss-chart-compact":cn.value&&!Bt.value}]]),style:e.normalizeStyle({width:Ze.value?"100%":Je.value+"px",height:Et.value,...Ze.value||xt.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ko.value,cursor:Xl()}),"data-chart-type":Ie.value,ref_key:"containerEl",ref:b,onWheel:ql,onMousedown:So,onMousemove:Lt,onMouseup:Bo,onMouseleave:fn,onDblclick:Ul,onContextmenu:e.withModifiers(Rt,["prevent"]),onClick:e.withModifiers(Ut,["left"]),onWheelCapture:ql},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ce},[e.createElementVNode("div",Ua,[at.value?(e.openBlock(),e.createElementBlock("div",Xa,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("div",Ya,e.toDisplayString(Vt.value),1)):e.createCommentVNode("",!0)]),Bt.value&&Ct.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":Ct.value==="top","dss-legend-bottom":Ct.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:v=>Xn(i),onMouseenter:v=>rt(i),onMouseleave:Ge,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ft(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0),Bt.value&&(Ct.value==="left"||Ct.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":Ct.value==="left","dss-legend-right":Ct.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(L.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:v=>Xn(i),onMouseenter:v=>rt(i),onMouseleave:Ge,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ft(i)})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(n.name),1)],46,Ga))),128))],2)):e.createCommentVNode("",!0)],512),R.showAddMarkerButton&&Rn.value&&Dt.value.addMarker&&(rn.value||Wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:mo,title:e.unref(I)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:un.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,es),s[4]||(s[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,Ja)):e.createCommentVNode("",!0),e.createElementVNode("div",ts,[Wt.value&&an.value?(e.openBlock(),e.createElementBlock("div",ns,"Bubble size: "+e.toDisplayString(an.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Je.value,height:We.value,class:"dss-chart-svg","data-smooth":ae.value,"data-animated":P.value,ref_key:"svgEl",ref:Be},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:ee.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:Je.value,height:z.value.height*4},null,8,as)],8,os),zn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:el.value},[e.createElementVNode("path",{d:fo.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:rl.value},[e.createElementVNode("path",{d:Mo.value},null,8,cs)],8,is)):e.createCommentVNode("",!0)]),rn.value||Wt.value?(e.openBlock(),e.createElementBlock("g",us,[vt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":le.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:z.value.left,x2:z.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ms))),128))],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",ps,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,vs),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,fs)]),e.createElementVNode("g",gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,ys))),128)),Mt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Mt.value),9,Cs)):e.createCommentVNode("",!0),nt.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(nt.value),9,ks)):e.createCommentVNode("",!0)]),ml.value.length>0?(e.openBlock(),e.createElementBlock("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ml.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":le.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,xs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Es)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Vs)):e.createCommentVNode("",!0)],8,ws),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Ns)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,z.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Ss),e.createElementVNode("text",{x:n.x,y:Math.max(15,z.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Bs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":le.value},[Tn.value?(e.openBlock(),e.createElementBlock("g",_s,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":nn.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,$s)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,Ts))],64))),128))],2),e.createElementVNode("g",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Le.value+2:Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Le.value+2:Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,As))),128)),ve.value>0||je.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:W(n.isHighlighted?U(n,ve.value)+2:U(n,ve.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,Ds))),128)):e.createCommentVNode("",!0)])])):Ie.value==="line"?(e.openBlock(),e.createElementBlock("g",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":it.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Le.value+2:Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Is))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Le.value+2:Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,zs))),128)),ve.value>0||je.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Gl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:W(n.isHighlighted?U(n,ve.value)+2:U(n,ve.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,Ps))),128)):e.createCommentVNode("",!0)])):Ie.value==="area"?(e.openBlock(),e.createElementBlock("g",Os,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${R.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,Ws)],8,Zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?K.value+.2:K.value,mask:`url(#area-mask-${i}-${R.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Le.value+1:Le.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*te.value}ms`})},null,14,Us))),128))])):Ie.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":nn.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,Xs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:v=>ll(n,v),onMouseleave:ol},null,46,Ys))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ms),Ve.value&&Pe.value.show&&!j.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":le.value},[e.createElementVNode("line",{x1:Pe.value.x,x2:Pe.value.x,y1:z.value.top,y2:z.value.bottom,stroke:he.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Pe.value.x,cy:n.y,r:W(ve.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Gs))),128))],8,js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("g",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Js,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:W(n.radius),fill:n.color,"fill-opacity":c(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:v=>f(n,v),onMouseleave:v=>_(n),onClick:v=>u(n,v)},null,42,er),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:d(n)}),onLoad:v=>Al(i),onError:v=>Yl(i),onMouseenter:v=>f(n,v),onMouseleave:v=>_(n),onClick:v=>u(n,v)},null,46,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),cn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Jn.value},[Ie.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Nt.value,cy:St.value,r:gt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,lr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Ie.value,"clip-path":_o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":vl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:v=>ll(n.segment,v),onMouseleave:ol},null,42,ar))),128))],8,or),Tl.value&&Ao.value?(e.openBlock(),e.createElementBlock("g",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wn.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,rr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yl.value&&(Ao.value||zn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Ll.value.x,y:Ll.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":vn.value,fill:Cl.value,class:"dss-radial-data-center"},e.toDisplayString(kn.value),9,ir)):e.createCommentVNode("",!0),Oo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Eo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,cr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,ur),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":tn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,dr)],6))),128))],2)):e.createCommentVNode("",!0)],8,nr)):e.createCommentVNode("",!0),Gn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Jn.value},[vt.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Nt.value,cy:St.value,r:W(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,vr))),128)),e.createElementVNode("g",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Nt.value-16,y:St.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,gr),e.createElementVNode("text",{x:Nt.value,y:St.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Cn(i)),9,hr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(fe.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Nt.value,x2:n.x,y1:St.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,yr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/Y.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/Y.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,kr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Qt,onMouseleave:ol},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ot.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":Kt("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Le.value+1:Le.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*te.value}ms`,transition:"all 0.2s ease"})},null,14,br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(v,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:v.x,cy:v.y,r:W(n.isHighlighted?ve.value+1:ve.value>0?ve.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*te.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>ll(v,E),onMouseleave:ol},null,46,wr))),128))]))),128))],32)],8,mr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:W(n.width/2),fill:Ft(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Er))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:v=>Un(i),onError:v=>cl(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Vr))),128))])],8,ls))]),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Je.value+"px",height:We.value+"px",backgroundImage:`url('${Fn.value}')`,backgroundRepeat:"no-repeat",...st.value,opacity:Ne.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:dn.value+"px",height:dn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(v=>gn(n),["stop"]),onMouseenter:v=>N(n,v),onMouseleave:Q},[e.createElementVNode("img",{src:bn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Sr)],44,Nr)),[[e.vShow,D.value]])),128)),mt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:mt.value.x+"px",top:mt.value.y+"px"})},[e.createElementVNode("div",Br,e.toDisplayString(mt.value.categoryValue),1),mt.value.description?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(mt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),ne.value&&(Ae.value.show||Ve.value&&Pe.value.show&&!j.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Ve.value&&Pe.value.show&&!j.value.isZooming}]),style:e.normalizeStyle(xo.value)},[!Ve.value||!Pe.value.show||j.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Gn.value&&Ae.value.spiderSeries&&Ae.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_r,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Tr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Lr,e.toDisplayString(n.value),1)]))),128))])):Wt.value&&Ae.value.bubbleData&&Ae.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Ae.value.title?(e.openBlock(),e.createElementBlock("div",Ar,e.toDisplayString(Ae.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Fr,e.toDisplayString(Ae.value.title),1),e.createElementVNode("div",Ir,e.toDisplayString(Ae.value.value),1)])),Ae.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[en(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pr,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(en(Ae.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Or,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),en(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ur,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(en(Ae.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",jr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(Wt.value?M():R.categories[Pe.value.categoryIndex]||`Category ${Pe.value.categoryIndex+1}`),1),Wt.value?(e.openBlock(),e.createElementBlock("div",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Jr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ei,e.toDisplayString(Nn(n.value)),1)]))),128))]),en(Pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ti,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ni,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(en(Pe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",li,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(v,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",oi,[e.createElementVNode("div",ai,e.toDisplayString(v.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),en(Pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",si,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ri,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(en(Pe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ii,[e.createElementVNode("div",ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ui,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),rn.value&&ye.value&&j.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ul},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(j.value.scale*100))+"% "+e.toDisplayString(e.unref(I)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,qa),Bt.value&&Ct.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(L.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":de.value===i,"dss-legend-dimmed":de.value!==null&&de.value!==i}]),onClick:v=>Xn(i),onMouseenter:v=>rt(i),onMouseleave:Ge,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Ft(i)})},null,4),e.createElementVNode("span",mi,e.toDisplayString(n.name),1)],46,di))),128))],2)):e.createCommentVNode("",!0),Qe.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Qe.value.x+"px",top:Qe.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Dt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:uo},e.toDisplayString(e.unref(I)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Dt.value.addMarker&&(Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv||Zn.value.length>0)?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),Dt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Sn},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Dt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Zl},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Zn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",vi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",fi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(n)),style:e.normalizeStyle(oo(n)),onClick:v=>No(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Pl(n),class:"dss-custom-menu-content"},null,8,hi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",yi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,gi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),h.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:jt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ci,[e.createElementVNode("h3",null,e.toDisplayString(re.value?e.unref(I)("chart.modalMarker.viewMarker"):Z.value?e.unref(I)("chart.modalMarker.editMarker"):e.unref(I)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:jt},"×")]),e.createElementVNode("div",ki,[e.createElementVNode("div",bi,[e.createVNode(Po,{id:"dss-marker-date",mode:"single",modelValue:h.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>h.value.date=n),"min-date":C.value,"max-date":S.value,disabled:re.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",wi,[e.createElementVNode("label",xi,e.toDisplayString(e.unref(I)("chart.modalMarker.description")),1),re.value?(e.openBlock(),e.createElementBlock("div",Ei,e.toDisplayString(h.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>h.value.description=n),placeholder:e.unref(I)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Vi)),[[e.vModelText,h.value.description]])])]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Si,[Z.value&&!re.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(I)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:jt},e.toDisplayString(re.value?e.unref(I)("chart.modalMarker.close"):e.unref(I)("chart.modalMarker.cancel")),1),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(h.value.description&&h.value.description.length)},e.toDisplayString(Z.value?e.unref(I)("chart.modalMarker.save"):e.unref(I)("chart.contextMenu.addMarker")),9,Mi))])])])])):e.createCommentVNode("",!0)],64))}}),Ti={class:"dss-modal-title"},Li={class:"dss-modal-actions"},Do={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(R,{emit:be}){const I=R,A=be,Se=e.ref(null),b=e.ref(null),Be=e.computed(()=>{const ee={"max-width":I.width};return I.height!=="auto"&&(ee.height=I.height,ee["min-height"]="0"),ee}),ce=e.computed(()=>({}));function pt(){A("close-modal")}function p(){I.backDrop&&!Se.value&&A("close-modal")}function me(ee){ee.target.tagName==="INPUT"&&(Se.value=ee.target.tagName)}function Ce(){setTimeout(()=>{Se.value=null},300)}function pe(){const ee=document.body,le=document.documentElement;b.value={bodyOverflow:ee.style.overflow,bodyPosition:ee.style.position,bodyTop:ee.style.top,bodyWidth:ee.style.width,htmlOverflow:le.style.overflow,scrollY:window.scrollY},ee.style.overflow="hidden",ee.style.position="fixed",ee.style.top=`-${b.value.scrollY}px`,ee.style.width="100%",ee.style.left="0",le.style.overflow="hidden"}function oe(){if(!b.value)return;const ee=document.body,le=document.documentElement,{bodyOverflow:L,bodyPosition:Fe,bodyTop:Re,bodyWidth:Oe,htmlOverflow:ut,scrollY:O}=b.value;ee.style.overflow=L||"",ee.style.position=Fe||"",ee.style.top=Re||"",ee.style.width=Oe||"",ee.style.left="",le.style.overflow=ut||"",window.scrollTo(0,O||0)}return e.watch(()=>I.showModal,ee=>{if(ee)pe(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const le=document.getElementById("dss-modal-backdrop");le&&(le.addEventListener("focusin",me),le.addEventListener("focusout",Ce))},100);else{oe(),document.body.classList.remove("dss-modal-open");const le=document.getElementById("dss-modal-backdrop");le&&(le.removeEventListener("focusin",me),le.removeEventListener("focusout",Ce))}},{immediate:!0}),e.onUnmounted(()=>{I.showModal&&oe()}),(ee,le)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:p},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Be.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:le[0]||(le[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":R.headerType,"font-size":R.titleSize})},[e.createElementVNode("h1",Ti,[e.renderSlot(ee.$slots,"title",{},()=>[le[1]||(le[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(ee.$slots,"title-data"),R.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:pt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ce.value)},[e.renderSlot(ee.$slots,"content",{},()=>[le[2]||(le[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Li,[e.renderSlot(ee.$slots,"actions")])])],4),[[e.vShow,R.showModal]])])):e.createCommentVNode("",!0)]))}},Hi={key:0,class:"dss-table-toolbar"},Ai={class:"dss-table-toolbar-left"},Di=["aria-expanded"],Ri={class:"dss-pagination-select-dropdown",role:"listbox"},Fi={class:"dss-table-column-visibility-label"},Ii={class:"dss-table-checkbox-wrapper"},zi=["checked","onChange"],Pi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Oi={class:"dss-table-column-visibility-text"},Zi={class:"dss-table-toolbar-right"},Wi=["placeholder"],qi=["aria-expanded"],Ui={key:1,class:"dss-table-toolbar-extra"},Xi={class:"dss-table-thead"},Yi={key:0,class:"dss-table-th dss-table-selection-column"},ji={key:0,class:"dss-table-checkbox-wrapper"},Ki=["checked","indeterminate"],Gi={key:0,class:"dss-table-checkbox__indeterminate"},Qi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ji={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ec=["onClick"],tc={class:"dss-table-th-content"},nc={class:"dss-table-th-text"},lc={key:0},oc={key:1},ac={key:2},sc=["data-filter-column-key","aria-expanded","onClick"],rc={class:"dss-table-tbody"},ic=["onClick"],cc={class:"dss-table-checkbox-wrapper"},uc=["type","name","checked","onChange"],dc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},mc={key:1,class:"dss-table-checkbox__dot"},pc=["onClick"],vc=["aria-expanded","aria-label"],fc={key:0,class:"dss-table-expansion-row"},gc=["colspan"],hc=["colspan"],yc={key:1,class:"dss-table-pagination"},Cc={class:"dss-pagination-center"},kc={class:"dss-pagination-controls"},bc=["disabled","title"],wc=["disabled","title"],xc={class:"dss-pagination-pages"},Ec=["onClick"],Vc={key:1,class:"dss-pagination-ellipsis"},Nc=["disabled","title"],Sc=["disabled","title"],Bc=["aria-expanded"],Mc={class:"dss-pagination-select-dropdown",role:"listbox"},_c=["aria-selected","onClick"],$c={key:0,class:"dss-table-filter-row"},Tc=["value","placeholder"],Lc=["min","max","value"],Hc=["min","max","value"],Ac={class:"dss-table-filter-double-range-values"},Dc={key:2,class:"dss-table-filter-daterange"},Rc={class:"dss-table-filter-daterange-row"},Fc={class:"dss-table-filter-daterange-label"},Ic=["value"],zc={class:"dss-table-filter-daterange-row"},Pc={class:"dss-table-filter-daterange-label"},Oc=["value"],Zc=["value","placeholder"],Wc={class:"dss-table-filter-list"},qc=["checked","onChange"],Uc={class:"dss-table-filter-actions"},Xc={name:"DSSTable"},Yc=Object.assign(Xc,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(R,{emit:be}){const{t:I,locale:A}=Jl.useI18n(),Se=R,b=be,Be={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ce(h,C){const S=Object.assign({},h);return pt(h)&&pt(C)&&Object.keys(C).forEach(Z=>{pt(C[Z])?Z in h?S[Z]=ce(h[Z],C[Z]):Object.assign(S,{[Z]:C[Z]}):Object.assign(S,{[Z]:C[Z]})}),S}function pt(h){return h&&typeof h=="object"&&!Array.isArray(h)}const p=e.computed(()=>ce(Be,Se.options)),me=e.computed(()=>{const h=p.value.table.width;return h==="auto"?null:typeof h=="number"?h:null}),Ce=e.computed(()=>p.value.table.height),pe=e.computed(()=>p.value.table.rowHeight??"auto"),oe=e.computed(()=>({height:pe.value})),ee=e.computed(()=>p.value.table.expandable===!0),le=e.computed(()=>p.value.table.truncated===!0),L=e.computed(()=>p.value.table.striped),Fe=e.computed(()=>p.value.table.bordered),Re=e.computed(()=>p.value.table.hoverable),Oe=e.computed(()=>p.value.table.size),ut=e.computed(()=>p.value.table.align||"left");e.computed(()=>p.value.title.text),e.computed(()=>p.value.subtitle.text);const O=e.computed(()=>p.value.selection.enabled),Ze=e.computed(()=>p.value.selection.mode),xt=e.computed(()=>p.value.sorting.enabled),Je=e.computed(()=>p.value.sorting.mode),Ht=e.computed(()=>p.value.pagination.enabled),$e=e.computed(()=>p.value.pagination.rows),We=e.computed(()=>p.value.pagination.rowsPerPageOptions),Et=e.computed(()=>p.value.scrollable),Ie=e.computed(()=>p.value.emptyMessage),$t=e.computed(()=>p.value.toolbar?.downloads?.pdf!==!1),at=e.computed(()=>p.value.toolbar?.downloads?.excel!==!1),Vt=e.computed(()=>p.value.toolbar?.search!==!1),an=e.computed(()=>$t.value||at.value||Vt.value||Mt.value),Mt=e.computed(()=>p.value.toolbar?.columnVisibility!==!1),nt=e.ref(""),ze=e.ref(!1),At=e.ref(null);let Tt=null;function sn(){ze.value?(Tt&&(clearTimeout(Tt),Tt=null),ze.value=!1,nt.value="",b("search",""),At.value?.blur()):(ze.value=!0,Tt=setTimeout(()=>{Tt=null,At.value?.focus()},80))}function vt(){nt.value||(ze.value=!1)}function Bt(){nt.value="",b("search",""),At.value?.focus()}const Ct=e.computed(()=>({"dss-table-striped":L.value,"dss-table-bordered":Fe.value,"dss-table-hoverable":Re.value,[`dss-table-${Oe.value}`]:Oe.value!=="default","dss-table-truncated":le.value})),_t=(h,C)=>h?.field??h?.key??C,ne=e.ref(new Set);function Ve(){const h=new Set;Se.columns.forEach((C,S)=>{C?.hidden!==!0&&h.add(_t(C,S))}),ne.value=h}const he=e.computed(()=>Se.columns.filter((h,C)=>ne.value.has(_t(h,C)))),ye=h=>{const C=Se.columns.findIndex(S=>S===h);return _t(h,C>=0?C:0)},lt=(h,C)=>ne.value.has(_t(h,C));function kt(h,C){const S=_t(h,C),Z=new Set(ne.value);Z.has(S)?Z.delete(S):Z.add(S),ne.value=Z}const Le=e.ref(null),dt=e.ref(!1);function ve(h){Le.value&&!Le.value.contains(h.target)&&(dt.value=!1)}const je=e.computed(()=>he.value.length+(O.value?1:0)+(ee.value?1:0)),U=(h,C)=>h?.id??h?.key??C,W=e.ref(new Set),K=e.ref(null),ae=(h,C)=>W.value.has(U(h,C)),x=(h,C,S)=>{S&&S.stopPropagation();const Z=U(h,C),re=new Set(W.value);re.has(Z)?(re.delete(Z),b("row-collapse",{data:h,index:C})):(re.add(Z),b("row-expand",{data:h,index:C})),W.value=re},k=(h,C)=>{if(!le.value)return;const S=U(h,C);K.value!==S&&(K.value=S)},V=e.ref(null),P=e.ref(0),X=e.ref([]),He=h=>{if(Je.value==="single")return V.value===h.field?P.value:0;{const C=X.value.find(S=>S.field===h.field);return C?C.order:0}},Xe=h=>{const C=He(h);return{"dss-sort-active":C!==0,"dss-sort-asc":C===1,"dss-sort-desc":C===-1}},Me=e.ref({}),te=e.ref(null),et=e.ref(null),Ke=220,yt=e.ref(null),ht=e.computed(()=>he.value.find(h=>ye(h)===te.value)??null),Ye=e.computed(()=>{if(!ht.value||ht.value.filter!=="range")return null;const h=ht.value,C=te.value,{min:S,max:Z}=F(h),re=h.filterMin??S,rt=h.filterMax??Z,Ge=Dt(C),Lt=Ge.min??re,fn=Ge.max??rt,Rt=rt-re,Ut=Rt===0?0:(Lt-re)/Rt*100,Pl=Rt===0?100:(fn-re)/Rt*100;return{rangeMin:re,rangeMax:rt,currentMin:Lt,currentMax:fn,minPct:Ut,maxPct:Pl}}),Cn=e.ref(null),Yn=e.ref("max");function Rn(h){const C=Cn.value,S=Ye.value;if(!C||!S)return;const Z=C.getBoundingClientRect(),rt=(h.clientX-Z.left)/Z.width*100,Ge=(S.minPct+S.maxPct)/2;Yn.value=rt<Ge?"min":"max"}function Dt(h){return Me.value[h]??{}}function Zn(h,C){Me.value={...Me.value,[h]:C}}function un(h){const C=Me.value[h];return C?C.type==="string"?!!C.value?.trim():C.type==="range"?C.min!=null||C.max!=null:C.type==="dateRange"?!!(C.from||C.to):C.type==="list"?C.selected?.length>0:!1:!1}function Bn(h){const C={...Me.value};delete C[h],Me.value=C,te.value=null,et.value=null}function dn(){if(!te.value){et.value=null;return}const h=yt.value;if(!h)return;const C=h.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${te.value}"]`);if(!C)return;const S=C.getBoundingClientRect();et.value={top:S.bottom+6,left:Math.max(8,S.right-Ke)}}const Mn=e.computed(()=>{let h=[...Se.data];const C=(nt.value??"").trim().toLowerCase();return C&&(h=h.filter(S=>Se.columns.some(Z=>{if(!Z||!Z.field)return!1;const re=Pe(S,Z);return String(re??"").toLowerCase().includes(C)}))),he.value.forEach(S=>{const Z=ye(S),re=Me.value[Z];if(!re)return;const rt=S.field;if(rt){if(re.type==="string"&&re.value?.trim()){const Ge=re.value.trim().toLowerCase();h=h.filter(Lt=>{const fn=Pe(Lt,S);return String(fn??"").toLowerCase().includes(Ge)})}else if(re.type==="range")h=h.filter(Ge=>{const Lt=Qe(Ge,rt),fn=Number(Lt);return!(Number.isNaN(fn)||re.min!=null&&fn<re.min||re.max!=null&&fn>re.max)});else if(re.type==="dateRange"){const Ge=re.from?new Date(re.from).getTime():null,Lt=re.to?new Date(re.to).getTime():null;h=h.filter(fn=>{const Rt=Qe(fn,rt),Ut=Rt?new Date(Rt).getTime():NaN;return!(Number.isNaN(Ut)||Ge!=null&&Ut<Ge||Lt!=null&&Ut>Lt)})}else if(re.type==="list"&&re.selected?.length){const Ge=new Set(re.selected);h=h.filter(Lt=>{const fn=Pe(Lt,S);return Ge.has(fn!=null?String(fn):"")})}}}),h});function Nn(h){const C=new Set;return Se.data.forEach(S=>{const Z=Pe(S,h);C.add(Z!=null?String(Z):"")}),Array.from(C).sort((S,Z)=>String(S).localeCompare(String(Z)))}function D(h,C){if(te.value===h){te.value=null,et.value=null;return}if(te.value=h,C?.currentTarget){const S=C.currentTarget.getBoundingClientRect();et.value={top:S.bottom+6,left:Math.max(8,S.right-Ke)}}else dn()}function q(h,C){Zn(h,{type:"string",value:C})}function F(h){const C=h.field;if(!C)return{min:0,max:100};let S=1/0,Z=-1/0;return Se.data.forEach(re=>{const rt=Qe(re,C),Ge=Number(rt);Number.isNaN(Ge)||(S=Math.min(S,Ge),Z=Math.max(Z,Ge))}),{min:S===1/0?0:S,max:Z===-1/0?100:Z}}function se(h,C,S){const Z={...Dt(h),type:"range"},re=S===""?null:Number(S),rt=re===null||Number.isNaN(re)?null:re;Z[C]=rt,rt!=null&&(C==="min"&&Z.max!=null&&rt>Z.max&&(Z.max=rt),C==="max"&&Z.min!=null&&rt<Z.min&&(Z.min=rt)),Zn(h,Z)}function Ne(h,C,S){const Z={...Dt(h),type:"dateRange"};Z[C]=S||"",Zn(h,Z)}const tt=e.reactive({});function ot(h,C){tt[h]=C}function qe(h){const C=ye(h),S=(tt[C]??"").trim().toLowerCase(),Z=Nn(h);return S?Z.filter(re=>String(re).toLowerCase().includes(S)):Z}function st(h,C){return(Dt(h).selected??[]).includes(C!=null?String(C):"")}function mn(h,C){const Z=[...Dt(h).selected??[]],re=C!=null?String(C):"",rt=Z.indexOf(re);rt>=0?Z.splice(rt,1):Z.push(re),Zn(h,{type:"list",selected:Z})}function en(h){te.value&&!h.target.closest(".dss-table-filter-wrap")&&!h.target.closest(".dss-table-filter-dropdown")&&(te.value=null,et.value=null)}function pn(){dn()}const Fn=h=>{if(!(h.sortable===!1||!xt.value))if(Je.value==="single")V.value===h.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=h.field,P.value=1),P.value===0&&(V.value=null),b("sort",{field:V.value,order:P.value});else{const C=X.value.findIndex(S=>S.field===h.field);C>=0?X.value[C].order===1?X.value[C].order=-1:X.value.splice(C,1):X.value.push({field:h.field,order:1}),b("sort",{multiSortMeta:X.value})}},hn=e.computed(()=>{if(!xt.value)return Mn.value;let h=[...Mn.value];return Je.value==="single"&&V.value&&P.value!==0?h.sort((C,S)=>{const Z=Qe(C,V.value),re=Qe(S,V.value);return Z===re?0:Z==null?1:re==null?-1:(Z<re?-1:Z>re?1:0)*P.value}):Je.value==="multiple"&&X.value.length>0&&h.sort((C,S)=>{for(const Z of X.value){const re=Qe(C,Z.field),rt=Qe(S,Z.field);if(re===rt)continue;if(re==null)return 1;if(rt==null)return-1;const Ge=re<rt?-1:re>rt?1:0;if(Ge!==0)return Ge*Z.order}return 0}),h}),tn=e.ref(0),yn=e.ref($e.value),In=e.ref(!1),Vl=e.ref(null),Tl=h=>{yn.value=h,In.value=!1,tn.value=0,b("page",{page:0,rows:yn.value})};function Nl(h){Vl.value&&!Vl.value.contains(h.target)&&(In.value=!1)}const yl=e.computed(()=>hn.value.length),kn=e.computed(()=>Math.ceil(yl.value/yn.value)),vn=e.computed(()=>Ht.value?tn.value*yn.value:0),Ll=e.computed(()=>Ht.value?Math.min((tn.value+1)*yn.value,yl.value):yl.value),Cl=e.computed(()=>{if(!Ht.value)return hn.value;const h=vn.value,C=Ll.value;return hn.value.slice(h,C)}),Wn=e.ref(new Set),ml=e.computed(()=>hn.value.filter((h,C)=>Wn.value.has(U(h,C)))),pl=e.computed(()=>{const h=hn.value.length;return h>0&&Wn.value.size===h}),Sl=e.computed(()=>{const h=hn.value.length,C=Wn.value.size;return C>0&&C<h}),jn=(h,C)=>Wn.value.has(U(h,C)),zl=()=>{if(pl.value)Wn.value=new Set,b("unselect-all");else{const h=new Set;hn.value.forEach((C,S)=>h.add(U(C,S))),Wn.value=h,b("select-all",ml.value)}},ft=(h,C)=>{const S=U(h,C),Z=new Set(Wn.value),re=Z.has(S);Ze.value==="single"?re?(Z.delete(S),b("row-unselect",h)):(Z.clear(),Z.add(S),b("row-select",h)):re?(Z.delete(S),b("row-unselect",h)):(Z.add(S),b("row-select",h)),Wn.value=Z},de=e.computed(()=>{const h=kn.value,C=tn.value+1,S=2,Z=[],re=[];let rt;for(let Ge=1;Ge<=h;Ge++)(Ge===1||Ge===h||Ge>=C-S&&Ge<=C+S)&&Z.push(Ge);for(const Ge of Z)rt&&(Ge-rt===2?re.push(rt+1):Ge-rt!==1&&re.push("...")),re.push(Ge),rt=Ge;return re}),_n=h=>{h<0||h>=kn.value||(tn.value=h,b("page",{page:h,rows:yn.value}))},Ae=(h,C,S)=>{b("row-click",{data:h,index:C,originalEvent:S}),k(h,vn.value+C)},mt=(h,C)=>{const S=vn.value+C;return{"dss-table-row-selected":jn(h,S),"dss-table-row-even":C%2===0,"dss-table-row-odd":C%2!==0,"dss-table-row-truncated-clickable":le.value,"dss-table-row-truncated-expanded":K.value===U(h,S)}},Pe=(h,C)=>C.field?Qe(h,C.field):"",Qe=(h,C)=>C.split(".").reduce((S,Z)=>S&&S[Z],h),j=h=>{const C=h.align??ut.value;return{"dss-table-sortable":h.sortable!==!1&&xt.value,"dss-table-align-left":C==="left","dss-table-align-center":C==="center","dss-table-align-right":C==="right",[h.className]:h.className}},Zt=h=>{const C={};return h.width&&(C.width=typeof h.width=="number"?`${h.width}px`:h.width),h.minWidth&&(C.minWidth=typeof h.minWidth=="number"?`${h.minWidth}px`:h.minWidth),h.maxWidth&&(C.maxWidth=typeof h.maxWidth=="number"?`${h.maxWidth}px`:h.maxWidth),C};return e.watch(()=>Se.locale,h=>{h&&h!==A.value&&(A.value=h)},{immediate:!0}),e.watch($e,h=>{yn.value=h,tn.value=0}),e.watch(nt,h=>{b("search",h??"")}),e.watch(()=>Se.columns,()=>{Ve()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Nl),document.addEventListener("click",ve),document.addEventListener("click",en),window.addEventListener("resize",pn),window.addEventListener("scroll",pn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Nl),document.removeEventListener("click",ve),document.removeEventListener("click",en),window.removeEventListener("resize",pn),window.removeEventListener("scroll",pn,!0)}),(h,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:yt,style:e.normalizeStyle({width:me.value+"px",height:Ce.value?Ce.value+"px":"auto"})},[an.value?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("div",Ai,[$t.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:C[0]||(C[0]=S=>b("download-pdf"))},[C[21]||(C[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(I)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:C[1]||(C[1]=S=>b("download-excel"))},[C[22]||(C[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(I)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Mt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Le},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":dt.value}]),onClick:C[2]||(C[2]=S=>dt.value=!dt.value),"aria-expanded":dt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(I)("table.columnVisibility"))+" ",1),C[23]||(C[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Di),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,(S,Z)=>(e.openBlock(),e.createElementBlock("li",{key:_t(S,Z),role:"option",class:"dss-table-column-visibility-option",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Fi,[e.createElementVNode("span",Ii,[e.createElementVNode("input",{type:"checkbox",checked:lt(S,Z),onChange:re=>kt(S,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,zi),lt(S,Z)?(e.openBlock(),e.createElementBlock("span",Pi,[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Oi,e.toDisplayString(S.header),1)])]))),128))],512),[[e.vShow,dt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zi,[Vt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":ze.value||nt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:At,"onUpdate:modelValue":C[4]||(C[4]=S=>nt.value=S),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(I)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:C[5]||(C[5]=S=>ze.value=!0),onBlur:vt},null,40,Wi),[[e.vModelText,nt.value]]),nt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Bt},[...C[25]||(C[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":ze.value||!!nt.value,onMousedown:e.withModifiers(sn,["prevent"])},[...C[26]||(C[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,qi)],2)):e.createCommentVNode("",!0),h.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ui,[e.renderSlot(h.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Et.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",Ct.value])},[e.createElementVNode("thead",Xi,[e.createElementVNode("tr",null,[O.value?(e.openBlock(),e.createElementBlock("th",Yi,[Ze.value==="multiple"?(e.openBlock(),e.createElementBlock("span",ji,[e.createElementVNode("input",{type:"checkbox",checked:pl.value,indeterminate:Sl.value,onChange:zl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ki),Sl.value?(e.openBlock(),e.createElementBlock("span",Gi)):pl.value?(e.openBlock(),e.createElementBlock("span",Qi,[...C[27]||(C[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),ee.value?(e.openBlock(),e.createElementBlock("th",Ji)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(S,Z)=>(e.openBlock(),e.createElementBlock("th",{key:ye(S),class:e.normalizeClass(["dss-table-th",j(S)]),style:e.normalizeStyle(Zt(S)),onClick:re=>Fn(S)},[e.createElementVNode("div",tc,[e.createElementVNode("span",nc,e.toDisplayString(S.header),1),S.sortable!==!1&&xt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Xe(S)])},[He(S)===0?(e.openBlock(),e.createElementBlock("span",lc,[...C[28]||(C[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):He(S)===1?(e.openBlock(),e.createElementBlock("span",oc,[...C[29]||(C[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):He(S)===-1?(e.openBlock(),e.createElementBlock("span",ac,[...C[30]||(C[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),S.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":te.value===ye(S)}]),onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":un(ye(S))}]),"data-filter-column-key":ye(S),"aria-expanded":te.value===ye(S),"aria-label":"Filter column",onClick:re=>D(ye(S),re)},[...C[31]||(C[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,sc)],2)):e.createCommentVNode("",!0)])],14,ec))),128))])]),e.createElementVNode("tbody",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(S,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U(S,vn.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",mt(S,Z)]),style:e.normalizeStyle(oe.value),onClick:re=>Ae(S,Z,re)},[O.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:C[7]||(C[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",cc,[e.createElementVNode("input",{type:Ze.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${R.tableId}`,checked:jn(S,vn.value+Z),onChange:re=>ft(S,vn.value+Z),class:e.normalizeClass(["dss-table-checkbox",Ze.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,uc),Ze.value==="multiple"&&jn(S,vn.value+Z)?(e.openBlock(),e.createElementBlock("span",dc,[...C[32]||(C[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ze.value==="single"&&jn(S,vn.value+Z)?(e.openBlock(),e.createElementBlock("span",mc)):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(re=>x(S,vn.value+Z,re),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ae(S,vn.value+Z),"aria-label":ae(S,vn.value+Z)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ae(S,vn.value+Z)}]),"aria-hidden":"true"},[...C[33]||(C[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,vc)],8,pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(re,rt)=>(e.openBlock(),e.createElementBlock("td",{key:ye(re),class:e.normalizeClass(["dss-table-td",j(re)]),style:e.normalizeStyle(Zt(re))},[e.renderSlot(h.$slots,`cell-${re.field}`,{data:S,column:re,rowIndex:Z},()=>[e.createTextVNode(e.toDisplayString(Pe(S,re)),1)])],6))),128))],14,ic),ee.value&&ae(S,vn.value+Z)?(e.openBlock(),e.createElementBlock("tr",fc,[e.createElementVNode("td",{colspan:je.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(h.$slots,"expansion",{data:S,rowIndex:Z})],8,gc)])):e.createCommentVNode("",!0)],64))),128)),Cl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(oe.value)},[e.createElementVNode("td",{colspan:je.value,class:"dss-table-empty-cell"},[e.renderSlot(h.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(Ie.value),1)])],8,hc)],4))])],2)],2),Ht.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:tn.value===0,onClick:C[8]||(C[8]=S=>_n(0)),title:e.unref(I)("table.firstPage")},[...C[34]||(C[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:tn.value===0,onClick:C[9]||(C[9]=S=>_n(tn.value-1)),title:e.unref(I)("table.previousPage")}," ‹ ",8,wc),e.createElementVNode("span",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,S=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S},[S!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":S===tn.value+1}]),onClick:Z=>_n(S-1)},e.toDisplayString(S),11,Ec)):(e.openBlock(),e.createElementBlock("span",Vc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:tn.value>=kn.value-1,onClick:C[10]||(C[10]=S=>_n(tn.value+1)),title:e.unref(I)("table.nextPage")}," › ",8,Nc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:tn.value>=kn.value-1,onClick:C[11]||(C[11]=S=>_n(kn.value-1)),title:e.unref(I)("table.lastPage")},[...C[35]||(C[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Sc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Vl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":In.value}]),onClick:C[12]||(C[12]=S=>In.value=!In.value),"aria-expanded":In.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(yn.value)+" ",1),C[36]||(C[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Bc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":S===yn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":S===yn.value}]),onClick:Z=>Tl(S)},e.toDisplayString(S),11,_c))),128))],512),[[e.vShow,In.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(et.value?{top:et.value.top+"px",left:et.value.left+"px",width:Ke+"px"}:void 0),onClick:C[20]||(C[20]=e.withModifiers(()=>{},["stop"]))},[ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ht.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("input",{type:"text",value:Dt(te.value).value??"",onInput:C[13]||(C[13]=S=>q(te.value,S.target.value)),class:"dss-table-filter-input",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Tc)])):ht.value.filter==="range"&&Ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ye.value.minPct+"%","--range-max-pct":Ye.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Cn,class:"dss-table-filter-double-range-track",onMousemove:Rn,onMouseenter:Rn},[e.createElementVNode("input",{type:"range",min:Ye.value.rangeMin,max:Ye.value.rangeMax,value:Ye.value.currentMin,onInput:C[14]||(C[14]=S=>se(te.value,"min",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Yn.value==="min"?2:1})},null,44,Lc),e.createElementVNode("input",{type:"range",min:Ye.value.rangeMin,max:Ye.value.rangeMax,value:Ye.value.currentMax,onInput:C[15]||(C[15]=S=>se(te.value,"max",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Yn.value==="max"?2:1})},null,44,Hc)],544),e.createElementVNode("div",Ac,e.toDisplayString(Ye.value.currentMin)+" – "+e.toDisplayString(Ye.value.currentMax),1)],4)):ht.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Fc,e.toDisplayString(e.unref(I)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:Dt(te.value).from??"",onInput:C[16]||(C[16]=S=>Ne(te.value,"from",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ic)]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(I)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:Dt(te.value).to??"",onInput:C[17]||(C[17]=S=>Ne(te.value,"to",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Oc)])])):ht.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:tt[te.value]??"",onInput:C[18]||(C[18]=S=>ot(te.value,S.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Zc),e.createElementVNode("div",Wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe(ht.value),S=>(e.openBlock(),e.createElementBlock("label",{key:S,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:st(te.value,S),onChange:Z=>mn(te.value,S)},null,40,qc),e.createElementVNode("span",null,e.toDisplayString(S),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Uc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:C[19]||(C[19]=S=>Bn(te.value))},e.toDisplayString(e.unref(I)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,te.value&&ht.value&&et.value]])]),_:1})]))],64))}}),jc={class:"dss-toolbar-left"},Kc=["title"],Gc=["title"],Qc={class:"dss-toolbar-dropdown-wrapper"},Jc=["title"],eu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},au={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},su={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],vu=["title"],fu=["title"],gu={key:2,class:"dss-toolbar-separator"},hu=["title"],yu={key:4,class:"dss-toolbar-separator"},Cu={key:5,class:"dss-toolbar-dropdown-wrapper"},ku=["title"],bu={class:"dss-toolbar-dropdown-ai"},wu={class:"dss-toolbar-right"},xu={key:0,class:"dss-toolbar-custom-group"},Eu={key:1,class:"dss-toolbar-separator"},Vu={class:"dss-link-modal-content"},Nu={class:"dss-link-modal-field"},Su={class:"dss-link-modal-label"},Bu=["placeholder"],Mu={class:"dss-link-modal-field"},_u={class:"dss-link-modal-label"},$u=["placeholder"],Tu={class:"dss-image-modal-tabs"},Lu={key:0,class:"dss-image-tab-content"},Hu={class:"dss-link-modal-content"},Au={class:"dss-link-modal-field"},Du={key:0,class:"dss-link-modal-label"},Ru=["src"],Fu={class:"dss-link-modal-field"},Iu={class:"dss-link-modal-label"},zu=["placeholder"],Pu={class:"dss-link-modal-field"},Ou={class:"dss-link-modal-label"},Zu=["placeholder"],Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={key:1,class:"dss-image-tab-content"},Yu={class:"dss-link-modal-content"},ju={class:"dss-link-modal-field"},Ku={class:"dss-link-modal-label"},Gu=["placeholder"],Qu={class:"dss-link-modal-field"},Ju={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},ld=["placeholder"],od={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-text-editor-title-input-container"},id={key:0,class:"dss-text-editor-title-preview"},cd={key:0},ud={key:1,class:"dss-text-editor-preview-placeholder"},dd=["value","placeholder","disabled"],md={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},pd={class:"dss-text-editor-description-input-container"},vd={key:0,class:"dss-text-editor-description-preview"},fd={key:0},gd={key:1,class:"dss-text-editor-preview-placeholder"},hd=["value","placeholder","disabled"],yd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Cd=["data-comment-id","onMouseenter"],kd=["onClick"],bd=["src","alt"],wd={key:1},xd=["onClick"],Ed=["src","alt"],Vd={key:1},Nd=["data-has-second-user","onClick"],Sd={class:"editor-comment-marker-count"},Bd={key:4,class:"dss-text-editor-textarea-wrapper"},Md=["value","placeholder","rows","disabled"],_d={class:"dss-text-editor-footer"},$d={class:"dss-text-editor-footer-content"},Td={class:"dss-text-editor-footer-stat"},Ld={class:"dss-text-editor-footer-stat"},Hd={key:5,class:"dss-text-editor-content-wrapper"},Ad={key:0,class:"dss-comment-overlay-body"},Dd={class:"dss-comment-selection-wrapper"},Rd=["innerHTML"],Fd={class:"dss-comment-messages-wrapper"},Id={key:0,class:"dss-comment-avatar-wrapper"},zd={class:"dss-comment-avatar"},Pd=["src","alt"],Od={key:1},Zd={class:"dss-comment-header"},Wd={class:"dss-comment-header-text"},qd={class:"dss-comment-author"},Ud={key:0,class:"dss-comment-date"},Xd=["onClick","title"],Yd={class:"dss-comment-overlay-inner"},jd=["placeholder","onKeydown"],Kd={class:"dss-text-editor-footer"},Gd={class:"dss-text-editor-footer-content"},Qd={class:"dss-text-editor-footer-stat"},Jd={class:"dss-text-editor-footer-stat"},e1=["title"],t1=["title"],n1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},l1={class:"dss-image-popup-content"},o1={key:0,class:"dss-image-popup-no-alt-icon"},a1=["title"],s1=["title"],r1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},i1={class:"dss-toolbar-left"},c1=["title"],u1=["title"],d1={class:"dss-toolbar-dropdown-wrapper"},m1=["title"],p1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1=["title"],M1=["title"],_1={key:2,class:"dss-toolbar-separator"},$1={key:3,class:"dss-toolbar-dropdown-wrapper"},T1=["title"],L1={class:"dss-toolbar-dropdown-ai"},H1={key:0,class:"dss-toolbar-right"},A1={key:0,class:"dss-toolbar-separator"},D1={key:0,class:"dss-toolbar-custom-group"},R1={key:1,class:"dss-toolbar-separator"},F1={name:"DSSTextEditor"},I1=Object.assign(F1,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(R,{expose:be,emit:I}){const{t:A,locale:Se}=Jl.useI18n(),b=R,Be=I,ce=e.useSlots(),pt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,t+="Category",H.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
|
|
97
|
+
`;const s=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let T='"'+(H.categories[g]||I("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach($=>{const L=$.data&&$.data[g]!==void 0?$.data[g]:"";T+=","+L}),t+=T+`
|
|
98
|
+
`}const n=new Blob([t],{type:"text/csv;charset=utf-8;"}),i=URL.createObjectURL(n),p=document.createElement("a");p.href=i,p.download=$n("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),qt()}catch(t){console.error("Error downloading CSV:",t)}},No=t=>{if(typeof t.action=="function"){const s={series:H.series,categories:H.categories,markers:Ot.value},n={chartX:tt.value.chartX,chartY:tt.value.chartY,dataX:tt.value.mouseDataX,dataY:tt.value.mouseDataY,categoryIndex:clampedCategoryIndex||tt.value.categoryIndex};t.action(s,n)}qt()},uo=()=>{Kt(),h.value.show=!0,h.value.categoryIndex=tt.value.categoryIndex,h.value.fromButton=!1,qt()},mo=()=>{Kt(),h.value.show=!0,h.value.categoryIndex=0,h.value.fromButton=!0},po=t=>{if(tt.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(tt.value.show=!1)}},Wl=t=>{tt.value.show&&!t.target.closest(".context-menu")&&(tt.value.show=!1)},ql=t=>{if(!sn.value||!fe.value)return;t.preventDefault(),t.stopPropagation(),K.value.isZooming=!0,Pe.value.show=!1,K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<z.value.left-50||i>z.value.right+50||p<z.value.top-50||p>z.value.bottom+100){K.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(K.value.minScale,Math.min(K.value.maxScale,K.value.scale*g));if(E!==K.value.scale){const{minX:w,maxX:T}=It.value,$=T-w||1,L=$/K.value.scale,B=w-K.value.offsetX/z.value.width*$,G=(i-z.value.left)/z.value.width,me=B+G*L;K.value.scale=E;const Ee=$/K.value.scale,ee=me-G*Ee;K.value.offsetX=-(ee-w)/$*z.value.width,K.value.scale<=1.01&&(K.value.scale=1,K.value.offsetX=0)}K.value.zoomTimeout=setTimeout(()=>{K.value.isZooming=!1,K.value.zoomTimeout=null},300)},So=t=>{if(!sn.value||!fe.value||K.value.scale<=1)return;Pe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,K.value.isDragging=!0,K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY,t.preventDefault()},Bo=()=>{K.value.isDragging=!1},Ul=()=>{!sn.value||!fe.value||(K.value.scale=1,K.value.offsetX=0,K.value.isDragging=!1,K.value.zoomTimeout&&(clearTimeout(K.value.zoomTimeout),K.value.zoomTimeout=null),K.value.isZooming=!1)},Xl=()=>!sn.value||!_n.value||!fe.value?"default":K.value.isDragging?"grabbing":K.value.scale>1?"grab":"dss-crosshair",Hl=t=>{if(t.length<2)return"";if(t.length===2)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let s=`M ${t[0].x} ${t[0].y}`;for(let n=0;n<t.length-1;n++){const i=t[Math.max(n-1,0)],p=t[n],g=t[n+1],E=t[Math.min(n+2,t.length-1)],w=p.x+(g.x-i.x)/6*x.value,T=p.y+(g.y-i.y)/6*x.value,$=g.x-(E.x-p.x)/6*x.value,L=g.y-(E.y-p.y)/6*x.value;s+=` C ${w} ${T} ${$} ${L} ${g.x} ${g.y}`}return s},xn=e.computed(()=>{const s=Z.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(_t.value?30:0)+60;if(Gn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(rn.value){const B=!Nt.value,G=hn.value,me=G?yn.value+In.value+Math.max(24,nn.value+16):0,Ee=B?12:p;let ee=0;at.value&&(ee+=B?8:15),Ct.value&&(ee+=B?6:10);const ye=Oe();let ke=Ee+(B?4:16)+(G?me:0),ie=Ee+(G?me:0);Nt.value&&xt.value==="left"?ke+=ye.legendWidth||150:Nt.value&&xt.value==="right"&&(ie+=ye.legendWidth||150);const we=ze.value==="semi-radial"?G?me:8:G?me:B?8:p+80,xe=G?14:0,Fe=Ee+ee+xe,He={left:ke,top:Fe,right:ie,bottom:we};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??He.left,top:i.top??He.top,right:i.right??He.right,bottom:i.bottom??He.bottom}:He}let E=0;at.value&&(E+=15),Ct.value&&(E+=10);const w=Oe();let T=p+16,$=p;Nt.value&&xt.value==="left"?T+=w.legendWidth||150:Nt.value&&xt.value==="right"&&($+=w.legendWidth||150);const L={left:T,top:p+E,right:$,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??L.left,top:i.top??L.top,right:i.right??L.right,bottom:i.bottom??L.bottom}:L}),z=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:Ue.value-xn.value.right,bottom:Ze.value-xn.value.bottom,width:Ue.value-(xn.value.left+xn.value.right),height:Ze.value-(xn.value.top+xn.value.bottom)})),sn=e.computed(()=>["line","area","bar"].includes(ze.value)||Mt.value),Tn=e.computed(()=>Mt.value),rn=e.computed(()=>["radial","semi-radial"].includes(ze.value)),Gn=e.computed(()=>ze.value==="spider"),Zt=e.computed(()=>ze.value==="bubble"),ln=e.computed(()=>Z.value?.chart?.orientation==="horizontal"&&(ze.value==="bar"||Tn.value)),Qn=t=>{const{minY:s,maxY:n}=It.value,i=n-s||1;return z.value.left+(t-s)/i*z.value.width},Ln=t=>{const{maxX:s}=It.value,n=s+1,p=z.value.height/n;return z.value.top+(t+.5)*p},Et=e.computed(()=>rn.value?xn.value.left+(Ue.value-xn.value.left-xn.value.right)/2:Ue.value/2),Vt=e.computed(()=>Gn.value?Ze.value/2-40:rn.value?xn.value.top+(Ze.value-xn.value.top-xn.value.bottom)/2:Ze.value/2),gt=e.computed(()=>{if(Gn.value){const t=z.value.width-80,s=z.value.height-80;return Math.min(t,s)/2}return Math.min(z.value.width,z.value.height)/2}),Ut=e.computed(()=>{const t=Z.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return gt.value*n}),vo=e.computed(()=>{const t=Z.value,s=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(rn.value||Gn.value)?1:1+s/100}),Jn=e.computed(()=>{const t=vo.value;if(t===1||t<=0)return;const s=Et.value,n=Vt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Hn=e.ref(0),el=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),zn=e.computed(()=>ze.value==="semi-radial"),Ft=e.computed(()=>zn.value&&P.value&&!en.value),Ml=e.computed(()=>zn.value&&P.value&&!en.value&&X.value==="fill"),fo=e.computed(()=>{const t=Ft.value?Hn.value:1,s=Et.value,n=Vt.value,i=Ut.value,p=gt.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const w=s+p*Math.cos(g),T=n+p*Math.sin(g),$=s+p*Math.cos(E),L=n+p*Math.sin(E),B=s+i*Math.cos(E),G=n+i*Math.sin(E),me=s+i*Math.cos(g),Ee=n+i*Math.sin(g),ee=t>.5?1:0;return`M ${s} ${n} L ${w} ${T} A ${p} ${p} 0 ${ee} 1 ${$} ${L} L ${B} ${G} A ${i} ${i} 0 ${ee} 1 ${me} ${Ee} Z`}),sl=e.computed(()=>{if(!(!zn.value||!Ft.value)&&!Ml.value)return`url(#${el.value})`}),vl=t=>{if(!(!Ml.value||t!==0))return`url(#${el.value})`},An=e.ref(0),rl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),En=e.computed(()=>ze.value==="radial"),Mo=e.computed(()=>{const t=En.value?An.value:1,s=Et.value,n=Vt.value,i=Math.max(gt.value*1.5,Ue.value,Ze.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const B=s-i,G=s+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,E=s+i*Math.cos(p),w=n+i*Math.sin(p),T=s+i*Math.cos(g),$=n+i*Math.sin(g),L=t>=.5?1:0;return`M ${s} ${n} L ${E} ${w} A ${i} ${i} 0 ${L} 1 ${T} ${$} Z`}),_o=e.computed(()=>{if(sl.value)return sl.value;if(En.value)return`url(#${rl.value})`});let tl=null;const go=()=>{if(!Ft.value)return;Hn.value=0;const t=De.value,s=performance.now(),n=i=>{const p=i-s,g=Math.min(1,p/t);Hn.value=On(Me.value,g),g<1&&(tl=requestAnimationFrame(n))};tl=requestAnimationFrame(n)},bl=e.computed(()=>Z.value?.bubbles?.minSize||8),ho=e.computed(()=>Z.value?.bubbles?.maxSize||50),yo=e.computed(()=>Z.value?.bubbles?.opacity||.7),Co=(t,s)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(s*.5)*.2;return Math.max(5,i*p)},Al=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Yl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},Pn=e.computed(()=>H.series),fl=e.computed(()=>H.series.filter((t,s)=>!ft.value.has(s))),nl="auto",It=e.computed(()=>{if(Zt.value)return ko();if(!fl.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;fl.value.forEach(w=>{w.data&&w.data.length&&(n=Math.max(n,w.data.length-1),w.data.forEach(T=>{typeof T=="number"&&(t=Math.min(t,T),s=Math.max(s,T))}))}),H.categories.length>0&&(n=Math.max(n,H.categories.length-1)),t===1/0&&(t=0,s=100);const i=je.value,p=$t.value;let g,E;if(i===nl){const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}else if(typeof i=="number")g=i;else{const w=s-t,T=w>0?w*.1:1;g=Math.max(0,t-T)}if(p===nl){const w=s-t,T=w>0?w*.1:2;E=s+T}else if(typeof p=="number")E=p;else{const w=s-t,T=w>0?w*.1:2;E=s+T}return{minX:0,maxX:n,minY:g,maxY:E}}),ko=()=>{if(!fl.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,s=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,E=!1;if(fl.value.forEach((me,Ee)=>{me?.data?.length&&me.data.forEach((ee,ye)=>{let ke,ie,qe;if(typeof ee=="object"&&ee!==null&&!Array.isArray(ee))ke=typeof ee.x=="number"?ee.x:ye,ie=typeof ee.y=="number"?ee.y:0,qe=typeof ee.size=="number"?ee.size:20;else if(Array.isArray(ee)&&ee.length>=3)ke=typeof ee[0]=="number"?ee[0]:ye,ie=typeof ee[1]=="number"?ee[1]:0,qe=typeof ee[2]=="number"?ee[2]:20;else if(typeof ee=="number")ke=ye,ie=ee,qe=Co(Ee,ye);else return;isFinite(ke)&&isFinite(ie)&&isFinite(qe)&&(t=Math.min(t,ke),s=Math.max(s,ke),n=Math.min(n,ie),i=Math.max(i,ie),p=Math.min(p,qe),g=Math.max(g,qe),E=!0)})}),!E)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const w=s-t,T=i-n;let $,L,B,G;return Ht.value!==null?$=Ht.value:$=t-w*.1,Yt.value!==null?L=Yt.value:L=s+w*.1,je.value!==null&&typeof je.value=="number"?B=je.value:B=Math.max(0,n-T*.1),$t.value!==null&&typeof $t.value=="number"?G=$t.value:G=i+T*.1,{minX:$,maxX:L,minY:B,maxY:G,minSize:p,maxSize:g}},Wt=t=>{if(Zt.value){const{minX:w,maxX:T}=It.value,$=T-w||1;return z.value.left+(t-w)/$*z.value.width}const{minX:s,maxX:n}=It.value,i=n-s;if(n===0||i===0)return z.value.left+z.value.width/2;const p=i/K.value.scale,g=s-K.value.offsetX/z.value.width*i,E=(t-g)/p;return z.value.left+E*z.value.width},on=t=>{const{minY:s,maxY:n}=It.value,i=n-s||1;return z.value.bottom-(t-s)/i*z.value.height},bo=t=>{if(!Zt.value)return de.value||4;const{maxSize:s}=It.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return bl.value+i*(ho.value-bl.value)},$o=e.computed(()=>Dl.value.map(t=>({y:t.y}))),gl=e.computed(()=>{if(Zt.value)return il();if(ze.value==="bar"){if(ln.value){const we=[],{minY:xe,maxY:Fe}=It.value,He=5,kt=Fe-xe||1;for(let bt=0;bt<=He;bt++){const Vn=xe+kt*(bt/He),Xt=Qn(Vn);we.push({x:Xt,y:z.value.bottom+20,text:Nn(Math.round(Vn))})}return we}const Ee=[],{maxX:ee}=It.value,ye=ee+1,ke=5,qe=(z.value.width-ke*2)/ye;for(let we=0;we<=ee;we++){const xe=z.value.left+ke+(we+.5)*qe;Ee.push({x:xe,y:z.value.bottom+20,text:H.categories[we]||I("chart.fallback.item",{number:we+1})})}return Ee}const t=[],{minX:s,maxX:n}=It.value,i=n-s||1,p=i/K.value.scale,g=s-K.value.offsetX/z.value.width*i,E=g+p,w=Math.max(0,Math.floor(g-2)),T=Math.min(n,Math.ceil(E+2)),$=T-w,L=z.value.width,G=Math.floor(L/60);let me=1;$>G&&(me=Math.ceil($/G));for(let Ee=w;Ee<=T;Ee+=me)if(Ee>=0&&Ee<=n){const ee=Wt(Ee);ee>=z.value.left-100&&ee<=z.value.right+100&&t.push({x:ee,y:z.value.bottom+20,text:H.categories[Ee]||`Item ${Ee+1}`})}return t}),il=()=>{const t=[],{minX:s,maxX:n}=It.value,i=n-s||1,p=Math.min(8,Math.max(4,Math.floor(z.value.width/80)));for(let g=0;g<=p;g++){const E=s+i*g/p,w=Wt(E);if(w>=z.value.left-10&&w<=z.value.right+10){const T=Math.round(E),$=H.categories?.[T];t.push({x:w,y:z.value.bottom+20,text:$||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Dl=e.computed(()=>{if(ln.value){const p=[],{maxX:g}=It.value;for(let E=0;E<=g;E++)p.push({x:z.value.left-10,y:Ln(E),text:H.categories[E]||`Item ${E+1}`});return p}const t=[],{minY:s,maxY:n}=It.value,i=5;for(let p=0;p<=i;p++){const g=s+(n-s)*(p/i),E=Math.round(g);t.push({x:z.value.left-10,y:on(g),text:Nn(E)})}return t}),Rt=t=>{const s=V.value;if(!s||s.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return s[t%s.length]},To=t=>{if(!t||typeof t!="string")return"#3a3a3a";const s=t.trim();let n=0,i=0,p=0;const g=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(g)n=Number(g[1])/255,i=Number(g[2])/255,p=Number(g[3])/255;else{const w=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(w)n=Number(w[1])/255,i=Number(w[2])/255,p=Number(w[3])/255;else{const T=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(T){let $=T[1];$.length===3&&($=$[0]+$[0]+$[1]+$[1]+$[2]+$[2]),n=parseInt($.slice(0,2),16)/255,i=parseInt($.slice(2,4),16)/255,p=parseInt($.slice(4,6),16)/255}else if(typeof document<"u"){const $=document.createElement("span");$.style.color=s,$.style.display="none",document.body.appendChild($);const L=getComputedStyle($).color;document.body.removeChild($);const B=L.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},jl=t=>{if(!t||typeof t!="string")return t;const s=t.trim(),n=s.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(n){const g=Math.max(0,Math.floor(Number(n[1])*.65)),E=Math.max(0,Math.floor(Number(n[2])*.65)),w=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${w})`}const i=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(i){const g=Math.max(0,Math.floor(Number(i[1])*.65)),E=Math.max(0,Math.floor(Number(i[2])*.65)),w=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${w}, ${i[4]})`}const p=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(p){let g=p[1];g.length===3&&(g=g[0]+g[0]+g[1]+g[1]+g[2]+g[2]);const E=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),T=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,w,T].map($=>$.toString(16).padStart(2,"0")).join("")}`}return s},Kl=(t,s)=>{const i=Z.value?.stroke?.color;return i==null?jl(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??jl(s):jl(s)},wl=t=>{let s=0;for(let n=1;n<t.length;n++){const i=t[n].x-t[n-1].x,p=t[n].y-t[n-1].y;s+=Math.sqrt(i*i+p*p)}return s},Dn=e.computed(()=>ze.value==="line"||Tn.value?(Tn.value?H.series.filter(s=>(s.type||ze.value)==="line"):Pn.value).map((s,n)=>{const i=H.series.findIndex(B=>B===s),p=[];let g=[];s.data.forEach((B,G)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:ln.value?Qn(B):Wt(G),y:ln.value?Ln(G):on(B),index:G})}),g.length>0&&p.push(g);let E="";p.forEach(B=>{if(B.length>0){let G="";ne.value?G=Hl(B):G=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(me=>` L ${me.x} ${me.y}`).join(""),E+=(E?" ":"")+G}});const w=p.reduce((B,G)=>B+wl(G),0),T=ft.value.has(i),$=pe.value===i,L=pe.value!==null&&pe.value!==i;return{path:E,color:Rt(i),pathLength:w,seriesIndex:i,animationDelay:n*le.value,isHighlighted:$,isDimmed:L,isHidden:T}}):[]),wo=e.computed(()=>{if(!(ze.value==="line"||Tn.value))return[];const t=Tn.value?H.series.filter(n=>(n.type||ze.value)==="line"):Pn.value,s=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let w=-1,T=0;for(let $=g+1;$<n.data.length;$++){const L=n.data[$];if(L==null)T++;else{w=$;break}}if(T>0&&w!==-1){const $=n.data[w],L=ln.value?Qn(E):Wt(g),B=ln.value?Ln(g):on(E),G=ln.value?Qn($):Wt(w),me=ln.value?Ln(w):on($),Ee=ft.value.has(p),ee=pe.value===p,ye=pe.value!==null&&pe.value!==p;s.push({path:`M ${L} ${B} L ${G} ${me}`,color:Rt(p),seriesIndex:p,animationDelay:i*le.value,isHighlighted:ee,isDimmed:ye,isHidden:Ee,gapSize:T}),g=w-1}}}}),s}),hl=e.computed(()=>ze.value==="line"||Tn.value?!P.value||en.value||ct.value.hasAnimated?[]:(Tn.value?H.series.filter(s=>(s.type||ze.value)==="line"):Pn.value).map((s,n)=>{const i=H.series.findIndex(T=>T===s);let p="",g=null;s.data.forEach((T,$)=>{if(T!=null){const L={x:ln.value?Qn(T):Wt($),y:ln.value?Ln($):on(T)};g===null?p+=`M ${L.x} ${L.y}`:p+=` L ${L.x} ${L.y}`,g=L}else if(g!==null){const L=s.data.findIndex((B,G)=>G>$&&B!==null&&B!==void 0);if(L!==-1){const B={x:ln.value?Qn(s.data[L]):Wt(L),y:ln.value?Ln(L):on(s.data[L])};p+=` L ${B.x} ${B.y}`,g=B}}});const E=s.data.map((T,$)=>T==null?null:{x:ln.value?Qn(T):Wt($),y:ln.value?Ln($):on(T)}).filter(T=>T!==null),w=wl(E);return{path:p,pathLength:w,color:Rt(i),animationDelay:n*le.value,seriesIndex:i}}):[]),Gl=e.computed(()=>{if(ze.value!=="line")return[];const t=[];return Pn.value.forEach((s,n)=>{const i=pe.value===n,p=pe.value!==null&&pe.value!==n,g=ft.value.has(n);s.data.forEach((E,w)=>{E!=null&&t.push({x:Wt(w),y:on(E),color:Rt(n),value:E,label:H.categories[w]||w.toString(),seriesName:s.name,categoryIndex:w,dataIndex:w,animationDelay:(n*s.data.length+w)*(le.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Lo=e.computed(()=>{if(!Tn.value)return[];const t=[];return H.series.filter(n=>(n.type||ze.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(T=>T===n),g=pe.value===p,E=pe.value!==null&&pe.value!==p,w=ft.value.has(p);n.data.forEach((T,$)=>{T!=null&&t.push({x:Wt($),y:on(T),color:Rt(p),value:T,label:H.categories[$]||$.toString(),seriesName:n.name,categoryIndex:$,dataIndex:$,animationDelay:(i*n.data.length+$)*(le.value/8),isHighlighted:g,isDimmed:E,isHidden:w})})}),t}),_l=e.computed(()=>{if(!Zt.value)return[];const t=[];return Pn.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=pe.value,p=i!==null&&i===n,g=i!==null&&i!==n,E=ft.value.has(n);s.data.forEach((w,T)=>{let $,L,B,G,me;if(typeof w=="object"&&w!==null&&!Array.isArray(w))$=typeof w.x=="number"?w.x:T,L=typeof w.y=="number"?w.y:0,B=typeof w.size=="number"?w.size:20,G=w.label||H.categories?.[T]||`Point ${T+1}`,me=w.image||w.imageUrl;else if(Array.isArray(w)&&w.length>=3)$=typeof w[0]=="number"?w[0]:T,L=typeof w[1]=="number"?w[1]:0,B=typeof w[2]=="number"?w[2]:20,G=w[3]||H.categories?.[T]||`Point ${T+1}`,me=w[4];else if(typeof w=="number")$=T,L=w,B=Co(n,T),G=H.categories?.[T]||`Point ${T+1}`;else return;!isFinite($)||!isFinite(L)||!isFinite(B)||t.push({x:Wt($),y:on(L),radius:bo(B),originalX:$,originalY:L,originalSize:B,color:Rt(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:me,seriesIndex:n,dataIndex:T,categoryIndex:Math.round($),isHighlighted:p,isDimmed:g,isHidden:E,opacity:yo.value})})}),t}),Rl=e.computed(()=>ze.value!=="area"?[]:Pn.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((B,G)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Wt(G),y:on(B),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Rt(s),isHidden:ft.value.has(s)};const p=z.value.bottom+1;let g="",E="";n.forEach((B,G)=>{if(B.length===0)return;let me=`M ${B[0].x} ${B[0].y}`;ne.value&&B.length>1?me=Hl(B):B.slice(1).forEach(ee=>{me+=` L ${ee.x} ${ee.y}`}),g+=(g?" ":"")+me;let Ee=`M ${B[0].x} ${p}`;if(Ee+=` L ${B[0].x} ${B[0].y}`,ne.value&&B.length>1){const ee=Hl(B),ye=ee.substring(ee.indexOf("C")||ee.indexOf("Q")||ee.indexOf("L"));ye?Ee+=" "+ye:B.slice(1).forEach(ke=>{Ee+=` L ${ke.x} ${ke.y}`})}else B.slice(1).forEach(ee=>{Ee+=` L ${ee.x} ${ee.y}`});Ee+=` L ${B[B.length-1].x} ${p} Z`,E+=(E?" ":"")+Ee});const w=pe.value===s,T=pe.value!==null&&pe.value!==s,$=ft.value.has(s),L=n.reduce((B,G)=>B+wl(G),0);return{linePath:g,areaPath:E,color:Rt(s),pathLength:L,isHighlighted:w,isDimmed:T,isHidden:$}})),o=e.computed(()=>{if(!(["bar"].includes(ze.value)||Tn.value))return[];const t=[],{maxX:s}=It.value,n=Tn.value?H.series.filter(p=>(p.type||ze.value)==="bar"):Pn.value,i=n.length;if(ln.value){const p=s+1,E=z.value.height/p,w=E*(2/3),T=Math.min(4,w/i*.15),$=w-(i-1)*T,L=Math.max(4,$/i);n.forEach((B,G)=>{const me=H.series.findIndex(ke=>ke===B),Ee=pe.value===me,ee=pe.value!==null&&pe.value!==me,ye=ft.value.has(me);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const xe=z.value.top+(ie+.5)*E-w/2+G*(L+T),Fe=z.value.left,He=Math.abs(Qn(ke)-z.value.left);let kt="";if(ne.value&&He>0){const bt=Math.min(k.value,L/2,He/2);kt=[`M ${Fe} ${xe}`,`L ${Fe+He-bt} ${xe}`,`Q ${Fe+He} ${xe} ${Fe+He} ${xe+bt}`,`L ${Fe+He} ${xe+L-bt}`,`Q ${Fe+He} ${xe+L} ${Fe+He-bt} ${xe+L}`,`L ${Fe} ${xe+L}`,"Z"].join(" ")}t.push({x:Fe,y:xe,width:He,height:L,color:Rt(i===1?ie:me),value:ke,label:H.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(le.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:ye,barPath:kt,isSmooth:ne.value&&He>0})})})}else{const p=s+1,E=z.value.width/p,w=E*.8,T=w/i,$=T*.05,L=T-$;n.forEach((B,G)=>{const me=H.series.findIndex(ke=>ke===B),Ee=pe.value===me,ee=pe.value!==null&&pe.value!==me,ye=ft.value.has(me);B.data.forEach((ke,ie)=>{if(ke==null||typeof ke!="number"||!isFinite(ke))return;const xe=z.value.left+(ie+.5)*E-w/2+G*T+$/2,Fe=on(Math.max(0,ke)),He=Math.abs(on(0)-on(ke));let kt="";if(ne.value&&He>0){const bt=Math.min(k.value,L/2,He/2);kt=[`M ${xe} ${Fe+He}`,`L ${xe} ${Fe+bt}`,`Q ${xe} ${Fe} ${xe+bt} ${Fe}`,`L ${xe+L-bt} ${Fe}`,`Q ${xe+L} ${Fe} ${xe+L} ${Fe+bt}`,`L ${xe+L} ${Fe+He}`,"Z"].join(" ")}t.push({x:xe,y:Fe,width:L,height:He,color:Rt(i===1?ie:me),value:ke,label:H.categories[ie]||ie.toString(),seriesName:B.name,animationDelay:(G*n.length+ie)*(le.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:ye,barPath:kt,isSmooth:ne.value&&He>0})})})}return t}),l=e.computed(()=>{if(!rn.value)return[];const t=Pn.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!ft.value.has(g));if(t.length===0)return[];let s=ze.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ze.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],w=g.data[0]||0,T=s,$=s+n-.001,L=T+n/2,B=Et.value+Math.cos(T)*Ut.value,G=Vt.value+Math.sin(T)*Ut.value,me=Et.value+Math.cos($)*Ut.value,Ee=Vt.value+Math.sin($)*Ut.value,ee=Et.value+Math.cos($)*gt.value,ye=Vt.value+Math.sin($)*gt.value,ke=Et.value+Math.cos(T)*gt.value,ie=Vt.value+Math.sin(T)*gt.value,qe=1,we=[`M ${B} ${G}`,`A ${Ut.value} ${Ut.value} 0 ${qe} 1 ${me} ${Ee}`,`L ${ee} ${ye}`,`A ${gt.value} ${gt.value} 0 ${qe} 0 ${ke} ${ie}`,"Z"].join(" "),xe=Rt(E);return i.push({path:we,color:xe,strokeWidth:Ke.value,strokeColor:Kl(0,xe),value:w,seriesName:g.name,opacity:.8,isHighlighted:pe.value===E,isDimmed:!1,isHidden:!1,startAngle:T,endAngle:$,midAngle:L}),i}if(Ml.value&&t.length===2){const g=t[0],E=t[1],w=Math.min(100,Math.max(0,g.series.data[0]||0)),T=w/100*n,$=(L,B,G,me,Ee)=>{const ee=L+(B-L)/2,ye=B-L,ke=Et.value+Math.cos(L)*Ut.value,ie=Vt.value+Math.sin(L)*Ut.value,qe=Et.value+Math.cos(B)*Ut.value,we=Vt.value+Math.sin(B)*Ut.value,xe=Et.value+Math.cos(B)*gt.value,Fe=Vt.value+Math.sin(B)*gt.value,He=Et.value+Math.cos(L)*gt.value,kt=Vt.value+Math.sin(L)*gt.value,bt=ye>Math.PI?1:0,Vn=[`M ${ke} ${ie}`,`A ${Ut.value} ${Ut.value} 0 ${bt} 1 ${qe} ${we}`,`L ${xe} ${Fe}`,`A ${gt.value} ${gt.value} 0 ${bt} 0 ${He} ${kt}`,"Z"].join(" "),Xt=Rt(me);return{path:Vn,color:Xt,strokeWidth:Ke.value,strokeColor:Kl(i.length,Xt),value:Ee,seriesName:G.name,opacity:.8,isHighlighted:pe.value===me,isDimmed:pe.value!==null&&pe.value!==me,isHidden:!1,startAngle:L,endAngle:B,midAngle:ee}};return i.push($(s,s+T,g.series,g.originalIndex,w)),i.push($(s,s+n,E.series,E.originalIndex,100)),i}const p=t.reduce((g,{series:E})=>g+(E.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:E})=>{const w=g.data[0]||0,T=w/p*n,$=s,L=s+T,B=$+T/2,G=Et.value+Math.cos($)*Ut.value,me=Vt.value+Math.sin($)*Ut.value,Ee=Et.value+Math.cos(L)*Ut.value,ee=Vt.value+Math.sin(L)*Ut.value,ye=Et.value+Math.cos(L)*gt.value,ke=Vt.value+Math.sin(L)*gt.value,ie=Et.value+Math.cos($)*gt.value,qe=Vt.value+Math.sin($)*gt.value,we=T>Math.PI?1:0,xe=[`M ${G} ${me}`,`A ${Ut.value} ${Ut.value} 0 ${we} 1 ${Ee} ${ee}`,`L ${ye} ${ke}`,`A ${gt.value} ${gt.value} 0 ${we} 0 ${ie} ${qe}`,"Z"].join(" "),Fe=Rt(E);i.push({path:xe,color:Fe,strokeWidth:Ke.value,strokeColor:Kl(i.length,Fe),value:w,seriesName:g.name,opacity:.8,isHighlighted:pe.value===E,isDimmed:pe.value!==null&&pe.value!==E,isHidden:!1,startAngle:$,endAngle:L,midAngle:B}),s=L}),i)}),a=e.computed(()=>{const t=l.value;return Ml.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),r=e.computed(()=>{if(!hn.value||!rn.value)return[];const t=nn.value,s=yn.value,n=In.value,i=Vl.value,p=15,g=t*1.3,E=.55,w=(B,G)=>{const me=Et.value+Math.cos(B.midAngle)*gt.value,Ee=Vt.value+Math.sin(B.midAngle)*gt.value,ee=Et.value+Math.cos(B.midAngle)*(gt.value+s),ye=Vt.value+Math.sin(B.midAngle)*(gt.value+s),ie=ee+n*(G?1:-1),qe=G?ee+p:ee-p,we=ye-i,xe=`${B.seriesName}: ${Nn(B.value)}`,Fe=xe.length*t*E;return{pointerStartX:me,pointerStartY:Ee,pointerEndX:ee,pointerEndY:ye,horizontalEndX:ie,horizontalEndY:ye,textX:qe,textY:we,text:xe,textWidth:Fe,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ee-me,ye-Ee),horizontalLineLength:Math.hypot(ie-ee,0)}},T=(B,G)=>{const me=Math.abs(B.textY-G.textY)<g,Ee=B.isRightSide?B.textX:B.textX-B.textWidth,ee=B.isRightSide?B.textX+B.textWidth:B.textX,ye=G.isRightSide?G.textX:G.textX-G.textWidth,ke=G.isRightSide?G.textX+G.textWidth:G.textX,ie=Ee<ke&&ye<ee;return me&&ie},$=l.value.filter(B=>!B.isHidden),L=[];for(let B=0;B<$.length;B++){const G=$[B];let me=Math.cos(G.midAngle)>=0;if(B>0){const ee=L[B-1],ye=w(G,me);T(ee,ye)&&(me=!me)}const Ee=w(G,me);L.push({...Ee,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return L}),c=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||yo.value||.7;return pe.value===null||pe.value===void 0?s:pe.value!==null?t.seriesIndex===pe.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},d=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return pe.value!==null?t.seriesIndex===pe.value?Math.min(1,s+.1):s*.7:s},u=(t,s)=>{if(t)try{if(pe.value===t.seriesIndex?pe.value=null:pe.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},m=(t,s)=>{const n=[`dss-bubble-fallback-${s}`];return t.isHighlighted&&n.push("dss-bubble-highlighted"),t.isDimmed&&n.push("dss-bubble-dimmed"),t.isHidden&&n.push("dss-bubble-hidden"),n.push(`dss-bubble-series-${t.seriesIndex}`),n.join(" ")},f=(t,s)=>{if(!t||(s.stopPropagation(),$l.value=!0,pe.value=t.seriesIndex,Pe.value.show=!1,!jt.value))return;const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120;p+E>Ue.value&&(p=s.clientX-i.left-E-10),g+w>i.height&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);const T=Sl.value,$=jn.value,L=T.map(B=>{const G=$[B]||B,me=y(B,t);return me?{seriesName:t.seriesName,label:t.label,value:`${G}: ${me}`,color:t.color}:null}).filter(Boolean);Re.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:L,categoryIndex:void 0,spiderSeries:[]}},y=(t,s)=>{let n;switch(t){case"x":n=s.originalX;break;case"y":n=s.originalY;break;case"size":n=s.originalSize;break;case"label":n=s.label;break;case"seriesName":n=s.seriesName;break;default:n=s[t]||""}const i=zl.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const p=n.toFixed(1);return Mn.value?p+Mn.value:p}return n?.toString()||""},M=()=>{if(!Zt.value||!Pe.value.data||Pe.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Pe.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;s.has(i)||(t.push(i),s.add(i))}else n.seriesName&&(s.has(n.seriesName)||(t.push(n.seriesName),s.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},_=(t,s)=>{t&&($l.value=!1,pe.value=null,Re.value.show=!1,Re.value.bubbleData=[])},N=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=ao(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,w=s.clientY-i.top-10;const T=200,$=g?80:50;E+T>Ue.value&&(E=s.clientX-i.left-T-15),w+$>Ze.value&&(w=s.clientY-i.top-$-10),E<0&&(E=10),w<0&&(w=10),dt.value={show:!0,x:E,y:w,categoryValue:p,description:g}},J=()=>{dt.value.show=!1},Y=e.computed(()=>H.categories.length||Math.max(...fl.value.map(t=>t.data.length))),$e=e.computed(()=>{let t=0;return fl.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),ge=e.computed(()=>{const t=[],s=Y.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,p=Et.value+Math.cos(i)*gt.value,g=Vt.value+Math.sin(i)*gt.value;t.push({x:p,y:g,angle:i,index:n})}return t}),ut=e.computed(()=>{const t=[],s=Y.value;return ge.value.forEach((n,i)=>{const p=gt.value+15,g=i*2*Math.PI/s-Math.PI/2,E=Et.value+Math.cos(g)*p,w=Vt.value+Math.sin(g)*p+5;let T="middle",$="middle";Math.abs(Math.cos(g))>.5&&(T=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&($=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:w,text:H.categories[i]||`Axis ${i+1}`,anchor:T,baseline:$})}),t}),an=e.ref(new Set),Gt=(t,s,n)=>{const i=`current-${n}`,p=an.value.has(i);return!p&&pe.value===null?s.fillOpacity||yt.value:s.isHighlighted||p?(s.fillOpacity||yt.value)+.15:s.isDimmed?(s.fillOpacity||yt.value)*.3:s.fillOpacity||yt.value},Pt=e.computed(()=>{if(!Gn.value)return[];const t=[],s=Y.value;return Pn.value.forEach((n,i)=>{const p=[],g=[],E=[],w=pe.value===i,T=pe.value!==null&&pe.value!==i,$=ft.value.has(i);for(let L=0;L<s;L++){const B=n.data[L]||0,me=B/$e.value*gt.value,Ee=L*2*Math.PI/s-Math.PI/2,ee=Et.value+Math.cos(Ee)*me,ye=Vt.value+Math.sin(Ee)*me;p.push(`${ee},${ye}`),g.push({x:ee,y:ye}),E.push({x:ee,y:ye,value:B,label:H.categories[L]||`Axis ${L+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:E,color:Rt(i),fillOpacity:yt.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:w,isDimmed:T,isHidden:$,seriesIndex:i})}),t}),Qt=(t,s)=>{if(!s||s.length<3)return!1;let n=!1;for(let i=0,p=s.length-1;i<s.length;p=i++){const g=s[i].x,E=s[i].y,w=s[p].x,T=s[p].y;E>t.y!=T>t.y&&t.x<(w-g)*(t.y-E)/(T-E)+g&&(n=!n)}return n},Jt=t=>{if(!Gn.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Be.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,E=Pt.value.filter(w=>w.isHidden?!1:Qt({x:p,y:g},w.polygonPoints));if(E.length>0){E.length,pe.value=E[0].seriesIndex;const w=t.clientX-n.left+10,T=t.clientY-n.top-10,$=200,L=50+E.length*25;let B=w,G=T;B+$>Ue.value&&(B=t.clientX-n.left-$-10),G+L>Ze.value&&(G=t.clientY-n.top-L-10),B<0&&(B=10),G<0&&(G=10);const me=E.map(Ee=>{let ee=Ee.dataPoints[0],ye=1/0;return Ee.dataPoints.forEach(ke=>{const ie=Math.sqrt(Math.pow(ke.x-p,2)+Math.pow(ke.y-g,2));ie<ye&&(ye=ie,ee=ke)}),{seriesName:Ee.seriesName,color:Ee.color,value:Nn(ee.value!==void 0?ee.value:Ee.value)}});Re.value={show:!0,x:B,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:me}}else ol()},zt=e.computed(()=>{const t=Z.value;return t.logos.map((s,n)=>{const i=H.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||ft.value.has(s.seriesIndex))return null;let p,g;if(sn.value){let w=-1,T=null;for(let L=i.data.length-1;L>=0;L--)if(i.data[L]!==null&&i.data[L]!==void 0){w=L,T=i.data[L];break}if(w===-1||T===null)return null;const $=i.data.map((L,B)=>L==null?null:{x:Wt(B),y:on(L),index:B}).filter(L=>L!==null);if(t.animations.enabled&&!en.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(ct.value.isAnimating||!ct.value.hasAnimated))if(ct.value.isAnimating){const L=ct.value.currentFrame/ct.value.totalFrames,B=On(t.animations.easing,Math.min(L,1)),G=Jo($,B);p=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else p=$[0].x+(s.offsetX||0),g=$[0].y+(s.offsetY||0);else p=Wt(w)+(s.offsetX||0),g=on(T)+(s.offsetY||0)}else if(rn.value||Gn.value){const w=Math.PI*2/t.logos.length*n;p=Et.value+Math.cos(w)*(gt.value+30)+(s.offsetX||0),g=Vt.value+Math.sin(w)*(gt.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Un=t=>{const s=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.opacity="0"),n&&(n.style.opacity="1")},cl=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Xn=t=>{ft.value.has(t)?ft.value.delete(t):ft.value.add(t)},xo=e.computed(()=>{if(!Re.value.show&&!(Q.value&&Pe.value.show&&!K.value.isZooming))return{display:"none"};let t,s;if(Q.value&&Pe.value.show&&!K.value.isZooming){t=Pe.value.x+15,s=z.value.top;const n=Zt.value?200:150;t+n>Ue.value&&(t=Pe.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Re.value.x,s=Re.value.y;return{left:t+"px",top:s+"px"}}),ll=(t,s)=>{if(!jt.value||xl.value)return;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+10,g=s.clientY-i.top-10;const E=200,w=120,T=Ue.value,$=Ze.value;p+E>T&&(p=s.clientX-i.left-E-10),g+w>$&&(g=s.clientY-i.top-w-10),p<0&&(p=10),g<0&&(g=10);let L;typeof t.categoryIndex=="number"?L=t.categoryIndex:typeof t.dataIndex=="number"?L=t.dataIndex:t.label&&H.categories.includes(t.label)&&(L=H.categories.indexOf(t.label));const B=(ln.value||ze.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Re.value={show:!0,x:p,y:g,title:B,value:Nn(t.value)||"",categoryIndex:L,spiderSeries:[]}},Ql=e.ref(!1),$l=e.ref(!1),ol=()=>{Re.value.show=!1,Re.value.spiderSeries=[],Re.value.bubbleData=[],Pe.value.show=!1,Ql.value||(pe.value=null)},xl=e.ref(!1),ul=(t,s)=>{xl.value=!0,Re.value.show=!1,Pe.value.show=!1;const i=s.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=s.clientX-i.left+15,g=s.clientY-i.top-10;const E=250;p+E>Ue.value&&(p=s.clientX-i.left-E-15),p<0&&(p=10),g<0&&(g=10),pl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},El=()=>{xl.value=!1,pl.value.show=!1},ct=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),On=(t,s)=>{switch(t){case"linear":return s;case"ease":return s<.5?2*s*s:-1+(4-2*s)*s;case"ease-in":return s*s;case"ease-out":return s*(2-s);case"ease-in-out":return s<.5?2*s*s:-1+(4-2*s)*s;default:return s}},en=e.computed(()=>Je.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Ho=()=>{if(!P.value||en.value){ct.value.hasAnimated=!0,En.value&&(An.value=1);return}En.value&&(An.value=0),ct.value.isAnimating=!0,ct.value.currentFrame=0,ct.value.totalFrames=Math.ceil(De.value/16.67);const t=()=>{const s=ct.value.currentFrame/ct.value.totalFrames,n=On(Me.value,Math.min(s,1));Yo(n),En.value&&(An.value=n),s<1?(ct.value.currentFrame++,ct.value.animationId=requestAnimationFrame(t)):jo()};ct.value.animationId=requestAnimationFrame(t)},Yo=t=>{const s=b.value;s&&s.style.setProperty("--dss-animation-progress",t)},jo=()=>{ct.value.isAnimating=!1,ct.value.hasAnimated=!0,En.value&&(An.value=1),ct.value.animationId&&(cancelAnimationFrame(ct.value.animationId),ct.value.animationId=null)},Ao=e.computed(()=>!rn.value||ct.value.hasAnimated?!0:En.value?An.value>=1:zn.value?Hn.value>=1:!0),Oo=e.computed(()=>hn.value&&Ao.value),Eo=e.ref(!1);e.watch(Oo,t=>{t?(Eo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Eo.value=!0})})):Eo.value=!1},{immediate:!0});const Ko=e.computed(()=>{if(!P.value||en.value||ct.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${De.value}ms`,t["--dss-animation-easing"]=Go(Me.value),t["--dss-stagger-delay"]=`${le.value}ms`,t}),Go=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",Qo=()=>{if(!P.value||en.value)return"";const t=["dss-chart-animated"];return ct.value.hasAnimated||t.push(`dss-animate-${X.value}`),ct.value.hasAnimated||(rn.value&&ze.value!=="semi-radial"?t.push("dss-animate-fill"):rn.value||t.push(`dss-animate-${X.value}`)),ct.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,s)=>{nt.value&&s&&ct.value.hasAnimated&&(ct.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Ho(),Xe.value)}))},{deep:!0}),e.watch(()=>K.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Ol()},50)}),e.watch(()=>[K.value.scale,K.value.offsetX],()=>{!K.value.isZooming&&!K.value.isDragging&&Ol()},{flush:"post"}),e.watch([_e,rt],([t,s])=>{K.value.minScale=t,K.value.maxScale=s,(K.value.scale<t||K.value.scale>s)&&Ul()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==A.value&&(A.value=t)},{immediate:!0}),e.watch(()=>tt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Wl)}):document.removeEventListener("click",Wl)}),e.onMounted(()=>{pe.value=null,En.value&&(!P.value||en.value)&&(An.value=1),kl(),b.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(Ce&&cancelAnimationFrame(Ce),Ce=requestAnimationFrame(()=>{Ce=null;const{width:n,height:i}=s.contentRect;vt.value=Math.round(n),v.value=Math.round(i),ce.value&&(Lt.value=ce.value.offsetHeight||he)}))}),ue.observe(b.value)),P.value&&!en.value?ze.value==="semi-radial"?setTimeout(()=>go(),Xe.value):setTimeout(()=>Ho(),Xe.value):(ct.value.hasAnimated=!0,ze.value==="semi-radial"&&(Hn.value=1)),document.addEventListener("mousemove",Zo),document.addEventListener("mouseup",Wo),document.addEventListener("click",po)}),e.onUnmounted(()=>{Ce&&cancelAnimationFrame(Ce),ue&&b.value&&(ue.unobserve(b.value),ue.disconnect(),ue=null),ct.value.animationId&&cancelAnimationFrame(ct.value.animationId),tl&&(cancelAnimationFrame(tl),tl=null),K.value.zoomTimeout&&clearTimeout(K.value.zoomTimeout),document.removeEventListener("mousemove",Zo),document.removeEventListener("mouseup",Wo),document.removeEventListener("click",po),document.removeEventListener("click",Wl)});const Zo=t=>{if(K.value.isDragging&&K.value.scale>1&&sn.value){Pe.value.show=!1;const s=t.clientX-K.value.lastMouseX,{minX:n,maxX:i}=It.value,p=i-n||1,E=s*.8;K.value.offsetX+=E;const w=p/K.value.scale,T=p-w,$=0,L=-T/p*z.value.width,B=$;K.value.offsetX=Math.max(L,Math.min(B,K.value.offsetX)),K.value.lastMouseX=t.clientX,K.value.lastMouseY=t.clientY}},Wo=()=>{K.value.isDragging&&(K.value.isDragging=!1,setTimeout(()=>{!K.value.isDragging&&K.value.isZooming},100))},Jo=(t,s)=>{const n=t.filter(w=>w!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||s<=0)return n[0];if(s>=1)return n[n.length-1];let i=0;const p=[];for(let w=1;w<n.length;w++){const T=n[w].x-n[w-1].x,$=n[w].y-n[w-1].y,L=Math.sqrt(T*T+$*$);p.push(L),i+=L}const g=i*s;let E=0;for(let w=0;w<p.length;w++){const T=E+p[w];if(g<=T){const $=(g-E)/p[w],L=n[w],B=n[w+1];return{x:L.x+(B.x-L.x)*$,y:L.y+(B.y-L.y)*$}}E=T}return n[n.length-1]};return(t,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[Qo(),{"dss-chart-fill-width":Te.value,"dss-chart-fill-height":Bt.value,"dss-chart-compact":rn.value&&!Nt.value}]]),style:e.normalizeStyle({width:Te.value?"100%":Ue.value+"px",height:wt.value,...Te.value||Bt.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Ko.value,cursor:Xl()}),"data-chart-type":ze.value,ref_key:"containerEl",ref:b,onWheel:ql,onMousedown:So,onMousemove:Tt,onMouseup:Bo,onMouseleave:fn,onDblclick:Ul,onContextmenu:e.withModifiers(Dt,["prevent"]),onClick:e.withModifiers(qt,["left"]),onWheelCapture:ql},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ce},[e.createElementVNode("div",Ua,[at.value?(e.openBlock(),e.createElementBlock("div",Xa,e.toDisplayString(at.value),1)):e.createCommentVNode("",!0),Ct.value?(e.openBlock(),e.createElementBlock("div",Ya,e.toDisplayString(Ct.value),1)):e.createCommentVNode("",!0)]),Nt.value&&xt.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":St.value==="horizontal","dss-legend-vertical":St.value==="vertical","dss-legend-top":xt.value==="top","dss-legend-bottom":xt.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xn(i),onMouseenter:p=>it(i),onMouseleave:et,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",Ka,e.toDisplayString(n.name),1)],46,ja))),128))],2)):e.createCommentVNode("",!0),Nt.value&&(xt.value==="left"||xt.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":xt.value==="left","dss-legend-right":xt.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xn(i),onMouseenter:p=>it(i),onMouseleave:et,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",Qa,e.toDisplayString(n.name),1)],46,Ga))),128))],2)):e.createCommentVNode("",!0)],512),R.showAddMarkerButton&&Rn.value&&At.value.addMarker&&(sn.value||Zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:mo,title:e.unref(I)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:un.value,class:"dss-add-marker-button-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,es),s[4]||(s[4]=e.createElementVNode("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 4V16M4 10H16",stroke:"hsl(60, 2%, 47%)","stroke-width":"2","stroke-linecap":"round"})],-1))],8,Ja)):e.createCommentVNode("",!0),e.createElementVNode("div",ts,[Zt.value&&cn.value?(e.openBlock(),e.createElementBlock("div",ns,"Bubble size: "+e.toDisplayString(cn.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ue.value,height:Ze.value,class:"dss-chart-svg","data-smooth":ne.value,"data-animated":P.value,ref_key:"svgEl",ref:Be},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:te.value},[e.createElementVNode("rect",{x:0,y:z.value.top,width:Ue.value,height:z.value.height*4},null,8,as)],8,os),zn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:el.value},[e.createElementVNode("path",{d:fo.value},null,8,rs)],8,ss)):e.createCommentVNode("",!0),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:rl.value},[e.createElementVNode("path",{d:Mo.value},null,8,cs)],8,is)):e.createCommentVNode("",!0)]),sn.value||Zt.value?(e.openBlock(),e.createElementBlock("g",us,[pt.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":oe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($o.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:z.value.left,x2:z.value.right,y1:n.y,y2:n.y,stroke:"#e0e0e0","stroke-width":"1","stroke-dasharray":"4,2",style:e.normalizeStyle({animationDelay:`${i*50}ms`})},null,12,ms))),128))],8,ds)):e.createCommentVNode("",!0),e.createElementVNode("g",ps,[e.createElementVNode("line",{x1:z.value.left,x2:z.value.right,y1:z.value.bottom,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,vs),e.createElementVNode("line",{x1:z.value.left,x2:z.value.left,y1:z.value.top,y2:z.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,fs)]),e.createElementVNode("g",gs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`x-${i}`,x:n.x,y:n.y,"text-anchor":"middle","font-size":"12",fill:"#666",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},e.toDisplayString(n.text),13,hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-${i}`,x:n.x,y:n.y,"text-anchor":"end","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,ys))),128)),_t.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:z.value.left+z.value.width/2,y:z.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(_t.value),9,Cs)):e.createCommentVNode("",!0),Qe.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:z.value.top+12+z.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${z.value.top+z.value.height/2})`},e.toDisplayString(Qe.value),9,ks)):e.createCommentVNode("",!0)]),ml.value.length>0?(e.openBlock(),e.createElementBlock("g",bs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ml.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":oe.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,xs)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Es)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:z.value.bottom,y2:z.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Vs)):e.createCommentVNode("",!0)],8,ws),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,z.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Ns)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,z.value.top-10),r:"14",fill:n.hasManual&&n.hasAuto||n.hasManual?"#047395":"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>ul(n,i),onMouseleave:El},null,40,Ss),e.createElementVNode("text",{x:n.x,y:Math.max(15,z.value.top-5),"text-anchor":"middle","font-size":"12","font-weight":"bold",fill:"#fafafa",class:"dss-flag-count-text","pointer-events":"none"},e.toDisplayString(n.totalCount),9,Bs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":oe.value},[Tn.value?(e.openBlock(),e.createElementBlock("g",_s,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":ln.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`mixed-bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,$s)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ts))],64))),128))],2),e.createElementVNode("g",Ls,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+2:Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Hs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+2:Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,As))),128)),de.value>0||Ge.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:W(n.isHighlighted?U(n,de.value)+2:U(n,de.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ds))),128)):e.createCommentVNode("",!0)])])):ze.value==="line"?(e.openBlock(),e.createElementBlock("g",Rs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":ct.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Dn.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+2:Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,Is))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+2:Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round","stroke-dasharray":"15, 10, 5, 10",opacity:n.isHighlighted?0:.5,class:e.normalizeClass({"dss-gap-connector":!0,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`,transition:"opacity 0.2s ease"})},null,14,zs))),128)),de.value>0||Ge.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Gl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:W(n.isHighlighted?U(n,de.value)+2:U(n,de.value)),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ps))),128)):e.createCommentVNode("",!0)])):ze.value==="area"?(e.openBlock(),e.createElementBlock("g",Os,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${R.chartId}`},[e.createElementVNode("rect",{x:z.value.left-10,y:z.value.top-10,width:z.value.width+20,height:z.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${z.value.width+20}px`})},null,12,Ws)],8,Zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?j.value+.2:j.value,mask:`url(#area-mask-${i}-${R.chartId})`,class:e.normalizeClass({"dss-area-fill-smooth":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden})},null,10,qs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Rl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+1:Ie.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*le.value}ms`})},null,14,Us))),128))])):ze.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":ln.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bar-${i}`},[n.isSmooth?(e.openBlock(),e.createElementBlock("path",{key:0,d:n.barPath,fill:n.color,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Xs)):(e.openBlock(),e.createElementBlock("rect",{key:1,x:n.x,y:n.y,width:n.width,height:n.height,stroke:"#fafafa","stroke-width":"1",class:e.normalizeClass({"dss-bar-highlighted":n.isHighlighted,"dss-bar-dimmed":n.isDimmed,"dss-bar-hidden":n.isHidden}),style:e.normalizeStyle({fill:n.color,fillOpacity:n.isDimmed?.4:1,animationDelay:`${n.animationDelay}ms`}),onMouseover:p=>ll(n,p),onMouseleave:ol},null,46,Ys))],64))),128))],2)):e.createCommentVNode("",!0)],8,Ms),Q.value&&Pe.value.show&&!K.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":oe.value},[e.createElementVNode("line",{x1:Pe.value.x,x2:Pe.value.x,y1:z.value.top,y2:z.value.bottom,stroke:ve.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Ks),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Pe.value.x,cy:n.y,r:W(de.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,Gs))),128))],8,js)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Zt.value?(e.openBlock(),e.createElementBlock("g",Qs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_l.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Js,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:W(n.radius),fill:n.color,"fill-opacity":c(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(m(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>f(n,p),onMouseleave:p=>_(n),onClick:p=>u(n,p)},null,42,er),n.imageUrl?(e.openBlock(),e.createElementBlock("image",{key:0,x:n.x-n.radius*.65,y:n.y-n.radius*.65,width:n.radius*1.3,height:n.radius*1.3,"xlink:href":n.imageUrl,class:e.normalizeClass(`dss-bubble-image-${i} ${n.isHighlighted?"dss-bubble-highlighted":""} ${n.isDimmed?"dss-bubble-dimmed":""} ${n.isHidden?"dss-bubble-hidden":""}`),"clip-path":`circle(${n.radius*.65}px at ${n.radius*.65}px ${n.radius*.65}px)`,style:e.normalizeStyle({cursor:"pointer",transition:"all 0.3s ease",opacity:d(n)}),onLoad:p=>Al(i),onError:p=>Yl(i),onMouseenter:p=>f(n,p),onMouseleave:p=>_(n),onClick:p=>u(n,p)},null,46,tr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),rn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:Jn.value},[ze.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Et.value,cy:Vt.value,r:gt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,lr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ze.value,"clip-path":_o.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`radial-${n.originalIndex}-${i}`,d:n.segment.path,fill:n.segment.color,"fill-opacity":n.segment.isHighlighted?(n.segment.opacity||.8)+.2:n.segment.opacity||.8,stroke:n.segment.strokeWidth?n.segment.strokeColor||n.segment.color:"none","stroke-width":n.segment.strokeWidth||0,"clip-path":vl(n.originalIndex),class:e.normalizeClass({"dss-series-highlighted":n.segment.isHighlighted,"dss-series-dimmed":n.segment.isDimmed,"dss-series-hidden":n.segment.isHidden}),onMouseover:p=>ll(n.segment,p),onMouseleave:ol},null,42,ar))),128))],8,or),Tl.value&&Ao.value?(e.openBlock(),e.createElementBlock("g",sr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wn.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("text",{key:`radial-segment-label-${i}`,x:n.x,y:n.y,"text-anchor":"middle","dominant-baseline":"middle",class:"dss-radial-segment-data-label",style:e.normalizeStyle({fill:n.contrastColor})},e.toDisplayString(n.value),13,rr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yl.value&&(Ao.value||zn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Ll.value.x,y:Ll.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":vn.value,fill:Cl.value,class:"dss-radial-data-center"},e.toDisplayString(kn.value),9,ir)):e.createCommentVNode("",!0),Oo.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Eo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`radial-label-${i}`,class:e.normalizeClass(["dss-radial-label-group",{"dss-label-highlighted":n.isHighlighted,"dss-label-dimmed":n.isDimmed}]),style:e.normalizeStyle({"--label-delay":`${i*.08}s`})},[e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-pointer",x1:n.pointerStartX,y1:n.pointerStartY,x2:n.pointerEndX,y2:n.pointerEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.pointerLineLength})},null,12,cr),e.createElementVNode("line",{class:"dss-radial-label-line dss-radial-label-line-horizontal",x1:n.pointerEndX,y1:n.pointerEndY,x2:n.horizontalEndX,y2:n.horizontalEndY,stroke:n.color,"stroke-width":"1.5",opacity:"0.8",style:e.normalizeStyle({"--line-length":n.horizontalLineLength})},null,12,ur),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":nn.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,dr)],6))),128))],2)):e.createCommentVNode("",!0)],8,nr)):e.createCommentVNode("",!0),Gn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:Jn.value},[pt.value?(e.openBlock(),e.createElementBlock("g",pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Et.value,cy:Vt.value,r:W(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,vr))),128)),e.createElementVNode("g",fr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Et.value-16,y:Vt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,gr),e.createElementVNode("text",{x:Et.value,y:Vt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Cn(i)),9,hr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Et.value,x2:n.x,y1:Vt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,yr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/Y.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/Y.value-Math.PI/2)*16,"text-anchor":n.anchor,"dominant-baseline":n.baseline,"font-size":"14px",fill:"#666","font-weight":"500",style:e.normalizeStyle({animationDelay:`${i*120}ms`})},e.toDisplayString(n.text.charAt(0).toUpperCase()+n.text.slice(1)),13,kr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jt,onMouseleave:ol},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":Gt("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?Ie.value+1:Ie.value,"stroke-linejoin":"round",class:e.normalizeClass({"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*le.value}ms`,transition:"all 0.2s ease"})},null,14,br),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.dataPoints,(p,g)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-point-${i}-${g}`,cx:p.x,cy:p.y,r:W(n.isHighlighted?de.value+1:de.value>0?de.value:0),fill:n.color,stroke:"none",class:e.normalizeClass({"dss-point-highlighted":n.isHighlighted,"dss-point-dimmed":n.isDimmed,"dss-point-hidden":n.isHidden}),style:e.normalizeStyle({animationDelay:`${i*le.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>ll(p,E),onMouseleave:ol},null,46,wr))),128))]))),128))],32)],8,mr)):e.createCommentVNode("",!0),e.createElementVNode("g",xr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:W(n.width/2),fill:Rt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Er))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(zt.value,(n,i)=>(e.openBlock(),e.createElementBlock("image",{key:`logo-${i}`,x:n.x-n.width/2,y:n.y-n.height/2,width:n.width,height:n.height,"xlink:href":n.url,onLoad:p=>Un(i),onError:p=>cl(i),preserveAspectRatio:"xMidYMid slice",class:e.normalizeClass(`dss-logo-image-${i}`),"clip-path":`circle(${n.width/2}px at ${n.width/2}px ${n.height/2}px)`,style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,46,Vr))),128))])],8,ls))]),se.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ue.value+"px",height:Ze.value+"px",backgroundImage:`url('${Fn.value}')`,backgroundRepeat:"no-repeat",...st.value,opacity:Ne.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(F.value,(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{key:"marker-"+n.id,class:"dss-chart-marker",style:e.normalizeStyle({position:"absolute",left:n.x+"px",top:n.y+"px",width:dn.value+"px",height:dn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>gn(n),["stop"]),onMouseenter:p=>N(n,p),onMouseleave:J},[e.createElementVNode("img",{src:bn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Sr)],44,Nr)),[[e.vShow,D.value]])),128)),dt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:dt.value.x+"px",top:dt.value.y+"px"})},[e.createElementVNode("div",Br,e.toDisplayString(dt.value.categoryValue),1),dt.value.description?(e.openBlock(),e.createElementBlock("div",Mr,e.toDisplayString(dt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),jt.value&&(Re.value.show||Q.value&&Pe.value.show&&!K.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":Q.value&&Pe.value.show&&!K.value.isZooming}]),style:e.normalizeStyle(xo.value)},[!Q.value||!Pe.value.show||K.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Gn.value&&Re.value.spiderSeries&&Re.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",_r,[Re.value.title?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(Re.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value.spiderSeries,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Tr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Lr,e.toDisplayString(n.value),1)]))),128))])):Zt.value&&Re.value.bubbleData&&Re.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Hr,[Re.value.title?(e.openBlock(),e.createElementBlock("div",Ar,e.toDisplayString(Re.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value.bubbleData,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`bubble-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])])):(e.openBlock(),e.createElementBlock("div",Rr,[e.createElementVNode("div",Fr,e.toDisplayString(Re.value.title),1),e.createElementVNode("div",Ir,e.toDisplayString(Re.value.value),1)])),Re.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[tn(Re.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",zr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Pr,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(Re.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Or,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",Zr,[e.createElementVNode("div",Wr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),tn(Re.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",qr,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ur,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(Re.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",jr,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64)):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Kr,[e.createElementVNode("div",Gr,e.toDisplayString(Zt.value?M():R.categories[Pe.value.categoryIndex]||`Category ${Pe.value.categoryIndex+1}`),1),Zt.value?(e.openBlock(),e.createElementBlock("div",Qr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-bubble-tooltip-item"},e.toDisplayString(n.value),1))),128))])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(Pe.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-tooltip-${i}`,class:"dss-tooltip-series"},[e.createElementVNode("div",{class:"dss-tooltip-series-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",Jr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",ei,e.toDisplayString(Nn(n.value)),1)]))),128))]),tn(Pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",ti,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ni,e.toDisplayString(e.unref(I)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(Pe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",li,[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.type),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.flags,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-${i}-${g}`,class:"dss-tooltip-item dss-tooltip-item-no-indicator"},[e.createElementVNode("div",oi,[e.createElementVNode("div",ai,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),tn(Pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",si,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",ri,e.toDisplayString(e.unref(I)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(tn(Pe.value.categoryIndex).markers,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-dss-marker-${i}`,class:"dss-tooltip-item"},[e.createElementVNode("div",{class:"dss-tooltip-item-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createElementVNode("div",ii,[e.createElementVNode("div",ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ui,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),sn.value&&fe.value&&K.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Ul},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(K.value.scale*100))+"% "+e.toDisplayString(e.unref(I)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,qa),Nt.value&&xt.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":St.value==="horizontal","dss-legend-vertical":St.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,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ft.value.has(i),"dss-legend-hovered":pe.value===i,"dss-legend-dimmed":pe.value!==null&&pe.value!==i}]),onClick:p=>Xn(i),onMouseenter:p=>it(i),onMouseleave:et,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Rt(i)})},null,4),e.createElementVNode("span",mi,e.toDisplayString(n.name),1)],46,di))),128))],2)):e.createCommentVNode("",!0),tt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:tt.value.x+"px",top:tt.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[At.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:uo},e.toDisplayString(e.unref(I)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),At.value.addMarker&&(At.value.downloadSvg||At.value.downloadPng||At.value.downloadCsv||Zn.value.length>0)?(e.openBlock(),e.createElementBlock("div",pi)):e.createCommentVNode("",!0),At.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Sn},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),At.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:Zl},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),At.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:Bl},e.toDisplayString(e.unref(I)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Zn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[At.value.downloadSvg||At.value.downloadPng||At.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",vi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",fi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(lo(n)),style:e.normalizeStyle(oo(n)),onClick:p=>No(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Pl(n),class:"dss-custom-menu-content"},null,8,hi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",yi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,gi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),h.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:Kt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Ci,[e.createElementVNode("h3",null,e.toDisplayString(re.value?e.unref(I)("chart.modalMarker.viewMarker"):O.value?e.unref(I)("chart.modalMarker.editMarker"):e.unref(I)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:Kt},"×")]),e.createElementVNode("div",ki,[e.createElementVNode("div",bi,[e.createVNode(Po,{id:"dss-marker-date",mode:"single",modelValue:h.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>h.value.date=n),"min-date":C.value,"max-date":S.value,disabled:re.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",wi,[e.createElementVNode("label",xi,e.toDisplayString(e.unref(I)("chart.modalMarker.description")),1),re.value?(e.openBlock(),e.createElementBlock("div",Ei,e.toDisplayString(h.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>h.value.description=n),placeholder:e.unref(I)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Vi)),[[e.vModelText,h.value.description]])])]),e.createElementVNode("div",Ni,[e.createElementVNode("div",Si,[O.value&&!re.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(I)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Bi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:Kt},e.toDisplayString(re.value?e.unref(I)("chart.modalMarker.close"):e.unref(I)("chart.modalMarker.cancel")),1),re.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(h.value.description&&h.value.description.length)},e.toDisplayString(O.value?e.unref(I)("chart.modalMarker.save"):e.unref(I)("chart.contextMenu.addMarker")),9,Mi))])])])])):e.createCommentVNode("",!0)],64))}}),Ti={class:"dss-modal-title"},Li={class:"dss-modal-actions"},Do={__name:"DSSModal",props:{showModal:{type:Boolean,required:!0},backDrop:{type:Boolean,default:!0},width:{type:String,default:"800px"},height:{type:String,default:"auto"},showCloseBtn:{type:Boolean,default:!0},headerType:{type:String,default:"space-between"},titleSize:{type:String,default:"24px"}},emits:["close-modal"],setup(R,{emit:be}){const I=R,A=be,Se=e.ref(null),b=e.ref(null),Be=e.computed(()=>{const te={"max-width":I.width};return I.height!=="auto"&&(te.height=I.height,te["min-height"]="0"),te}),ce=e.computed(()=>({}));function vt(){A("close-modal")}function v(){I.backDrop&&!Se.value&&A("close-modal")}function ue(te){te.target.tagName==="INPUT"&&(Se.value=te.target.tagName)}function Ce(){setTimeout(()=>{Se.value=null},300)}function he(){const te=document.body,oe=document.documentElement;b.value={bodyOverflow:te.style.overflow,bodyPosition:te.style.position,bodyTop:te.style.top,bodyWidth:te.style.width,htmlOverflow:oe.style.overflow,scrollY:window.scrollY},te.style.overflow="hidden",te.style.position="fixed",te.style.top=`-${b.value.scrollY}px`,te.style.width="100%",te.style.left="0",oe.style.overflow="hidden"}function ae(){if(!b.value)return;const te=document.body,oe=document.documentElement,{bodyOverflow:H,bodyPosition:Ve,bodyTop:Ae,bodyWidth:Oe,htmlOverflow:mt,scrollY:Z}=b.value;te.style.overflow=H||"",te.style.position=Ve||"",te.style.top=Ae||"",te.style.width=Oe||"",te.style.left="",oe.style.overflow=mt||"",window.scrollTo(0,Z||0)}return e.watch(()=>I.showModal,te=>{if(te)he(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const oe=document.getElementById("dss-modal-backdrop");oe&&(oe.addEventListener("focusin",ue),oe.addEventListener("focusout",Ce))},100);else{ae(),document.body.classList.remove("dss-modal-open");const oe=document.getElementById("dss-modal-backdrop");oe&&(oe.removeEventListener("focusin",ue),oe.removeEventListener("focusout",Ce))}},{immediate:!0}),e.onUnmounted(()=>{I.showModal&&ae()}),(te,oe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:v},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Be.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:oe[0]||(oe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":R.headerType,"font-size":R.titleSize})},[e.createElementVNode("h1",Ti,[e.renderSlot(te.$slots,"title",{},()=>[oe[1]||(oe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(te.$slots,"title-data"),R.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:vt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ce.value)},[e.renderSlot(te.$slots,"content",{},()=>[oe[2]||(oe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Li,[e.renderSlot(te.$slots,"actions")])])],4),[[e.vShow,R.showModal]])])):e.createCommentVNode("",!0)]))}},Hi={key:0,class:"dss-table-toolbar"},Ai={class:"dss-table-toolbar-left"},Di=["aria-expanded"],Ri={class:"dss-pagination-select-dropdown",role:"listbox"},Fi={class:"dss-table-column-visibility-label"},Ii={class:"dss-table-checkbox-wrapper"},zi=["checked","onChange"],Pi={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Oi={class:"dss-table-column-visibility-text"},Zi={class:"dss-table-toolbar-right"},Wi=["placeholder"],qi=["aria-expanded"],Ui={key:1,class:"dss-table-toolbar-extra"},Xi={class:"dss-table-thead"},Yi={key:0,class:"dss-table-th dss-table-selection-column"},ji={key:0,class:"dss-table-checkbox-wrapper"},Ki=["checked","indeterminate"],Gi={key:0,class:"dss-table-checkbox__indeterminate"},Qi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Ji={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ec=["onClick"],tc={class:"dss-table-th-content"},nc={class:"dss-table-th-text"},lc={key:0},oc={key:1},ac={key:2},sc=["data-filter-column-key","aria-expanded","onClick"],rc={class:"dss-table-tbody"},ic=["onClick"],cc={class:"dss-table-checkbox-wrapper"},uc=["type","name","checked","onChange"],dc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},mc={key:1,class:"dss-table-checkbox__dot"},pc=["onClick"],vc=["aria-expanded","aria-label"],fc={key:0,class:"dss-table-expansion-row"},gc=["colspan"],hc=["colspan"],yc={key:1,class:"dss-table-pagination"},Cc={class:"dss-pagination-center"},kc={class:"dss-pagination-controls"},bc=["disabled","title"],wc=["disabled","title"],xc={class:"dss-pagination-pages"},Ec=["onClick"],Vc={key:1,class:"dss-pagination-ellipsis"},Nc=["disabled","title"],Sc=["disabled","title"],Bc=["aria-expanded"],Mc={class:"dss-pagination-select-dropdown",role:"listbox"},_c=["aria-selected","onClick"],$c={key:0,class:"dss-table-filter-row"},Tc=["value","placeholder"],Lc=["min","max","value"],Hc=["min","max","value"],Ac={class:"dss-table-filter-double-range-values"},Dc={key:2,class:"dss-table-filter-daterange"},Rc={class:"dss-table-filter-daterange-row"},Fc={class:"dss-table-filter-daterange-label"},Ic=["value"],zc={class:"dss-table-filter-daterange-row"},Pc={class:"dss-table-filter-daterange-label"},Oc=["value"],Zc=["value","placeholder"],Wc={class:"dss-table-filter-list"},qc=["checked","onChange"],Uc={class:"dss-table-filter-actions"},Xc={name:"DSSTable"},Yc=Object.assign(Xc,{props:{data:{type:Array,required:!0,default:()=>[]},columns:{type:Array,required:!0,default:()=>[]},tableId:{type:String,default:()=>"table-"+Math.random().toString(36).substring(2,9)},locale:{type:String,default:null},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(R,{emit:be}){const{t:I,locale:A}=Jl.useI18n(),Se=R,b=be,Be={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100]},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:"No data available"};function ce(h,C){const S=Object.assign({},h);return vt(h)&&vt(C)&&Object.keys(C).forEach(O=>{vt(C[O])?O in h?S[O]=ce(h[O],C[O]):Object.assign(S,{[O]:C[O]}):Object.assign(S,{[O]:C[O]})}),S}function vt(h){return h&&typeof h=="object"&&!Array.isArray(h)}const v=e.computed(()=>ce(Be,Se.options)),ue=e.computed(()=>{const h=v.value.table.width;return h==="auto"?null:typeof h=="number"?h:null}),Ce=e.computed(()=>v.value.table.height),he=e.computed(()=>v.value.table.rowHeight??"auto"),ae=e.computed(()=>({height:he.value})),te=e.computed(()=>v.value.table.expandable===!0),oe=e.computed(()=>v.value.table.truncated===!0),H=e.computed(()=>v.value.table.striped),Ve=e.computed(()=>v.value.table.bordered),Ae=e.computed(()=>v.value.table.hoverable),Oe=e.computed(()=>v.value.table.size),mt=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const Z=e.computed(()=>v.value.selection.enabled),Te=e.computed(()=>v.value.selection.mode),Bt=e.computed(()=>v.value.sorting.enabled),Ue=e.computed(()=>v.value.sorting.mode),Lt=e.computed(()=>v.value.pagination.enabled),Le=e.computed(()=>v.value.pagination.rows),Ze=e.computed(()=>v.value.pagination.rowsPerPageOptions),wt=e.computed(()=>v.value.scrollable),ze=e.computed(()=>v.value.emptyMessage),Mt=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),at=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),Ct=e.computed(()=>v.value.toolbar?.search!==!1),cn=e.computed(()=>Mt.value||at.value||Ct.value||_t.value),_t=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),Qe=e.ref(""),je=e.ref(!1),$t=e.ref(null);let Ht=null;function Yt(){je.value?(Ht&&(clearTimeout(Ht),Ht=null),je.value=!1,Qe.value="",b("search",""),$t.value?.blur()):(je.value=!0,Ht=setTimeout(()=>{Ht=null,$t.value?.focus()},80))}function pt(){Qe.value||(je.value=!1)}function Nt(){Qe.value="",b("search",""),$t.value?.focus()}const xt=e.computed(()=>({"dss-table-striped":H.value,"dss-table-bordered":Ve.value,"dss-table-hoverable":Ae.value,[`dss-table-${Oe.value}`]:Oe.value!=="default","dss-table-truncated":oe.value})),St=(h,C)=>h?.field??h?.key??C,jt=e.ref(new Set);function Q(){const h=new Set;Se.columns.forEach((C,S)=>{C?.hidden!==!0&&h.add(St(C,S))}),jt.value=h}const ve=e.computed(()=>Se.columns.filter((h,C)=>jt.value.has(St(h,C)))),fe=h=>{const C=Se.columns.findIndex(S=>S===h);return St(h,C>=0?C:0)},_e=(h,C)=>jt.value.has(St(h,C));function rt(h,C){const S=St(h,C),O=new Set(jt.value);O.has(S)?O.delete(S):O.add(S),jt.value=O}const Ie=e.ref(null),Ke=e.ref(!1);function de(h){Ie.value&&!Ie.value.contains(h.target)&&(Ke.value=!1)}const Ge=e.computed(()=>ve.value.length+(Z.value?1:0)+(te.value?1:0)),U=(h,C)=>h?.id??h?.key??C,W=e.ref(new Set),j=e.ref(null),ne=(h,C)=>W.value.has(U(h,C)),x=(h,C,S)=>{S&&S.stopPropagation();const O=U(h,C),re=new Set(W.value);re.has(O)?(re.delete(O),b("row-collapse",{data:h,index:C})):(re.add(O),b("row-expand",{data:h,index:C})),W.value=re},k=(h,C)=>{if(!oe.value)return;const S=U(h,C);j.value!==S&&(j.value=S)},V=e.ref(null),P=e.ref(0),X=e.ref([]),De=h=>{if(Ue.value==="single")return V.value===h.field?P.value:0;{const C=X.value.find(S=>S.field===h.field);return C?C.order:0}},Xe=h=>{const C=De(h);return{"dss-sort-active":C!==0,"dss-sort-asc":C===1,"dss-sort-desc":C===-1}},Me=e.ref({}),le=e.ref(null),nt=e.ref(null),Je=220,yt=e.ref(null),ht=e.computed(()=>ve.value.find(h=>fe(h)===le.value)??null),Ye=e.computed(()=>{if(!ht.value||ht.value.filter!=="range")return null;const h=ht.value,C=le.value,{min:S,max:O}=F(h),re=h.filterMin??S,it=h.filterMax??O,et=At(C),Tt=et.min??re,fn=et.max??it,Dt=it-re,qt=Dt===0?0:(Tt-re)/Dt*100,Pl=Dt===0?100:(fn-re)/Dt*100;return{rangeMin:re,rangeMax:it,currentMin:Tt,currentMax:fn,minPct:qt,maxPct:Pl}}),Cn=e.ref(null),Yn=e.ref("max");function Rn(h){const C=Cn.value,S=Ye.value;if(!C||!S)return;const O=C.getBoundingClientRect(),it=(h.clientX-O.left)/O.width*100,et=(S.minPct+S.maxPct)/2;Yn.value=it<et?"min":"max"}function At(h){return Me.value[h]??{}}function Zn(h,C){Me.value={...Me.value,[h]:C}}function un(h){const C=Me.value[h];return C?C.type==="string"?!!C.value?.trim():C.type==="range"?C.min!=null||C.max!=null:C.type==="dateRange"?!!(C.from||C.to):C.type==="list"?C.selected?.length>0:!1:!1}function Bn(h){const C={...Me.value};delete C[h],Me.value=C,le.value=null,nt.value=null}function dn(){if(!le.value){nt.value=null;return}const h=yt.value;if(!h)return;const C=h.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${le.value}"]`);if(!C)return;const S=C.getBoundingClientRect();nt.value={top:S.bottom+6,left:Math.max(8,S.right-Je)}}const Mn=e.computed(()=>{let h=[...Se.data];const C=(Qe.value??"").trim().toLowerCase();return C&&(h=h.filter(S=>Se.columns.some(O=>{if(!O||!O.field)return!1;const re=Pe(S,O);return String(re??"").toLowerCase().includes(C)}))),ve.value.forEach(S=>{const O=fe(S),re=Me.value[O];if(!re)return;const it=S.field;if(it){if(re.type==="string"&&re.value?.trim()){const et=re.value.trim().toLowerCase();h=h.filter(Tt=>{const fn=Pe(Tt,S);return String(fn??"").toLowerCase().includes(et)})}else if(re.type==="range")h=h.filter(et=>{const Tt=tt(et,it),fn=Number(Tt);return!(Number.isNaN(fn)||re.min!=null&&fn<re.min||re.max!=null&&fn>re.max)});else if(re.type==="dateRange"){const et=re.from?new Date(re.from).getTime():null,Tt=re.to?new Date(re.to).getTime():null;h=h.filter(fn=>{const Dt=tt(fn,it),qt=Dt?new Date(Dt).getTime():NaN;return!(Number.isNaN(qt)||et!=null&&qt<et||Tt!=null&&qt>Tt)})}else if(re.type==="list"&&re.selected?.length){const et=new Set(re.selected);h=h.filter(Tt=>{const fn=Pe(Tt,S);return et.has(fn!=null?String(fn):"")})}}}),h});function Nn(h){const C=new Set;return Se.data.forEach(S=>{const O=Pe(S,h);C.add(O!=null?String(O):"")}),Array.from(C).sort((S,O)=>String(S).localeCompare(String(O)))}function D(h,C){if(le.value===h){le.value=null,nt.value=null;return}if(le.value=h,C?.currentTarget){const S=C.currentTarget.getBoundingClientRect();nt.value={top:S.bottom+6,left:Math.max(8,S.right-Je)}}else dn()}function q(h,C){Zn(h,{type:"string",value:C})}function F(h){const C=h.field;if(!C)return{min:0,max:100};let S=1/0,O=-1/0;return Se.data.forEach(re=>{const it=tt(re,C),et=Number(it);Number.isNaN(et)||(S=Math.min(S,et),O=Math.max(O,et))}),{min:S===1/0?0:S,max:O===-1/0?100:O}}function se(h,C,S){const O={...At(h),type:"range"},re=S===""?null:Number(S),it=re===null||Number.isNaN(re)?null:re;O[C]=it,it!=null&&(C==="min"&&O.max!=null&&it>O.max&&(O.max=it),C==="max"&&O.min!=null&&it<O.min&&(O.min=it)),Zn(h,O)}function Ne(h,C,S){const O={...At(h),type:"dateRange"};O[C]=S||"",Zn(h,O)}const lt=e.reactive({});function ot(h,C){lt[h]=C}function We(h){const C=fe(h),S=(lt[C]??"").trim().toLowerCase(),O=Nn(h);return S?O.filter(re=>String(re).toLowerCase().includes(S)):O}function st(h,C){return(At(h).selected??[]).includes(C!=null?String(C):"")}function mn(h,C){const O=[...At(h).selected??[]],re=C!=null?String(C):"",it=O.indexOf(re);it>=0?O.splice(it,1):O.push(re),Zn(h,{type:"list",selected:O})}function tn(h){le.value&&!h.target.closest(".dss-table-filter-wrap")&&!h.target.closest(".dss-table-filter-dropdown")&&(le.value=null,nt.value=null)}function pn(){dn()}const Fn=h=>{if(!(h.sortable===!1||!Bt.value))if(Ue.value==="single")V.value===h.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=h.field,P.value=1),P.value===0&&(V.value=null),b("sort",{field:V.value,order:P.value});else{const C=X.value.findIndex(S=>S.field===h.field);C>=0?X.value[C].order===1?X.value[C].order=-1:X.value.splice(C,1):X.value.push({field:h.field,order:1}),b("sort",{multiSortMeta:X.value})}},hn=e.computed(()=>{if(!Bt.value)return Mn.value;let h=[...Mn.value];return Ue.value==="single"&&V.value&&P.value!==0?h.sort((C,S)=>{const O=tt(C,V.value),re=tt(S,V.value);return O===re?0:O==null?1:re==null?-1:(O<re?-1:O>re?1:0)*P.value}):Ue.value==="multiple"&&X.value.length>0&&h.sort((C,S)=>{for(const O of X.value){const re=tt(C,O.field),it=tt(S,O.field);if(re===it)continue;if(re==null)return 1;if(it==null)return-1;const et=re<it?-1:re>it?1:0;if(et!==0)return et*O.order}return 0}),h}),nn=e.ref(0),yn=e.ref(Le.value),In=e.ref(!1),Vl=e.ref(null),Tl=h=>{yn.value=h,In.value=!1,nn.value=0,b("page",{page:0,rows:yn.value})};function Nl(h){Vl.value&&!Vl.value.contains(h.target)&&(In.value=!1)}const yl=e.computed(()=>hn.value.length),kn=e.computed(()=>Math.ceil(yl.value/yn.value)),vn=e.computed(()=>Lt.value?nn.value*yn.value:0),Ll=e.computed(()=>Lt.value?Math.min((nn.value+1)*yn.value,yl.value):yl.value),Cl=e.computed(()=>{if(!Lt.value)return hn.value;const h=vn.value,C=Ll.value;return hn.value.slice(h,C)}),Wn=e.ref(new Set),ml=e.computed(()=>hn.value.filter((h,C)=>Wn.value.has(U(h,C)))),pl=e.computed(()=>{const h=hn.value.length;return h>0&&Wn.value.size===h}),Sl=e.computed(()=>{const h=hn.value.length,C=Wn.value.size;return C>0&&C<h}),jn=(h,C)=>Wn.value.has(U(h,C)),zl=()=>{if(pl.value)Wn.value=new Set,b("unselect-all");else{const h=new Set;hn.value.forEach((C,S)=>h.add(U(C,S))),Wn.value=h,b("select-all",ml.value)}},ft=(h,C)=>{const S=U(h,C),O=new Set(Wn.value),re=O.has(S);Te.value==="single"?re?(O.delete(S),b("row-unselect",h)):(O.clear(),O.add(S),b("row-select",h)):re?(O.delete(S),b("row-unselect",h)):(O.add(S),b("row-select",h)),Wn.value=O},pe=e.computed(()=>{const h=kn.value,C=nn.value+1,S=2,O=[],re=[];let it;for(let et=1;et<=h;et++)(et===1||et===h||et>=C-S&&et<=C+S)&&O.push(et);for(const et of O)it&&(et-it===2?re.push(it+1):et-it!==1&&re.push("...")),re.push(et),it=et;return re}),_n=h=>{h<0||h>=kn.value||(nn.value=h,b("page",{page:h,rows:yn.value}))},Re=(h,C,S)=>{b("row-click",{data:h,index:C,originalEvent:S}),k(h,vn.value+C)},dt=(h,C)=>{const S=vn.value+C;return{"dss-table-row-selected":jn(h,S),"dss-table-row-even":C%2===0,"dss-table-row-odd":C%2!==0,"dss-table-row-truncated-clickable":oe.value,"dss-table-row-truncated-expanded":j.value===U(h,S)}},Pe=(h,C)=>C.field?tt(h,C.field):"",tt=(h,C)=>C.split(".").reduce((S,O)=>S&&S[O],h),K=h=>{const C=h.align??mt.value;return{"dss-table-sortable":h.sortable!==!1&&Bt.value,"dss-table-align-left":C==="left","dss-table-align-center":C==="center","dss-table-align-right":C==="right",[h.className]:h.className}},Ot=h=>{const C={};return h.width&&(C.width=typeof h.width=="number"?`${h.width}px`:h.width),h.minWidth&&(C.minWidth=typeof h.minWidth=="number"?`${h.minWidth}px`:h.minWidth),h.maxWidth&&(C.maxWidth=typeof h.maxWidth=="number"?`${h.maxWidth}px`:h.maxWidth),C};return e.watch(()=>Se.locale,h=>{h&&h!==A.value&&(A.value=h)},{immediate:!0}),e.watch(Le,h=>{yn.value=h,nn.value=0}),e.watch(Qe,h=>{b("search",h??"")}),e.watch(()=>Se.columns,()=>{Q()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Nl),document.addEventListener("click",de),document.addEventListener("click",tn),window.addEventListener("resize",pn),window.addEventListener("scroll",pn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Nl),document.removeEventListener("click",de),document.removeEventListener("click",tn),window.removeEventListener("resize",pn),window.removeEventListener("scroll",pn,!0)}),(h,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:yt,style:e.normalizeStyle({width:ue.value+"px",height:Ce.value?Ce.value+"px":"auto"})},[cn.value?(e.openBlock(),e.createElementBlock("div",Hi,[e.createElementVNode("div",Ai,[Mt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:C[0]||(C[0]=S=>b("download-pdf"))},[C[21]||(C[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(I)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),at.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:C[1]||(C[1]=S=>b("download-excel"))},[C[22]||(C[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(I)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),_t.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":Ke.value}]),onClick:C[2]||(C[2]=S=>Ke.value=!Ke.value),"aria-expanded":Ke.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(I)("table.columnVisibility"))+" ",1),C[23]||(C[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Di),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ri,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,(S,O)=>(e.openBlock(),e.createElementBlock("li",{key:St(S,O),role:"option",class:"dss-table-column-visibility-option",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Fi,[e.createElementVNode("span",Ii,[e.createElementVNode("input",{type:"checkbox",checked:_e(S,O),onChange:re=>rt(S,O),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,zi),_e(S,O)?(e.openBlock(),e.createElementBlock("span",Pi,[...C[24]||(C[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Oi,e.toDisplayString(S.header),1)])]))),128))],512),[[e.vShow,Ke.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Zi,[Ct.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":je.value||Qe.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:$t,"onUpdate:modelValue":C[4]||(C[4]=S=>Qe.value=S),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(I)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:C[5]||(C[5]=S=>je.value=!0),onBlur:pt},null,40,Wi),[[e.vModelText,Qe.value]]),Qe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Nt},[...C[25]||(C[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":je.value||!!Qe.value,onMousedown:e.withModifiers(Yt,["prevent"])},[...C[26]||(C[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,qi)],2)):e.createCommentVNode("",!0),h.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Ui,[e.renderSlot(h.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":wt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",xt.value])},[e.createElementVNode("thead",Xi,[e.createElementVNode("tr",null,[Z.value?(e.openBlock(),e.createElementBlock("th",Yi,[Te.value==="multiple"?(e.openBlock(),e.createElementBlock("span",ji,[e.createElementVNode("input",{type:"checkbox",checked:pl.value,indeterminate:Sl.value,onChange:zl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ki),Sl.value?(e.openBlock(),e.createElementBlock("span",Gi)):pl.value?(e.openBlock(),e.createElementBlock("span",Qi,[...C[27]||(C[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("th",Ji)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(S,O)=>(e.openBlock(),e.createElementBlock("th",{key:fe(S),class:e.normalizeClass(["dss-table-th",K(S)]),style:e.normalizeStyle(Ot(S)),onClick:re=>Fn(S)},[e.createElementVNode("div",tc,[e.createElementVNode("span",nc,e.toDisplayString(S.header),1),S.sortable!==!1&&Bt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Xe(S)])},[De(S)===0?(e.openBlock(),e.createElementBlock("span",lc,[...C[28]||(C[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):De(S)===1?(e.openBlock(),e.createElementBlock("span",oc,[...C[29]||(C[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):De(S)===-1?(e.openBlock(),e.createElementBlock("span",ac,[...C[30]||(C[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),S.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":le.value===fe(S)}]),onClick:C[6]||(C[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":un(fe(S))}]),"data-filter-column-key":fe(S),"aria-expanded":le.value===fe(S),"aria-label":"Filter column",onClick:re=>D(fe(S),re)},[...C[31]||(C[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,sc)],2)):e.createCommentVNode("",!0)])],14,ec))),128))])]),e.createElementVNode("tbody",rc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl.value,(S,O)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:U(S,vn.value+O)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",dt(S,O)]),style:e.normalizeStyle(ae.value),onClick:re=>Re(S,O,re)},[Z.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:C[7]||(C[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",cc,[e.createElementVNode("input",{type:Te.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${R.tableId}`,checked:jn(S,vn.value+O),onChange:re=>ft(S,vn.value+O),class:e.normalizeClass(["dss-table-checkbox",Te.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,uc),Te.value==="multiple"&&jn(S,vn.value+O)?(e.openBlock(),e.createElementBlock("span",dc,[...C[32]||(C[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Te.value==="single"&&jn(S,vn.value+O)?(e.openBlock(),e.createElementBlock("span",mc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),te.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(re=>x(S,vn.value+O,re),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ne(S,vn.value+O),"aria-label":ne(S,vn.value+O)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ne(S,vn.value+O)}]),"aria-hidden":"true"},[...C[33]||(C[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,vc)],8,pc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(re,it)=>(e.openBlock(),e.createElementBlock("td",{key:fe(re),class:e.normalizeClass(["dss-table-td",K(re)]),style:e.normalizeStyle(Ot(re))},[e.renderSlot(h.$slots,`cell-${re.field}`,{data:S,column:re,rowIndex:O},()=>[e.createTextVNode(e.toDisplayString(Pe(S,re)),1)])],6))),128))],14,ic),te.value&&ne(S,vn.value+O)?(e.openBlock(),e.createElementBlock("tr",fc,[e.createElementVNode("td",{colspan:Ge.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(h.$slots,"expansion",{data:S,rowIndex:O})],8,gc)])):e.createCommentVNode("",!0)],64))),128)),Cl.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ae.value)},[e.createElementVNode("td",{colspan:Ge.value,class:"dss-table-empty-cell"},[e.renderSlot(h.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ze.value),1)])],8,hc)],4))])],2)],2),Lt.value?(e.openBlock(),e.createElementBlock("div",yc,[e.createElementVNode("div",Cc,[e.createElementVNode("div",kc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:nn.value===0,onClick:C[8]||(C[8]=S=>_n(0)),title:e.unref(I)("table.firstPage")},[...C[34]||(C[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:nn.value===0,onClick:C[9]||(C[9]=S=>_n(nn.value-1)),title:e.unref(I)("table.previousPage")}," ‹ ",8,wc),e.createElementVNode("span",xc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pe.value,S=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:S},[S!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":S===nn.value+1}]),onClick:O=>_n(S-1)},e.toDisplayString(S),11,Ec)):(e.openBlock(),e.createElementBlock("span",Vc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:nn.value>=kn.value-1,onClick:C[10]||(C[10]=S=>_n(nn.value+1)),title:e.unref(I)("table.nextPage")}," › ",8,Nc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:nn.value>=kn.value-1,onClick:C[11]||(C[11]=S=>_n(kn.value-1)),title:e.unref(I)("table.lastPage")},[...C[35]||(C[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,Sc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Vl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":In.value}]),onClick:C[12]||(C[12]=S=>In.value=!In.value),"aria-expanded":In.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(yn.value)+" ",1),C[36]||(C[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Bc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Mc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ze.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":S===yn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":S===yn.value}]),onClick:O=>Tl(S)},e.toDisplayString(S),11,_c))),128))],512),[[e.vShow,In.value]])]),_:1})],512)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(nt.value?{top:nt.value.top+"px",left:nt.value.left+"px",width:Je+"px"}:void 0),onClick:C[20]||(C[20]=e.withModifiers(()=>{},["stop"]))},[ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ht.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("input",{type:"text",value:At(le.value).value??"",onInput:C[13]||(C[13]=S=>q(le.value,S.target.value)),class:"dss-table-filter-input",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Tc)])):ht.value.filter==="range"&&Ye.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ye.value.minPct+"%","--range-max-pct":Ye.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Cn,class:"dss-table-filter-double-range-track",onMousemove:Rn,onMouseenter:Rn},[e.createElementVNode("input",{type:"range",min:Ye.value.rangeMin,max:Ye.value.rangeMax,value:Ye.value.currentMin,onInput:C[14]||(C[14]=S=>se(le.value,"min",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Yn.value==="min"?2:1})},null,44,Lc),e.createElementVNode("input",{type:"range",min:Ye.value.rangeMin,max:Ye.value.rangeMax,value:Ye.value.currentMax,onInput:C[15]||(C[15]=S=>se(le.value,"max",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Yn.value==="max"?2:1})},null,44,Hc)],544),e.createElementVNode("div",Ac,e.toDisplayString(Ye.value.currentMin)+" – "+e.toDisplayString(Ye.value.currentMax),1)],4)):ht.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Dc,[e.createElementVNode("div",Rc,[e.createElementVNode("label",Fc,e.toDisplayString(e.unref(I)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:At(le.value).from??"",onInput:C[16]||(C[16]=S=>Ne(le.value,"from",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Ic)]),e.createElementVNode("div",zc,[e.createElementVNode("label",Pc,e.toDisplayString(e.unref(I)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:At(le.value).to??"",onInput:C[17]||(C[17]=S=>Ne(le.value,"to",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Oc)])])):ht.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:lt[le.value]??"",onInput:C[18]||(C[18]=S=>ot(le.value,S.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(I)("table.search")||"Search..."},null,40,Zc),e.createElementVNode("div",Wc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We(ht.value),S=>(e.openBlock(),e.createElementBlock("label",{key:S,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:st(le.value,S),onChange:O=>mn(le.value,S)},null,40,qc),e.createElementVNode("span",null,e.toDisplayString(S),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Uc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:C[19]||(C[19]=S=>Bn(le.value))},e.toDisplayString(e.unref(I)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,le.value&&ht.value&&nt.value]])]),_:1})]))],64))}}),jc={class:"dss-toolbar-left"},Kc=["title"],Gc=["title"],Qc={class:"dss-toolbar-dropdown-wrapper"},Jc=["title"],eu={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tu={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nu={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lu={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ou={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},au={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},su={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},ru=["title"],iu=["title"],cu=["title"],uu=["title"],du=["title"],mu=["title"],pu=["title"],vu=["title"],fu=["title"],gu={key:2,class:"dss-toolbar-separator"},hu=["title"],yu={key:4,class:"dss-toolbar-separator"},Cu={key:5,class:"dss-toolbar-dropdown-wrapper"},ku=["title"],bu={class:"dss-toolbar-dropdown-ai"},wu={class:"dss-toolbar-right"},xu={key:0,class:"dss-toolbar-custom-group"},Eu={key:1,class:"dss-toolbar-separator"},Vu={class:"dss-link-modal-content"},Nu={class:"dss-link-modal-field"},Su={class:"dss-link-modal-label"},Bu=["placeholder"],Mu={class:"dss-link-modal-field"},_u={class:"dss-link-modal-label"},$u=["placeholder"],Tu={class:"dss-image-modal-tabs"},Lu={key:0,class:"dss-image-tab-content"},Hu={class:"dss-link-modal-content"},Au={class:"dss-link-modal-field"},Du={key:0,class:"dss-link-modal-label"},Ru=["src"],Fu={class:"dss-link-modal-field"},Iu={class:"dss-link-modal-label"},zu=["placeholder"],Pu={class:"dss-link-modal-field"},Ou={class:"dss-link-modal-label"},Zu=["placeholder"],Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={key:1,class:"dss-image-tab-content"},Yu={class:"dss-link-modal-content"},ju={class:"dss-link-modal-field"},Ku={class:"dss-link-modal-label"},Gu=["placeholder"],Qu={class:"dss-link-modal-field"},Ju={class:"dss-link-modal-label"},ed=["placeholder"],td={class:"dss-link-modal-field"},nd={class:"dss-link-modal-label"},ld=["placeholder"],od={class:"dss-link-modal-field"},ad={class:"dss-link-modal-label"},sd=["placeholder"],rd={class:"dss-text-editor-title-input-container"},id={key:0,class:"dss-text-editor-title-preview"},cd={key:0},ud={key:1,class:"dss-text-editor-preview-placeholder"},dd=["value","placeholder","disabled"],md={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},pd={class:"dss-text-editor-description-input-container"},vd={key:0,class:"dss-text-editor-description-preview"},fd={key:0},gd={key:1,class:"dss-text-editor-preview-placeholder"},hd=["value","placeholder","disabled"],yd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},Cd=["data-comment-id","onMouseenter"],kd=["onClick"],bd=["src","alt"],wd={key:1},xd=["onClick"],Ed=["src","alt"],Vd={key:1},Nd=["data-has-second-user","onClick"],Sd={class:"editor-comment-marker-count"},Bd={key:4,class:"dss-text-editor-textarea-wrapper"},Md=["value","placeholder","rows","disabled"],_d={class:"dss-text-editor-footer"},$d={class:"dss-text-editor-footer-content"},Td={class:"dss-text-editor-footer-stat"},Ld={class:"dss-text-editor-footer-stat"},Hd={key:5,class:"dss-text-editor-content-wrapper"},Ad={key:0,class:"dss-comment-overlay-body"},Dd={class:"dss-comment-selection-wrapper"},Rd=["innerHTML"],Fd={class:"dss-comment-messages-wrapper"},Id={key:0,class:"dss-comment-avatar-wrapper"},zd={class:"dss-comment-avatar"},Pd=["src","alt"],Od={key:1},Zd={class:"dss-comment-header"},Wd={class:"dss-comment-header-text"},qd={class:"dss-comment-author"},Ud={key:0,class:"dss-comment-date"},Xd=["onClick","title"],Yd={class:"dss-comment-overlay-inner"},jd=["placeholder","onKeydown"],Kd={class:"dss-text-editor-footer"},Gd={class:"dss-text-editor-footer-content"},Qd={class:"dss-text-editor-footer-stat"},Jd={class:"dss-text-editor-footer-stat"},e1=["title"],t1=["title"],n1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},l1={class:"dss-image-popup-content"},o1={key:0,class:"dss-image-popup-no-alt-icon"},a1=["title"],s1=["title"],r1={xmlns:"http://www.w3.org/2000/svg",version:"1.1","xmlns:xlink":"http://www.w3.org/1999/xlink",width:"512",height:"512",x:"0",y:"0",viewBox:"0 0 32 32",style:{"enable-background":"new 0 0 512 512"},"xml:space":"preserve",class:""},i1={class:"dss-toolbar-left"},c1=["title"],u1=["title"],d1={class:"dss-toolbar-dropdown-wrapper"},m1=["title"],p1={key:0,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},v1={key:1,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f1={key:2,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},g1={key:3,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h1={key:4,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y1={key:5,class:"dss-toolbar-heading-icon",width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1=["title"],N1=["title"],S1=["title"],B1=["title"],M1=["title"],_1={key:2,class:"dss-toolbar-separator"},$1={key:3,class:"dss-toolbar-dropdown-wrapper"},T1=["title"],L1={class:"dss-toolbar-dropdown-ai"},H1={key:0,class:"dss-toolbar-right"},A1={key:0,class:"dss-toolbar-separator"},D1={key:0,class:"dss-toolbar-custom-group"},R1={key:1,class:"dss-toolbar-separator"},F1={name:"DSSTextEditor"},I1=Object.assign(F1,{props:{modelValue:{type:String,default:""},title:{type:String,default:""},description:{type:String,default:""},titlePlaceholder:{type:String,default:null},descriptionPlaceholder:{type:String,default:null},placeholder:{type:String,default:null},rows:{type:Number,default:10},fullHeight:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},richText:{type:Boolean,default:!1},border:{type:Boolean,default:!0},rounded:{type:Boolean,default:!1},fixedHeight:{type:Boolean,default:!1},options:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},floatingToolbar:{type:Boolean,default:!1},askAi:{type:Boolean,default:!1},commentUser:{type:Object,default:null},customToolbarSlots:{type:Array,default:()=>["custom-tool-1","custom-tool-2","custom-tool-3"]},customToolbarFloatingMap:{type:Object,default:()=>({}),validator:R=>typeof R=="object"&&R!==null},locale:{type:String,default:null},comments:{type:Array,default:()=>[]}},emits:["update:modelValue","update:title","update:description","update:comments","change","blur","title-change","description-change","comment-submitted","comment-marker-clicked","comment-deleted"],setup(R,{expose:be,emit:I}){const{t:A,locale:Se}=Jl.useI18n(),b=R,Be=I,ce=e.useSlots(),vt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
99
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
100
|
-
</svg>`,p=e.ref(null),me=e.ref(null),Ce=e.ref(!1),pe=e.ref(!1),oe=e.ref(!1),ee=e.ref(""),le=e.ref({}),L=e.ref(!1),Fe=e.ref(!1),Re=e.ref(""),Oe=e.ref(""),ut=e.ref(null),O=e.ref(null),Ze=e.ref(null),xt=e.ref(null),Je=e.ref(""),Ht=e.ref(!1),$e=e.ref({}),We=e.ref(!1),Et=e.ref({}),Ie=e.ref(null),$t=e.ref(null),at=e.ref(!1),Vt=e.ref(""),an=e.ref(null),Mt=e.ref(""),nt=e.ref(""),ze=e.ref(""),At=e.ref(null),Tt=e.ref(null),sn=e.ref(null),vt=e.ref(null),Bt=e.ref(null),Ct=e.ref(!1),_t=e.ref(""),ne=e.ref({}),Ve=e.ref(!1),he=e.ref("upload"),ye=e.ref(""),lt=e.ref(null),kt=e.ref(null),Le=e.ref([]),dt=e.ref([]),ve=e.ref(null),je=e.ref(!1),U=e.ref(""),W=e.ref(""),K=e.ref(""),ae=e.ref(""),x=e.ref(""),k=e.ref(""),V=e.ref(null),P=e.ref(null),X=e.ref(null),He=e.ref(!1),Xe=e.ref(null),Me=e.ref(!1),te=e.ref(!1),et=e.ref(null),Ke=e.ref("p"),yt=e.ref(!1),ht=e.ref([]),Ye=e.ref(null),Cn=e.ref(null),Yn=e.ref(null),Rn=e.ref(!1),Dt=e.ref(0),Zn=100,un=e.ref(null),Bn=e.computed(()=>({"dss-text-editor-no-border":!b.border,"dss-text-editor-rounded":b.rounded,"dss-text-editor-full-height":b.fullHeight,"dss-comment-overlay-open":gn.value!==null})),dn=e.computed(()=>({})),Mn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+24+2}px`,resize:"none",overflowY:"auto"}),Nn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>b.richText&&dt.value.length>0),q=e.computed(()=>{if(!b.modelValue)return"";if(b.richText){let o=b.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /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 b.modelValue}),F=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),se=e.computed(()=>q.value.length),Ne=e.computed(()=>vt.value!==null&&he.value==="upload"&&Mt.value&&Mt.value.startsWith("data:")),tt=e.computed(()=>b.titlePlaceholder||A("textEditor.placeholders.title")),ot=e.computed(()=>b.descriptionPlaceholder||A("textEditor.placeholders.description")),qe=e.computed(()=>b.placeholder||A("textEditor.placeholders.startTyping")),st=o=>ce&&ce[o]!==void 0,mn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++)if(st(b.customToolbarSlots[l]))return!0;return!1},en=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++){const a=b.customToolbarSlots[l];if(st(a)&&pn(a))return!0}return!1},pn=o=>b.customToolbarFloatingMap.hasOwnProperty(o)?b.customToolbarFloatingMap[o]===!0:!0,Fn=e.computed(()=>b.customToolbarSlots.some(o=>st(o)&&pn(o))),hn=e.computed(()=>st("title-slot")),tn=e.computed(()=>st("description-slot")),yn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},In=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Vl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Tl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Nl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=A("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},yl=o=>{const l=o.target.value;Be("update:modelValue",l),Be("change",l)},kn=()=>{if(!V.value)return;const o=V.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{Me.value=!0,kn()},Ll=()=>{Me.value=!1,Cl()},Cl=()=>{if(!V.value)return;const o=V.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Wn=o=>{const a=o.target.value;Me.value&&kn(),Be("update:title",a),Be("title-change",a),X.value="title",b.richText&&(je.value||(W.value=U.value,x.value=K.value,k.value=ae.value),ve.value&&clearTimeout(ve.value),je.value=!0,ve.value=setTimeout(()=>{je.value=!1,Ae()},500))},ml=()=>{if(!P.value)return;const o=P.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},pl=()=>{te.value=!0,ml()},Sl=()=>{te.value=!1,jn()},jn=()=>{if(!P.value)return;const o=P.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},zl=o=>{const a=o.target.value;te.value&&ml(),Be("update:description",a),Be("description-change",a),X.value="description",b.richText&&(je.value||(W.value=U.value,x.value=K.value,k.value=ae.value),ve.value&&clearTimeout(ve.value),je.value=!0,ve.value=setTimeout(()=>{je.value=!1,Ae()},500))},ft=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(p.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},de=o=>{if(!(!o||!p.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(p.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{p.value.focus();return}let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(a)}catch{p.value.focus()}},_n=()=>{if(!p.value)return;p.value.focus();const o=window.getSelection(),l=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(p.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Ae=(o=!1)=>{if(!p.value)return;const l=p.value.innerHTML,a=b.title||"",r=b.description||"";if(!o&&l===U.value&&a===K.value&&r===ae.value)return;const c={content:W.value||U.value,title:x.value!==void 0?x.value:K.value,description:k.value!==void 0?k.value:ae.value},d=Le.value.length>0?Le.value[Le.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&&(Le.value.push(c),Le.value.length>50&&Le.value.shift(),dt.value=[]),U.value=l,K.value=a,ae.value=r,W.value=l,x.value=a,k.value=r},mt=o=>{if(!p.value)return;Pe(),p.value&&Vl(p.value);let l=null;p.value&&(p.value.querySelector("p")||(l=ft(),Qe()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&et.value&&(et.value=null),pe.value=!0;const r=p.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=yn(r);Be("update:modelValue",c),Be("change",c),X.value="editor",je.value||(W.value=U.value,x.value=K.value,k.value=ae.value),ve.value&&clearTimeout(ve.value),je.value=!0,ve.value=setTimeout(()=>{je.value=!1,Ae(),Pn(),nl()},500),e.nextTick(()=>{l&&de(l),Pe();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(y=>{try{if(f&&et.value?.command===y){$e.value[y]=et.value.state;return}if(y==="bold")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M;let N=!1;if(_&&((_.tagName==="STRONG"||_.tagName==="B"||_.closest&&_.closest("strong, b"))&&(N=!0),!N&&_.style&&parseInt(_.style.fontWeight)>=600&&(N=!0),!N))try{const Q=window.getComputedStyle(_);parseInt(Q.fontWeight)>=600&&(N=!0)}catch{}$e.value[y]=N}else $e.value.hasOwnProperty(y)||($e.value[y]=!1);else if(y==="italic")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M,N=_&&(_.tagName==="EM"||_.tagName==="I"||_.closest&&_.closest("em, i"));$e.value[y]=!!N}else{const M=document.queryCommandState(y);$e.value[y]=M}else{const M=document.queryCommandState(y);$e.value[y]=M}}catch{}}),jt(),j(),Z(),It(),Jn(),Dn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>nl(y),0),(y===" "||y===`
|
|
101
|
-
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Pn()},100)}pe.value=!1})},Pe=()=>{if(!p.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},Qe=()=>{if(!p.value)return;const o=p.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},j=()=>{if(p.value&&!He.value){He.value=!0;try{p.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),p.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),p.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===y;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=pt,m.appendChild(y)}else if(f&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{He.value=!1}}},Zt=o=>{Pn(),Be("blur",o),zn()},h=()=>{if(b.disabled||!b.richText||!p.value)return;Rt(),ve.value&&(clearTimeout(ve.value),ve.value=null),je.value&&(Ae(),je.value=!1);const o=X.value==="title",l=X.value==="description",a=X.value==="editor";if(Le.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{mt()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};dt.value.push(r);const c=Le.value.pop();if(c!==void 0){pe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,U.value=d,K.value=u,ae.value=m,W.value=d,x.value=u,k.value=m,e.nextTick(()=>{jt(),bn(),Hn(),It();const f=yn(d);Be("update:modelValue",f),Be("update:title",u),Be("update:description",m),Be("change",f),Be("title-change",u),Be("description-change",m),pe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}}else if(l){if(P.value){P.value.focus();const y=m.length;P.value.setSelectionRange(y,y)}}else if(a)_n();else if(V.value&&document.activeElement===V.value){const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}else if(P.value&&document.activeElement===P.value){const y=m.length;P.value.setSelectionRange(y,y)}else p.value&&_n()},10)})})}},C=()=>{if(b.disabled||!b.richText||!p.value)return;Rt();const o=X.value==="title",l=X.value==="description",a=X.value==="editor";if(dt.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():p.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{mt()});return}const r={content:p.value.innerHTML,title:b.title||"",description:b.description||""};Le.value.push(r);const c=dt.value.pop();if(c!==void 0){pe.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";p.value.innerHTML=d,U.value=d,K.value=u,ae.value=m,W.value=d,x.value=u,k.value=m,e.nextTick(()=>{jt(),bn(),Hn(),It();const f=yn(d);Be("update:modelValue",f),Be("update:title",u),Be("update:description",m),Be("change",f),Be("title-change",u),Be("description-change",m),pe.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}}else if(l){if(P.value){P.value.focus();const y=m.length;P.value.setSelectionRange(y,y)}}else if(a)_n();else if(V.value&&document.activeElement===V.value){const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}else if(P.value&&document.activeElement===P.value){const y=m.length;P.value.setSelectionRange(y,y)}else p.value&&_n()},10)})})}},S=()=>{if(!p.value)return;p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),p.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},Z=()=>{if(!p.value)return;p.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},re=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{Z()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{Z()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{Z()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{Z()})}return!0},rt=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==p.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==p.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{S()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==p.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);f.appendChild(y),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===p.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}S()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{S()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{S()})}return!0},Ge=(o,l=null)=>{if(b.disabled||!b.richText||!p.value)return;je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae(),Rt(),p.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&el(d)&&(r=ft())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=rt();$e.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(et.value={command:"bold",state:d}),e.nextTick(()=>{r&&(de(r),e.nextTick(()=>{const m=Lt("bold");$e.value.bold=m})),mt(),bn(),It()});return}if(o==="italic"){const d=re();$e.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(et.value={command:"italic",state:d}),e.nextTick(()=>{r&&(de(r),e.nextTick(()=>{const m=Lt("italic");$e.value.italic=m})),mt(),Z(),bn(),It()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&de(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Lt("bold");$e.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Lt("italic");$e.value.italic=u});else{const u=document.queryCommandState(o);$e.value[o]=u}else{const u=document.queryCommandState(o);$e.value[o]=u}}catch{$e.value.hasOwnProperty(o)?$e.value[o]=!$e.value[o]:$e.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),y=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}p.value.querySelectorAll("a").forEach(f=>{const y=f.getAttribute("href");(!y||y===""||y==="#")&&f.setAttribute("href",l)})}mt(),bn(),It()})},Lt=(o,l=null)=>{if(b.disabled||!p.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const y=window.getComputedStyle(f);parseInt(y.fontWeight)>=600&&(u=!0)}catch{}return $e.value.hasOwnProperty(o)?$e.value[o]:($e.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.parentElement;for(;N&&N!==p.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(M.nodeType===1){const _=M;if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}}if(u)break}}return $e.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return $e.value.hasOwnProperty(o)?$e.value[o]:($e.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.parentElement;for(;N&&N!==p.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(M.nodeType===1){const _=M;if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return $e.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&$e.value.hasOwnProperty(o)?$e.value[o]:($e.value[o]=d,d)}return $e.value.hasOwnProperty(o)?$e.value[o]:!1}catch{return $e.value.hasOwnProperty(o)?$e.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},fn=o=>{b.disabled||!b.richText||(me.value=me.value===o?null:o,o==="askAi"&&($t.value=null))},Rt=()=>{me.value=null,lt.value=null},Ut=o=>{Ge("formatBlock",o),Rt()},Pl=o=>{if(!o||!p.value)return o;const l=_e=>{let fe=_e.nodeType===Node.TEXT_NODE?_e.parentElement:_e;for(;fe&&fe!==p.value;){const ct=fe.tagName;if(ct==="P"){const on=fe.parentElement;if(on===p.value||on.tagName==="BLOCKQUOTE")return fe}if(ct==="BLOCKQUOTE")break;fe=fe.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(p.value,NodeFilter.SHOW_ELEMENT,{acceptNode:_e=>{const fe=_e.tagName;if(fe==="P"){const ct=_e.parentElement;if(ct===p.value||ct.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return fe==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),f=c.indexOf(r);if(m===-1||f===-1)return o;const y=Math.min(m,f),M=Math.max(m,f),_=c.slice(y,M+1);if(_.length===0)return o;const N=_[0],Q=_[_.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(Q),Y},lo=()=>{if(b.disabled||!b.richText||!p.value)return;je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae(),Rt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&el(l)&&(l=Pl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&el(l)&&(a=ft());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const y=document.createElement("p");y.appendChild(f.cloneNode(!0)),u.insertBefore(y,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const y=document.createElement("p");y.appendChild(f.cloneNode(!0)),u.insertBefore(y,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const f=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=y.nextNode();)f.push(M);if(f.forEach(N=>{const Q=document.createElement("p");N.parentNode.insertBefore(Q,N),Q.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{a&&de(a),Hn(),mt(),It()})},oo=()=>{if(!p.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!p.value.contains(r))return;const c=M=>{if(!M)return!1;const _=M.textContent||"",Q=(M.innerHTML||"").trim();return _.trim()===""||Q===""||Q==="<br>"||Q==="<br/>"||Q==="<p></p>"||Q==="<p><br></p>"||Q==="<p><br/></p>"||Q==="<p> </p>"||Q==="<p><br> </p>"||Q==="<div></div>"||Q==="<div><br></div>"||Q==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const _=r.children[M];if((_.tagName==="P"||_.tagName==="DIV")&&c(_))_.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(f,r.nextSibling):r.parentNode.appendChild(f):p.value&&p.value.appendChild(f);const y=document.createRange();y.selectNodeContents(f),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{Hn(),mt()})},bn=()=>{if(!p.value){Ce.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");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},ao=()=>{if(!p.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),xt.value=ft();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Re.value="",Oe.value=a,Je.value="",Ze.value=null,Fe.value=!0,Rt(),e.nextTick(()=>{ut.value&&ut.value.focus()})},so=()=>{if(!p.value)return;je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Ze.value&&(l=Ze.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Ze.value=null}else Ge("unlink");Ce.value=!1,Rt(),e.nextTick(()=>{mt(),bn()})},ro=()=>{b.disabled||!b.richText||p.value&&(je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae(),Rt(),p.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{jt(),mt(),It()}))},Ol=()=>{b.disabled||!b.richText||p.value&&(je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae(),Rt(),p.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{jt(),mt(),It()}))},io=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},jt=()=>{if(!p.value)return;p.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=io(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},co=()=>{if(b.disabled||!b.richText||!p.value)return;Rt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{jt(),mt()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=io(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),jt();const f=document.createRange();f.selectNodeContents(a),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{mt(),It()})}else document.execCommand("indent",!1),e.nextTick(()=>{jt(),mt(),It()})},Vo=()=>{if(b.disabled||!b.richText||!p.value)return;Rt(),p.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{jt(),mt()});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(),jt();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{mt(),It()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{jt(),mt(),It()})},gn=e.ref(null),Kn=e.ref(null),kl=e.ref({}),$n=e.ref(""),qn=e.ref(null),wn=e.ref("");e.ref("");const al=e.ref(null);e.ref("");const Sn=e.ref([]),Zl=e.ref(!1),Bl=e.ref(!1),No=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},uo=()=>{if(b.disabled||!b.richText||!p.value)return;if(gn.value!==null){gn.value=null,$n.value="",wn.value="",al.value=null,Sn.value=[],hl(!0);return}Rt(),p.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!el(l))return;wn.value=No(l)||"",al.value=ft();const a=l.getBoundingClientRect(),r=p.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);kl.value={top:`${m}px`,bottom:"auto"},gn.value=Date.now(),e.nextTick(()=>{if($n.value="",qn.value){const y=qn.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const f=r.querySelector(".dss-comment-overlay");if(f&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const M=r.getBoundingClientRect(),_=f.getBoundingClientRect(),N=y.getBoundingClientRect(),Q=_.bottom-M.top,Y=N.top-M.top,_e=8;if(Q>Y-_e){const fe=N.height;kl.value={bottom:`${fe+_e}px`,top:"auto"}}else kl.value={top:`${m}px`,bottom:"auto"}}}})},mo=()=>{if(!$n.value.trim())return;const o=$n.value.trim(),l=new Date,a={text:o,selectionText:wn.value,selectionRange:al.value,commentId:gn.value,user:b.commentUser||null,createdAt:l.toISOString()};Sn.value=[...Sn.value,a],Be("comment-submitted",a),Bo(a),al.value&&!Wl(al.value)&&So(gn.value,al.value),$n.value="",e.nextTick(()=>{if(qn.value){const r=qn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Dn("sendComment")})},po=(o,l)=>{if(!(!b.commentUser||!o.user||o.user.id!==b.commentUser.id)){if(Sn.value=Sn.value.filter((a,r)=>r!==l),gn.value!==null&&p.value){const a=String(gn.value),r=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Sn.value.length>0){const c=[],d=new Set;Sn.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(Sn.value.length))}else r&&Sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Be("comment-deleted",{comment:o,index:l,commentId:gn.value}),b.comments&&Array.isArray(b.comments)){const a=b.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Be("update:comments",a)}e.nextTick(()=>{Dn("deleteComment")})}},Wl=o=>{if(!o||!p.value)return!1;try{const l=ql(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ql=o=>{if(!o||!p.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return p.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[p.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},So=(o,l)=>{if(!(!o||!l||!p.value))try{const a=ql(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,f=a.endContainer,y=a.startOffset,M=a.endOffset,_=m.nodeType===3?m.parentNode:m,N=f.nodeType===3?f.parentNode:f;if(_===N&&y===0&&M===(f.nodeType===3?f.length:N.childNodes.length)&&(_.tagName==="P"||_.tagName==="DIV"||_.tagName==="H1"||_.tagName==="H2"||_.tagName==="H3"||_.tagName==="H4"||_.tagName==="H5"||_.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const f=a.extractContents();d.appendChild(f),a.insertNode(d)}const u=p.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Dn("wrapSelectionWithCommentMarker"),mt()})}catch{}},Bo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(b.comments)?[...b.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(f=>f.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Zl.value=!0,Be("update:comments",l)},Ul=(o,l=[])=>{if(b.disabled||!b.richText||!p.value)return;const a=p.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Rt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),wn.value=r.innerHTML||"",al.value=ft();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),_=u.bottom-M.top,Q=Math.max(_+8,0);kl.value={top:`${Q}px`,bottom:"auto"}}const f=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(f&&b.comments&&Array.isArray(b.comments)){const M=b.comments.find(_=>String(_.conversation_id)===String(f));if(M&&M.conversation&&Array.isArray(M.conversation)){const _=M.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:M.id||M.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));y.push(..._)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((M,_)=>{const N=_e=>{if(!_e)return 0;const fe=new Date(_e).getTime();return isNaN(fe)?0:fe},Q=N(M.createdAt),Y=N(_.createdAt);return Q===Y?0:Q-Y}),Sn.value=y,hl(!0),gn.value=f||null,r&&(Kn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if($n.value="",qn.value){const M=qn.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const _=m.querySelector(".dss-text-editor-footer");if(_){const N=m.getBoundingClientRect(),Q=M.getBoundingClientRect(),Y=_.getBoundingClientRect(),_e=Q.bottom-N.top,fe=Y.top-N.top,ct=8;if(_e>fe-ct){const on=Y.height;kl.value={bottom:`${on+ct}px`,top:"auto"}}}}}Dn("openCommentOverlayForSelector")})},Xl=e.ref(null),Hl=e.ref(0),xn=o=>{if(!(b.disabled||!b.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{oo()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,f=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,y=c.contains(m)||m===c,_=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!f||!y||_.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{mt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Vo():co();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=f=>{if(!f)return!1;let y=f.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const M=f.parentElement;return M&&M!==p.value?m(M):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const y=f.closest("p, div");if(y&&y!==p.value){o.preventDefault(),o.stopPropagation();let M=null;const _=a.startOffset;_<u.length&&(M=u.splitText(_));const N=document.createElement("p");if(M?N.appendChild(M):N.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(N,y.nextSibling):y.parentNode.appendChild(N);const Q=document.createRange();M?Q.setStart(M,0):Q.setStart(N,0),Q.collapse(!0),l.removeAllRanges(),l.addRange(Q),e.nextTick(()=>{mt()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&p.value&&p.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const _e=Y.textContent||"",ct=(Y.innerHTML||"").trim(),on=ct.replace(/<br\s*\/?>/gi,"").trim();return _e.trim()===""||ct===""||on===""||ct==="<br>"||ct==="<br/>"||ct==="<p></p>"||ct==="<p><br></p>"||ct==="<p><br/></p>"||ct==="<p> </p>"||ct==="<p><br> </p>"||ct==="<div></div>"||ct==="<div><br></div>"||ct==="<div><br/></div>"},f=c.lastChild,y=f&&f.nodeType===1&&f.tagName==="BR",M=a.startContainer,_=M.nodeType===3?M.parentElement:M,N=_===c||_&&_.parentElement===c;if(u&&m(u)||y&&N){o.preventDefault(),setTimeout(()=>{oo()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-Hl.value;if(Xl.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),co();return}}}}Xl.value=" ",Hl.value=l}else Xl.value=o.key}},z=o=>{if(b.disabled||!b.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Ae();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const f=new DOMParser().parseFromString(u,"text/html");let y=p.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(_=>{if(y>0){const N=f.createElement("p");N.innerHTML=_.innerHTML,_.parentNode.replaceChild(N,_)}else y++}),c){const _=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(f.body.children).filter(Q=>_.includes(Q.tagName));if(N.length===1){const Q=N[0].tagName,Y=c.tagName,_e=c.textContent.trim()===""&&!c.querySelector("img");let fe=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?fe=!0:_e||(Q===Y||Q==="P")&&(fe=!0),fe)return N[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);mt()},rn=o=>{if(me.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Rt()}if(We.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=p.value&&a.closest(".dss-text-editor-content");!r&&!c&&zn()}if($t.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&fo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(lt.value=null),!p.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);yt.value=!r.collapsed&&el(r)}else yt.value=!1}if(gn.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,f=o.clientY;r=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(gn.value=null,$n.value="",wn.value="",al.value=null,Sn.value=[],hl(!0))}},Tn=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),kt.value&&(clearTimeout(kt.value),kt.value=null),lt.value=l},cn=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}kt.value&&clearTimeout(kt.value),kt.value=setTimeout(()=>{lt.value=null,kt.value=null},150)},Gn=o=>{lt.value=null};let Wt=0;const nn=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++Wt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let f=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},Qn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{nn(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=f=>{const y=c.getAttribute("data-submenu-id");y&&Tn(f,y)},m=cn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=y=>{const M=c.getAttribute("data-submenu-id");M&&Tn(y,M)},m=cn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",Gn)})})})};let Ln=null;const Nt=()=>{if(lt.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${lt.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${lt.value}"]`);o&&l&&Rl(o,l)}if(We.value&&It(),b.richText){if(Ln!==null)return;Ln=setTimeout(()=>{Ln=null,Dn("handleWindowResize")},150)}},St=()=>{if(!b.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},gt=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Me.value?kn():Cl(),te.value?ml():jn()})}),e.nextTick(()=>{gt()}),b.richText&&p.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",rn),window.addEventListener("resize",Nt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,Nt()},150))};window.addEventListener("scroll",l,!0),p.value._windowScrollHandler=l,p.value._windowScrollTimeout=o,p.value.closest(".editor-with-comments"),p.value.closest(".dss-text-editor-content-wrapper");const a=p.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Nt()},150))};a&&(a.addEventListener("scroll",c),p.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Qn(),St()}),p.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!b.disabled&&m.preventDefault();const M=f.closest(".dss-image-no-alt-icon"),_=f.closest(".dss-image-wrapper");if(M||_&&f===_){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),Q=document.createRange();Q.setStartAfter(_),Q.collapse(!0),N.removeAllRanges(),N.addRange(Q)}else _&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,_e=Y.nodeType===3?Y.parentElement:Y;if(_.contains(_e)&&_e!==_.querySelector("img")){const fe=document.createRange();fe.setStartAfter(_),fe.collapse(!0),N.removeAllRanges(),N.addRange(fe)}}else{const Q=document.createRange();Q.setStartAfter(_),Q.collapse(!0),N.addRange(Q)}}))},!0),p.value.addEventListener("mousedown",m=>{const f=m.target,y=f.closest(".dss-image-no-alt-icon"),M=f.closest(".dss-image-wrapper");if(y||M&&f.tagName!=="IMG"){m.preventDefault();const _=window.getSelection(),N=document.createRange();M&&(N.setStartAfter(M),N.collapse(!0),_.removeAllRanges(),_.addRange(N))}},!0),p.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!p.value)return;p.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const _=y.getAttribute("alt")||y.alt||"";if(_){const N=y.getAttribute("src")||y.src||"",Q=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=_===N||_===Q;(_.startsWith("http://")||_.startsWith("https://")||_.startsWith("data:")||Y||Y)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),j()})}),p.value.addEventListener("dragstart",m=>{const f=m.target,y=f.tagName==="IMG"?f:f.closest("img"),M=y?.closest(".dss-image-wrapper");y&&p.value.contains(y)&&(Xe.value=M||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),p.value.addEventListener("dragover",m=>{Xe.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),p.value.addEventListener("dragenter",m=>{Xe.value&&(m.preventDefault(),m.stopPropagation())}),p.value.addEventListener("drop",m=>{if(!Xe.value||!p.value)return;m.preventDefault(),m.stopPropagation();const f=Xe.value,y=f.classList?.contains("dss-image-wrapper"),M=y?f.querySelector("img"):f,_=y?f:M?.closest(".dss-image-wrapper");if(!M||!p.value.contains(M)){Xe.value=null;return}let N=null;const Q=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(Q,Y);else{const Ot=window.getSelection();Ot.rangeCount>0?N=Ot.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(p.value),N.collapse(!1))}if(!N){Xe.value=null;return}const _e=N.commonAncestorContainer,fe=_e.nodeType===3?_e.parentElement:_e;if(fe?.closest(".dss-image-wrapper")===_||_&&_.contains(fe)){Xe.value=null;return}if(_&&(fe===_||_.contains(fe))){Xe.value=null;return}const on=M.getAttribute("src");let Kt=null;_?Kt=_.cloneNode(!0):Kt=M.cloneNode(!0);try{let Ot=N.startContainer;if(Ot.nodeType===3&&(Ot=Ot.parentElement),_&&(Ot===_||_.contains(Ot))){const Pt=document.createRange();Pt.setStartAfter(_),Pt.collapse(!0),N=Pt}N.insertNode(Kt);const Gt=document.createRange();Gt.setStartAfter(Kt),Gt.collapse(!0);const Qt=window.getSelection();Qt.removeAllRanges(),Qt.addRange(Gt)}catch{if(p.value.childNodes.length===0){const Gt=document.createElement("p");Gt.appendChild(Kt),p.value.appendChild(Gt)}else{const Gt=p.value.lastChild;if(Gt&&Gt.nodeType===1)Gt.appendChild(Kt);else{const Qt=document.createElement("p");Qt.appendChild(Kt),p.value.appendChild(Qt)}}}_?_.remove():M.remove(),Xe.value=null,e.nextTick(()=>{const Ot=p.value.querySelectorAll("img");let Gt=!1;Ot.forEach(Qt=>{if(Qt.getAttribute("src")===on)if(!Gt)Gt=!0;else{const Pt=Qt.closest(".dss-image-wrapper");Pt?Pt.remove():Qt.remove()}}),j(),mt()})}),p.value.addEventListener("dragend",m=>{Xe.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const M=y.querySelectorAll&&y.querySelectorAll("img");M&&M.forEach(_=>{_.removeAttribute("alt"),_.removeAttribute("data-alt"),_.setAttribute("alt",""),_.setAttribute("data-alt",""),_.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{j(),St(),d=null},100)});if(u.observe(p.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{St()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),b.modelValue){const m=In(b.modelValue);p.value.innerHTML=m,Qe()}e.nextTick(()=>{const m=p.value.innerHTML||"",f=b.title||"",y=b.description||"";U.value=m,K.value=f,ae.value=y,x.value=f,k.value=y,jt(),j(),Z(),Jn(),_l(),Dl()}),bn(),Hn(),p.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",rn),window.removeEventListener("resize",Nt),p.value&&p.value._windowScrollHandler&&window.removeEventListener("scroll",p.value._windowScrollHandler,!0),Ln!==null&&(clearTimeout(Ln),Ln=null),p.value&&p.value._windowScrollTimeout!==null&&clearTimeout(p.value._windowScrollTimeout),ve.value&&clearTimeout(ve.value),kt.value&&clearTimeout(kt.value),p.value&&p.value._mutationObserver&&p.value._mutationObserver.disconnect(),Ye.value&&Ye.value.disconnect(),Cn.value!==null&&(cancelAnimationFrame(Cn.value),Cn.value=null),Yn.value!==null&&(clearTimeout(Yn.value),Yn.value=null),un.value!==null&&(clearTimeout(un.value),un.value=null),hl(!0),p.value&&p.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=p.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Xt=o=>{const l=o.target,a=l.closest("a");if(a&&!b.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const f=document.createRange();f.setStartAfter(r),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}j(),bn(),Hn(),It(),Jn()}):e.nextTick(()=>{j(),bn(),Hn(),It(),Jn()})},vo=()=>{Pe();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);yt.value=!a.collapsed&&el(a),!a.collapsed&&et.value&&(et.value=null)}else yt.value=!1;if(j(),bn(),Hn(),It(),Jn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),yt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}$e.value[a]=m}else{const d=document.queryCommandState(a);$e.value[a]=d}}}catch{}})},Jn=()=>{if(!b.richText||b.disabled||!p.value){Ke.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){Ke.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!p.value.contains(r)){Ke.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){Ke.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Ke.value=d:Ke.value="p"}catch{Ke.value="p"}},Hn=()=>{if(!p.value){Ht.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&p.value.contains(c))}Ht.value=l}catch{Ht.value=!1}},el=o=>{if(!o||!p.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?p.value.contains(a):!1},zn=()=>{We.value=!1},It=()=>{if(!b.floatingToolbar||!b.richText||b.disabled){We.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){We.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!el(l)){We.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){We.value=!1;return}const r=p.value;if(!r){We.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){We.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let f=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Ie.value&&(M=Ie.value.getBoundingClientRect().width);const _=(M||320)/2;let N=c.left+_,Q=c.right-_;if(Q<N){const Y=c.left+c.width/2;N=Y,Q=Y}if(y>0){const Y=_+u,_e=y-_-u;if(N=Math.max(N,Y),Q=Math.min(Q,_e),Q<N){const fe=y/2;N=fe,Q=fe}}f<N?f=N:f>Q&&(f=Q),Et.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},We.value=!0},Ml=o=>{b.disabled||!b.richText||($t.value=$t.value===o?null:o,o==="askAi"&&(me.value=null))},fo=()=>{$t.value=null,lt.value=null},sl=o=>{Ut(o),fo()};let vl=null,An=null,rl=null,En=null;const Mo=o=>{if(b.disabled||!b.richText){tl(),bl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(vl&&(clearTimeout(vl),vl=null),rl&&(clearTimeout(rl),rl=null),a&&a!==An){bl(),An=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Ze.value=a,ee.value=c,oe.value=!0,L.value=!0,go(a)}else!a&&An?(An=null,vl=setTimeout(()=>{L.value||tl()},150)):a&&a===An&&go(a);if(r&&r!==En){tl(),En=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),vt.value=r,_t.value=c.trim()||A("textEditor.image.noAlt"),Ct.value=!0,Ve.value=!0,ho(r)}else!r&&En?(En=null,rl=setTimeout(()=>{Ve.value||bl()},150)):r&&r===En&&ho(r)},_o=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(An=null,En=null,vl&&(clearTimeout(vl),vl=null),rl&&(clearTimeout(rl),rl=null),tl(),bl())},tl=()=>{L.value=!1,setTimeout(()=>{L.value||(oe.value=!1,ee.value="",Fe.value||(Ze.value=null))},100)},go=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;le.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},bl=()=>{Ve.value=!1,setTimeout(()=>{Ve.value||(Ct.value=!1,_t.value="",at.value||(vt.value=null))},100)},ho=o=>{if(!o||!p.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ne.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},yo=()=>{if(!ee.value||!Ze.value)return;let l=Ze.value.getAttribute("href")||ee.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Co=()=>{if(Ze.value){const o=Ze.value.textContent||"",l=Ze.value.getAttribute("href")||"",a=Ze.value;Re.value=l,Oe.value=o,Je.value=o,L.value=!1,oe.value=!1,ee.value="",Ze.value=a,Fe.value=!0}else if(Ce.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")||"";Re.value=d,Oe.value=c,Je.value=c,Ze.value=r,Fe.value=!0}}}else{xt.value=ft();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Re.value="",Oe.value=l,Je.value="",Ze.value=null,Fe.value=!0}e.nextTick(()=>{ut.value&&(ut.value.focus(),ut.value.select())})},Al=()=>{Fe.value=!1,Re.value="",Oe.value="",Je.value="",Ze.value=null,xt.value=null},Yl=()=>{if(!Re.value.trim()){Al();return}if(je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae(),Oe.value.trim()||(Oe.value=Re.value.trim()),Ze.value&&p.value&&p.value.contains(Ze.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Ze.value;if(l.setAttribute("href",Re.value.trim()),Oe.value.trim()!==Je.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=Oe.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),mt()}else if(p.value){p.value.focus();const o=window.getSelection();o.removeAllRanges(),xt.value&&de(xt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Re.value.trim(),a.textContent=Oe.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(p.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Re.value.trim(),d.textContent=Oe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==p.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==p.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=a.textContent.substring(0,l.startOffset),M=y[y.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
100
|
+
</svg>`,v=e.ref(null),ue=e.ref(null),Ce=e.ref(!1),he=e.ref(!1),ae=e.ref(!1),te=e.ref(""),oe=e.ref({}),H=e.ref(!1),Ve=e.ref(!1),Ae=e.ref(""),Oe=e.ref(""),mt=e.ref(null),Z=e.ref(null),Te=e.ref(null),Bt=e.ref(null),Ue=e.ref(""),Lt=e.ref(!1),Le=e.ref({}),Ze=e.ref(!1),wt=e.ref({}),ze=e.ref(null),Mt=e.ref(null),at=e.ref(!1),Ct=e.ref(""),cn=e.ref(null),_t=e.ref(""),Qe=e.ref(""),je=e.ref(""),$t=e.ref(null),Ht=e.ref(null),Yt=e.ref(null),pt=e.ref(null),Nt=e.ref(null),xt=e.ref(!1),St=e.ref(""),jt=e.ref({}),Q=e.ref(!1),ve=e.ref("upload"),fe=e.ref(""),_e=e.ref(null),rt=e.ref(null),Ie=e.ref([]),Ke=e.ref([]),de=e.ref(null),Ge=e.ref(!1),U=e.ref(""),W=e.ref(""),j=e.ref(""),ne=e.ref(""),x=e.ref(""),k=e.ref(""),V=e.ref(null),P=e.ref(null),X=e.ref(null),De=e.ref(!1),Xe=e.ref(null),Me=e.ref(!1),le=e.ref(!1),nt=e.ref(null),Je=e.ref("p"),yt=e.ref(!1),ht=e.ref([]),Ye=e.ref(null),Cn=e.ref(null),Yn=e.ref(null),Rn=e.ref(!1),At=e.ref(0),Zn=100,un=e.ref(null),Bn=e.computed(()=>({"dss-text-editor-no-border":!b.border,"dss-text-editor-rounded":b.rounded,"dss-text-editor-full-height":b.fullHeight,"dss-comment-overlay-open":gn.value!==null})),dn=e.computed(()=>({})),Mn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+24+2}px`,resize:"none",overflowY:"auto"}),Nn=e.computed(()=>!b.fixedHeight||b.fullHeight?{}:{height:`${1.6*14*b.rows+32}px`,overflowY:"auto"}),D=e.computed(()=>b.richText&&Ke.value.length>0),q=e.computed(()=>{if(!b.modelValue)return"";if(b.richText){let o=b.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /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 b.modelValue}),F=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),se=e.computed(()=>q.value.length),Ne=e.computed(()=>pt.value!==null&&ve.value==="upload"&&_t.value&&_t.value.startsWith("data:")),lt=e.computed(()=>b.titlePlaceholder||A("textEditor.placeholders.title")),ot=e.computed(()=>b.descriptionPlaceholder||A("textEditor.placeholders.description")),We=e.computed(()=>b.placeholder||A("textEditor.placeholders.startTyping")),st=o=>ce&&ce[o]!==void 0,mn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++)if(st(b.customToolbarSlots[l]))return!0;return!1},tn=o=>{for(let l=o+1;l<b.customToolbarSlots.length;l++){const a=b.customToolbarSlots[l];if(st(a)&&pn(a))return!0}return!1},pn=o=>b.customToolbarFloatingMap.hasOwnProperty(o)?b.customToolbarFloatingMap[o]===!0:!0,Fn=e.computed(()=>b.customToolbarSlots.some(o=>st(o)&&pn(o))),hn=e.computed(()=>st("title-slot")),nn=e.computed(()=>st("description-slot")),yn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},In=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),a=l.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():l},Vl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=l.nextNode();for(;r;)a.push(r),r=l.nextNode();a.forEach(c=>c.remove())},Tl=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},Nl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=A("textEditor.started_conversation");if(c&&l===c)return!0}catch{}const r=l.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},yl=o=>{const l=o.target.value;Be("update:modelValue",l),Be("change",l)},kn=()=>{if(!V.value)return;const o=V.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},vn=()=>{Me.value=!0,kn()},Ll=()=>{Me.value=!1,Cl()},Cl=()=>{if(!V.value)return;const o=V.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},Wn=o=>{const a=o.target.value;Me.value&&kn(),Be("update:title",a),Be("title-change",a),X.value="title",b.richText&&(Ge.value||(W.value=U.value,x.value=j.value,k.value=ne.value),de.value&&clearTimeout(de.value),Ge.value=!0,de.value=setTimeout(()=>{Ge.value=!1,Re()},500))},ml=()=>{if(!P.value)return;const o=P.value;if(o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important"),o.value.trim()===""){const r=o.value;o.value="M";const c=o.scrollHeight;o.value=r,o.style.setProperty("height",`${c}px`,"important"),o.style.setProperty("overflow-y","hidden","important");return}o.offsetHeight;const a=o.scrollHeight;o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},pl=()=>{le.value=!0,ml()},Sl=()=>{le.value=!1,jn()},jn=()=>{if(!P.value)return;const o=P.value;o.style.setProperty("text-overflow","","important"),o.style.setProperty("white-space","","important"),o.style.setProperty("overflow-x","","important"),o.style.setProperty("height","auto","important");const l=o.value;o.value="M";const a=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${a}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},zl=o=>{const a=o.target.value;le.value&&ml(),Be("update:description",a),Be("description-change",a),X.value="description",b.richText&&(Ge.value||(W.value=U.value,x.value=j.value,k.value=ne.value),de.value&&clearTimeout(de.value),Ge.value=!0,de.value=setTimeout(()=>{Ge.value=!1,Re()},500))},ft=()=>{const o=window.getSelection();if(o.rangeCount===0)return null;const l=o.getRangeAt(0);if(l.startContainer.nodeType===1)return{type:"element",element:l.startContainer,offset:l.startOffset};const a=l.cloneRange();return a.selectNodeContents(v.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},pe=o=>{if(!(!o||!v.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(v.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{v.value.focus();return}let r=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}l.removeAllRanges(),l.addRange(a)}catch{v.value.focus()}},_n=()=>{if(!v.value)return;v.value.focus();const o=window.getSelection(),l=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let d=c.childNodes.length-1;d>=0;d--){const u=c.childNodes[d],m=a(u);if(m)return m}return c},r=a(v.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(l.setStart(c,c.length),l.setEnd(c,c.length)):(l.selectNodeContents(r),l.collapse(!1))}else l.setStart(r,0),l.setEnd(r,0);o.removeAllRanges(),o.addRange(l)},Re=(o=!1)=>{if(!v.value)return;const l=v.value.innerHTML,a=b.title||"",r=b.description||"";if(!o&&l===U.value&&a===j.value&&r===ne.value)return;const c={content:W.value||U.value,title:x.value!==void 0?x.value:j.value,description:k.value!==void 0?k.value:ne.value},d=Ie.value.length>0?Ie.value[Ie.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&&(Ie.value.push(c),Ie.value.length>50&&Ie.value.shift(),Ke.value=[]),U.value=l,j.value=a,ne.value=r,W.value=l,x.value=a,k.value=r},dt=o=>{if(!v.value)return;Pe(),v.value&&Vl(v.value);let l=null;v.value&&(v.value.querySelector("p")||(l=ft(),tt()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&nt.value&&(nt.value=null),he.value=!0;const r=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=yn(r);Be("update:modelValue",c),Be("change",c),X.value="editor",Ge.value||(W.value=U.value,x.value=j.value,k.value=ne.value),de.value&&clearTimeout(de.value),Ge.value=!0,de.value=setTimeout(()=>{Ge.value=!1,Re(),Pn(),nl()},500),e.nextTick(()=>{l&&pe(l),Pe();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,f=m&&m.collapsed;if(d.forEach(y=>{try{if(f&&nt.value?.command===y){Le.value[y]=nt.value.state;return}if(y==="bold")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M;let N=!1;if(_&&((_.tagName==="STRONG"||_.tagName==="B"||_.closest&&_.closest("strong, b"))&&(N=!0),!N&&_.style&&parseInt(_.style.fontWeight)>=600&&(N=!0),!N))try{const J=window.getComputedStyle(_);parseInt(J.fontWeight)>=600&&(N=!0)}catch{}Le.value[y]=N}else Le.value.hasOwnProperty(y)||(Le.value[y]=!1);else if(y==="italic")if(m){const M=m.commonAncestorContainer,_=M.nodeType===3?M.parentElement:M,N=_&&(_.tagName==="EM"||_.tagName==="I"||_.closest&&_.closest("em, i"));Le.value[y]=!!N}else{const M=document.queryCommandState(y);Le.value[y]=M}else{const M=document.queryCommandState(y);Le.value[y]=M}}catch{}}),Kt(),K(),O(),Ft(),Jn(),Dn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>nl(y),0),(y===" "||y===`
|
|
101
|
+
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Pn()},100)}he.value=!1})},Pe=()=>{if(!v.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const d=c.querySelector("img");if(r!==d&&!d?.contains(r)){const u=l.startContainer.nodeType===3?l.startContainer.parentElement:l.startContainer,m=l.endContainer.nodeType===3?l.endContainer.parentElement:l.endContainer;if(c.contains(u)&&u!==d||c.contains(m)&&m!==d){const f=document.createRange();f.setStartAfter(c),f.collapse(!0),o.removeAllRanges(),o.addRange(f)}}}},tt=()=>{if(!v.value)return;const o=v.value;if(o.querySelector&&o.querySelector("p"))return;const l=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(o.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===o&&o.removeChild(c);return}r||(r=document.createElement("p"),o.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const d=c,u=d.tagName;if(u==="BR"){r=null;return}if(l.has(u)){r=null;return}r||(r=document.createElement("p"),o.insertBefore(r,d)),r.appendChild(d)}})},K=()=>{if(v.value&&!De.value){De.value=!0;try{v.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),v.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),v.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===y;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(u){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=vt,m.appendChild(y)}else if(f&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{De.value=!1}}},Ot=o=>{Pn(),Be("blur",o),zn()},h=()=>{if(b.disabled||!b.richText||!v.value)return;Dt(),de.value&&(clearTimeout(de.value),de.value=null),Ge.value&&(Re(),Ge.value=!1);const o=X.value==="title",l=X.value==="description",a=X.value==="editor";if(Ie.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{dt()});return}const r={content:v.value.innerHTML,title:b.title||"",description:b.description||""};Ke.value.push(r);const c=Ie.value.pop();if(c!==void 0){he.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,U.value=d,j.value=u,ne.value=m,W.value=d,x.value=u,k.value=m,e.nextTick(()=>{Kt(),bn(),Hn(),Ft();const f=yn(d);Be("update:modelValue",f),Be("update:title",u),Be("update:description",m),Be("change",f),Be("title-change",u),Be("description-change",m),he.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}}else if(l){if(P.value){P.value.focus();const y=m.length;P.value.setSelectionRange(y,y)}}else if(a)_n();else if(V.value&&document.activeElement===V.value){const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}else if(P.value&&document.activeElement===P.value){const y=m.length;P.value.setSelectionRange(y,y)}else v.value&&_n()},10)})})}},C=()=>{if(b.disabled||!b.richText||!v.value)return;Dt();const o=X.value==="title",l=X.value==="description",a=X.value==="editor";if(Ke.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{dt()});return}const r={content:v.value.innerHTML,title:b.title||"",description:b.description||""};Ie.value.push(r);const c=Ke.value.pop();if(c!==void 0){he.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=d,U.value=d,j.value=u,ne.value=m,W.value=d,x.value=u,k.value=m,e.nextTick(()=>{Kt(),bn(),Hn(),Ft();const f=yn(d);Be("update:modelValue",f),Be("update:title",u),Be("update:description",m),Be("change",f),Be("title-change",u),Be("description-change",m),he.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}}else if(l){if(P.value){P.value.focus();const y=m.length;P.value.setSelectionRange(y,y)}}else if(a)_n();else if(V.value&&document.activeElement===V.value){const y=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(y,y),kn()}else if(P.value&&document.activeElement===P.value){const y=m.length;P.value.setSelectionRange(y,y)}else v.value&&_n()},10)})})}},S=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),v.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},O=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},re=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==v.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{O()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{O()});else try{const r=l.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{O()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{O()})}return!0},it=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let a=!1;if(l.collapsed){const r=l.startContainer;let c=r.nodeType===3?r.parentElement:r;for(;c&&c!==v.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer:l.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let d;for(;d=c.nextNode();)if(!(typeof l.intersectsNode=="function"&&!l.intersectsNode(d))){if(d.nodeType===3){let u=d.parentElement;for(;u&&u!==v.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{S()}),!1;if(l.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.startContainer;let u=d.nodeType===3?d.parentElement:d;for(;u&&u!==v.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);f.appendChild(y),u.parentNode&&u.parentNode.replaceChild(f,u),c.setStart(f,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===v.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}S()});else try{const r=l.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),l.insertNode(c),l.setStartAfter(c),l.collapse(!0),o.removeAllRanges(),o.addRange(l),e.nextTick(()=>{S()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{S()})}return!0},et=(o,l=null)=>{if(b.disabled||!b.richText||!v.value)return;Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re(),Dt(),v.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&el(d)&&(r=ft())}if(o==="createLink"&&l){const d=window.getSelection();if(d.rangeCount>0){const u=d.getRangeAt(0);if(u.collapsed)try{u.expand("word")}catch{const f=document.createTextNode(l);u.insertNode(f),u.selectNodeContents(f)}}}if(o==="bold"){const d=it();Le.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(nt.value={command:"bold",state:d}),e.nextTick(()=>{r&&(pe(r),e.nextTick(()=>{const m=Tt("bold");Le.value.bold=m})),dt(),bn(),Ft()});return}if(o==="italic"){const d=re();Le.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(nt.value={command:"italic",state:d}),e.nextTick(()=>{r&&(pe(r),e.nextTick(()=>{const m=Tt("italic");Le.value.italic=m})),dt(),O(),bn(),Ft()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&pe(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Tt("bold");Le.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Tt("italic");Le.value.italic=u});else{const u=document.queryCommandState(o);Le.value[o]=u}else{const u=document.queryCommandState(o);Le.value[o]=u}}catch{Le.value.hasOwnProperty(o)?Le.value[o]=!Le.value[o]:Le.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const f=u.getRangeAt(0),y=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}v.value.querySelectorAll("a").forEach(f=>{const y=f.getAttribute("href");(!y||y===""||y==="#")&&f.setAttribute("href",l)})}dt(),bn(),Ft()})},Tt=(o,l=null)=>{if(b.disabled||!v.value)return!1;try{if(o==="formatBlock"&&l){const r=document.queryCommandValue("formatBlock");if(l==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const d=window.getSelection();if(d.rangeCount>0){const m=d.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===l||r.toLowerCase()===l.toLowerCase()}if(["bold","italic","underline"].includes(o))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(o==="bold"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="STRONG"||f.tagName==="B"||f.closest&&f.closest("strong, b"))&&(u=!0),!u&&f.style&&parseInt(f.style.fontWeight)>=600&&(u=!0),!u))try{const y=window.getComputedStyle(f);parseInt(y.fontWeight)>=600&&(u=!0)}catch{}return Le.value.hasOwnProperty(o)?Le.value[o]:(Le.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.parentElement;for(;N&&N!==v.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(M.nodeType===1){const _=M;if(_.tagName==="STRONG"||_.tagName==="B"){u=!0;break}if(_.style&&parseInt(_.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Le.value[o]=u&&f,u&&f}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,f=m.nodeType===3?m.parentElement:m;if(f&&((f.tagName==="EM"||f.tagName==="I"||f.closest&&f.closest("em, i"))&&(u=!0),!u&&f.style&&f.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(f).fontStyle==="italic"&&(u=!0)}catch{}return Le.value.hasOwnProperty(o)?Le.value[o]:(Le.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;f=!0;let N=M.parentElement;for(;N&&N!==v.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(M.nodeType===1){const _=M;if(_.tagName==="EM"||_.tagName==="I"){u=!0;break}if(_.style&&_.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Le.value[o]=u&&f,u&&f}}const d=document.queryCommandState(o);return c.collapsed&&Le.value.hasOwnProperty(o)?Le.value[o]:(Le.value[o]=d,d)}return Le.value.hasOwnProperty(o)?Le.value[o]:!1}catch{return Le.value.hasOwnProperty(o)?Le.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},fn=o=>{b.disabled||!b.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(Mt.value=null))},Dt=()=>{ue.value=null,_e.value=null},qt=o=>{et("formatBlock",o),Dt()},Pl=o=>{if(!o||!v.value)return o;const l=$e=>{let ge=$e.nodeType===Node.TEXT_NODE?$e.parentElement:$e;for(;ge&&ge!==v.value;){const ut=ge.tagName;if(ut==="P"){const an=ge.parentElement;if(an===v.value||an.tagName==="BLOCKQUOTE")return ge}if(ut==="BLOCKQUOTE")break;ge=ge.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:$e=>{const ge=$e.tagName;if(ge==="P"){const ut=$e.parentElement;if(ut===v.value||ut.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return ge==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),f=c.indexOf(r);if(m===-1||f===-1)return o;const y=Math.min(m,f),M=Math.max(m,f),_=c.slice(y,M+1);if(_.length===0)return o;const N=_[0],J=_[_.length-1],Y=document.createRange();return Y.setStartBefore(N),Y.setEndAfter(J),Y},lo=()=>{if(b.disabled||!b.richText||!v.value)return;Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re(),Dt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&el(l)&&(l=Pl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&el(l)&&(a=ft());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")u.insertBefore(f,c);else{const y=document.createElement("p");y.appendChild(f.cloneNode(!0)),u.insertBefore(y,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const y=document.createElement("p");y.appendChild(f.cloneNode(!0)),u.insertBefore(y,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const f=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=y.nextNode();)f.push(M);if(f.forEach(N=>{const J=document.createElement("p");N.parentNode.insertBefore(J,N),J.appendChild(N)}),u.querySelectorAll("p, div").forEach(N=>{N.textContent.trim()===""&&!N.querySelector("img")&&(N.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const N=document.createElement("p");N.innerHTML="<br>",u.appendChild(N)}}e.nextTick(()=>{a&&pe(a),Hn(),dt(),Ft()})},oo=()=>{if(!v.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!v.value.contains(r))return;const c=M=>{if(!M)return!1;const _=M.textContent||"",J=(M.innerHTML||"").trim();return _.trim()===""||J===""||J==="<br>"||J==="<br/>"||J==="<p></p>"||J==="<p><br></p>"||J==="<p><br/></p>"||J==="<p> </p>"||J==="<p><br> </p>"||J==="<div></div>"||J==="<div><br></div>"||J==="<div><br/></div>"};let d=null;for(a.nodeType===3?d=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?d=a:d=a.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const _=r.children[M];if((_.tagName==="P"||_.tagName==="DIV")&&c(_))_.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const f=document.createElement("p");f.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(f,r.nextSibling):r.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const y=document.createRange();y.selectNodeContents(f),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{Hn(),dt()})},bn=()=>{if(!v.value){Ce.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");Ce.value=!!r}else Ce.value=!1}catch{Ce.value=!1}},ao=()=>{if(!v.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Bt.value=ft();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ae.value="",Oe.value=a,Ue.value="",Te.value=null,Ve.value=!0,Dt(),e.nextTick(()=>{mt.value&&mt.value.focus()})},so=()=>{if(!v.value)return;Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re();const o=window.getSelection();let l=null;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!l&&Te.value&&(l=Te.value),l&&l.parentNode){const a=document.createDocumentFragment();for(;l.firstChild;)a.appendChild(l.firstChild);if(l.parentNode.replaceChild(a,l),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Te.value=null}else et("unlink");Ce.value=!1,Dt(),e.nextTick(()=>{dt(),bn()})},ro=()=>{b.disabled||!b.richText||v.value&&(Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re(),Dt(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Kt(),dt(),Ft()}))},Ol=()=>{b.disabled||!b.richText||v.value&&(Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re(),Dt(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Kt(),dt(),Ft()}))},io=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let a=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Kt=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=io(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},co=()=>{if(b.disabled||!b.richText||!v.value)return;Dt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Kt(),dt()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const d=r.tagName.toLowerCase();let u=c.querySelector(`:scope > ${d}`);u||(u=document.createElement(d),c.appendChild(u));const m=io(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Kt();const f=document.createRange();f.selectNodeContents(a),f.collapse(!1),o.removeAllRanges(),o.addRange(f),e.nextTick(()=>{dt(),Ft()})}else document.execCommand("indent",!1),e.nextTick(()=>{Kt(),dt(),Ft()})},Vo=()=>{if(b.disabled||!b.richText||!v.value)return;Dt(),v.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),a=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Kt(),dt()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const d=c.parentElement;if(d&&(d.tagName==="OL"||d.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),d.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Kt();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{dt(),Ft()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Kt(),dt(),Ft()})},gn=e.ref(null),Kn=e.ref(null),kl=e.ref({}),$n=e.ref(""),qn=e.ref(null),wn=e.ref("");e.ref("");const al=e.ref(null);e.ref("");const Sn=e.ref([]),Zl=e.ref(!1),Bl=e.ref(!1),No=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},uo=()=>{if(b.disabled||!b.richText||!v.value)return;if(gn.value!==null){gn.value=null,$n.value="",wn.value="",al.value=null,Sn.value=[],hl(!0);return}Dt(),v.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!el(l))return;wn.value=No(l)||"",al.value=ft();const a=l.getBoundingClientRect(),r=v.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);kl.value={top:`${m}px`,bottom:"auto"},gn.value=Date.now(),e.nextTick(()=>{if($n.value="",qn.value){const y=qn.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const f=r.querySelector(".dss-comment-overlay");if(f&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const M=r.getBoundingClientRect(),_=f.getBoundingClientRect(),N=y.getBoundingClientRect(),J=_.bottom-M.top,Y=N.top-M.top,$e=8;if(J>Y-$e){const ge=N.height;kl.value={bottom:`${ge+$e}px`,top:"auto"}}else kl.value={top:`${m}px`,bottom:"auto"}}}})},mo=()=>{if(!$n.value.trim())return;const o=$n.value.trim(),l=new Date,a={text:o,selectionText:wn.value,selectionRange:al.value,commentId:gn.value,user:b.commentUser||null,createdAt:l.toISOString()};Sn.value=[...Sn.value,a],Be("comment-submitted",a),Bo(a),al.value&&!Wl(al.value)&&So(gn.value,al.value),$n.value="",e.nextTick(()=>{if(qn.value){const r=qn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Dn("sendComment")})},po=(o,l)=>{if(!(!b.commentUser||!o.user||o.user.id!==b.commentUser.id)){if(Sn.value=Sn.value.filter((a,r)=>r!==l),gn.value!==null&&v.value){const a=String(gn.value),r=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Sn.value.length>0){const c=[],d=new Set;Sn.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(Sn.value.length))}else r&&Sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Be("comment-deleted",{comment:o,index:l,commentId:gn.value}),b.comments&&Array.isArray(b.comments)){const a=b.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Be("update:comments",a)}e.nextTick(()=>{Dn("deleteComment")})}},Wl=o=>{if(!o||!v.value)return!1;try{const l=ql(o);if(!l)return!1;const a=l.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ql=o=>{if(!o||!v.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return v.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[v.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(l.setStart(c,o.start-a),d=!0),d&&o.end>=a&&o.end<=m&&(l.setEnd(c,o.end-a),u=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},So=(o,l)=>{if(!(!o||!l||!v.value))try{const a=ql(l);if(!a||a.collapsed)return;const r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const m=c.closest("[data-comment], [data-fake-comment]");if(m){m.getAttribute("data-comment")!==String(o)&&m.getAttribute("data-fake-comment")!==String(o)&&m.setAttribute("data-comment",String(o));return}}const d=document.createElement("span");d.setAttribute("data-comment",String(o));try{const m=a.startContainer,f=a.endContainer,y=a.startOffset,M=a.endOffset,_=m.nodeType===3?m.parentNode:m,N=f.nodeType===3?f.parentNode:f;if(_===N&&y===0&&M===(f.nodeType===3?f.length:N.childNodes.length)&&(_.tagName==="P"||_.tagName==="DIV"||_.tagName==="H1"||_.tagName==="H2"||_.tagName==="H3"||_.tagName==="H4"||_.tagName==="H5"||_.tagName==="H6")){const Y=a.extractContents();d.appendChild(Y),a.insertNode(d)}else a.surroundContents(d)}catch{const f=a.extractContents();d.appendChild(f),a.insertNode(d)}const u=v.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Dn("wrapSelectionWithCommentMarker"),dt()})}catch{}},Bo=o=>{if(!o||!o.commentId)return;const l=Array.isArray(b.comments)?[...b.comments]:[],a=typeof o.commentId=="string"&&o.commentId.startsWith("comment-")?Date.now():Number(o.commentId)||o.commentId;let r=l.findIndex(d=>typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)===Number(a)||d.conversation_id===a);const c={text:o.text,user:o.user,createdAt:o.createdAt,created_at:o.createdAt,updated_at:o.createdAt};if(r>=0){const d=l[r];if(d.conversation||(d.conversation=[]),d.conversation.push(c),d.updated_at=o.createdAt,!d.article_id&&l.length>0){const u=l.find(m=>m.article_id);u&&(d.article_id=u.article_id)}}else{const d=o.selectionRange,u=l.length>0&&l.find(f=>f.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Zl.value=!0,Be("update:comments",l)},Ul=(o,l=[])=>{if(b.disabled||!b.richText||!v.value)return;const a=v.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;Dt(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),wn.value=r.innerHTML||"",al.value=ft();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const M=m.getBoundingClientRect(),_=u.bottom-M.top,J=Math.max(_+8,0);kl.value={top:`${J}px`,bottom:"auto"}}const f=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(f&&b.comments&&Array.isArray(b.comments)){const M=b.comments.find(_=>String(_.conversation_id)===String(f));if(M&&M.conversation&&Array.isArray(M.conversation)){const _=M.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:M.id||M.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));y.push(..._)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((M,_)=>{const N=$e=>{if(!$e)return 0;const ge=new Date($e).getTime();return isNaN(ge)?0:ge},J=N(M.createdAt),Y=N(_.createdAt);return J===Y?0:J-Y}),Sn.value=y,hl(!0),gn.value=f||null,r&&(Kn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if($n.value="",qn.value){const M=qn.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const _=m.querySelector(".dss-text-editor-footer");if(_){const N=m.getBoundingClientRect(),J=M.getBoundingClientRect(),Y=_.getBoundingClientRect(),$e=J.bottom-N.top,ge=Y.top-N.top,ut=8;if($e>ge-ut){const an=Y.height;kl.value={bottom:`${an+ut}px`,top:"auto"}}}}}Dn("openCommentOverlayForSelector")})},Xl=e.ref(null),Hl=e.ref(0),xn=o=>{if(!(b.disabled||!b.richText)){if(o.key==="Escape"){const l=window.getSelection();if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{oo()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const d=c.closest(".dss-image-wrapper");if(d){const u=d.querySelector("img");if(c!==u&&!u?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,f=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(f)&&f!==u){o.preventDefault();const y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const f=c.contains(u)||u===c,y=c.contains(m)||m===c,_=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!f||!y||_.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{dt()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Vo():co();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);if(a.collapsed){const u=a.startContainer,m=f=>{if(!f)return!1;let y=f.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const M=f.parentElement;return M&&M!==v.value?m(M):!1};if(u.nodeType===3){const f=u.parentElement;if(f&&(m(f)||m(u))){const y=f.closest("p, div");if(y&&y!==v.value){o.preventDefault(),o.stopPropagation();let M=null;const _=a.startOffset;_<u.length&&(M=u.splitText(_));const N=document.createElement("p");if(M?N.appendChild(M):N.innerHTML="<br>",u.length===0){const Y=u.parentElement;Y&&(Y.removeChild(u),Y.childNodes.length===0&&Y.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(N,y.nextSibling):y.parentNode.appendChild(N);const J=document.createRange();M?J.setStart(M,0):J.setStart(N,0),J.collapse(!0),l.removeAllRanges(),l.addRange(J),e.nextTick(()=>{dt()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&v.value&&v.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=Y=>{if(!Y)return!1;const $e=Y.textContent||"",ut=(Y.innerHTML||"").trim(),an=ut.replace(/<br\s*\/?>/gi,"").trim();return $e.trim()===""||ut===""||an===""||ut==="<br>"||ut==="<br/>"||ut==="<p></p>"||ut==="<p><br></p>"||ut==="<p><br/></p>"||ut==="<p> </p>"||ut==="<p><br> </p>"||ut==="<div></div>"||ut==="<div><br></div>"||ut==="<div><br/></div>"},f=c.lastChild,y=f&&f.nodeType===1&&f.tagName==="BR",M=a.startContainer,_=M.nodeType===3?M.parentElement:M,N=_===c||_&&_.parentElement===c;if(u&&m(u)||y&&N){o.preventDefault(),setTimeout(()=>{oo()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-Hl.value;if(Xl.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),d=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(d){const u=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((d.textContent||"").indexOf(u.trim())<=10||u.trim().length<=2){o.preventDefault(),co();return}}}}Xl.value=" ",Hl.value=l}else Xl.value=o.key}},z=o=>{if(b.disabled||!b.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),a=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),Re();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const f=new DOMParser().parseFromString(u,"text/html");let y=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(_=>{if(y>0){const N=f.createElement("p");N.innerHTML=_.innerHTML,_.parentNode.replaceChild(N,_)}else y++}),c){const _=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(f.body.children).filter(J=>_.includes(J.tagName));if(N.length===1){const J=N[0].tagName,Y=c.tagName,$e=c.textContent.trim()===""&&!c.querySelector("img");let ge=!1;if(["H1","H2","H3","H4","H5","H6"].includes(Y)?ge=!0:$e||(J===Y||J==="P")&&(ge=!0),ge)return N[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=d(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);dt()},sn=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&Dt()}if(Ze.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=v.value&&a.closest(".dss-text-editor-content");!r&&!c&&zn()}if(Mt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&fo()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(_e.value=null),!v.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);yt.value=!r.collapsed&&el(r)}else yt.value=!1}if(gn.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,f=o.clientY;r=m>=u.left&&m<=u.right&&f>=u.top&&f<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(gn.value=null,$n.value="",wn.value="",al.value=null,Sn.value=[],hl(!0))}},Tn=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),rt.value&&(clearTimeout(rt.value),rt.value=null),_e.value=l},rn=o=>{const l=o.relatedTarget;if(l){const a=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}rt.value&&clearTimeout(rt.value),rt.value=setTimeout(()=>{_e.value=null,rt.value=null},150)},Gn=o=>{_e.value=null};let Zt=0;const ln=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.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-${++Zt}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let f=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),f=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),f=d),f&&(f.setAttribute("data-submenu-id",m),f.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?f.dataset.originalParentRef="inside":f.dataset.originalParentRef="sibling",Array.from(f.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},Qn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{ln(l),l.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=f=>{const y=c.getAttribute("data-submenu-id");y&&Tn(f,y)},m=rn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=y=>{const M=c.getAttribute("data-submenu-id");M&&Tn(y,M)},m=rn;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",Gn)})})})};let Ln=null;const Et=()=>{if(_e.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${_e.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${_e.value}"]`);o&&l&&Rl(o,l)}if(Ze.value&&Ft(),b.richText){if(Ln!==null)return;Ln=setTimeout(()=>{Ln=null,Dn("handleWindowResize")},150)}},Vt=()=>{if(!b.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(l=>{Array.from(l.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},gt=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(a=>{a.addEventListener("selectstart",l),a.addEventListener("mousedown",l),a.addEventListener("dragstart",l),a.addEventListener("contextmenu",l),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Me.value?kn():Cl(),le.value?ml():jn()})}),e.nextTick(()=>{gt()}),b.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",sn),window.addEventListener("resize",Et);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,Et()},150))};window.addEventListener("scroll",l,!0),v.value._windowScrollHandler=l,v.value._windowScrollTimeout=o,v.value.closest(".editor-with-comments"),v.value.closest(".dss-text-editor-content-wrapper");const a=v.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Et()},150))};a&&(a.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Qn(),Vt()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!b.disabled&&m.preventDefault();const M=f.closest(".dss-image-no-alt-icon"),_=f.closest(".dss-image-wrapper");if(M||_&&f===_){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),J=document.createRange();J.setStartAfter(_),J.collapse(!0),N.removeAllRanges(),N.addRange(J)}else _&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const Y=N.getRangeAt(0).commonAncestorContainer,$e=Y.nodeType===3?Y.parentElement:Y;if(_.contains($e)&&$e!==_.querySelector("img")){const ge=document.createRange();ge.setStartAfter(_),ge.collapse(!0),N.removeAllRanges(),N.addRange(ge)}}else{const J=document.createRange();J.setStartAfter(_),J.collapse(!0),N.addRange(J)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,y=f.closest(".dss-image-no-alt-icon"),M=f.closest(".dss-image-wrapper");if(y||M&&f.tagName!=="IMG"){m.preventDefault();const _=window.getSelection(),N=document.createRange();M&&(N.setStartAfter(M),N.collapse(!0),_.removeAllRanges(),_.addRange(N))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const _=y.getAttribute("alt")||y.alt||"";if(_){const N=y.getAttribute("src")||y.src||"",J=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),Y=_===N||_===J;(_.startsWith("http://")||_.startsWith("https://")||_.startsWith("data:")||Y||Y)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),K()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,y=f.tagName==="IMG"?f:f.closest("img"),M=y?.closest(".dss-image-wrapper");y&&v.value.contains(y)&&(Xe.value=M||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{Xe.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{Xe.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!Xe.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=Xe.value,y=f.classList?.contains("dss-image-wrapper"),M=y?f.querySelector("img"):f,_=y?f:M?.closest(".dss-image-wrapper");if(!M||!v.value.contains(M)){Xe.value=null;return}let N=null;const J=m.clientX,Y=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(J,Y);else{const Pt=window.getSelection();Pt.rangeCount>0?N=Pt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(v.value),N.collapse(!1))}if(!N){Xe.value=null;return}const $e=N.commonAncestorContainer,ge=$e.nodeType===3?$e.parentElement:$e;if(ge?.closest(".dss-image-wrapper")===_||_&&_.contains(ge)){Xe.value=null;return}if(_&&(ge===_||_.contains(ge))){Xe.value=null;return}const an=M.getAttribute("src");let Gt=null;_?Gt=_.cloneNode(!0):Gt=M.cloneNode(!0);try{let Pt=N.startContainer;if(Pt.nodeType===3&&(Pt=Pt.parentElement),_&&(Pt===_||_.contains(Pt))){const zt=document.createRange();zt.setStartAfter(_),zt.collapse(!0),N=zt}N.insertNode(Gt);const Qt=document.createRange();Qt.setStartAfter(Gt),Qt.collapse(!0);const Jt=window.getSelection();Jt.removeAllRanges(),Jt.addRange(Qt)}catch{if(v.value.childNodes.length===0){const Qt=document.createElement("p");Qt.appendChild(Gt),v.value.appendChild(Qt)}else{const Qt=v.value.lastChild;if(Qt&&Qt.nodeType===1)Qt.appendChild(Gt);else{const Jt=document.createElement("p");Jt.appendChild(Gt),v.value.appendChild(Jt)}}}_?_.remove():M.remove(),Xe.value=null,e.nextTick(()=>{const Pt=v.value.querySelectorAll("img");let Qt=!1;Pt.forEach(Jt=>{if(Jt.getAttribute("src")===an)if(!Qt)Qt=!0;else{const zt=Jt.closest(".dss-image-wrapper");zt?zt.remove():Jt.remove()}}),K(),dt()})}),v.value.addEventListener("dragend",m=>{Xe.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const M=y.querySelectorAll&&y.querySelectorAll("img");M&&M.forEach(_=>{_.removeAttribute("alt"),_.removeAttribute("data-alt"),_.setAttribute("alt",""),_.setAttribute("data-alt",""),_.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{K(),Vt(),d=null},100)});if(u.observe(v.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const f=new MutationObserver(()=>{e.nextTick(()=>{Vt()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),b.modelValue){const m=In(b.modelValue);v.value.innerHTML=m,tt()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=b.title||"",y=b.description||"";U.value=m,j.value=f,ne.value=y,x.value=f,k.value=y,Kt(),K(),O(),Jn(),_l(),Dl()}),bn(),Hn(),v.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",sn),window.removeEventListener("resize",Et),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),Ln!==null&&(clearTimeout(Ln),Ln=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),de.value&&clearTimeout(de.value),rt.value&&clearTimeout(rt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Ye.value&&Ye.value.disconnect(),Cn.value!==null&&(cancelAnimationFrame(Cn.value),Cn.value=null),Yn.value!==null&&(clearTimeout(Yn.value),Yn.value=null),un.value!==null&&(clearTimeout(un.value),un.value=null),hl(!0),v.value&&v.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=v.value._scrollHandlers;l&&l.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const Ut=o=>{const l=o.target,a=l.closest("a");if(a&&!b.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=l.closest(".dss-image-wrapper");r&&l.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const u=c.getRangeAt(0).commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(r.contains(m)&&m!==r.querySelector("img")){const f=document.createRange();f.setStartAfter(r),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}K(),bn(),Hn(),Ft(),Jn()}):e.nextTick(()=>{K(),bn(),Hn(),Ft(),Jn()})},vo=()=>{Pe();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);yt.value=!a.collapsed&&el(a),!a.collapsed&&nt.value&&(nt.value=null)}else yt.value=!1;if(K(),bn(),Hn(),Ft(),Jn(),o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){o.removeAllRanges(),yt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const f=window.getComputedStyle(u);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}Le.value[a]=m}else{const d=document.queryCommandState(a);Le.value[a]=d}}}catch{}})},Jn=()=>{if(!b.richText||b.disabled||!v.value){Je.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){Je.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!v.value.contains(r)){Je.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){Je.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?Je.value=d:Je.value="p"}catch{Je.value="p"}},Hn=()=>{if(!v.value){Lt.value=!1;return}try{const o=window.getSelection();let l=!1;if(o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");l=!!(c&&v.value.contains(c))}Lt.value=l}catch{Lt.value=!1}},el=o=>{if(!o||!v.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?v.value.contains(a):!1},zn=()=>{Ze.value=!1},Ft=()=>{if(!b.floatingToolbar||!b.richText||b.disabled){Ze.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){Ze.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!el(l)){Ze.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){Ze.value=!1;return}const r=v.value;if(!r){Ze.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){Ze.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let f=a.left+a.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let M=0;ze.value&&(M=ze.value.getBoundingClientRect().width);const _=(M||320)/2;let N=c.left+_,J=c.right-_;if(J<N){const Y=c.left+c.width/2;N=Y,J=Y}if(y>0){const Y=_+u,$e=y-_-u;if(N=Math.max(N,Y),J=Math.min(J,$e),J<N){const ge=y/2;N=ge,J=ge}}f<N?f=N:f>J&&(f=J),wt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},Ze.value=!0},Ml=o=>{b.disabled||!b.richText||(Mt.value=Mt.value===o?null:o,o==="askAi"&&(ue.value=null))},fo=()=>{Mt.value=null,_e.value=null},sl=o=>{qt(o),fo()};let vl=null,An=null,rl=null,En=null;const Mo=o=>{if(b.disabled||!b.richText){tl(),bl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(vl&&(clearTimeout(vl),vl=null),rl&&(clearTimeout(rl),rl=null),a&&a!==An){bl(),An=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Te.value=a,te.value=c,ae.value=!0,H.value=!0,go(a)}else!a&&An?(An=null,vl=setTimeout(()=>{H.value||tl()},150)):a&&a===An&&go(a);if(r&&r!==En){tl(),En=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let d=r.getAttribute("data-alt");d===null&&(d=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",d),pt.value=r,St.value=c.trim()||A("textEditor.image.noAlt"),xt.value=!0,Q.value=!0,ho(r)}else!r&&En?(En=null,rl=setTimeout(()=>{Q.value||bl()},150)):r&&r===En&&ho(r)},_o=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(An=null,En=null,vl&&(clearTimeout(vl),vl=null),rl&&(clearTimeout(rl),rl=null),tl(),bl())},tl=()=>{H.value=!1,setTimeout(()=>{H.value||(ae.value=!1,te.value="",Ve.value||(Te.value=null))},100)},go=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;oe.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},bl=()=>{Q.value=!1,setTimeout(()=>{Q.value||(xt.value=!1,St.value="",at.value||(pt.value=null))},100)},ho=o=>{if(!o||!v.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;jt.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},yo=()=>{if(!te.value||!Te.value)return;let l=Te.value.getAttribute("href")||te.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Co=()=>{if(Te.value){const o=Te.value.textContent||"",l=Te.value.getAttribute("href")||"",a=Te.value;Ae.value=l,Oe.value=o,Ue.value=o,H.value=!1,ae.value=!1,te.value="",Te.value=a,Ve.value=!0}else if(Ce.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")||"";Ae.value=d,Oe.value=c,Ue.value=c,Te.value=r,Ve.value=!0}}}else{Bt.value=ft();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ae.value="",Oe.value=l,Ue.value="",Te.value=null,Ve.value=!0}e.nextTick(()=>{mt.value&&(mt.value.focus(),mt.value.select())})},Al=()=>{Ve.value=!1,Ae.value="",Oe.value="",Ue.value="",Te.value=null,Bt.value=null},Yl=()=>{if(!Ae.value.trim()){Al();return}if(Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re(),Oe.value.trim()||(Oe.value=Ae.value.trim()),Te.value&&v.value&&v.value.contains(Te.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Te.value;if(l.setAttribute("href",Ae.value.trim()),Oe.value.trim()!==Ue.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=Oe.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(l),a.collapse(!1),o.removeAllRanges(),o.addRange(a),dt()}else if(v.value){v.value.focus();const o=window.getSelection();o.removeAllRanges(),Bt.value&&pe(Bt.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ae.value.trim(),a.textContent=Oe.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",l.deleteContents(),l.insertNode(a);const r=document.createTextNode(" ");l.setStartAfter(a),l.insertNode(r),l.setStartAfter(r),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}else{l||(l=document.createRange(),l.selectNodeContents(v.value),l.collapse(!1));const a=l.startContainer,r=a.nodeType===3,c=r&&l.startOffset===a.textContent.length,d=document.createElement("a");if(d.href=Ae.value.trim(),d.textContent=Oe.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==v.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const f=document.createTextNode(" ");m.appendChild(f);const y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=a.textContent.substring(0,l.startOffset),M=y[y.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
102
102
|
`){const _=document.createTextNode(" ");l.insertNode(_),l.setStartAfter(_)}}l.insertNode(d);const f=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(f),l.setStartAfter(f),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),f=m[m.length-1];if(f&&f!==" "&&f!==" "&&f!==`
|
|
103
|
-
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}mt()}e.nextTick(()=>{bn(),Al()})},Pn=()=>{if(!p.value||pe.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=ft());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],y=f.textContent;a.lastIndex=0;const M=[...y.matchAll(a)];if(M.length===0)continue;const _=M.filter(Y=>{const _e=Y[0],fe=Y.index;if(fe>0&&y[fe-1]==="@"||fe+_e.length<y.length&&y[fe+_e.length]==="@")return!1;const ct=f.parentElement;return!(ct&&ct.closest("a"))});if(_.length===0)continue;if(_.length===1&&_[0][0]===y.trim()){const Y=_[0][0],_e=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,fe=document.createElement("a");fe.href=_e,fe.textContent=Y,fe.style.color="#60afdf",fe.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(fe,f),u=!0);continue}let N=0;const Q=document.createDocumentFragment();if(_.forEach(Y=>{const _e=Y.index,fe=Y[0];if(_e>N){const Kt=y.substring(N,_e);Kt&&Q.appendChild(document.createTextNode(Kt))}const ct=fe.startsWith("http://")||fe.startsWith("https://")?fe:`https://${fe}`,on=document.createElement("a");on.href=ct,on.textContent=fe,on.style.color="#60afdf",on.style.textDecoration="underline",Q.appendChild(on),N=_e+fe.length}),N<y.length){const Y=y.substring(N);Y&&Q.appendChild(document.createTextNode(Y))}f.parentNode&&Q.childNodes.length>0&&(f.parentNode.replaceChild(Q,f),u=!0)}u&&l&&e.nextTick(()=>{de(l),bn()})},fl=()=>{if(!p.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(p.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const y=document.createDocumentFragment();m.forEach(M=>{const _=M.index,N=M[0].startsWith("<u>")?"u":"ins",Q=M[1]||M[2]||"";_>f&&y.appendChild(document.createTextNode(u.substring(f,_)));const Y=document.createElement(N);Y.textContent=Q,y.appendChild(Y),f=_+M[0].length}),f<u.length&&y.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},nl=o=>{if(!p.value||pe.value)return;if(!o){fl();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===p.value||!p.value.contains(c))return;const d=()=>{let Kt="",Ot=0,Gt=!1;const Qt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Un=>Un.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Pt=0;for(;Qt.nextNode();){const Un=Qt.currentNode,cl=Un.textContent||"",Xn=Pt;if(Pt+=cl.length,Un===r.startContainer){Kt+=cl.substring(0,r.startOffset),Ot=Xn+r.startOffset,Gt=!0;break}Kt+=cl}return Gt||(Ot=Kt.length),{textBeforeCursor:Kt,cursorCharOffset:Ot}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],M=m[1],_=u.length-y.length,Q=(Kt=>{let Ot=0;const Gt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Pt=>Pt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Qt;for(;Qt=Gt.nextNode();){const Pt=(Qt.textContent||"").length;if(Ot+Pt>=Kt)return{node:Qt,offset:Kt-Ot};Ot+=Pt}return null})(_);if(!Q)return;const Y=document.createRange();Y.setStart(Q.node,Q.offset),Y.setEnd(r.endContainer,r.endOffset);const _e=document.createElement(f);_e.textContent=M,Y.deleteContents(),Y.insertNode(_e);const fe=window.getSelection(),ct=document.createRange();ct.setStartAfter(_e),ct.collapse(!0),fe.removeAllRanges(),fe.addRange(ct);const on=ft();e.nextTick(()=>{mt(),on&&de(on)})},zt=()=>{p.value&&(Bt.value=ft(),Vt.value="",Mt.value="",ye.value="",nt.value="",ze.value="",an.value=null,vt.value=null,he.value="upload",at.value=!0,Rt(),e.nextTick(()=>{At.value&&At.value.focus(),Tt.value&&(Tt.value.value="")}))},ko=o=>{const l=o.target?.files?.[0];if(!l){an.value=null,Mt.value="";return}an.value=l;const a=new FileReader;a.onload=r=>{Mt.value=r.target?.result||""},a.readAsDataURL(l)},qt=()=>{Tt.value&&Tt.value.click()},ln=()=>{nt.value&&(ze.value="")},bo=()=>{ze.value&&(nt.value="")},$o=()=>{let o=vt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";vt.value=o,Vt.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(ye.value=a,Mt.value="",he.value="url"):(Mt.value=a,ye.value="",he.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";nt.value=c.endsWith("px")?c.replace("px",""):c,ze.value=d.endsWith("px")?d.replace("px",""):d,Bt.value=null}else{zt();return}at.value=!0,Ve.value=!1,Ct.value=!1,e.nextTick(()=>{he.value==="url"&&sn.value?(sn.value.focus(),sn.value.select()):At.value&&(At.value.focus(),At.value.select()),Tt.value&&(Tt.value.value="")})},gl=()=>{at.value=!1,Vt.value="",Mt.value="",ye.value="",nt.value="",ze.value="",an.value=null,vt.value=null,Bt.value=null,he.value="upload"},il=()=>{const o=(Vt.value||"").trim(),l=p.value?._mutationObserver;l&&l.disconnect(),je.value?(ve.value&&(clearTimeout(ve.value),ve.value=null),Ae(),je.value=!1):Ae();const a=he.value==="url"?ye.value.trim():Mt.value;if(vt.value&&p.value&&p.value.contains(vt.value)){a&&(vt.value.src=a),vt.value.setAttribute("alt",o),vt.value.setAttribute("data-alt",o),nt.value?(vt.value.style.width=`${nt.value}px`,vt.value.setAttribute("width",nt.value)):(vt.value.style.removeProperty("width"),vt.value.removeAttribute("width")),ze.value?(vt.value.style.height=`${ze.value}px`,vt.value.setAttribute("height",ze.value)):(vt.value.style.removeProperty("height"),vt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(vt.value),c.collapse(!0),r.addRange(c)}mt()}else{if(!a){l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),gl();return}if(p.value){p.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Bt.value&&(de(Bt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&p.value){if(d=document.createRange(),p.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",p.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){gl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!p.value.contains(m)){if(d=document.createRange(),p.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",p.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(p.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=a,f.setAttribute("alt",o),f.setAttribute("data-alt",o),nt.value&&(f.style.width=`${nt.value}px`,f.setAttribute("width",nt.value)),ze.value&&(f.style.height=`${ze.value}px`,f.setAttribute("height",ze.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(p.value){if(p.value.childNodes.length===0){const _=document.createElement("p");p.value.appendChild(_),_.appendChild(f)}else{const _=p.value.lastChild;if(_&&_.nodeType===1)_.appendChild(f);else{const N=document.createElement("p");p.value.appendChild(N),N.appendChild(f)}}const M=document.createRange();M.setStartAfter(f),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}vt.value=f,mt()}}e.nextTick(()=>{l&&p.value&&l.observe(p.value,{childList:!0,subtree:!0}),bn(),It(),gl()})};e.watch(()=>b.modelValue,o=>{if(b.richText&&p.value&&!pe.value){const l=In(o||""),r=p.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=ft();p.value.innerHTML=l,e.nextTick(()=>{Qe();const u=p.value.innerHTML||"",m=b.title||"",f=b.description||"";U.value=u,K.value=m,ae.value=f,W.value=u,x.value=m,k.value=f,Le.value=[],dt.value=[],ve.value&&(clearTimeout(ve.value),ve.value=null),je.value=!1,d&&de(d),jt(),j(),Z(),bn(),It(),Jn(),Dn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>b.richText,o=>{o?(It(),e.nextTick(()=>{_l()})):(zn(),ht.value=[],Ye.value&&(Ye.value.disconnect(),Ye.value=null)),Jn()}),e.watch(()=>b.floatingToolbar,o=>{o?It():zn()}),e.watch(()=>b.disabled,o=>{o&&zn(),Jn()}),e.watch(()=>b.description,()=>{e.nextTick(()=>{te.value?ml():jn()})}),e.watch(()=>b.title,()=>{e.nextTick(()=>{Me.value?kn():Cl()})}),e.watch(()=>b.customToolbarSlots,()=>{e.nextTick(()=>{St()})},{deep:!0}),e.watch(()=>b.comments,(o,l)=>{if(Zl.value){Zl.value=!1;return}Bl.value||b.richText&&p.value&&e.nextTick(()=>{Dl()})},{deep:!0,immediate:!1});const Dl=()=>{if(!Bl.value&&!(!b.comments||!Array.isArray(b.comments)||b.comments.length===0)&&!(!b.richText||!p.value)){Bl.value=!0;try{const o=new Set,l=b.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=p.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const f=String(m);if(d.has(f))return;const y=p.value.querySelector(`[data-comment="${f}"]`);if(y){wl(y,u),d.add(f);return}try{const M=Kl(u.selection_range,u.selection_text);if(M&&!M.collapsed){const _=M.commonAncestorContainer,N=_.nodeType===3?_.parentElement:_;if(N){const _e=N.closest("[data-comment], [data-fake-comment]");if(_e){const fe=_e.getAttribute("data-comment")||_e.getAttribute("data-fake-comment");if(String(fe)===String(m)){_e.setAttribute("data-comment",f),_e.removeAttribute("data-fake-comment"),wl(_e,u),d.add(f);return}else return}}const Q=p.value.querySelector(`[data-comment="${f}"]`);if(Q){wl(Q,u),d.add(f);return}const Y=document.createElement("span");Y.setAttribute("data-comment",f),wl(Y,u);try{M.surroundContents(Y),c++,d.add(f)}catch{try{const fe=document.createRange();fe.setStart(M.startContainer,M.startOffset),fe.setEnd(M.endContainer,M.endOffset),Ft(fe),fe.surroundContents(Y),c++,d.add(f)}catch{try{const ct=M.extractContents();Y.appendChild(ct),M.insertNode(Y),c++,d.add(f)}catch(ct){console.warn("Failed to create comment marker:",ct)}}}}}catch{}}),e.nextTick(()=>{Dn("restoreCommentsFromModel"),mt(),Bl.value=!1})}catch{Bl.value=!1}}},Ft=o=>{if(!o||!p.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!To(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!jl(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},To=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},jl=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Kl=(o,l)=>{if(!o||!p.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[p.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Ft(a):null}}catch{return null}return null},wl=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Dn=(o="unknown")=>{if(!b.richText||!p.value){ht.value=[];return}Date.now()-Dt.value<Zn&&Cn.value!==null||Cn.value===null&&(Cn.value=requestAnimationFrame(()=>{if(Cn.value=null,Dt.value=Date.now(),Rn.value)return;Rn.value=!0;const a={},r=p.value;if(!r){Rn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Rn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");Q&&N.tagName==="SPAN"&&(m.has(Q)||(u.push(N),m.add(Q)))}),d.forEach(N=>{const Q=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!Q||m.has(Q)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${Q}"], span[data-fake-comment="${Q}"]`)||(u.push(N),m.add(Q)):N.tagName!=="SPAN"&&(u.push(N),m.add(Q)))});const f=c.getBoundingClientRect(),y=r.getBoundingClientRect();u.forEach((N,Q)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const it=N.textContent?.trim(),On=b.comments?.find(Jt=>(typeof Jt.conversation_id=="string"&&Jt.conversation_id.startsWith("comment-")?null:Jt.conversation_id)&&Jt.selection_text?.trim()===it);On?(Y=String(On.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const _e=N.getBoundingClientRect(),fe=window.getComputedStyle(N),ct=parseFloat(fe.lineHeight)||parseFloat(fe.fontSize)*1.2,Ot=_e.top-y.top+ct/2-15,Qt=y.top-f.top+Ot;let Pt=null,Un=null,cl=0;const Xn=[],xo=new Set;if(Y&&b.comments){const it=b.comments.find(On=>String(On.conversation_id||On.id)===String(Y));if(it){const On=it.conversation||[];On.length>0?(On.forEach(Jt=>{Jt.user&&Jt.user.id&&!xo.has(Jt.user.id)&&(xo.add(Jt.user.id),Xn.push(Jt.user))}),cl=On.length):(cl=0,Pt=null,Un=null),Xn.length>0?Pt=Xn[0]:Pt=null,Xn.length>1?Un=Xn[1]:Un=null}}const ll=_e.top+ct/2-15,Ql=ll+30,$l=5,xl=Ql>y.top+$l&&ll<y.bottom-$l?1:0;ht.value.find(it=>it.id===Y);let ul=N;if(!ul&&Y&&p.value){const it=String(Y);ul=p.value.querySelector(`[data-comment="${it}"], [data-fake-comment="${it}"]`)}const El=Xn.length;a[Y]?(a[Y].top=Qt,a[Y].opacity=xl,a[Y].element=ul,a[Y].firstUser=Pt,a[Y].secondUser=Un,a[Y].totalCount=cl,a[Y].uniqueUserCount=El):a[Y]={id:Y,top:Qt,opacity:xl,element:ul,firstUser:Pt,secondUser:Un,totalCount:cl,uniqueUserCount:El}});const M=Object.values(a).map(N=>{const Q=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&p.value){const _e=String(N.id);N.element=p.value.querySelector(`[data-comment="${_e}"], [data-fake-comment="${_e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:Q}});(ht.value.length!==M.length||M.some((N,Q)=>{const Y=ht.value[Q];if(!Y)return!0;const _e=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),fe=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||_e||fe||Y.element!==N.element}))&&(ht.value=M),Rn.value=!1}))},wo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&p.value){const a=String(o.id);l=p.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(hl(),Kn.value=l,l.classList.add("editor-comment-highlighted"))},hl=(o=!1)=>{!o&&gn.value!==null&&Kn.value&&(Kn.value.getAttribute("data-comment")||Kn.value.getAttribute("data-fake-comment"))===gn.value||(p.value&&p.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kn.value&&(Kn.value.classList.remove("editor-comment-highlighted"),Kn.value=null))},Gl=o=>{if(!o||!o.element)return;hl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Be("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},Lo=()=>{hl()},_l=()=>{!b.richText||!p.value||(Ye.value&&Ye.value.disconnect(),un.value!==null&&(clearTimeout(un.value),un.value=null),Ye.value=new MutationObserver(()=>{un.value===null&&(un.value=setTimeout(()=>{un.value=null,e.nextTick(()=>{Dn("MutationObserver")})},200))}),Ye.value.observe(p.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Dn("setupCommentMarkersObserver-initial"))},Rl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=a.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>lt.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(()=>{Rl(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(()=>[me.value,$t.value],()=>{me.value==="askAi"||$t.value==="askAi"?e.nextTick(()=>{Qn()}):(lt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>b.locale,o=>{o&&o!==Se.value&&(Se.value=o)},{immediate:!0}),be({openCommentOverlayForSelector:Ul,updateCommentMarkers:Dn,restoreCommentsFromModel:Dl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Bn.value]),style:e.normalizeStyle(dn.value)},[R.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",jc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:h,title:e.unref(A)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:C,title:e.unref(A)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Gc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Qc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>fn("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[Ke.value==="h1"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h2"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h3"?(e.openBlock(),e.createElementBlock("svg",nu,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h4"?(e.openBlock(),e.createElementBlock("svg",lu,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ou,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h6"?(e.openBlock(),e.createElementBlock("svg",au,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",su,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Jc),me.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>Ut("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>Ut("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>Ut("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>Ut("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>Ut("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>Ut("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>Ut("<p>"))},[l[61]||(l[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("bold")}]),onClick:l[9]||(l[9]=a=>Ge("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("italic")}]),onClick:l[10]||(l[10]=a=>Ge("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("underline")}]),onClick:l[11]||(l[11]=a=>Ge("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht.value}]),onClick:lo,title:e.unref(A)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,uu),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:so,title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,mu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ao,title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,du)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("insertUnorderedList")}]),onClick:ro,title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("insertOrderedList")}]),onClick:Ol,title:e.unref(A)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,vu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:zt,title:e.unref(A)("textEditor.toolbar.image")},[...l[70]||(l[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,fu),yt.value?(e.openBlock(),e.createElementBlock("div",gu)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:uo},[...l[71]||(l[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,hu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",yu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>fn("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[l[72]||(l[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",bu,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,ku),me.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[st(a)?(e.openBlock(),e.createElementBlock("div",xu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),st(a)&&r<R.customToolbarSlots.length-1&&mn(r)?(e.openBlock(),e.createElementBlock("div",Eu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(me.value==="paragraph"||me.value==="askAi")&&R.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Rt})):e.createCommentVNode("",!0),e.createVNode(Do,{showModal:Fe.value,width:"500px",height:"55vh",onCloseModal:Al},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Vu,[e.createElementVNode("div",Nu,[e.createElementVNode("label",Su,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:O,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>Oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Yl,["enter"])},null,40,Bu),[[e.vModelText,Oe.value]])]),e.createElementVNode("div",Mu,[e.createElementVNode("label",_u,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:ut,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Re.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Yl,["enter"])},null,40,$u),[[e.vModelText,Re.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Al},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Yl},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Do,{showModal:at.value,width:"500px",height:"80vh",onCloseModal:gl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(vt.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Tu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":he.value==="upload"}]),onClick:l[17]||(l[17]=a=>he.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),l[77]||(l[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":he.value==="url"}]),onClick:l[18]||(l[18]=a=>he.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),he.value==="upload"?(e.openBlock(),e.createElementBlock("div",Lu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",Au,[Ne.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Du,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:qt},[e.createElementVNode("img",{src:Mt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ru),l[78]||(l[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Tt,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ko},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Tt,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ko},null,544))]),e.createElementVNode("div",Fu,[e.createElementVNode("label",Iu,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:At,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(il,["enter"])},null,40,zu),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",Pu,[e.createElementVNode("label",Ou,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>nt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:ln},null,40,Zu),[[e.vModelText,nt.value]])]),e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:bo},null,40,Uu),[[e.vModelText,ze.value]])])])])):e.createCommentVNode("",!0),he.value==="url"?(e.openBlock(),e.createElementBlock("div",Xu,[e.createElementVNode("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:sn,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>ye.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(il,["enter"])},null,40,Gu),[[e.vModelText,ye.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Vt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(il,["enter"])},null,40,ed),[[e.vModelText,Vt.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>nt.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:ln},null,40,ld),[[e.vModelText,nt.value]])]),e.createElementVNode("div",od,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:bo},null,40,sd),[[e.vModelText,ze.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:il},e.toDisplayString(e.unref(A)("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&&Me.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",rd,[Me.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",id,[R.title?(e.openBlock(),e.createElementBlock("span",cd,e.toDisplayString(R.title),1)):(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(tt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:R.title,onInput:Wn,onFocus:vn,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Me.value}]),placeholder:tt.value,disabled:R.disabled,rows:"1"},null,42,dd)])],2),hn.value&&Me.value?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":tn.value&&te.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",pd,[te.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vd,[R.description?(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(R.description),1)):(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(ot.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:R.description,onInput:zl,onFocus:pl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!te.value}]),placeholder:ot.value,disabled:R.disabled,rows:"1"},null,42,hd)])],2),tn.value&&te.value?(e.openBlock(),e.createElementBlock("div",yd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":gn.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>wo(a),onMouseleave:Lo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Gl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,bd)):(e.openBlock(),e.createElementBlock("span",wd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,kd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Gl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ed)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,xd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>Gl(a),["stop"])},[e.createElementVNode("span",Sd,"+"+e.toDisplayString(a.additionalCount),1)],12,Nd)):e.createCommentVNode("",!0)],46,Cd))),128)),R.richText?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",{ref_key:"editorRef",ref:p,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":R.disabled,"dss-text-editor-fixed-height":R.fixedHeight}]),style:e.normalizeStyle(Nn.value),onInput:mt,onBlur:Zt,onClick:Xt,onMouseup:vo,onKeyup:vo,onKeydown:xn,onPaste:z,onMousemove:Mo,onMouseleave:_o},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[gn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(kl.value)},[wn.value||Sn.value.length>0?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("div",Dd,[wn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:wn.value},null,8,Rd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sn.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",zd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Pd)):(e.openBlock(),e.createElementBlock("span",Od,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.createElementVNode("div",Wd,[e.createElementVNode("div",qd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Ud,e.toDisplayString(Tl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Nl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),b.commentUser&&a.user&&a.user.id===b.commentUser.id&&!Nl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>po(a,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,Xd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Yd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:qn,"onUpdate:modelValue":l[26]||(l[26]=a=>$n.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(mo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(qn.value){const a=qn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,jd),[[e.vModelText,$n.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(mo,["stop"])},[...l[81]||(l[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Kd,[e.createElementVNode("div",Gd,[e.createElementVNode("span",Qd,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Jd,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("textarea",{value:R.modelValue,onInput:yl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":R.fixedHeight}]),placeholder:qe.value,rows:R.rows,disabled:R.disabled,style:e.normalizeStyle(Mn.value)},null,46,Md),e.createElementVNode("div",_d,[e.createElementVNode("div",$d,[e.createElementVNode("span",Td,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Ld,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[oe.value&&ee.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(le.value),onMouseenter:l[28]||(l[28]=a=>L.value=!0),onMouseleave:tl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(yo,["stop"]),title:ee.value},e.toDisplayString(ee.value),9,e1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",n1,[...l[83]||(l[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Ct.value&&_t.value&&p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ne.value),onMouseenter:l[29]||(l[29]=a=>Ve.value=!0),onMouseleave:bl},[e.createElementVNode("div",l1,[_t.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",o1,[...l[84]||(l[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:_t.value},e.toDisplayString(_t.value),9,a1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($o,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",r1,[...l[85]||(l[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,s1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.floatingToolbar&&R.richText&&We.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ie,class:"dss-floating-toolbar",style:e.normalizeStyle(Et.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",i1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(h,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(C,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,u1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",d1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>Ml("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[Ke.value==="h1"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h2"?(e.openBlock(),e.createElementBlock("svg",v1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h3"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h4"?(e.openBlock(),e.createElementBlock("svg",g1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h5"?(e.openBlock(),e.createElementBlock("svg",h1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Ke.value==="h6"?(e.openBlock(),e.createElementBlock("svg",y1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",C1,[...l[94]||(l[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,m1),$t.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>sl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>sl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>sl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>sl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>sl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>sl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>sl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>Ge("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,k1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>Ge("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>Ge("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,w1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Ht.value}]),onClick:e.withModifiers(lo,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,x1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,V1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,E1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("insertUnorderedList")}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,N1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt("insertOrderedList")}]),onClick:e.withModifiers(Ol,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,S1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(zt,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...l[104]||(l[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,B1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(uo,["stop"])},[...l[105]||(l[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,M1),R.askAi?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>Ml("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[l[106]||(l[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",L1,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,T1),$t.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Fn.value?(e.openBlock(),e.createElementBlock("div",H1,[R.askAi&&Fn.value?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[st(a)&&pn(a)?(e.openBlock(),e.createElementBlock("div",D1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),st(a)&&pn(a)&&r<R.customToolbarSlots.length-1&&en(r)?(e.openBlock(),e.createElementBlock("div",R1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),z1={class:"dss-color-picker__section-title"},P1={class:"dss-color-picker__presets-row"},O1=["title","onClick"],Z1={key:1,class:"dss-color-picker__section"},W1={class:"dss-color-picker__presets-row"},q1=["title","onClick"],U1={class:"dss-color-picker__section"},X1={class:"dss-color-picker__section-header"},Y1={class:"dss-color-picker__presets-row"},j1=["title","onClick"],K1=["onClick"],G1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Q1=["title","onClick"],J1={class:"dss-color-picker__input-row"},em=["value"],tm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(R,{emit:be}){function I(U){const W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(U);if(!W)return{h:0,s:0,l:50};const K=parseInt(W[1],16)/255,ae=parseInt(W[2],16)/255,x=parseInt(W[3],16)/255,k=Math.max(K,ae,x),V=Math.min(K,ae,x);let P=0,X=0;const He=(k+V)/2;if(k!==V){const Xe=k-V;switch(X=He>.5?Xe/(2-k-V):Xe/(k+V),k){case K:P=((ae-x)/Xe+(ae<x?6:0))/6;break;case ae:P=((x-K)/Xe+2)/6;break;case x:P=((K-ae)/Xe+4)/6;break}}return{h:P*360,s:X*100,l:He*100}}function A(U,W,K){W/=100,K/=100;const ae=W*Math.min(K,1-K),x=k=>{const V=(k+U/30)%12,P=K-ae*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function Se(U){const W=U.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!W)return null;let K=W[1];return K.length===3&&(K=K.split("").map(ae=>ae+ae).join("")),"#"+K}function b(U,W,K){W/=100,K/=100;const ae=K+W*Math.min(K,1-K),x=ae===0?0:2-2*K/ae;return{h:U,s:x*100,v:ae*100}}function Be(U,W,K){W/=100,K/=100;const ae=K*(1-W/2),x=ae===0||ae===1?0:(K-ae)/Math.min(ae,1-ae);return{h:U,s:x*100,l:ae*100}}const ce=R,pt=be,p=e.ref(!1),me=e.ref(!1),Ce=e.ref(!1),pe=e.ref(-1),oe=e.ref(-1),ee=e.ref(null),le=e.ref(null),L=e.ref(null),Fe=e.ref(null),Re=e.ref({top:0,left:0}),Oe=e.ref(I(ce.modelValue||"#b8a5de")),ut=e.computed(()=>Array.isArray(ce.presetGroups)&&ce.presetGroups.length>0),O=e.computed(()=>ut.value?0:ce.initialPresetCount!=null?ce.initialPresetCount:oe.value<0?null:oe.value),Ze=e.computed(()=>{const U=O.value;return U==null?!0:Math.max(0,ce.presetColors.length-U)<ce.max}),xt=e.computed(()=>!!(me.value||pe.value>=0||!Je.value&&ce.presetColors.length===0));e.computed(()=>{const U=O.value;return U!=null&&ce.presetColors.length>U});const Je=e.computed(()=>ut.value||O.value!=null),Ht=e.computed(()=>{const U=O.value;return U==null?[]:ce.presetColors.slice(0,U)}),$e=e.computed(()=>{const U=O.value;return U==null?[]:ce.presetColors.slice(U)});function We(U){const W=O.value;return W!=null?W+U:-1}function Et(U){const W=O.value;return W!=null&&U>=W}function Ie(U){Et(U)&&(pe.value=U,Oe.value=I(ce.presetColors[U]),me.value=!0,e.nextTick(()=>Fe.value?.focus()))}function $t(U){if(!Et(U))return;const W=ce.presetColors.filter((x,k)=>k!==U);pt("update:presetColors",W);const K=Se(ce.modelValue),ae=Se(ce.presetColors[U]);if(K&&ae&&K.toLowerCase()===ae.toLowerCase()){const x=W[Math.max(0,U-1)]||W[0];x&&pt("update:modelValue",x)}}function at(){Ce.value=!Ce.value,Ce.value||(pe.value=-1,me.value=!1)}function Vt(){if(pe.value<0)return;const U=ze.value,W=Se(U);if(W){const K=[...ce.presetColors];K[pe.value]=W,pt("update:presetColors",K),pt("update:modelValue",W),pe.value=-1,me.value=!1}}function an(){ce.disabled||(pe.value=-1,me.value=!me.value,me.value&&(_t(),e.nextTick(()=>Fe.value?.focus())))}function Mt(U){const W=Se(U),K=Se(ce.modelValue);return W&&K&&W.toLowerCase()===K.toLowerCase()}function nt(){if(ce.disabled||!Ze.value)return;const U=ze.value,W=Se(U);if(W){const K=[...ce.presetColors,W];pt("update:presetColors",K),pt("update:modelValue",W);const ae=O.value??oe.value;ae>=0&&K.length-ae>=ce.max&&(me.value=!1)}}const ze=e.computed(()=>{const{h:U,s:W,l:K}=Oe.value;return A(U,W,K)}),At=e.computed(()=>ze.value.toLowerCase()),Tt=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Oe.value.h}, 100%, 50%))`})),sn=e.computed(()=>{const U=b(Oe.value.h,Oe.value.s,Oe.value.l);return{left:`${U.s}%`,bottom:`${U.v}%`,transform:"translate(-50%, 50%)"}}),vt=e.computed(()=>({left:`${Oe.value.h/360*100}%`,transform:"translateX(-50%)"})),Bt=e.computed(()=>({position:"fixed",left:`${Re.value.left}px`,top:`${Re.value.top}px`,zIndex:1002}));function Ct(){if(!ee.value||!p.value)return;const U=ee.value.getBoundingClientRect(),W=window.innerHeight||document.documentElement.clientHeight;let K=U.bottom+4;const ae=le.value;ae&&K+ae.offsetHeight>W-8&&(K=U.top-4-ae.offsetHeight),Re.value={top:K,left:U.left}}function _t(){const U=ce.modelValue||"#b8a5de";Se(U)&&(Oe.value=I(U))}function ne(){pt("update:modelValue",ze.value)}function Ve(){ce.disabled||(p.value=!p.value,p.value&&(_t(),e.nextTick(()=>{Ct(),Fe.value?.focus()})))}function he(){const U=ze.value,W=Se(U);if(W){if(pe.value>=0){const K=[...ce.presetColors];K[pe.value]=W,pt("update:presetColors",K),pt("update:modelValue",W)}else if((ce.presetColors.length>0||ut.value)&&me.value&&Ze.value&&!ce.presetColors.some(ae=>Se(ae)?.toLowerCase()===W.toLowerCase())){const ae=[...ce.presetColors,W];pt("update:presetColors",ae),pt("update:modelValue",W)}}p.value=!1,me.value=!1,Ce.value=!1,pe.value=-1}function ye(U){if(!L.value)return;const W=L.value.getBoundingClientRect(),K=ae=>{const x=Math.max(0,Math.min(1,(ae.clientX-W.left)/W.width)),k=Math.max(0,Math.min(1,1-(ae.clientY-W.top)/W.height)),V={h:Oe.value.h,s:x*100,v:k*100};Oe.value=Be(V.h,V.s,V.v)};K(U),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),ne()},{once:!0})}function lt(U){if(!U.currentTarget)return;const K=U.currentTarget.getBoundingClientRect(),ae=x=>{const k=Math.max(0,Math.min(1,(x.clientX-K.left)/K.width));Oe.value={...Oe.value,h:k*360}};ae(U),document.addEventListener("mousemove",ae),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ae),ne()},{once:!0})}function kt(U){const W=U.target.value,K=Se(W);K&&(Oe.value=I(K),pt("update:modelValue",K))}function Le(U){if(ce.disabled)return;const W=Se(U);W&&(Oe.value=I(W),pt("update:modelValue",W))}let dt=null,ve=null;function je(){dt&&(document.removeEventListener("keydown",dt),dt=null),ve&&(window.removeEventListener("resize",ve),ve=null)}return e.watch(p,U=>{if(je(),U){if(!ut.value&&ce.initialPresetCount==null){const W=ce.presetColors.length;W>0&&(oe.value<0||W<oe.value)&&(oe.value=W)}dt=W=>{W.key==="Escape"&&he()},ve=Ct,document.addEventListener("keydown",dt),window.addEventListener("resize",ve)}}),e.watch(()=>ce.modelValue,()=>{p.value&&_t()},{immediate:!1}),e.watch($e,U=>{U.length===0&&(Ce.value=!1,pe.value=-1,me.value=!1)}),e.onBeforeUnmount(je),(U,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":R.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:ee,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":p.value}]),onClick:Ve},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:ze.value})},[...W[0]||(W[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[p.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(he,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:le,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Bt.value)},[Je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ut.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.presetGroups,(K,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ae,class:"dss-color-picker__section"},[e.createElementVNode("span",z1,e.toDisplayString(K.title),1),e.createElementVNode("div",P1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(x,k)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ae+"-"+k,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Mt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>Le(x),["stop"])},null,14,O1))),128))])]))),128)):Ht.value.length?(e.openBlock(),e.createElementBlock("div",Z1,[W[1]||(W[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",W1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,(K,ae)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Mt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>Le(K),["stop"])},null,14,q1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",U1,[e.createElementVNode("div",X1,[W[3]||(W[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),$e.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":Ce.value}]),title:"Manage custom colors",onClick:e.withModifiers(at,["stop"])},[...W[2]||(W[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,(K,ae)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ae,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Ce.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Ce.value&&Mt(K),"dss-color-picker__preset-bubble--editing":Ce.value&&pe.value===We(ae)}]),style:e.normalizeStyle({backgroundColor:pe.value===We(ae)?ze.value:K}),title:pe.value===We(ae)?ze.value:K,onClick:e.withModifiers(x=>Ce.value?Ie(We(ae)):Le(K),["stop"])},null,14,j1),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(x=>$t(We(ae)),["stop"])},[...W[4]||(W[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,K1)):e.createCommentVNode("",!0)],2))),128)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":me.value}]),onClick:e.withModifiers(an,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):R.presetColors.length?(e.openBlock(),e.createElementBlock("div",G1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.presetColors,(K,ae)=>(e.openBlock(),e.createElementBlock("button",{key:ae,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Mt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(x=>Le(K),["stop"])},null,14,Q1))),128)),Ze.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":me.value}]),onClick:e.withModifiers(an,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:L,onMousedown:ye},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Tt.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(sn.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:lt},[W[5]||(W[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(vt.value)},null,4)],32),e.createElementVNode("div",J1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Fe,type:"text",class:"dss-color-picker__hex-input",value:At.value,onInput:kt},null,40,em)]),Je.value&&(R.presetColors.length||ut.value)&&Ze.value&&pe.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:nt}," Save color ")):e.createCommentVNode("",!0),Je.value&&pe.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Vt}," Save color ")):e.createCommentVNode("",!0),Je.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:he}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},nm={key:0,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:1,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:2,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:3,class:"dss-loader"},cm={key:0,class:"dss-loader-label"},um={key:4,class:"dss-loader"},dm={key:0,class:"dss-loader-label"},mm={key:5,class:"dss-loader dss-loader--inline"},pm={class:"dss-loader-inline-text"},vm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(R){const be=R,I=e.computed(()=>be.size==="small"?"dss-loaders--size-small":be.size==="large"?"dss-loaders--size-large":be.size==="medium"||be.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>be.size==="small"||be.size==="medium"||be.size==="large"||be.size==null?{}:{"--dss-loader-size":typeof be.size=="number"?`${be.size}px`:String(be.size)});return(Se,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",I.value]),style:e.normalizeStyle(A.value)},[R.type==="spinner"?(e.openBlock(),e.createElementBlock("div",nm,[b[0]||(b[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="dots"?(e.openBlock(),e.createElementBlock("div",om,[b[1]||(b[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="battery"?(e.openBlock(),e.createElementBlock("div",sm,[b[2]||(b[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",im,[b[3]||(b[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",cm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="bars"?(e.openBlock(),e.createElementBlock("div",um,[b[4]||(b[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="inline"?(e.openBlock(),e.createElementBlock("div",mm,[b[5]||(b[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",pm,[e.renderSlot(Se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(R.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",fm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:R=>["single","multiple"].includes(R)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(R){const be=R,I=e.computed(()=>{const b={"dss-skeleton--loading":be.loading,"dss-skeleton--static":!be.shimmer,"dss-skeleton--multiple":be.mode==="multiple","dss-skeleton--dark":be.darkMode};return be.mode==="multiple"&&be.targetClass!==Xo&&(b[`dss-skeleton--target-${be.targetClass}`]=!0),b}),A=e.computed(()=>{const b={};return be.borderRadius&&(b.borderRadius=be.borderRadius),b}),Se=e.computed(()=>{const b={};return be.borderRadius&&(b["--dss-skeleton-border-radius"]=be.borderRadius),be.darkMode?(b["--dss-skeleton-bg"]=be.bgDark||"#322c3f",b["--dss-skeleton-shimmer"]=be.shimmerDark||"#3e3f41",b):(be.bgColor&&(b["--dss-skeleton-bg"]=be.bgColor),be.shimmerColor&&(b["--dss-skeleton-shimmer"]=be.shimmerColor),b)});return(b,Be)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",I.value]),style:e.normalizeStyle(Se.value)},[R.loading&&R.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":R.loading&&R.mode==="single"}])},[e.renderSlot(b.$slots,"default")],2)],6))}},gm={key:0,class:"dss-dnd-column-header"},hm={class:"dss-dnd-column-title"},ym={class:"dss-dnd-column-count"},Cm=["data-column"],km={key:0,class:"dss-dnd-indicator"},bm=["onPointerdown"],wm=["onPointerdown"],xm={class:"dss-dnd-item-content"},Em={class:"dss-dnd-item-default"},Vm={key:0,class:"dss-dnd-empty"},Nm={name:"DSSDnd"},Sm=Object.assign(Nm,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(R,{emit:be}){const I=R,A=be,Se=e.useSlots(),b=e.computed(()=>!!Se["delete-zone"]),Be={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1},ce=e.computed(()=>({...Be,...I.options})),pt=e.computed(()=>({"--dss-dnd-col-min-w":ce.value.columnMinWidth,"--dss-dnd-col-max-w":ce.value.columnMaxWidth,"--dss-dnd-col-gap":ce.value.columnGap,"--dss-dnd-indicator-color":ce.value.indicatorColor,"--dss-dnd-body-max-h":ce.value.columnBodyMaxHeight})),p=e.ref(null),me=e.ref(null),Ce=e.ref(!1),pe=e.ref(-1),oe=e.ref(null);let ee=null,le=null,L=null,Fe=null,Re=0,Oe=0,ut="",O=null;const Ze=5,xt=e.computed(()=>{const ne={};for(const Ve of I.columns)ne[Ve.value]=I.items.filter(he=>he[I.columnKey]===Ve.value).sort((he,ye)=>(he[I.positionKey]??0)-(ye[I.positionKey]??0));return ne}),Je=e.computed(()=>{const ne={},Ve=!!p.value,he=p.value?.[I.itemKey],ye=me.value,lt=pe.value;for(const kt of I.columns){const Le=xt.value[kt.value]||[],dt=[],ve=ye==kt.value;let je=0;for(let U=0;U<Le.length;U++){const W=Le[U],K=Ve&&W[I.itemKey]===he;!K&&ve&<===je&&dt.push({type:"indicator",key:`ind-${je}`}),K||je++,dt.push({type:"item",item:W,isDragged:K,key:`item-${W[I.itemKey]}`})}ve&<>=je&&dt.push({type:"indicator",key:"ind-end"}),ne[kt.value]=dt}return ne});function Ht(ne,Ve){const ye=(xt.value[ne]||[]).filter(Le=>Le[I.itemKey]!==p.value?.[I.itemKey]);if(ye.length===0)return 1;if(Ve<=0){const Le=ye[0][I.positionKey];return Le!=null&&Le>0?Le/2:.5}if(Ve>=ye.length){const Le=ye[ye.length-1][I.positionKey];return(Le??0)+1}const lt=ye[Ve-1][I.positionKey]??0,kt=ye[Ve][I.positionKey]??0;return(lt+kt)/2}function $e(ne,Ve,he){L&&L.remove();const ye=ne.getBoundingClientRect(),lt=ne.cloneNode(!0);lt.classList.add("dss-dnd-ghost"),lt.style.cssText=`
|
|
103
|
+
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}dt()}e.nextTick(()=>{bn(),Al()})},Pn=()=>{if(!v.value||he.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=ft());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const f=m.parentElement;return!f||f.closest("a")||f.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],y=f.textContent;a.lastIndex=0;const M=[...y.matchAll(a)];if(M.length===0)continue;const _=M.filter(Y=>{const $e=Y[0],ge=Y.index;if(ge>0&&y[ge-1]==="@"||ge+$e.length<y.length&&y[ge+$e.length]==="@")return!1;const ut=f.parentElement;return!(ut&&ut.closest("a"))});if(_.length===0)continue;if(_.length===1&&_[0][0]===y.trim()){const Y=_[0][0],$e=Y.startsWith("http://")||Y.startsWith("https://")?Y:`https://${Y}`,ge=document.createElement("a");ge.href=$e,ge.textContent=Y,ge.style.color="#60afdf",ge.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(ge,f),u=!0);continue}let N=0;const J=document.createDocumentFragment();if(_.forEach(Y=>{const $e=Y.index,ge=Y[0];if($e>N){const Gt=y.substring(N,$e);Gt&&J.appendChild(document.createTextNode(Gt))}const ut=ge.startsWith("http://")||ge.startsWith("https://")?ge:`https://${ge}`,an=document.createElement("a");an.href=ut,an.textContent=ge,an.style.color="#60afdf",an.style.textDecoration="underline",J.appendChild(an),N=$e+ge.length}),N<y.length){const Y=y.substring(N);Y&&J.appendChild(document.createTextNode(Y))}f.parentNode&&J.childNodes.length>0&&(f.parentNode.replaceChild(J,f),u=!0)}u&&l&&e.nextTick(()=>{pe(l),bn()})},fl=()=>{if(!v.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=l.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const d=a[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let f=0;const y=document.createDocumentFragment();m.forEach(M=>{const _=M.index,N=M[0].startsWith("<u>")?"u":"ins",J=M[1]||M[2]||"";_>f&&y.appendChild(document.createTextNode(u.substring(f,_)));const Y=document.createElement(N);Y.textContent=J,y.appendChild(Y),f=_+M[0].length}),f<u.length&&y.appendChild(document.createTextNode(u.substring(f))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},nl=o=>{if(!v.value||he.value)return;if(!o){fl();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===v.value||!v.value.contains(c))return;const d=()=>{let Gt="",Pt=0,Qt=!1;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Un=>Un.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let zt=0;for(;Jt.nextNode();){const Un=Jt.currentNode,cl=Un.textContent||"",Xn=zt;if(zt+=cl.length,Un===r.startContainer){Gt+=cl.substring(0,r.startOffset),Pt=Xn+r.startOffset,Qt=!0;break}Gt+=cl}return Qt||(Pt=Gt.length),{textBeforeCursor:Gt,cursorCharOffset:Pt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,f=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?f="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const y=m[0],M=m[1],_=u.length-y.length,J=(Gt=>{let Pt=0;const Qt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:zt=>zt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Jt;for(;Jt=Qt.nextNode();){const zt=(Jt.textContent||"").length;if(Pt+zt>=Gt)return{node:Jt,offset:Gt-Pt};Pt+=zt}return null})(_);if(!J)return;const Y=document.createRange();Y.setStart(J.node,J.offset),Y.setEnd(r.endContainer,r.endOffset);const $e=document.createElement(f);$e.textContent=M,Y.deleteContents(),Y.insertNode($e);const ge=window.getSelection(),ut=document.createRange();ut.setStartAfter($e),ut.collapse(!0),ge.removeAllRanges(),ge.addRange(ut);const an=ft();e.nextTick(()=>{dt(),an&&pe(an)})},It=()=>{v.value&&(Nt.value=ft(),Ct.value="",_t.value="",fe.value="",Qe.value="",je.value="",cn.value=null,pt.value=null,ve.value="upload",at.value=!0,Dt(),e.nextTick(()=>{$t.value&&$t.value.focus(),Ht.value&&(Ht.value.value="")}))},ko=o=>{const l=o.target?.files?.[0];if(!l){cn.value=null,_t.value="";return}cn.value=l;const a=new FileReader;a.onload=r=>{_t.value=r.target?.result||""},a.readAsDataURL(l)},Wt=()=>{Ht.value&&Ht.value.click()},on=()=>{Qe.value&&(je.value="")},bo=()=>{je.value&&(Qe.value="")},$o=()=>{let o=pt.value;if(!o){const l=window.getSelection();if(l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(o){const l=o.getAttribute("data-alt")||o.getAttribute("alt")||"";pt.value=o,Ct.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(fe.value=a,_t.value="",ve.value="url"):(_t.value=a,fe.value="",ve.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Qe.value=c.endsWith("px")?c.replace("px",""):c,je.value=d.endsWith("px")?d.replace("px",""):d,Nt.value=null}else{It();return}at.value=!0,Q.value=!1,xt.value=!1,e.nextTick(()=>{ve.value==="url"&&Yt.value?(Yt.value.focus(),Yt.value.select()):$t.value&&($t.value.focus(),$t.value.select()),Ht.value&&(Ht.value.value="")})},gl=()=>{at.value=!1,Ct.value="",_t.value="",fe.value="",Qe.value="",je.value="",cn.value=null,pt.value=null,Nt.value=null,ve.value="upload"},il=()=>{const o=(Ct.value||"").trim(),l=v.value?._mutationObserver;l&&l.disconnect(),Ge.value?(de.value&&(clearTimeout(de.value),de.value=null),Re(),Ge.value=!1):Re();const a=ve.value==="url"?fe.value.trim():_t.value;if(pt.value&&v.value&&v.value.contains(pt.value)){a&&(pt.value.src=a),pt.value.setAttribute("alt",o),pt.value.setAttribute("data-alt",o),Qe.value?(pt.value.style.width=`${Qe.value}px`,pt.value.setAttribute("width",Qe.value)):(pt.value.style.removeProperty("width"),pt.value.removeAttribute("width")),je.value?(pt.value.style.height=`${je.value}px`,pt.value.setAttribute("height",je.value)):(pt.value.style.removeProperty("height"),pt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(pt.value),c.collapse(!0),r.addRange(c)}dt()}else{if(!a){l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),gl();return}if(v.value){v.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Nt.value&&(pe(Nt.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&v.value){if(d=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){gl();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!v.value.contains(m)){if(d=document.createRange(),v.value.childNodes.length===0){const y=document.createElement("p");y.innerHTML="<br>",v.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(v.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const f=document.createElement("img");f.src=a,f.setAttribute("alt",o),f.setAttribute("data-alt",o),Qe.value&&(f.style.width=`${Qe.value}px`,f.setAttribute("width",Qe.value)),je.value&&(f.style.height=`${je.value}px`,f.setAttribute("height",je.value));try{d.insertNode(f),d.setStartAfter(f),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(v.value){if(v.value.childNodes.length===0){const _=document.createElement("p");v.value.appendChild(_),_.appendChild(f)}else{const _=v.value.lastChild;if(_&&_.nodeType===1)_.appendChild(f);else{const N=document.createElement("p");v.value.appendChild(N),N.appendChild(f)}}const M=document.createRange();M.setStartAfter(f),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}pt.value=f,dt()}}e.nextTick(()=>{l&&v.value&&l.observe(v.value,{childList:!0,subtree:!0}),bn(),Ft(),gl()})};e.watch(()=>b.modelValue,o=>{if(b.richText&&v.value&&!he.value){const l=In(o||""),r=v.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=ft();v.value.innerHTML=l,e.nextTick(()=>{tt();const u=v.value.innerHTML||"",m=b.title||"",f=b.description||"";U.value=u,j.value=m,ne.value=f,W.value=u,x.value=m,k.value=f,Ie.value=[],Ke.value=[],de.value&&(clearTimeout(de.value),de.value=null),Ge.value=!1,d&&pe(d),Kt(),K(),O(),bn(),Ft(),Jn(),Dn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>b.richText,o=>{o?(Ft(),e.nextTick(()=>{_l()})):(zn(),ht.value=[],Ye.value&&(Ye.value.disconnect(),Ye.value=null)),Jn()}),e.watch(()=>b.floatingToolbar,o=>{o?Ft():zn()}),e.watch(()=>b.disabled,o=>{o&&zn(),Jn()}),e.watch(()=>b.description,()=>{e.nextTick(()=>{le.value?ml():jn()})}),e.watch(()=>b.title,()=>{e.nextTick(()=>{Me.value?kn():Cl()})}),e.watch(()=>b.customToolbarSlots,()=>{e.nextTick(()=>{Vt()})},{deep:!0}),e.watch(()=>b.comments,(o,l)=>{if(Zl.value){Zl.value=!1;return}Bl.value||b.richText&&v.value&&e.nextTick(()=>{Dl()})},{deep:!0,immediate:!1});const Dl=()=>{if(!Bl.value&&!(!b.comments||!Array.isArray(b.comments)||b.comments.length===0)&&!(!b.richText||!v.value)){Bl.value=!0;try{const o=new Set,l=b.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;l.forEach(u=>{if(!u.conversation_id||!u.selection_range)return;const m=typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)||u.conversation_id;if(!m)return;const f=String(m);if(d.has(f))return;const y=v.value.querySelector(`[data-comment="${f}"]`);if(y){wl(y,u),d.add(f);return}try{const M=Kl(u.selection_range,u.selection_text);if(M&&!M.collapsed){const _=M.commonAncestorContainer,N=_.nodeType===3?_.parentElement:_;if(N){const $e=N.closest("[data-comment], [data-fake-comment]");if($e){const ge=$e.getAttribute("data-comment")||$e.getAttribute("data-fake-comment");if(String(ge)===String(m)){$e.setAttribute("data-comment",f),$e.removeAttribute("data-fake-comment"),wl($e,u),d.add(f);return}else return}}const J=v.value.querySelector(`[data-comment="${f}"]`);if(J){wl(J,u),d.add(f);return}const Y=document.createElement("span");Y.setAttribute("data-comment",f),wl(Y,u);try{M.surroundContents(Y),c++,d.add(f)}catch{try{const ge=document.createRange();ge.setStart(M.startContainer,M.startOffset),ge.setEnd(M.endContainer,M.endOffset),Rt(ge),ge.surroundContents(Y),c++,d.add(f)}catch{try{const ut=M.extractContents();Y.appendChild(ut),M.insertNode(Y),c++,d.add(f)}catch(ut){console.warn("Failed to create comment marker:",ut)}}}}}catch{}}),e.nextTick(()=>{Dn("restoreCommentsFromModel"),dt(),Bl.value=!1})}catch{Bl.value=!1}}},Rt=o=>{if(!o||!v.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=o.startContainer,r=o.startOffset;if(a.nodeType===3){const u=a.parentElement;u&&l.includes(u.tagName)&&(r===0&&!To(a)||o.setStartBefore(u))}else a.nodeType===1&&l.includes(a.tagName)&&r>0&&o.setStartBefore(a);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!jl(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},To=o=>{let l=o.previousSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.previousSibling}return!1},jl=o=>{let l=o.nextSibling;for(;l;){if(l.nodeType===3&&l.textContent.trim().length>0||l.nodeType===1&&l.textContent.trim().length>0)return!0;l=l.nextSibling}return!1},Kl=(o,l)=>{if(!o||!v.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[v.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const f=r+d.length;!u&&o.start>=r&&o.start<=f&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=f&&(a.setEnd(d,o.end-r),m=!0),r=f}else{let f=d.childNodes.length;for(;f--;)c.push(d.childNodes[f])}return u?Rt(a):null}}catch{return null}return null},wl=(o,l)=>{if(!o||!l)return;const a=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&d(m.user)}),c.length>0?o.setAttribute("data-comment-user",JSON.stringify(c[0])):o.removeAttribute("data-comment-user"),c.length>1?o.setAttribute("data-comment-user-2",JSON.stringify(c[1])):o.removeAttribute("data-comment-user-2");const u=a.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},Dn=(o="unknown")=>{if(!b.richText||!v.value){ht.value=[];return}Date.now()-At.value<Zn&&Cn.value!==null||Cn.value===null&&(Cn.value=requestAnimationFrame(()=>{if(Cn.value=null,At.value=Date.now(),Rn.value)return;Rn.value=!0;const a={},r=v.value;if(!r){Rn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Rn.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");J&&N.tagName==="SPAN"&&(m.has(J)||(u.push(N),m.add(J)))}),d.forEach(N=>{const J=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");!J||m.has(J)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(N.tagName)?N.querySelector(`span[data-comment="${J}"], span[data-fake-comment="${J}"]`)||(u.push(N),m.add(J)):N.tagName!=="SPAN"&&(u.push(N),m.add(J)))});const f=c.getBoundingClientRect(),y=r.getBoundingClientRect();u.forEach((N,J)=>{let Y=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!Y)return;if(typeof Y=="string"&&Y.startsWith("comment-")){const ct=N.textContent?.trim(),On=b.comments?.find(en=>(typeof en.conversation_id=="string"&&en.conversation_id.startsWith("comment-")?null:en.conversation_id)&&en.selection_text?.trim()===ct);On?(Y=String(On.conversation_id),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment")):(Y=String(Date.now()),N.setAttribute("data-comment",Y),N.removeAttribute("data-fake-comment"))}const $e=N.getBoundingClientRect(),ge=window.getComputedStyle(N),ut=parseFloat(ge.lineHeight)||parseFloat(ge.fontSize)*1.2,Pt=$e.top-y.top+ut/2-15,Jt=y.top-f.top+Pt;let zt=null,Un=null,cl=0;const Xn=[],xo=new Set;if(Y&&b.comments){const ct=b.comments.find(On=>String(On.conversation_id||On.id)===String(Y));if(ct){const On=ct.conversation||[];On.length>0?(On.forEach(en=>{en.user&&en.user.id&&!xo.has(en.user.id)&&(xo.add(en.user.id),Xn.push(en.user))}),cl=On.length):(cl=0,zt=null,Un=null),Xn.length>0?zt=Xn[0]:zt=null,Xn.length>1?Un=Xn[1]:Un=null}}const ll=$e.top+ut/2-15,Ql=ll+30,$l=5,xl=Ql>y.top+$l&&ll<y.bottom-$l?1:0;ht.value.find(ct=>ct.id===Y);let ul=N;if(!ul&&Y&&v.value){const ct=String(Y);ul=v.value.querySelector(`[data-comment="${ct}"], [data-fake-comment="${ct}"]`)}const El=Xn.length;a[Y]?(a[Y].top=Jt,a[Y].opacity=xl,a[Y].element=ul,a[Y].firstUser=zt,a[Y].secondUser=Un,a[Y].totalCount=cl,a[Y].uniqueUserCount=El):a[Y]={id:Y,top:Jt,opacity:xl,element:ul,firstUser:zt,secondUser:Un,totalCount:cl,uniqueUserCount:El}});const M=Object.values(a).map(N=>{const J=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&v.value){const $e=String(N.id);N.element=v.value.querySelector(`[data-comment="${$e}"], [data-fake-comment="${$e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:J}});(ht.value.length!==M.length||M.some((N,J)=>{const Y=ht.value[J];if(!Y)return!0;const $e=(Y.firstUser?.id||null)!==(N.firstUser?.id||null),ge=(Y.secondUser?.id||null)!==(N.secondUser?.id||null);return Y.id!==N.id||Math.abs(Y.top-N.top)>1||Y.opacity!==N.opacity||Y.totalCount!==N.totalCount||Y.additionalCount!==N.additionalCount||$e||ge||Y.element!==N.element}))&&(ht.value=M),Rn.value=!1}))},wo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&v.value){const a=String(o.id);l=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(hl(),Kn.value=l,l.classList.add("editor-comment-highlighted"))},hl=(o=!1)=>{!o&&gn.value!==null&&Kn.value&&(Kn.value.getAttribute("data-comment")||Kn.value.getAttribute("data-fake-comment"))===gn.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Kn.value&&(Kn.value.classList.remove("editor-comment-highlighted"),Kn.value=null))},Gl=o=>{if(!o||!o.element)return;hl(!0);const l=o.element.getAttribute("data-comment")||o.element.getAttribute("data-fake-comment");if(!l)return;const a=`[data-comment="${l}"], [data-fake-comment="${l}"]`;Be("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},Lo=()=>{hl()},_l=()=>{!b.richText||!v.value||(Ye.value&&Ye.value.disconnect(),un.value!==null&&(clearTimeout(un.value),un.value=null),Ye.value=new MutationObserver(()=>{un.value===null&&(un.value=setTimeout(()=>{un.value=null,e.nextTick(()=>{Dn("MutationObserver")})},200))}),Ye.value.observe(v.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Dn("setupCommentMarkersObserver-initial"))},Rl=(o,l)=>{if(!o||!l)return;const a=l.getBoundingClientRect();let r=a.top,c=a.right+4;o.style.top=`${r}px`,o.style.left=`${c}px`,o.offsetHeight;const d=o.getBoundingClientRect(),u=window.innerWidth,m=window.innerHeight;if(d.right>u){const f=a.left-d.width-4;o.style.left=`${f}px`}if(d.bottom>m){const f=Math.max(8,m-d.height-8);o.style.top=`${f}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>_e.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===o&&o){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const d=a.parentNode;a.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Rl(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(()=>[ue.value,Mt.value],()=>{ue.value==="askAi"||Mt.value==="askAi"?e.nextTick(()=>{Qn()}):(_e.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const a=l.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(l.dataset.originalParentRef==="inside")r.appendChild(l);else{const d=r.closest(".dss-toolbar-dropdown");d&&d.insertBefore(l,r.nextSibling)}}}})}))}),e.watch(()=>b.locale,o=>{o&&o!==Se.value&&(Se.value=o)},{immediate:!0}),be({openCommentOverlayForSelector:Ul,updateCommentMarkers:Dn,restoreCommentsFromModel:Dl}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Bn.value]),style:e.normalizeStyle(dn.value)},[R.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",jc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:h,title:e.unref(A)("textEditor.toolbar.undo")},[...l[45]||(l[45]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Kc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:C,title:e.unref(A)("textEditor.toolbar.redo")},[...l[46]||(l[46]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,Gc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Qc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>fn("paragraph")),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[Je.value==="h1"?(e.openBlock(),e.createElementBlock("svg",eu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Je.value==="h2"?(e.openBlock(),e.createElementBlock("svg",tu,[...l[48]||(l[48]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Je.value==="h3"?(e.openBlock(),e.createElementBlock("svg",nu,[...l[49]||(l[49]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Je.value==="h4"?(e.openBlock(),e.createElementBlock("svg",lu,[...l[50]||(l[50]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Je.value==="h5"?(e.openBlock(),e.createElementBlock("svg",ou,[...l[51]||(l[51]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Je.value==="h6"?(e.openBlock(),e.createElementBlock("svg",au,[...l[52]||(l[52]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",su,[...l[53]||(l[53]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[54]||(l[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Jc),ue.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=a=>qt("<h1>"))},[l[55]||(l[55]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"})],-1)),e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>qt("<h2>"))},[l[56]||(l[56]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"})],-1)),e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>qt("<h3>"))},[l[57]||(l[57]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"})],-1)),e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>qt("<h4>"))},[l[58]||(l[58]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"})],-1)),e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>qt("<h5>"))},[l[59]||(l[59]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"})],-1)),e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>qt("<h6>"))},[l[60]||(l[60]=e.createElementVNode("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"}),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"})],-1)),e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>qt("<p>"))},[l[61]||(l[61]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("bold")}]),onClick:l[9]||(l[9]=a=>et("bold")),title:e.unref(A)("textEditor.toolbar.bold")},[...l[62]||(l[62]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,ru),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("italic")}]),onClick:l[10]||(l[10]=a=>et("italic")),title:e.unref(A)("textEditor.toolbar.italic")},[...l[63]||(l[63]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("underline")}]),onClick:l[11]||(l[11]=a=>et("underline")),title:e.unref(A)("textEditor.toolbar.underline")},[...l[64]||(l[64]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,cu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt.value}]),onClick:lo,title:e.unref(A)("textEditor.toolbar.citation")},[...l[65]||(l[65]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,uu),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:so,title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[67]||(l[67]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,mu)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ao,title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[66]||(l[66]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,du)),l[75]||(l[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("insertUnorderedList")}]),onClick:ro,title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[68]||(l[68]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,pu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("insertOrderedList")}]),onClick:Ol,title:e.unref(A)("textEditor.toolbar.numberList")},[...l[69]||(l[69]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,vu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:It,title:e.unref(A)("textEditor.toolbar.image")},[...l[70]||(l[70]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,fu),yt.value?(e.openBlock(),e.createElementBlock("div",gu)):e.createCommentVNode("",!0),yt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:uo},[...l[71]||(l[71]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,hu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",yu)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",Cu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>fn("askAi")),title:e.unref(A)("textEditor.toolbar.askAi")},[l[72]||(l[72]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",bu,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,ku),ue.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[13]||(l[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",wu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[st(a)?(e.openBlock(),e.createElementBlock("div",xu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),st(a)&&r<R.customToolbarSlots.length-1&&mn(r)?(e.openBlock(),e.createElementBlock("div",Eu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&R.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:Dt})):e.createCommentVNode("",!0),e.createVNode(Do,{showModal:Ve.value,width:"500px",height:"55vh",onCloseModal:Al},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(A)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Vu,[e.createElementVNode("div",Nu,[e.createElementVNode("label",Su,e.toDisplayString(e.unref(A)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Z,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>Oe.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Yl,["enter"])},null,40,Bu),[[e.vModelText,Oe.value]])]),e.createElementVNode("div",Mu,[e.createElementVNode("label",_u,e.toDisplayString(e.unref(A)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:mt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ae.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Yl,["enter"])},null,40,$u),[[e.vModelText,Ae.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Al},e.toDisplayString(e.unref(A)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Yl},e.toDisplayString(e.unref(A)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Do,{showModal:at.value,width:"500px",height:"80vh",onCloseModal:gl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(pt.value?e.unref(A)("textEditor.image.editImage"):e.unref(A)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Tu,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ve.value==="upload"}]),onClick:l[17]||(l[17]=a=>ve.value="upload")},e.toDisplayString(e.unref(A)("textEditor.image.upload")),3),l[77]||(l[77]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":ve.value==="url"}]),onClick:l[18]||(l[18]=a=>ve.value="url")},e.toDisplayString(e.unref(A)("textEditor.image.imageLink")),3)]),ve.value==="upload"?(e.openBlock(),e.createElementBlock("div",Lu,[e.createElementVNode("div",Hu,[e.createElementVNode("div",Au,[Ne.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Du,e.toDisplayString(e.unref(A)("textEditor.image.uploadImage")),1)),Ne.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Wt},[e.createElementVNode("img",{src:_t.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Ru),l[78]||(l[78]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Ht,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ko},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ht,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ko},null,544))]),e.createElementVNode("div",Fu,[e.createElementVNode("label",Iu,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:$t,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(il,["enter"])},null,40,zu),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",Pu,[e.createElementVNode("label",Ou,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>Qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:on},null,40,Zu),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:bo},null,40,Uu),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0),ve.value==="url"?(e.openBlock(),e.createElementBlock("div",Xu,[e.createElementVNode("div",Yu,[e.createElementVNode("div",ju,[e.createElementVNode("label",Ku,e.toDisplayString(e.unref(A)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Yt,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>fe.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(il,["enter"])},null,40,Gu),[[e.vModelText,fe.value]])]),e.createElementVNode("div",Qu,[e.createElementVNode("label",Ju,e.toDisplayString(e.unref(A)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ct.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.enterAltText"),onKeyup:e.withKeys(il,["enter"])},null,40,ed),[[e.vModelText,Ct.value]])]),e.createElementVNode("div",td,[e.createElementVNode("label",nd,e.toDisplayString(e.unref(A)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>Qe.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:on},null,40,ld),[[e.vModelText,Qe.value]])]),e.createElementVNode("div",od,[e.createElementVNode("label",ad,e.toDisplayString(e.unref(A)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>je.value=a),class:"dss-link-modal-input",placeholder:e.unref(A)("textEditor.image.auto"),onKeyup:e.withKeys(il,["enter"]),onInput:bo},null,40,sd),[[e.vModelText,je.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:gl},e.toDisplayString(e.unref(A)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:il},e.toDisplayString(e.unref(A)("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&&Me.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.title")),1),e.createElementVNode("div",rd,[Me.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",id,[R.title?(e.openBlock(),e.createElementBlock("span",cd,e.toDisplayString(R.title),1)):(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(lt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:R.title,onInput:Wn,onFocus:vn,onBlur:Ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Me.value}]),placeholder:lt.value,disabled:R.disabled,rows:"1"},null,42,dd)])],2),hn.value&&Me.value?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":nn.value&&le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.labels.description")),1),e.createElementVNode("div",pd,[le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",vd,[R.description?(e.openBlock(),e.createElementBlock("span",fd,e.toDisplayString(R.description),1)):(e.openBlock(),e.createElementBlock("span",gd,e.toDisplayString(ot.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:R.description,onInput:zl,onFocus:pl,onBlur:Sl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!le.value}]),placeholder:ot.value,disabled:R.disabled,rows:"1"},null,42,hd)])],2),nn.value&&le.value?(e.openBlock(),e.createElementBlock("div",yd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ht.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":gn.value===a.id,"editor-comment-marker-group-out-of-view":a.opacity===0}]),"data-comment-id":a.id,style:e.normalizeStyle({top:a.top+"px"}),onMouseenter:r=>wo(a),onMouseleave:Lo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Gl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,bd)):(e.openBlock(),e.createElementBlock("span",wd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,kd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Gl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Ed)):(e.openBlock(),e.createElementBlock("span",Vd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,xd)):e.createCommentVNode("",!0),a.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:a.secondUser?"30px":"15px"}),"data-has-second-user":a.secondUser?"true":"false",onClick:e.withModifiers(r=>Gl(a),["stop"])},[e.createElementVNode("span",Sd,"+"+e.toDisplayString(a.additionalCount),1)],12,Nd)):e.createCommentVNode("",!0)],46,Cd))),128)),R.richText?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":R.disabled,"dss-text-editor-fixed-height":R.fixedHeight}]),style:e.normalizeStyle(Nn.value),onInput:dt,onBlur:Ot,onClick:Ut,onMouseup:vo,onKeyup:vo,onKeydown:xn,onPaste:z,onMousemove:Mo,onMouseleave:_o},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[gn.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(kl.value)},[wn.value||Sn.value.length>0?(e.openBlock(),e.createElementBlock("div",Ad,[e.createElementVNode("div",Dd,[wn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:wn.value},null,8,Rd)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Sn.value,(a,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[a.user&&(a.user.avatar||a.user.initials||a.user.name)?(e.openBlock(),e.createElementBlock("div",Id,[e.createElementVNode("div",zd,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Pd)):(e.openBlock(),e.createElementBlock("span",Od,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.createElementVNode("div",Wd,[e.createElementVNode("div",qd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Ud,e.toDisplayString(Tl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Nl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),b.commentUser&&a.user&&a.user.id===b.commentUser.id&&!Nl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>po(a,r),["stop"]),title:e.unref(A)("textEditor.comment.delete")||"Delete comment"},[...l[80]||(l[80]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,Xd)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Yd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:qn,"onUpdate:modelValue":l[26]||(l[26]=a=>$n.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(A)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(mo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(qn.value){const a=qn.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,jd),[[e.vModelText,$n.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(mo,["stop"])},[...l[81]||(l[81]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",Kd,[e.createElementVNode("div",Gd,[e.createElementVNode("span",Qd,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Jd,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",Bd,[e.createElementVNode("textarea",{value:R.modelValue,onInput:yl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":R.fixedHeight}]),placeholder:We.value,rows:R.rows,disabled:R.disabled,style:e.normalizeStyle(Mn.value)},null,46,Md),e.createElementVNode("div",_d,[e.createElementVNode("div",$d,[e.createElementVNode("span",Td,e.toDisplayString(F.value)+" "+e.toDisplayString(F.value===1?e.unref(A)("textEditor.footer.word"):e.unref(A)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Ld,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(A)("textEditor.footer.character"):e.unref(A)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ae.value&&te.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(oe.value),onMouseenter:l[28]||(l[28]=a=>H.value=!0),onMouseleave:tl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(yo,["stop"]),title:te.value},e.toDisplayString(te.value),9,e1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(A)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",n1,[...l[83]||(l[83]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xt.value&&St.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(jt.value),onMouseenter:l[29]||(l[29]=a=>Q.value=!0),onMouseleave:bl},[e.createElementVNode("div",l1,[St.value===e.unref(A)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",o1,[...l[84]||(l[84]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:St.value},e.toDisplayString(St.value),9,a1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers($o,["stop"]),title:e.unref(A)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",r1,[...l[85]||(l[85]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,s1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[R.floatingToolbar&&R.richText&&Ze.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ze,class:"dss-floating-toolbar",style:e.normalizeStyle(wt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",i1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(h,["stop"]),title:e.unref(A)("textEditor.toolbar.undo")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,c1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!D.value}]),onClick:e.withModifiers(C,["stop"]),title:e.unref(A)("textEditor.toolbar.redo")},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,u1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",d1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>Ml("paragraph"),["stop"])),title:e.unref(A)("textEditor.toolbar.paragraphFormat")},[Je.value==="h1"?(e.openBlock(),e.createElementBlock("svg",p1,[...l[88]||(l[88]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.2 13V11.836H8.456V7.12H6.548V6.16C8.312 6.04 8.648 5.44 8.804 4.84H9.884V11.836H11.96V13H6.2Z",fill:"#FFC230"},null,-1)])])):Je.value==="h2"?(e.openBlock(),e.createElementBlock("svg",v1,[...l[89]||(l[89]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M6.02 13V11.8L8.732 9.388C9.644 8.584 10.208 8.08 10.208 7.288C10.208 6.64 9.764 6.04 8.84 6.04C7.904 6.04 7.424 6.676 7.412 7.852H5.972C5.852 5.872 7.16 4.72 8.948 4.72C10.736 4.72 11.672 5.86 11.672 7.12C11.672 8.464 10.916 9.364 9.92 10.168L8.192 11.56H11.708V13H6.02Z",fill:"#FFC230"},null,-1)])])):Je.value==="h3"?(e.openBlock(),e.createElementBlock("svg",f1,[...l[90]||(l[90]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M8.156 8.188H8.828C9.56 8.188 10.064 7.696 10.064 7.072C10.064 6.508 9.74 6.04 8.792 6.04C7.748 6.04 7.472 6.688 7.388 7.612H5.948C5.828 6.232 6.896 4.72 8.924 4.72C10.712 4.72 11.6 5.896 11.6 6.892C11.6 7.648 11.3 8.356 10.568 8.704C11.42 9.112 11.768 9.7 11.768 10.48C11.768 11.86 10.712 13.12 8.804 13.12C6.776 13.12 5.708 11.608 5.828 10.228H7.268C7.232 11.068 7.736 11.8 8.792 11.8C9.74 11.8 10.184 11.248 10.184 10.48C10.184 9.808 9.752 9.268 8.828 9.268H8.156V8.188Z",fill:"#FFC230"},null,-1)])])):Je.value==="h4"?(e.openBlock(),e.createElementBlock("svg",g1,[...l[91]||(l[91]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M5.72 11.056V9.856L9.284 4.84H10.832V9.856H12.272V11.056H10.832V13H9.284V11.056H5.72ZM7.076 9.856H9.284V6.832L7.076 9.856Z",fill:"#FFC230"},null,-1)])])):Je.value==="h5"?(e.openBlock(),e.createElementBlock("svg",h1,[...l[92]||(l[92]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M7.652 9.436H6.164C6.416 7.84 6.56 6.64 6.596 4.852L11.516 4.84V6.28H7.82L7.676 7.972C8.084 7.684 8.6 7.516 9.308 7.516C10.832 7.516 11.804 8.644 11.804 10.24C11.804 11.86 10.58 13.12 8.804 13.12C7.328 13.12 5.864 11.968 6.164 10.156H7.484C7.388 11.224 7.964 11.8 8.876 11.8C9.812 11.8 10.316 11.092 10.316 10.252C10.316 9.412 9.908 8.632 8.9 8.632C8.132 8.632 7.748 9.112 7.652 9.436Z",fill:"#FFC230"},null,-1)])])):Je.value==="h6"?(e.openBlock(),e.createElementBlock("svg",y1,[...l[93]||(l[93]=[e.createElementVNode("path",{d:"M1.032 11V2.84H2.46V6.08H5.652V2.84H7.08V11H5.652V7.496H2.46V11H1.032Z",fill:"#020203"},null,-1),e.createElementVNode("path",{d:"M11.912 10.24C11.912 11.86 10.808 13.12 9.056 13.12C7.16 13.12 5.96 11.5 5.96 9.04C5.96 6.34 7.316 4.72 9.344 4.72C11 4.72 11.84 5.872 11.84 7.012H10.4C10.328 6.628 10.088 6.028 9.104 6.028C8.06 6.028 7.388 6.748 7.316 8.392C7.784 7.84 8.396 7.444 9.416 7.444C10.94 7.444 11.912 8.644 11.912 10.24ZM9.08 8.848C8.12 8.848 7.736 9.556 7.736 10.396C7.736 11.236 8.12 11.944 9.08 11.944C10.04 11.944 10.424 11.236 10.424 10.396C10.424 9.556 10.04 8.848 9.08 8.848Z",fill:"#FFC230"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",C1,[...l[94]||(l[94]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[95]||(l[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,m1),Mt.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[38]||(l[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[31]||(l[31]=a=>sl("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>sl("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>sl("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>sl("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>sl("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>sl("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>sl("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(A)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[108]||(l[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>et("bold"),["stop"])),title:e.unref(A)("textEditor.toolbar.bold")},[...l[96]||(l[96]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,k1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>et("italic"),["stop"])),title:e.unref(A)("textEditor.toolbar.italic")},[...l[97]||(l[97]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>et("underline"),["stop"])),title:e.unref(A)("textEditor.toolbar.underline")},[...l[98]||(l[98]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,w1),l[109]||(l[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Lt.value}]),onClick:e.withModifiers(lo,["stop"]),title:e.unref(A)("textEditor.toolbar.citation")},[...l[99]||(l[99]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,x1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(A)("textEditor.toolbar.removeLink")},[...l[101]||(l[101]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,V1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ao,["stop"]),title:e.unref(A)("textEditor.toolbar.insertLink")},[...l[100]||(l[100]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,E1)),l[111]||(l[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("insertUnorderedList")}]),onClick:e.withModifiers(ro,["stop"]),title:e.unref(A)("textEditor.toolbar.bulletList")},[...l[102]||(l[102]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,N1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Tt("insertOrderedList")}]),onClick:e.withModifiers(Ol,["stop"]),title:e.unref(A)("textEditor.toolbar.numberList")},[...l[103]||(l[103]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,S1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(It,["stop"]),title:e.unref(A)("textEditor.toolbar.image")},[...l[104]||(l[104]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,B1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(A)("textEditor.toolbar.comment"),onClick:e.withModifiers(uo,["stop"])},[...l[105]||(l[105]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,M1),R.askAi?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),R.askAi?(e.openBlock(),e.createElementBlock("div",$1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>Ml("askAi"),["stop"])),title:e.unref(A)("textEditor.toolbar.askAi")},[l[106]||(l[106]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#FFAF54"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#FFC963"})],-1)),e.createElementVNode("span",L1,e.toDisplayString(e.unref(A)("textEditor.toolbar.askAi")),1)],8,T1),Mt.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[43]||(l[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(o.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Fn.value?(e.openBlock(),e.createElementBlock("div",H1,[R.askAi&&Fn.value?(e.openBlock(),e.createElementBlock("div",A1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[st(a)&&pn(a)?(e.openBlock(),e.createElementBlock("div",D1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),st(a)&&pn(a)&&r<R.customToolbarSlots.length-1&&tn(r)?(e.openBlock(),e.createElementBlock("div",R1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),z1={class:"dss-color-picker__section-title"},P1={class:"dss-color-picker__presets-row"},O1=["title","onClick"],Z1={key:1,class:"dss-color-picker__section"},W1={class:"dss-color-picker__presets-row"},q1=["title","onClick"],U1={class:"dss-color-picker__section"},X1={class:"dss-color-picker__section-header"},Y1={class:"dss-color-picker__presets-row"},j1=["title","onClick"],K1=["onClick"],G1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Q1=["title","onClick"],J1={class:"dss-color-picker__input-row"},em=["value"],tm={__name:"DSSColorPicker",props:{modelValue:{type:String,default:"#b8a5de"},disabled:{type:Boolean,default:!1},presetColors:{type:Array,default:()=>[]},presetGroups:{type:Array,default:null},max:{type:Number,default:12},initialPresetCount:{type:Number,default:null}},emits:["update:modelValue","update:presetColors"],setup(R,{emit:be}){function I(U){const W=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(U);if(!W)return{h:0,s:0,l:50};const j=parseInt(W[1],16)/255,ne=parseInt(W[2],16)/255,x=parseInt(W[3],16)/255,k=Math.max(j,ne,x),V=Math.min(j,ne,x);let P=0,X=0;const De=(k+V)/2;if(k!==V){const Xe=k-V;switch(X=De>.5?Xe/(2-k-V):Xe/(k+V),k){case j:P=((ne-x)/Xe+(ne<x?6:0))/6;break;case ne:P=((x-j)/Xe+2)/6;break;case x:P=((j-ne)/Xe+4)/6;break}}return{h:P*360,s:X*100,l:De*100}}function A(U,W,j){W/=100,j/=100;const ne=W*Math.min(j,1-j),x=k=>{const V=(k+U/30)%12,P=j-ne*Math.max(Math.min(V-3,9-V,1),-1);return Math.round(255*P).toString(16).padStart(2,"0")};return`#${x(0)}${x(8)}${x(4)}`}function Se(U){const W=U.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!W)return null;let j=W[1];return j.length===3&&(j=j.split("").map(ne=>ne+ne).join("")),"#"+j}function b(U,W,j){W/=100,j/=100;const ne=j+W*Math.min(j,1-j),x=ne===0?0:2-2*j/ne;return{h:U,s:x*100,v:ne*100}}function Be(U,W,j){W/=100,j/=100;const ne=j*(1-W/2),x=ne===0||ne===1?0:(j-ne)/Math.min(ne,1-ne);return{h:U,s:x*100,l:ne*100}}const ce=R,vt=be,v=e.ref(!1),ue=e.ref(!1),Ce=e.ref(!1),he=e.ref(-1),ae=e.ref(-1),te=e.ref(null),oe=e.ref(null),H=e.ref(null),Ve=e.ref(null),Ae=e.ref({top:0,left:0}),Oe=e.ref(I(ce.modelValue||"#b8a5de")),mt=e.computed(()=>Array.isArray(ce.presetGroups)&&ce.presetGroups.length>0),Z=e.computed(()=>mt.value?0:ce.initialPresetCount!=null?ce.initialPresetCount:ae.value<0?null:ae.value),Te=e.computed(()=>{const U=Z.value;return U==null?!0:Math.max(0,ce.presetColors.length-U)<ce.max}),Bt=e.computed(()=>!!(ue.value||he.value>=0||!Ue.value&&ce.presetColors.length===0));e.computed(()=>{const U=Z.value;return U!=null&&ce.presetColors.length>U});const Ue=e.computed(()=>mt.value||Z.value!=null),Lt=e.computed(()=>{const U=Z.value;return U==null?[]:ce.presetColors.slice(0,U)}),Le=e.computed(()=>{const U=Z.value;return U==null?[]:ce.presetColors.slice(U)});function Ze(U){const W=Z.value;return W!=null?W+U:-1}function wt(U){const W=Z.value;return W!=null&&U>=W}function ze(U){wt(U)&&(he.value=U,Oe.value=I(ce.presetColors[U]),ue.value=!0,e.nextTick(()=>Ve.value?.focus()))}function Mt(U){if(!wt(U))return;const W=ce.presetColors.filter((x,k)=>k!==U);vt("update:presetColors",W);const j=Se(ce.modelValue),ne=Se(ce.presetColors[U]);if(j&&ne&&j.toLowerCase()===ne.toLowerCase()){const x=W[Math.max(0,U-1)]||W[0];x&&vt("update:modelValue",x)}}function at(){Ce.value=!Ce.value,Ce.value||(he.value=-1,ue.value=!1)}function Ct(){if(he.value<0)return;const U=je.value,W=Se(U);if(W){const j=[...ce.presetColors];j[he.value]=W,vt("update:presetColors",j),vt("update:modelValue",W),he.value=-1,ue.value=!1}}function cn(){ce.disabled||(he.value=-1,ue.value=!ue.value,ue.value&&(St(),e.nextTick(()=>Ve.value?.focus())))}function _t(U){const W=Se(U),j=Se(ce.modelValue);return W&&j&&W.toLowerCase()===j.toLowerCase()}function Qe(){if(ce.disabled||!Te.value)return;const U=je.value,W=Se(U);if(W){const j=[...ce.presetColors,W];vt("update:presetColors",j),vt("update:modelValue",W);const ne=Z.value??ae.value;ne>=0&&j.length-ne>=ce.max&&(ue.value=!1)}}const je=e.computed(()=>{const{h:U,s:W,l:j}=Oe.value;return A(U,W,j)}),$t=e.computed(()=>je.value.toLowerCase()),Ht=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${Oe.value.h}, 100%, 50%))`})),Yt=e.computed(()=>{const U=b(Oe.value.h,Oe.value.s,Oe.value.l);return{left:`${U.s}%`,bottom:`${U.v}%`,transform:"translate(-50%, 50%)"}}),pt=e.computed(()=>({left:`${Oe.value.h/360*100}%`,transform:"translateX(-50%)"})),Nt=e.computed(()=>({position:"fixed",left:`${Ae.value.left}px`,top:`${Ae.value.top}px`,zIndex:1002}));function xt(){if(!te.value||!v.value)return;const U=te.value.getBoundingClientRect(),W=window.innerHeight||document.documentElement.clientHeight;let j=U.bottom+4;const ne=oe.value;ne&&j+ne.offsetHeight>W-8&&(j=U.top-4-ne.offsetHeight),Ae.value={top:j,left:U.left}}function St(){const U=ce.modelValue||"#b8a5de";Se(U)&&(Oe.value=I(U))}function jt(){vt("update:modelValue",je.value)}function Q(){ce.disabled||(v.value=!v.value,v.value&&(St(),e.nextTick(()=>{xt(),Ve.value?.focus()})))}function ve(){const U=je.value,W=Se(U);if(W){if(he.value>=0){const j=[...ce.presetColors];j[he.value]=W,vt("update:presetColors",j),vt("update:modelValue",W)}else if((ce.presetColors.length>0||mt.value)&&ue.value&&Te.value&&!ce.presetColors.some(ne=>Se(ne)?.toLowerCase()===W.toLowerCase())){const ne=[...ce.presetColors,W];vt("update:presetColors",ne),vt("update:modelValue",W)}}v.value=!1,ue.value=!1,Ce.value=!1,he.value=-1}function fe(U){if(!H.value)return;const W=H.value.getBoundingClientRect(),j=ne=>{const x=Math.max(0,Math.min(1,(ne.clientX-W.left)/W.width)),k=Math.max(0,Math.min(1,1-(ne.clientY-W.top)/W.height)),V={h:Oe.value.h,s:x*100,v:k*100};Oe.value=Be(V.h,V.s,V.v)};j(U),document.addEventListener("mousemove",j),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",j),jt()},{once:!0})}function _e(U){if(!U.currentTarget)return;const j=U.currentTarget.getBoundingClientRect(),ne=x=>{const k=Math.max(0,Math.min(1,(x.clientX-j.left)/j.width));Oe.value={...Oe.value,h:k*360}};ne(U),document.addEventListener("mousemove",ne),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ne),jt()},{once:!0})}function rt(U){const W=U.target.value,j=Se(W);j&&(Oe.value=I(j),vt("update:modelValue",j))}function Ie(U){if(ce.disabled)return;const W=Se(U);W&&(Oe.value=I(W),vt("update:modelValue",W))}let Ke=null,de=null;function Ge(){Ke&&(document.removeEventListener("keydown",Ke),Ke=null),de&&(window.removeEventListener("resize",de),de=null)}return e.watch(v,U=>{if(Ge(),U){if(!mt.value&&ce.initialPresetCount==null){const W=ce.presetColors.length;W>0&&(ae.value<0||W<ae.value)&&(ae.value=W)}Ke=W=>{W.key==="Escape"&&ve()},de=xt,document.addEventListener("keydown",Ke),window.addEventListener("resize",de)}}),e.watch(()=>ce.modelValue,()=>{v.value&&St()},{immediate:!1}),e.watch(Le,U=>{U.length===0&&(Ce.value=!1,he.value=-1,ue.value=!1)}),e.onBeforeUnmount(Ge),(U,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":R.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:te,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":v.value}]),onClick:Q},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:je.value})},[...W[0]||(W[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ve,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:oe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Nt.value)},[Ue.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[mt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(R.presetGroups,(j,ne)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ne,class:"dss-color-picker__section"},[e.createElementVNode("span",z1,e.toDisplayString(j.title),1),e.createElementVNode("div",P1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.colors,(x,k)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ne+"-"+k,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":_t(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>Ie(x),["stop"])},null,14,O1))),128))])]))),128)):Lt.value.length?(e.openBlock(),e.createElementBlock("div",Z1,[W[1]||(W[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",W1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,(j,ne)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ne,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":_t(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(x=>Ie(j),["stop"])},null,14,q1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",U1,[e.createElementVNode("div",X1,[W[3]||(W[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Le.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":Ce.value}]),title:"Manage custom colors",onClick:e.withModifiers(at,["stop"])},[...W[2]||(W[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Y1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,(j,ne)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ne,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Ce.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Ce.value&&_t(j),"dss-color-picker__preset-bubble--editing":Ce.value&&he.value===Ze(ne)}]),style:e.normalizeStyle({backgroundColor:he.value===Ze(ne)?je.value:j}),title:he.value===Ze(ne)?je.value:j,onClick:e.withModifiers(x=>Ce.value?ze(Ze(ne)):Ie(j),["stop"])},null,14,j1),Ce.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(x=>Mt(Ze(ne)),["stop"])},[...W[4]||(W[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,K1)):e.createCommentVNode("",!0)],2))),128)),Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(cn,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):R.presetColors.length?(e.openBlock(),e.createElementBlock("div",G1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.presetColors,(j,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":_t(j)}]),style:e.normalizeStyle({backgroundColor:j}),title:j,onClick:e.withModifiers(x=>Ie(j),["stop"])},null,14,Q1))),128)),Te.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":ue.value}]),onClick:e.withModifiers(cn,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Bt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:fe},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(Ht.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Yt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:_e},[W[5]||(W[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(pt.value)},null,4)],32),e.createElementVNode("div",J1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ve,type:"text",class:"dss-color-picker__hex-input",value:$t.value,onInput:rt},null,40,em)]),Ue.value&&(R.presetColors.length||mt.value)&&Te.value&&he.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Qe}," Save color ")):e.createCommentVNode("",!0),Ue.value&&he.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ct}," Save color ")):e.createCommentVNode("",!0),Ue.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ve}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},nm={key:0,class:"dss-loader"},lm={key:0,class:"dss-loader-label"},om={key:1,class:"dss-loader"},am={key:0,class:"dss-loader-label"},sm={key:2,class:"dss-loader"},rm={key:0,class:"dss-loader-label"},im={key:3,class:"dss-loader"},cm={key:0,class:"dss-loader-label"},um={key:4,class:"dss-loader"},dm={key:0,class:"dss-loader-label"},mm={key:5,class:"dss-loader dss-loader--inline"},pm={class:"dss-loader-inline-text"},vm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(R){const be=R,I=e.computed(()=>be.size==="small"?"dss-loaders--size-small":be.size==="large"?"dss-loaders--size-large":be.size==="medium"||be.size==null?"dss-loaders--size-medium":null),A=e.computed(()=>be.size==="small"||be.size==="medium"||be.size==="large"||be.size==null?{}:{"--dss-loader-size":typeof be.size=="number"?`${be.size}px`:String(be.size)});return(Se,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",I.value]),style:e.normalizeStyle(A.value)},[R.type==="spinner"?(e.openBlock(),e.createElementBlock("div",nm,[b[0]||(b[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",lm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="dots"?(e.openBlock(),e.createElementBlock("div",om,[b[1]||(b[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",am,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="battery"?(e.openBlock(),e.createElementBlock("div",sm,[b[2]||(b[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),R.label?(e.openBlock(),e.createElementBlock("span",rm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",im,[b[3]||(b[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",cm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="bars"?(e.openBlock(),e.createElementBlock("div",um,[b[4]||(b[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),R.label?(e.openBlock(),e.createElementBlock("span",dm,e.toDisplayString(R.label),1)):e.createCommentVNode("",!0)])):R.type==="inline"?(e.openBlock(),e.createElementBlock("div",mm,[b[5]||(b[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",pm,[e.renderSlot(Se.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(R.label),1)])])])):e.createCommentVNode("",!0)],6))}},Xo="dss-skeleton-item",fm={__name:"DSSSkeleton",props:{loading:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},borderRadius:{type:String,default:"16px"},shimmer:{type:Boolean,default:!0},mode:{type:String,default:"single",validator:R=>["single","multiple"].includes(R)},targetClass:{type:String,default:Xo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(R){const be=R,I=e.computed(()=>{const b={"dss-skeleton--loading":be.loading,"dss-skeleton--static":!be.shimmer,"dss-skeleton--multiple":be.mode==="multiple","dss-skeleton--dark":be.darkMode};return be.mode==="multiple"&&be.targetClass!==Xo&&(b[`dss-skeleton--target-${be.targetClass}`]=!0),b}),A=e.computed(()=>{const b={};return be.borderRadius&&(b.borderRadius=be.borderRadius),b}),Se=e.computed(()=>{const b={};return be.borderRadius&&(b["--dss-skeleton-border-radius"]=be.borderRadius),be.darkMode?(b["--dss-skeleton-bg"]=be.bgDark||"#322c3f",b["--dss-skeleton-shimmer"]=be.shimmerDark||"#3e3f41",b):(be.bgColor&&(b["--dss-skeleton-bg"]=be.bgColor),be.shimmerColor&&(b["--dss-skeleton-shimmer"]=be.shimmerColor),b)});return(b,Be)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",I.value]),style:e.normalizeStyle(Se.value)},[R.loading&&R.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(A.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":R.loading&&R.mode==="single"}])},[e.renderSlot(b.$slots,"default")],2)],6))}},gm={key:0,class:"dss-dnd-column-header"},hm={class:"dss-dnd-column-title"},ym={class:"dss-dnd-column-count"},Cm=["data-column"],km={key:0,class:"dss-dnd-indicator"},bm=["onPointerdown"],wm=["onPointerdown"],xm={class:"dss-dnd-item-content"},Em={class:"dss-dnd-item-default"},Vm={key:0,class:"dss-dnd-empty"},Nm={name:"DSSDnd"},Sm=Object.assign(Nm,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(R,{emit:be}){const I=R,A=be,Se=e.useSlots(),b=e.computed(()=>!!Se["delete-zone"]),Be={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},ce=e.computed(()=>({...Be,...I.options})),vt=e.computed(()=>({"--dss-dnd-col-min-w":ce.value.columnMinWidth,"--dss-dnd-col-max-w":ce.value.columnMaxWidth,"--dss-dnd-col-gap":ce.value.columnGap,"--dss-dnd-indicator-color":ce.value.indicatorColor,"--dss-dnd-body-max-h":ce.value.columnBodyMaxHeight}));function v(Q){if(!ce.value.ColColor||!Q)return{};const ve=Q.background||Q.color;return ve?{background:ve}:{}}const ue=e.ref(null),Ce=e.ref(null),he=e.ref(!1),ae=e.ref(-1),te=e.ref(null);let oe=null,H=null,Ve=null,Ae=null,Oe=0,mt=0,Z="",Te=null;const Bt=5,Ue=e.computed(()=>{const Q={};for(const ve of I.columns)Q[ve.value]=I.items.filter(fe=>fe[I.columnKey]===ve.value).sort((fe,_e)=>(fe[I.positionKey]??0)-(_e[I.positionKey]??0));return Q}),Lt=e.computed(()=>{const Q={},ve=!!ue.value,fe=ue.value?.[I.itemKey],_e=Ce.value,rt=ae.value;for(const Ie of I.columns){const Ke=Ue.value[Ie.value]||[],de=[],Ge=_e==Ie.value;let U=0;for(let W=0;W<Ke.length;W++){const j=Ke[W],ne=ve&&j[I.itemKey]===fe;!ne&&Ge&&rt===U&&de.push({type:"indicator",key:`ind-${U}`}),ne||U++,de.push({type:"item",item:j,isDragged:ne,key:`item-${j[I.itemKey]}`})}Ge&&rt>=U&&de.push({type:"indicator",key:"ind-end"}),Q[Ie.value]=de}return Q});function Le(Q,ve){const _e=(Ue.value[Q]||[]).filter(Ke=>Ke[I.itemKey]!==ue.value?.[I.itemKey]);if(_e.length===0)return 1;if(ve<=0){const Ke=_e[0][I.positionKey];return Ke!=null&&Ke>0?Ke/2:.5}if(ve>=_e.length){const Ke=_e[_e.length-1][I.positionKey];return(Ke??0)+1}const rt=_e[ve-1][I.positionKey]??0,Ie=_e[ve][I.positionKey]??0;return(rt+Ie)/2}function Ze(Q,ve,fe){Ve&&Ve.remove();const _e=Q.getBoundingClientRect(),rt=Q.cloneNode(!0);rt.classList.add("dss-dnd-ghost"),rt.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
|
-
left: ${
|
|
106
|
-
top: ${
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
105
|
+
left: ${ve-Oe}px;
|
|
106
|
+
top: ${fe-mt}px;
|
|
107
|
+
width: ${_e.width}px;
|
|
108
|
+
height: ${_e.height}px;
|
|
109
109
|
z-index: 9999;
|
|
110
110
|
pointer-events: none;
|
|
111
111
|
opacity: ${ce.value.dragGhostOpacity};
|
|
@@ -114,4 +114,4 @@
|
|
|
114
114
|
background-color: ${ce.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(lt),L=lt}function We(ne,Ve){L&&(L.style.left=`${ne-Re}px`,L.style.top=`${Ve-Oe}px`)}function Et(ne){ne.classList.add("dss-dnd-item--dragging"),ne.style.background=ce.value.dragSourceBackground,ne.style.borderColor=ce.value.dragSourceBorder,ne.style.transform="scale(0.97)"}function Ie(ne){ne.classList.remove("dss-dnd-item--dragging"),ne.style.background="",ne.style.borderColor="",ne.style.transform=""}function $t(ne,Ve){return document.elementFromPoint(ne,Ve)?.closest(".dss-dnd-column-body")??null}function at(ne,Ve){return!!document.elementFromPoint(ne,Ve)?.closest("[data-dss-dnd-delete-zone]")}function Vt(ne,Ve){if(b.value&&at(ne,Ve)){Ce.value=!0,me.value=null,pe.value=-1;return}Ce.value=!1;const he=$t(ne,Ve),ye=he?.getAttribute("data-column")??null;if(!ye){me.value=null,pe.value=-1;return}me.value=ye;const lt=he.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let kt=lt.length;for(let Le=0;Le<lt.length;Le++){const dt=lt[Le].getBoundingClientRect();if(Ve<dt.top+dt.height/2){kt=Le;break}}pe.value=kt}function an(ne){ne.preventDefault(),We(ne.clientX,ne.clientY),!ee&&(ee=requestAnimationFrame(()=>{ee=null,Vt(ne.clientX,ne.clientY)}))}function Mt(ne){window.removeEventListener("pointermove",an),window.removeEventListener("pointerup",Mt),window.removeEventListener("pointercancel",Mt),Fe?.releasePointerCapture?.(ne.pointerId),Ie(Fe),Fe=null;const Ve=b.value&&at(ne.clientX,ne.clientY);if(p.value&&Ve)A("delete",{item:p.value});else{const ye=$t(ne.clientX,ne.clientY)?.getAttribute("data-column")??null;if(p.value&&ye){const lt=p.value[I.columnKey],kt=ye,dt=(xt.value[kt]||[]).filter(W=>W[I.itemKey]!==p.value[I.itemKey]),ve=Math.max(0,Math.min(pe.value,dt.length)),je=Ht(kt,ve),U=p.value[I.itemKey];A("move",{item:p.value,from:lt,to:kt,position:je,index:ve}),le&&clearTimeout(le),oe.value={id:U,from:lt,to:kt},le=setTimeout(()=>{oe.value=null},3500)}}L&&(L.remove(),L=null),ut!==null&&(document.body.style.cursor=ut,ut=""),_t()}function nt(ne,Ve){ne.preventDefault();const he=ne.target.closest(".dss-dnd-item");if(!he)return;const ye=he.getBoundingClientRect();Re=ne.clientX-ye.left,Oe=ne.clientY-ye.top,ut=document.body.style.cursor,document.body.style.cursor="grabbing",p.value=Ve,Fe=he,$e(he,ne.clientX,ne.clientY),requestAnimationFrame(()=>Et(he)),he.setPointerCapture?.(ne.pointerId),window.addEventListener("pointermove",an),window.addEventListener("pointerup",Mt,{once:!0}),window.addEventListener("pointercancel",Mt,{once:!0})}function ze(){O&&(window.removeEventListener("pointermove",At),window.removeEventListener("pointerup",Tt),window.removeEventListener("pointercancel",Tt),O=null)}function At(ne){if(!O||ne.pointerId!==O.pointerId)return;const Ve=ne.clientX-O.startX,he=ne.clientY-O.startY;if(Math.abs(Ve)>=Ze||Math.abs(he)>=Ze){const ye=O.item;ze(),nt(ne,ye)}}function Tt(ne){!O||ne.pointerId!==O.pointerId||ze()}function sn(ne,Ve){ze(),O={item:Ve,startX:ne.clientX,startY:ne.clientY,pointerId:ne.pointerId},window.addEventListener("pointermove",At),window.addEventListener("pointerup",Tt),window.addEventListener("pointercancel",Tt)}function vt(ne,Ve){ce.value.useHandle||sn(ne,Ve)}function Bt(ne,Ve){sn(ne,Ve)}function Ct(){ee&&(cancelAnimationFrame(ee),ee=null)}function _t(){Ct(),p.value=null,me.value=null,Ce.value=!1,pe.value=-1}return e.onBeforeUnmount(()=>{Ct(),ze(),le&&clearTimeout(le),L&&(L.remove(),L=null)}),(ne,Ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ce.value.unstyled}]),style:e.normalizeStyle(pt.value)},[b.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":Ce.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(ne.$slots,"delete-zone",{isDragging:!!p.value,isOver:Ce.value})],2),[[e.vShow,!!p.value||ce.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,he=>(e.openBlock(),e.createElementBlock("div",{key:he.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":me.value==he.value},he.class||""]])},[ce.value.showHeader?(e.openBlock(),e.createElementBlock("div",gm,[e.renderSlot(ne.$slots,"column-header",{column:he,items:xt.value[he.value]||[]},()=>[e.createElementVNode("span",hm,e.toDisplayString(he.title||he.value),1),e.createElementVNode("span",ym,e.toDisplayString((xt.value[he.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":he.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value[he.value],ye=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ye.key},[ye.type==="indicator"?(e.openBlock(),e.createElementBlock("div",km)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ye.isDragged,"dss-dnd-item--no-handle":!ce.value.useHandle}]),onPointerdown:lt=>vt(lt,ye.item)},[ce.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(lt=>Bt(lt,ye.item),["stop"])},[e.renderSlot(ne.$slots,"handle",{},()=>[Ve[0]||(Ve[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,wm)):e.createCommentVNode("",!0),e.createElementVNode("div",xm,[e.renderSlot(ne.$slots,"item",{item:ye.item,column:he,justDropped:oe.value?.id===ye.item[R.itemKey],droppedFrom:oe.value?.id===ye.item[R.itemKey]?oe.value.from:null,droppedTo:oe.value?.id===ye.item[R.itemKey]?oe.value.to:null},()=>[e.createElementVNode("div",Em,e.toDisplayString(ye.item[R.itemKey]),1)])])],42,bm))],64))),128)),(xt.value[he.value]||[]).length===0&&me.value!=he.value?(e.openBlock(),e.createElementBlock("div",Vm,[e.renderSlot(ne.$slots,"empty",{column:he},()=>[Ve[1]||(Ve[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Cm)],2))),128))],6))}}),Bm={name:"DSSConfetti"},Mm=Object.assign(Bm,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(R){const be=R,I=e.ref(null),A=e.ref(!1);let Se=[],b=null,Be=null;function ce(oe,ee){const le=[];for(let L=0;L<be.count;L++)le.push(pt(oe));return le}function pt(oe,ee){return{x:Math.random()*oe,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:be.colors[Math.floor(Math.random()*be.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function p(oe,ee,le,L){oe.clearRect(0,0,ee,le);for(const Fe of Se)oe.save(),oe.globalAlpha=Fe.opacity*L,oe.beginPath(),oe.lineWidth=Fe.r,oe.strokeStyle=Fe.color,oe.moveTo(Fe.x+Fe.tilt+Fe.r/2,Fe.y),oe.lineTo(Fe.x+Fe.tilt,Fe.y+Fe.tilt+Fe.r/2),oe.stroke(),oe.restore()}function me(oe,ee,le){const L=.3+le*.7;for(let Fe=0;Fe<Se.length;Fe++){const Re=Se[Fe];Re.tiltAngle+=Re.tiltInc,Re.y+=Re.speed*L,Re.x+=Math.sin(Re.d)*.5*L,Re.tilt=Math.sin(Re.tiltAngle)*15,le>=.99&&Re.y>ee+20&&(Se[Fe]=pt(oe))}}function Ce(){A.value=!0,e.nextTick(()=>{const oe=I.value;if(!oe)return;const ee=oe.getContext("2d"),le=oe.parentElement;if(!le)return;const L=le.getBoundingClientRect();oe.width=L.width,oe.height=L.height,Se=ce(oe.width,oe.height);const Fe=Date.now(),Re=Fe+be.duration,Oe=()=>{const ut=Date.now(),O=ut-Fe;if(ut<Re){let Ze=1;O>be.fadeStart&&(Ze=1-(O-be.fadeStart)/(be.duration-be.fadeStart)),p(ee,oe.width,oe.height,Ze),me(oe.width,oe.height,Ze),b=requestAnimationFrame(Oe)}else pe()};Oe()})}function pe(){b&&(cancelAnimationFrame(b),b=null),Se=[],A.value=!1}return e.watch(()=>be.trigger,oe=>{oe&&(Be&&clearTimeout(Be),Be=setTimeout(Ce,be.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{pe(),Be&&clearTimeout(Be)}),(oe,ee)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:I,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),_m={class:"dss-filter-global-inner"},$m=["value"],Tm=["title"],Lm={key:0,class:"dss-filter-funnel-badge"},Hm={class:"dss-filter-panel"},Am={key:0,class:"dss-filter-empty"},Dm={class:"dss-filter-row-prefix"},Rm={class:"dss-filter-cell"},Fm=["onClick"],Im={class:"dss-filter-trigger-text"},zm={class:"dss-filter-popup-list"},Pm=["onClick"],Om={key:0,class:"dss-filter-popup-empty"},Zm={key:0,class:"dss-filter-cell"},Wm=["onClick"],qm={class:"dss-filter-trigger-text"},Um={class:"dss-filter-popup-list"},Xm=["onClick"],Ym={key:1,class:"dss-filter-cell dss-filter-cell--value"},jm=["onUpdate:modelValue"],Km={key:1,class:"dss-filter-date-wrap"},Gm=["onUpdate:modelValue"],Qm=["value","onInput","step"],Jm={key:4,class:"dss-filter-between"},e2=["value","onInput","step"],t2=["value","onInput","step"],n2={key:5,class:"dss-filter-multiselect"},l2=["onClick"],o2={class:"dss-filter-trigger-text"},a2={class:"dss-filter-popup-list dss-filter-popup-list--check"},s2=["onClick"],r2=["checked"],i2={key:0,class:"dss-filter-popup-empty"},c2=["onClick"],u2={class:"dss-filter-foot"},d2={class:"dss-filter-cell"},m2={class:"dss-filter-popup-list"},p2=["onClick"],v2={key:0,class:"dss-filter-popup-divider"},f2=["onClick"],g2={class:"dss-filter-popup-list"},h2=["onClick"],y2={key:0,class:"dss-filter-popup-empty"},C2={class:"dss-filter-popup-list"},k2=["onClick"],b2={key:0,class:"dss-filter-popup-empty"},w2={name:"DSSFilter"},x2=Object.assign(w2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(R,{expose:be,emit:I}){const A=R,Se=I,b={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Be=e.computed(()=>({...b,...A.options})),ce={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},pt=new Set(["is_empty","is_not_empty","is_true","is_false"]),p=["label","name","title","keyword","full_name","value","text"],me=e.ref(""),Ce=e.ref([]),pe=e.ref(null),oe=e.ref(!1),ee=e.ref(null),le=e.ref(""),L=e.ref(null);let Fe=1;function Re(x){const k=x.find(V=>V&&typeof V=="object");if(!k)return null;for(const V of p)if(V in k&&typeof k[V]=="string")return V;return Object.keys(k).find(V=>typeof k[V]=="string")||null}function Oe(x,k){const V=k.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(He=>He).filter(He=>He!=null);return P.length===0?null:typeof P.find(He=>He!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Be.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Be.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const ut=e.computed(()=>{if(!A.data?.length)return[];const x=new Set;for(const X of A.data)if(X&&typeof X=="object")for(const He of Object.keys(X))x.add(He);const k=new Set(A.exclude),V=[];for(const X of x){if(k.has(X))continue;const He=A.config[X]||{},Xe=A.data.map(yt=>yt?.[X]),Me=He.type||Oe(X,Xe);if(!Me)continue;const te=He.filterMode||"contain",et=te==="date"?"date":te==="string"?"text":Me,Ke={key:X,label:He.label||K(X),type:et,filterMode:te};if(Me==="select"){const yt=Xe.filter(ht=>ht!=null&&ht!=="NULL");Ke.uniqueValues=[...new Set(yt)].sort((ht,Ye)=>typeof ht=="number"&&typeof Ye=="number"?ht-Ye:String(ht).localeCompare(String(Ye)))}else if(Me==="range"||Me==="int"){const yt=Xe.filter(ht=>typeof ht=="number");Ke.min=Math.min(...yt),Ke.max=Math.max(...yt)}else if(Me==="arraySelect"){const yt=He.displayKey||Re(Xe.flatMap(Ye=>Array.isArray(Ye)?Ye:[]));Ke.displayKey=yt;const ht=Xe.flatMap(Ye=>Array.isArray(Ye)?Ye:[]).filter(Ye=>Ye!=null).map(Ye=>yt&&typeof Ye=="object"?Ye[yt]:String(Ye)).filter(Ye=>Ye!=null&&Ye!=="");Ke.uniqueValues=[...new Set(ht)].sort((Ye,Cn)=>String(Ye).localeCompare(String(Cn)))}V.push(Ke)}const P=A.config._order;return P&&V.sort((X,He)=>{const Xe=P.indexOf(X.key),Me=P.indexOf(He.key);return Xe===-1&&Me===-1?0:Xe===-1?1:Me===-1?-1:Xe-Me}),V}),O=e.computed(()=>{const x={};for(const k of ut.value)x[k.key]=k;return x}),Ze=e.computed(()=>Array.isArray(A.config.groups)&&A.config.groups.length>0),xt=e.computed(()=>{if(!Ze.value)return[];const x=new Set(ut.value.map(k=>k.key));return A.config.groups.map(k=>({...k,keys:k.keys.filter(V=>x.has(V))})).filter(k=>k.keys.length>0)}),Je=e.computed(()=>{if(!Ze.value)return[];const x=new Set(A.config.groups.flatMap(k=>k.keys));return ut.value.filter(k=>!x.has(k.key))}),Ht=e.computed(()=>{if(!L.value)return[];const x=new Set(L.value.keys),k=ut.value.filter(P=>x.has(P.key));if(!le.value)return k;const V=le.value.toLowerCase();return k.filter(P=>P.label.toLowerCase().includes(V))}),$e=e.computed(()=>{if(!le.value)return ut.value;const x=le.value.toLowerCase();return ut.value.filter(k=>k.label.toLowerCase().includes(x))});function We(x){pe.value===x?Et():(pe.value=x,le.value="",L.value=null)}function Et(){pe.value=null,le.value="",L.value=null}function Ie(x){const k=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");pe.value&&!k&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&&Et(),oe.value&&ee.value&&!ee.value.contains(x.target)&&(k||(oe.value=!1))}e.onMounted(()=>document.addEventListener("click",Ie)),e.onBeforeUnmount(()=>document.removeEventListener("click",Ie));function $t(x){return O.value[x]?.label||K(x)}function at(x){return O.value[x.key]?.filterMode||"contain"}function Vt(x){for(const k of Object.values(ce)){const V=k.find(P=>P.value===x);if(V)return V.label}return x}function an(x){const k=O.value[x.key];return ce[k?.type]||ce.text}function Mt(x){return pt.has(x)}function nt(x){const k=O.value[x.key];return k?k.type==="date"?"date":k.type==="boolean"?"boolean":k.type==="text"||k.type==="arrayText"?"text":k.type==="select"||k.type==="arraySelect"?"multiselect":k.type==="range"||k.type==="int"?x.operator==="between"?"between":"number":"text":"text"}function ze(x){return ce[x]?.[0]?.value||"contains"}function At(x,k){return pt.has(k)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&k==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function Tt(x){return O.value[x.key]?.uniqueValues||[]}function sn(x){const k=Tt(x);if(!le.value)return k;const V=le.value.toLowerCase();return k.filter(P=>String(P).toLowerCase().includes(V))}function vt(x){const k=x.value;return!k||k.length===0?"Select...":k.length<=2?k.join(", "):`${k.length} selected`}function Bt(x){const k=O.value[x],V=k?.filterMode||"contain",P=k?.type||"text",X=V==="string"?"contains":ze(P);Ce.value.push(e.reactive({id:Fe++,key:x,operator:X,value:At(P,X)})),Et()}function Ct(x){Ce.value=Ce.value.filter(k=>k.id!==x)}function _t(x,k){const P=O.value[k]?.type||"text";x.key=k,x.operator=ze(P),x.value=At(P,x.operator),Et()}function ne(x,k){const V=nt(x);x.operator=k;const P=nt(x);if(V!==P||pt.has(k)){const X=O.value[x.key];x.value=At(X?.type||"text",k)}Et()}function Ve(x,k){const V=k.target.value;x.value=V===""?null:Number(V)}function he(x,k,V){const P=V.target.value,X=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[k]:isNaN(X)?null:X}}function ye(x,k){const V=x.value||[],P=V.indexOf(k);x.value=P>=0?V.filter(X=>X!==k):[...V,k]}function lt(){Ce.value=[],me.value="",Et()}function kt(x){me.value=x.target.value}const Le=e.computed(()=>{if(!A.data)return[];let x=A.data;if(me.value){const k=me.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const X=V[P];if(typeof X=="string"&&X.toLowerCase().includes(k)||typeof X=="number"&&String(X).includes(k)||Array.isArray(X)&&X.some(He=>He!=null&&(typeof He=="string"?He.toLowerCase().includes(k):typeof He=="object"?Object.values(He).some(Xe=>typeof Xe=="string"&&Xe.toLowerCase().includes(k)):!1)))return!0}return!1})}for(const k of Ce.value){if(!dt(k))continue;const V=O.value[k.key];V&&(x=x.filter(P=>ve(P,k,V)))}return x});function dt(x){return pt.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function ve(x,k,V){const P=x?.[k.key],X=k.value,He=k.operator;if(He==="is_empty")return W(P);if(He==="is_not_empty")return!W(P);const Xe=V.type;if(Xe==="text"||Xe==="arrayText"){const Me=Xe==="arrayText"&&Array.isArray(P)?P.filter(Ke=>Ke!=null).map(String).join(" "):P!=null?String(P):"",te=String(X).toLowerCase(),et=Me.toLowerCase();switch(He){case"contains":return et.includes(te);case"not_contains":return!et.includes(te);case"equals":return et===te;case"not_equals":return et!==te;case"starts_with":return et.startsWith(te);case"ends_with":return et.endsWith(te);default:return!0}}if(Xe==="select")switch(He){case"is_any_of":return X.includes(P);case"is_none_of":return!X.includes(P);default:return!0}if(Xe==="range"||Xe==="int"){const Me=typeof P=="number"?P:Number(P);if(typeof Me!="number"||isNaN(Me))return!1;if(He==="between"){const et=X?.min!=null?Number(X.min):null,Ke=X?.max!=null?Number(X.max):null,yt=et!=null&&!isNaN(et)?et:null,ht=Ke!=null&&!isNaN(Ke)?Ke:null;return(yt==null||Me>=yt)&&(ht==null||Me<=ht)}const te=typeof X=="number"&&!isNaN(X)?X:Number(X);if(He==="contains"||He==="not_contains"){const et=String(Me),Ke=String(X??"").toLowerCase(),yt=et.toLowerCase().includes(Ke);return He==="contains"?yt:!yt}if(typeof te!="number"||isNaN(te))return!1;switch(He){case"eq":return Me===te;case"neq":return Me!==te;case"gt":return Me>te;case"gte":return Me>=te;case"lt":return Me<te;case"lte":return Me<=te;default:return!0}}if(Xe==="arraySelect"){if(!Array.isArray(P))return!1;const Me=P.filter(te=>te!=null).map(te=>V.displayKey&&typeof te=="object"?te[V.displayKey]:String(te));switch(He){case"contains_any":return Me.some(te=>X.includes(te));case"contains_all":return X.every(te=>Me.includes(te));case"not_contains_any":return!Me.some(te=>X.includes(te));default:return!0}}if(Xe==="date"){const Me=je(X);if(!Me||isNaN(Me.getTime()))return!1;const te=je(P);if(!te||isNaN(te.getTime()))return!1;const et=U(te),Ke=U(Me);switch(He){case"eq":return et===Ke;case"before":return et<Ke;case"after":return et>Ke;default:return!0}}if(Xe==="boolean"){const Me=P===!0||P==="true"||P===1,te=P===!1||P==="false"||P===0;switch(He){case"is_true":return Me;case"is_false":return te;default:return!0}}return!0}function je(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const k=new Date(x);return isNaN(k.getTime())?null:k}return null}function U(x){const k=x.getFullYear(),V=String(x.getMonth()+1).padStart(2,"0"),P=String(x.getDate()).padStart(2,"0");return`${k}-${V}-${P}`}function W(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(k=>k==null))}e.watch(Le,x=>Se("update:modelValue",x),{immediate:!0}),e.watch(()=>A.data,()=>{Ce.value=[],me.value="",oe.value=!1,Et()});function K(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,k=>k.toUpperCase())}function ae(){const x=k=>{if(k==null)return k;if(k instanceof Date)return{_type:"Date",value:k.toISOString(),local:k.toLocaleDateString()};if(Array.isArray(k))return k.map(x);if(typeof k=="object"&&!Array.isArray(k)){const V={};for(const P of Object.keys(k))V[P]=x(k[P]);return V}return k};return{globalSearch:me.value,rows:Ce.value.map(k=>({key:k.key,operator:k.operator,value:x(k.value),defType:O.value[k.key]?.type,defFilterMode:O.value[k.key]?.filterMode})),filteredCount:Le.value?.length??0}}return be({getDebugState:ae}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Be.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ee},[e.createElementVNode("div",_m,[k[15]||(k[15]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:"Search across all fields...",value:me.value,onInput:kt},null,40,$m),me.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:k[0]||(k[0]=V=>me.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:oe.value||Ce.value.length>0}]),onClick:k[1]||(k[1]=V=>oe.value=!oe.value),type:"button",title:oe.value?"Close advanced filter":"Open advanced filter"},[k[14]||(k[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",Lm,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,Tm)]),oe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:k[13]||(k[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Hm,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",Am," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Dm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Rm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>We(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Im,e.toDisplayString($t(V.key)),1),k[16]||(k[16]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Fm),pe.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[2]||(k[2]=X=>le.value=X),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,X=>(e.openBlock(),e.createElementBlock("li",{key:X.key,class:"dss-filter-popup-item",onClick:He=>_t(V,X.key)},e.toDisplayString(X.label),9,Pm))),128)),$e.value.length===0?(e.openBlock(),e.createElementBlock("li",Om,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),at(V)==="contain"||at(V)==="date"?(e.openBlock(),e.createElementBlock("div",Zm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>We(`${V.id}:op`),["stop"])},[e.createElementVNode("span",qm,e.toDisplayString(Vt(V.operator)),1),k[17]||(k[17]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Wm),pe.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[4]||(k[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(an(V),X=>(e.openBlock(),e.createElementBlock("li",{key:X.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===X.value}]),onClick:He=>ne(V,X.value)},e.toDisplayString(X.label),11,Xm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Mt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[at(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":X=>V.value=X},null,8,jm)),[[e.vModelText,V.value]]):at(V)==="date"?(e.openBlock(),e.createElementBlock("div",Km,[e.createVNode(Po,{mode:"single",modelValue:V.value,"onUpdate:modelValue":X=>V.value=X},null,8,["modelValue","onUpdate:modelValue"])])):nt(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":X=>V.value=X},null,8,Gm)),[[e.vModelText,V.value]]):nt(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:X=>Ve(V,X),step:O.value[V.key]?.type==="int"?1:void 0},null,40,Qm)):nt(V)==="between"?(e.openBlock(),e.createElementBlock("div",Jm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:X=>he(V,"min",X),step:O.value[V.key]?.type==="int"?1:void 0},null,40,e2),k[18]||(k[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:X=>he(V,"max",X),step:O.value[V.key]?.type==="int"?1:void 0},null,40,t2)])):nt(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>We(`${V.id}:val`),["stop"])},[e.createElementVNode("span",o2,e.toDisplayString(vt(V)),1),k[19]||(k[19]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,l2),pe.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[Tt(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[5]||(k[5]=X=>le.value=X),placeholder:"Search..."},null,512)),[[e.vModelText,le.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",a2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn(V),X=>(e.openBlock(),e.createElementBlock("li",{key:X,class:"dss-filter-popup-item",onClick:He=>ye(V,X)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(X),tabindex:"-1"},null,8,r2),e.createElementVNode("span",null,e.toDisplayString(X),1)],8,s2))),128)),sn(V).length===0?(e.openBlock(),e.createElementBlock("li",i2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:X=>Ct(V.id)},[...k[20]||(k[20]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,c2)]))),128)),e.createElementVNode("div",u2,[e.createElementVNode("div",d2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:k[7]||(k[7]=e.withModifiers(V=>We("add"),["stop"]))}," Add filter "),pe.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:k[12]||(k[12]=e.withModifiers(()=>{},["stop"]))},[Ze.value&&!L.value&&!le.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[8]||(k[8]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>L.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),k[21]||(k[21]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p2))),128)),Je.value.length>0?(e.openBlock(),e.createElementBlock("li",v2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Je.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Bt(V.key)},e.toDisplayString(V.label),9,f2))),128))])],64)):L.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:k[9]||(k[9]=V=>L.value=null)},[k[22]||(k[22]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(L.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[10]||(k[10]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",g2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Bt(V.key)},e.toDisplayString(V.label),9,h2))),128)),Ht.value.length===0?(e.openBlock(),e.createElementBlock("li",y2,"No match")):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[11]||(k[11]=V=>le.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,le.value]]),e.createElementVNode("ul",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($e.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Bt(V.key)},e.toDisplayString(V.label),9,k2))),128)),$e.value.length===0?(e.openBlock(),e.createElementBlock("li",b2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:lt}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),E2={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},V2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},N2={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},S2={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},eo={chart:E2,table:V2,datepicker:N2,textEditor:S2},B2={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},M2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},_2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},$2={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},to={chart:B2,table:M2,datepicker:_2,textEditor:$2},T2={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},L2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},H2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},A2={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},no={chart:T2,table:L2,datepicker:H2,textEditor:A2},Ro={en:eo,fr:to,nl:no};function D2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Ro).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Ro[I])})}const Fo={en:{textEditor:eo.textEditor},fr:{textEditor:to.textEditor},nl:{textEditor:no.textEditor}};function R2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Fo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Fo[I])})}const Io={en:{table:eo.table},fr:{table:to.table},nl:{table:no.table}};function F2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Io).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Io[I])})}const zo={en:{datepicker:eo.datepicker},fr:{datepicker:to.datepicker},nl:{datepicker:no.datepicker}};function I2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(zo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,zo[I])})}const z2={en:{...eo},fr:{...to},nl:{...no}};Jl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:z2});exports.DSSChart=$i;exports.DSSChartMessages=Ro;exports.DSSColorPicker=tm;exports.DSSConfetti=Mm;exports.DSSDatepicker=Po;exports.DSSDatepickerMessages=zo;exports.DSSDnd=Sm;exports.DSSFilter=x2;exports.DSSLoader=vm;exports.DSSModal=Do;exports.DSSSkeleton=fm;exports.DSSTable=Yc;exports.DSSTableMessages=Io;exports.DSSTextEditor=I1;exports.DSSTextEditorMessages=Fo;exports.addDSSChartTranslations=D2;exports.addDSSDatepickerTranslations=I2;exports.addDSSTableTranslations=F2;exports.addDSSTextEditorTranslations=R2;
|
|
117
|
+
`,document.body.appendChild(rt),Ve=rt}function wt(Q,ve){Ve&&(Ve.style.left=`${Q-Oe}px`,Ve.style.top=`${ve-mt}px`)}function ze(Q){Q.classList.add("dss-dnd-item--dragging"),Q.style.background=ce.value.dragSourceBackground,Q.style.borderColor=ce.value.dragSourceBorder,Q.style.transform="scale(0.97)"}function Mt(Q){Q.classList.remove("dss-dnd-item--dragging"),Q.style.background="",Q.style.borderColor="",Q.style.transform=""}function at(Q,ve){return document.elementFromPoint(Q,ve)?.closest(".dss-dnd-column-body")??null}function Ct(Q,ve){return!!document.elementFromPoint(Q,ve)?.closest("[data-dss-dnd-delete-zone]")}function cn(Q,ve){if(b.value&&Ct(Q,ve)){he.value=!0,Ce.value=null,ae.value=-1;return}he.value=!1;const fe=at(Q,ve),_e=fe?.getAttribute("data-column")??null;if(!_e){Ce.value=null,ae.value=-1;return}Ce.value=_e;const rt=fe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ie=rt.length;for(let Ke=0;Ke<rt.length;Ke++){const de=rt[Ke].getBoundingClientRect();if(ve<de.top+de.height/2){Ie=Ke;break}}ae.value=Ie}function _t(Q){Q.preventDefault(),wt(Q.clientX,Q.clientY),!oe&&(oe=requestAnimationFrame(()=>{oe=null,cn(Q.clientX,Q.clientY)}))}function Qe(Q){window.removeEventListener("pointermove",_t),window.removeEventListener("pointerup",Qe),window.removeEventListener("pointercancel",Qe),Ae?.releasePointerCapture?.(Q.pointerId),Mt(Ae),Ae=null;const ve=b.value&&Ct(Q.clientX,Q.clientY);if(ue.value&&ve)A("delete",{item:ue.value});else{const _e=at(Q.clientX,Q.clientY)?.getAttribute("data-column")??null;if(ue.value&&_e){const rt=ue.value[I.columnKey],Ie=_e,de=(Ue.value[Ie]||[]).filter(j=>j[I.itemKey]!==ue.value[I.itemKey]),Ge=Math.max(0,Math.min(ae.value,de.length)),U=Le(Ie,Ge),W=ue.value[I.itemKey];A("move",{item:ue.value,from:rt,to:Ie,position:U,index:Ge}),H&&clearTimeout(H),te.value={id:W,from:rt,to:Ie},H=setTimeout(()=>{te.value=null},3500)}}Ve&&(Ve.remove(),Ve=null),Z!==null&&(document.body.style.cursor=Z,Z=""),jt()}function je(Q,ve){Q.preventDefault();const fe=Q.target.closest(".dss-dnd-item");if(!fe)return;const _e=fe.getBoundingClientRect();Oe=Q.clientX-_e.left,mt=Q.clientY-_e.top,Z=document.body.style.cursor,document.body.style.cursor="grabbing",ue.value=ve,Ae=fe,Ze(fe,Q.clientX,Q.clientY),requestAnimationFrame(()=>ze(fe)),fe.setPointerCapture?.(Q.pointerId),window.addEventListener("pointermove",_t),window.addEventListener("pointerup",Qe,{once:!0}),window.addEventListener("pointercancel",Qe,{once:!0})}function $t(){Te&&(window.removeEventListener("pointermove",Ht),window.removeEventListener("pointerup",Yt),window.removeEventListener("pointercancel",Yt),Te=null)}function Ht(Q){if(!Te||Q.pointerId!==Te.pointerId)return;const ve=Q.clientX-Te.startX,fe=Q.clientY-Te.startY;if(Math.abs(ve)>=Bt||Math.abs(fe)>=Bt){const _e=Te.item;$t(),je(Q,_e)}}function Yt(Q){!Te||Q.pointerId!==Te.pointerId||$t()}function pt(Q,ve){$t(),Te={item:ve,startX:Q.clientX,startY:Q.clientY,pointerId:Q.pointerId},window.addEventListener("pointermove",Ht),window.addEventListener("pointerup",Yt),window.addEventListener("pointercancel",Yt)}function Nt(Q,ve){ce.value.useHandle||pt(Q,ve)}function xt(Q,ve){pt(Q,ve)}function St(){oe&&(cancelAnimationFrame(oe),oe=null)}function jt(){St(),ue.value=null,Ce.value=null,he.value=!1,ae.value=-1}return e.onBeforeUnmount(()=>{St(),$t(),H&&clearTimeout(H),Ve&&(Ve.remove(),Ve=null)}),(Q,ve)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":ce.value.unstyled}]),style:e.normalizeStyle(vt.value)},[b.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":he.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(Q.$slots,"delete-zone",{isDragging:!!ue.value,isOver:he.value})],2),[[e.vShow,!!ue.value||ce.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.columns,fe=>(e.openBlock(),e.createElementBlock("div",{key:fe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":Ce.value==fe.value},fe.class||""]]),style:e.normalizeStyle(v(fe))},[ce.value.showHeader?(e.openBlock(),e.createElementBlock("div",gm,[e.renderSlot(Q.$slots,"column-header",{column:fe,items:Ue.value[fe.value]||[]},()=>[e.createElementVNode("span",hm,e.toDisplayString(fe.title||fe.value),1),e.createElementVNode("span",ym,e.toDisplayString((Ue.value[fe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value[fe.value],_e=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:_e.key},[_e.type==="indicator"?(e.openBlock(),e.createElementBlock("div",km)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":_e.isDragged,"dss-dnd-item--no-handle":!ce.value.useHandle}]),onPointerdown:rt=>Nt(rt,_e.item)},[ce.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(rt=>xt(rt,_e.item),["stop"])},[e.renderSlot(Q.$slots,"handle",{},()=>[ve[0]||(ve[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,wm)):e.createCommentVNode("",!0),e.createElementVNode("div",xm,[e.renderSlot(Q.$slots,"item",{item:_e.item,column:fe,justDropped:te.value?.id===_e.item[R.itemKey],droppedFrom:te.value?.id===_e.item[R.itemKey]?te.value.from:null,droppedTo:te.value?.id===_e.item[R.itemKey]?te.value.to:null},()=>[e.createElementVNode("div",Em,e.toDisplayString(_e.item[R.itemKey]),1)])])],42,bm))],64))),128)),(Ue.value[fe.value]||[]).length===0&&Ce.value!=fe.value?(e.openBlock(),e.createElementBlock("div",Vm,[e.renderSlot(Q.$slots,"empty",{column:fe},()=>[ve[1]||(ve[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,Cm)],6))),128))],6))}}),Bm={name:"DSSConfetti"},Mm=Object.assign(Bm,{props:{trigger:{type:Boolean,default:!1},duration:{type:Number,default:3e3},fadeStart:{type:Number,default:2e3},count:{type:Number,default:90},colors:{type:Array,default:()=>["#047395","#ffc230","#0897c1","#fe3b59","#11e1a2","#b3b2fb","#fadb8d","#ffa25b","#feaab1"]},delay:{type:Number,default:300}},setup(R){const be=R,I=e.ref(null),A=e.ref(!1);let Se=[],b=null,Be=null;function ce(ae,te){const oe=[];for(let H=0;H<be.count;H++)oe.push(vt(ae));return oe}function vt(ae,te){return{x:Math.random()*ae,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:be.colors[Math.floor(Math.random()*be.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function v(ae,te,oe,H){ae.clearRect(0,0,te,oe);for(const Ve of Se)ae.save(),ae.globalAlpha=Ve.opacity*H,ae.beginPath(),ae.lineWidth=Ve.r,ae.strokeStyle=Ve.color,ae.moveTo(Ve.x+Ve.tilt+Ve.r/2,Ve.y),ae.lineTo(Ve.x+Ve.tilt,Ve.y+Ve.tilt+Ve.r/2),ae.stroke(),ae.restore()}function ue(ae,te,oe){const H=.3+oe*.7;for(let Ve=0;Ve<Se.length;Ve++){const Ae=Se[Ve];Ae.tiltAngle+=Ae.tiltInc,Ae.y+=Ae.speed*H,Ae.x+=Math.sin(Ae.d)*.5*H,Ae.tilt=Math.sin(Ae.tiltAngle)*15,oe>=.99&&Ae.y>te+20&&(Se[Ve]=vt(ae))}}function Ce(){A.value=!0,e.nextTick(()=>{const ae=I.value;if(!ae)return;const te=ae.getContext("2d"),oe=ae.parentElement;if(!oe)return;const H=oe.getBoundingClientRect();ae.width=H.width,ae.height=H.height,Se=ce(ae.width,ae.height);const Ve=Date.now(),Ae=Ve+be.duration,Oe=()=>{const mt=Date.now(),Z=mt-Ve;if(mt<Ae){let Te=1;Z>be.fadeStart&&(Te=1-(Z-be.fadeStart)/(be.duration-be.fadeStart)),v(te,ae.width,ae.height,Te),ue(ae.width,ae.height,Te),b=requestAnimationFrame(Oe)}else he()};Oe()})}function he(){b&&(cancelAnimationFrame(b),b=null),Se=[],A.value=!1}return e.watch(()=>be.trigger,ae=>{ae&&(Be&&clearTimeout(Be),Be=setTimeout(Ce,be.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{he(),Be&&clearTimeout(Be)}),(ae,te)=>A.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:I,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),_m={class:"dss-filter-global-inner"},$m=["value"],Tm=["title"],Lm={key:0,class:"dss-filter-funnel-badge"},Hm={class:"dss-filter-panel"},Am={key:0,class:"dss-filter-empty"},Dm={class:"dss-filter-row-prefix"},Rm={class:"dss-filter-cell"},Fm=["onClick"],Im={class:"dss-filter-trigger-text"},zm={class:"dss-filter-popup-list"},Pm=["onClick"],Om={key:0,class:"dss-filter-popup-empty"},Zm={key:0,class:"dss-filter-cell"},Wm=["onClick"],qm={class:"dss-filter-trigger-text"},Um={class:"dss-filter-popup-list"},Xm=["onClick"],Ym={key:1,class:"dss-filter-cell dss-filter-cell--value"},jm=["onUpdate:modelValue"],Km={key:1,class:"dss-filter-date-wrap"},Gm=["onUpdate:modelValue"],Qm=["value","onInput","step"],Jm={key:4,class:"dss-filter-between"},e2=["value","onInput","step"],t2=["value","onInput","step"],n2={key:5,class:"dss-filter-multiselect"},l2=["onClick"],o2={class:"dss-filter-trigger-text"},a2={class:"dss-filter-popup-list dss-filter-popup-list--check"},s2=["onClick"],r2=["checked"],i2={key:0,class:"dss-filter-popup-empty"},c2=["onClick"],u2={class:"dss-filter-foot"},d2={class:"dss-filter-cell"},m2={class:"dss-filter-popup-list"},p2=["onClick"],v2={key:0,class:"dss-filter-popup-divider"},f2=["onClick"],g2={class:"dss-filter-popup-list"},h2=["onClick"],y2={key:0,class:"dss-filter-popup-empty"},C2={class:"dss-filter-popup-list"},k2=["onClick"],b2={key:0,class:"dss-filter-popup-empty"},w2={name:"DSSFilter"},x2=Object.assign(w2,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["update:modelValue"],setup(R,{expose:be,emit:I}){const A=R,Se=I,b={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Be=e.computed(()=>({...b,...A.options})),ce={text:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"equals",label:"equals"},{value:"not_equals",label:"does not equal"},{value:"starts_with",label:"starts with"},{value:"ends_with",label:"ends with"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],select:[{value:"is_any_of",label:"is any of"},{value:"is_none_of",label:"is none of"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],range:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],int:[{value:"eq",label:"="},{value:"neq",label:"≠"},{value:"gt",label:">"},{value:"gte",label:"≥"},{value:"lt",label:"<"},{value:"lte",label:"≤"},{value:"between",label:"between"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arraySelect:[{value:"contains_any",label:"contains any of"},{value:"contains_all",label:"contains all of"},{value:"not_contains_any",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],arrayText:[{value:"contains",label:"contains"},{value:"not_contains",label:"does not contain"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],date:[{value:"eq",label:"on"},{value:"before",label:"before"},{value:"after",label:"after"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}],boolean:[{value:"is_true",label:"is true"},{value:"is_false",label:"is false"},{value:"is_empty",label:"is empty"},{value:"is_not_empty",label:"is not empty"}]},vt=new Set(["is_empty","is_not_empty","is_true","is_false"]),v=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),Ce=e.ref([]),he=e.ref(null),ae=e.ref(!1),te=e.ref(null),oe=e.ref(""),H=e.ref(null);let Ve=1;function Ae(x){const k=x.find(V=>V&&typeof V=="object");if(!k)return null;for(const V of v)if(V in k&&typeof k[V]=="string")return V;return Object.keys(k).find(V=>typeof k[V]=="string")||null}function Oe(x,k){const V=k.filter(P=>P!=null&&P!=="NULL");if(V.length===0)return null;if(V.every(P=>Array.isArray(P))){const P=V.flatMap(De=>De).filter(De=>De!=null);return P.length===0?null:typeof P.find(De=>De!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Be.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Be.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const mt=e.computed(()=>{if(!A.data?.length)return[];const x=new Set;for(const X of A.data)if(X&&typeof X=="object")for(const De of Object.keys(X))x.add(De);const k=new Set(A.exclude),V=[];for(const X of x){if(k.has(X))continue;const De=A.config[X]||{},Xe=A.data.map(yt=>yt?.[X]),Me=De.type||Oe(X,Xe);if(!Me)continue;const le=De.filterMode||"contain",nt=le==="date"?"date":le==="string"?"text":Me,Je={key:X,label:De.label||j(X),type:nt,filterMode:le};if(Me==="select"){const yt=Xe.filter(ht=>ht!=null&&ht!=="NULL");Je.uniqueValues=[...new Set(yt)].sort((ht,Ye)=>typeof ht=="number"&&typeof Ye=="number"?ht-Ye:String(ht).localeCompare(String(Ye)))}else if(Me==="range"||Me==="int"){const yt=Xe.filter(ht=>typeof ht=="number");Je.min=Math.min(...yt),Je.max=Math.max(...yt)}else if(Me==="arraySelect"){const yt=De.displayKey||Ae(Xe.flatMap(Ye=>Array.isArray(Ye)?Ye:[]));Je.displayKey=yt;const ht=Xe.flatMap(Ye=>Array.isArray(Ye)?Ye:[]).filter(Ye=>Ye!=null).map(Ye=>yt&&typeof Ye=="object"?Ye[yt]:String(Ye)).filter(Ye=>Ye!=null&&Ye!=="");Je.uniqueValues=[...new Set(ht)].sort((Ye,Cn)=>String(Ye).localeCompare(String(Cn)))}V.push(Je)}const P=A.config._order;return P&&V.sort((X,De)=>{const Xe=P.indexOf(X.key),Me=P.indexOf(De.key);return Xe===-1&&Me===-1?0:Xe===-1?1:Me===-1?-1:Xe-Me}),V}),Z=e.computed(()=>{const x={};for(const k of mt.value)x[k.key]=k;return x}),Te=e.computed(()=>Array.isArray(A.config.groups)&&A.config.groups.length>0),Bt=e.computed(()=>{if(!Te.value)return[];const x=new Set(mt.value.map(k=>k.key));return A.config.groups.map(k=>({...k,keys:k.keys.filter(V=>x.has(V))})).filter(k=>k.keys.length>0)}),Ue=e.computed(()=>{if(!Te.value)return[];const x=new Set(A.config.groups.flatMap(k=>k.keys));return mt.value.filter(k=>!x.has(k.key))}),Lt=e.computed(()=>{if(!H.value)return[];const x=new Set(H.value.keys),k=mt.value.filter(P=>x.has(P.key));if(!oe.value)return k;const V=oe.value.toLowerCase();return k.filter(P=>P.label.toLowerCase().includes(V))}),Le=e.computed(()=>{if(!oe.value)return mt.value;const x=oe.value.toLowerCase();return mt.value.filter(k=>k.label.toLowerCase().includes(x))});function Ze(x){he.value===x?wt():(he.value=x,oe.value="",H.value=null)}function wt(){he.value=null,oe.value="",H.value=null}function ze(x){const k=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");he.value&&!k&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&&wt(),ae.value&&te.value&&!te.value.contains(x.target)&&(k||(ae.value=!1))}e.onMounted(()=>document.addEventListener("click",ze)),e.onBeforeUnmount(()=>document.removeEventListener("click",ze));function Mt(x){return Z.value[x]?.label||j(x)}function at(x){return Z.value[x.key]?.filterMode||"contain"}function Ct(x){for(const k of Object.values(ce)){const V=k.find(P=>P.value===x);if(V)return V.label}return x}function cn(x){const k=Z.value[x.key];return ce[k?.type]||ce.text}function _t(x){return vt.has(x)}function Qe(x){const k=Z.value[x.key];return k?k.type==="date"?"date":k.type==="boolean"?"boolean":k.type==="text"||k.type==="arrayText"?"text":k.type==="select"||k.type==="arraySelect"?"multiselect":k.type==="range"||k.type==="int"?x.operator==="between"?"between":"number":"text":"text"}function je(x){return ce[x]?.[0]?.value||"contains"}function $t(x,k){return vt.has(k)||x==="date"?null:x==="select"||x==="arraySelect"?[]:(x==="range"||x==="int")&&k==="between"?{min:null,max:null}:x==="range"||x==="int"?null:""}function Ht(x){return Z.value[x.key]?.uniqueValues||[]}function Yt(x){const k=Ht(x);if(!oe.value)return k;const V=oe.value.toLowerCase();return k.filter(P=>String(P).toLowerCase().includes(V))}function pt(x){const k=x.value;return!k||k.length===0?"Select...":k.length<=2?k.join(", "):`${k.length} selected`}function Nt(x){const k=Z.value[x],V=k?.filterMode||"contain",P=k?.type||"text",X=V==="string"?"contains":je(P);Ce.value.push(e.reactive({id:Ve++,key:x,operator:X,value:$t(P,X)})),wt()}function xt(x){Ce.value=Ce.value.filter(k=>k.id!==x)}function St(x,k){const P=Z.value[k]?.type||"text";x.key=k,x.operator=je(P),x.value=$t(P,x.operator),wt()}function jt(x,k){const V=Qe(x);x.operator=k;const P=Qe(x);if(V!==P||vt.has(k)){const X=Z.value[x.key];x.value=$t(X?.type||"text",k)}wt()}function Q(x,k){const V=k.target.value;x.value=V===""?null:Number(V)}function ve(x,k,V){const P=V.target.value,X=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[k]:isNaN(X)?null:X}}function fe(x,k){const V=x.value||[],P=V.indexOf(k);x.value=P>=0?V.filter(X=>X!==k):[...V,k]}function _e(){Ce.value=[],ue.value="",wt()}function rt(x){ue.value=x.target.value}const Ie=e.computed(()=>{if(!A.data)return[];let x=A.data;if(ue.value){const k=ue.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const X=V[P];if(typeof X=="string"&&X.toLowerCase().includes(k)||typeof X=="number"&&String(X).includes(k)||Array.isArray(X)&&X.some(De=>De!=null&&(typeof De=="string"?De.toLowerCase().includes(k):typeof De=="object"?Object.values(De).some(Xe=>typeof Xe=="string"&&Xe.toLowerCase().includes(k)):!1)))return!0}return!1})}for(const k of Ce.value){if(!Ke(k))continue;const V=Z.value[k.key];V&&(x=x.filter(P=>de(P,k,V)))}return x});function Ke(x){return vt.has(x.operator)?!0:x.value==null||typeof x.value=="string"&&x.value===""||Array.isArray(x.value)&&x.value.length===0?!1:x.value instanceof Date?!isNaN(x.value.getTime()):!(typeof x.value=="object"&&!Array.isArray(x.value)&&x.value.min==null&&x.value.max==null)}function de(x,k,V){const P=x?.[k.key],X=k.value,De=k.operator;if(De==="is_empty")return W(P);if(De==="is_not_empty")return!W(P);const Xe=V.type;if(Xe==="text"||Xe==="arrayText"){const Me=Xe==="arrayText"&&Array.isArray(P)?P.filter(Je=>Je!=null).map(String).join(" "):P!=null?String(P):"",le=String(X).toLowerCase(),nt=Me.toLowerCase();switch(De){case"contains":return nt.includes(le);case"not_contains":return!nt.includes(le);case"equals":return nt===le;case"not_equals":return nt!==le;case"starts_with":return nt.startsWith(le);case"ends_with":return nt.endsWith(le);default:return!0}}if(Xe==="select")switch(De){case"is_any_of":return X.includes(P);case"is_none_of":return!X.includes(P);default:return!0}if(Xe==="range"||Xe==="int"){const Me=typeof P=="number"?P:Number(P);if(typeof Me!="number"||isNaN(Me))return!1;if(De==="between"){const nt=X?.min!=null?Number(X.min):null,Je=X?.max!=null?Number(X.max):null,yt=nt!=null&&!isNaN(nt)?nt:null,ht=Je!=null&&!isNaN(Je)?Je:null;return(yt==null||Me>=yt)&&(ht==null||Me<=ht)}const le=typeof X=="number"&&!isNaN(X)?X:Number(X);if(De==="contains"||De==="not_contains"){const nt=String(Me),Je=String(X??"").toLowerCase(),yt=nt.toLowerCase().includes(Je);return De==="contains"?yt:!yt}if(typeof le!="number"||isNaN(le))return!1;switch(De){case"eq":return Me===le;case"neq":return Me!==le;case"gt":return Me>le;case"gte":return Me>=le;case"lt":return Me<le;case"lte":return Me<=le;default:return!0}}if(Xe==="arraySelect"){if(!Array.isArray(P))return!1;const Me=P.filter(le=>le!=null).map(le=>V.displayKey&&typeof le=="object"?le[V.displayKey]:String(le));switch(De){case"contains_any":return Me.some(le=>X.includes(le));case"contains_all":return X.every(le=>Me.includes(le));case"not_contains_any":return!Me.some(le=>X.includes(le));default:return!0}}if(Xe==="date"){const Me=Ge(X);if(!Me||isNaN(Me.getTime()))return!1;const le=Ge(P);if(!le||isNaN(le.getTime()))return!1;const nt=U(le),Je=U(Me);switch(De){case"eq":return nt===Je;case"before":return nt<Je;case"after":return nt>Je;default:return!0}}if(Xe==="boolean"){const Me=P===!0||P==="true"||P===1,le=P===!1||P==="false"||P===0;switch(De){case"is_true":return Me;case"is_false":return le;default:return!0}}return!0}function Ge(x){if(x==null)return null;if(x instanceof Date)return isNaN(x.getTime())?null:x;if(typeof x=="number")return new Date(x>1e10?x:x*1e3);if(typeof x=="string"){const k=new Date(x);return isNaN(k.getTime())?null:k}return null}function U(x){const k=x.getFullYear(),V=String(x.getMonth()+1).padStart(2,"0"),P=String(x.getDate()).padStart(2,"0");return`${k}-${V}-${P}`}function W(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(k=>k==null))}e.watch(Ie,x=>Se("update:modelValue",x),{immediate:!0}),e.watch(()=>A.data,()=>{Ce.value=[],ue.value="",ae.value=!1,wt()});function j(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,k=>k.toUpperCase())}function ne(){const x=k=>{if(k==null)return k;if(k instanceof Date)return{_type:"Date",value:k.toISOString(),local:k.toLocaleDateString()};if(Array.isArray(k))return k.map(x);if(typeof k=="object"&&!Array.isArray(k)){const V={};for(const P of Object.keys(k))V[P]=x(k[P]);return V}return k};return{globalSearch:ue.value,rows:Ce.value.map(k=>({key:k.key,operator:k.operator,value:x(k.value),defType:Z.value[k.key]?.type,defFilterMode:Z.value[k.key]?.filterMode})),filteredCount:Ie.value?.length??0}}return be({getDebugState:ne}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Be.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:te},[e.createElementVNode("div",_m,[k[15]||(k[15]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:"Search across all fields...",value:ue.value,onInput:rt},null,40,$m),ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:k[0]||(k[0]=V=>ue.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:ae.value||Ce.value.length>0}]),onClick:k[1]||(k[1]=V=>ae.value=!ae.value),type:"button",title:ae.value?"Close advanced filter":"Open advanced filter"},[k[14]||(k[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),Ce.value.length>0?(e.openBlock(),e.createElementBlock("span",Lm,e.toDisplayString(Ce.value.length),1)):e.createCommentVNode("",!0)],10,Tm)]),ae.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:k[13]||(k[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Hm,[Ce.value.length===0?(e.openBlock(),e.createElementBlock("div",Am," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ce.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",Dm,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Rm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>Ze(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Im,e.toDisplayString(Mt(V.key)),1),k[16]||(k[16]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Fm),he.value===`${V.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[3]||(k[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[2]||(k[2]=X=>oe.value=X),placeholder:"Search attributes..."},null,512),[[e.vModelText,oe.value]]),e.createElementVNode("ul",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,X=>(e.openBlock(),e.createElementBlock("li",{key:X.key,class:"dss-filter-popup-item",onClick:De=>St(V,X.key)},e.toDisplayString(X.label),9,Pm))),128)),Le.value.length===0?(e.openBlock(),e.createElementBlock("li",Om,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),at(V)==="contain"||at(V)==="date"?(e.openBlock(),e.createElementBlock("div",Zm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>Ze(`${V.id}:op`),["stop"])},[e.createElementVNode("span",qm,e.toDisplayString(Ct(V.operator)),1),k[17]||(k[17]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,Wm),he.value===`${V.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[4]||(k[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",Um,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(cn(V),X=>(e.openBlock(),e.createElementBlock("li",{key:X.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===X.value}]),onClick:De=>jt(V,X.value)},e.toDisplayString(X.label),11,Xm))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),_t(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Ym,[at(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":X=>V.value=X},null,8,jm)),[[e.vModelText,V.value]]):at(V)==="date"?(e.openBlock(),e.createElementBlock("div",Km,[e.createVNode(Po,{mode:"single",modelValue:V.value,"onUpdate:modelValue":X=>V.value=X},null,8,["modelValue","onUpdate:modelValue"])])):Qe(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":X=>V.value=X},null,8,Gm)),[[e.vModelText,V.value]]):Qe(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:X=>Q(V,X),step:Z.value[V.key]?.type==="int"?1:void 0},null,40,Qm)):Qe(V)==="between"?(e.openBlock(),e.createElementBlock("div",Jm,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:X=>ve(V,"min",X),step:Z.value[V.key]?.type==="int"?1:void 0},null,40,e2),k[18]||(k[18]=e.createElementVNode("span",{class:"dss-filter-between-sep"},"and",-1)),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Max",value:V.value?.max,onInput:X=>ve(V,"max",X),step:Z.value[V.key]?.type==="int"?1:void 0},null,40,t2)])):Qe(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",n2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(X=>Ze(`${V.id}:val`),["stop"])},[e.createElementVNode("span",o2,e.toDisplayString(pt(V)),1),k[19]||(k[19]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,l2),he.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[Ht(V).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[5]||(k[5]=X=>oe.value=X),placeholder:"Search..."},null,512)),[[e.vModelText,oe.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",a2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yt(V),X=>(e.openBlock(),e.createElementBlock("li",{key:X,class:"dss-filter-popup-item",onClick:De=>fe(V,X)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(X),tabindex:"-1"},null,8,r2),e.createElementVNode("span",null,e.toDisplayString(X),1)],8,s2))),128)),Yt(V).length===0?(e.openBlock(),e.createElementBlock("li",i2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:X=>xt(V.id)},[...k[20]||(k[20]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,c2)]))),128)),e.createElementVNode("div",u2,[e.createElementVNode("div",d2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:k[7]||(k[7]=e.withModifiers(V=>Ze("add"),["stop"]))}," Add filter "),he.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:k[12]||(k[12]=e.withModifiers(()=>{},["stop"]))},[Te.value&&!H.value&&!oe.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[8]||(k[8]=V=>oe.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,oe.value]]),e.createElementVNode("ul",m2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>H.value=V},[e.createElementVNode("span",null,e.toDisplayString(V.label),1),k[21]||(k[21]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p2))),128)),Ue.value.length>0?(e.openBlock(),e.createElementBlock("li",v2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Nt(V.key)},e.toDisplayString(V.label),9,f2))),128))])],64)):H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:k[9]||(k[9]=V=>H.value=null)},[k[22]||(k[22]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(H.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[10]||(k[10]=V=>oe.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,oe.value]]),e.createElementVNode("ul",g2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Nt(V.key)},e.toDisplayString(V.label),9,h2))),128)),Lt.value.length===0?(e.openBlock(),e.createElementBlock("li",y2,"No match")):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[11]||(k[11]=V=>oe.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,oe.value]]),e.createElementVNode("ul",C2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Nt(V.key)},e.toDisplayString(V.label),9,k2))),128)),Le.value.length===0?(e.openBlock(),e.createElementBlock("li",b2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),Ce.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:_e}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),E2={contextMenu:{addMarker:"Add Marker",clearAllMarkers:"Clear All Markers",downloadSvg:"Download SVG",downloadPng:"Download PNG",downloadCsv:"Download CSV"},modalMarker:{editMarker:"Edit Marker",viewMarker:"View Marker",title:"Title",description:"Description",iconType:"Icon Type",defaultIcon:"Default Logo",iconPreview:"Icon Preview",deleteMarker:"Delete Marker",cancel:"Cancel",close:"Close",save:"Save",placeholderTitle:"Enter marker title",placeholderDescription:"Enter marker description (required)"},zoom:{doubleClickToReset:"(Double-click to reset)"},csv:{chartTitle:"Chart Title",chartSubtitle:"Chart Subtitle",generated:"Generated"},fallback:{item:"Item",axis:"Axis"},tooltip:{flags:"Flags",markers:"Markers",manualFlags:"Manual Flags",autoFlags:"Auto Flags"}},V2={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy"},N2={selectDate:"Select Date",selectRange:"Select range",startDate:"Start date",endDate:"End date",prevMonth:"Previous month",nextMonth:"Next month",quickSelect:{today:"Today",lastWeek:"Last week",last15Days:"Last 15 days",last30Days:"Last 30 days",thisMonth:"This month",last3Months:"Last 3 months",last6Months:"Last 6 months",last12Months:"Last 12 months",lastYear:"Last year",allDates:"All dates",last2Dates:"Last 2 dates",last3Dates:"Last 3 dates",last4Dates:"Last 4 dates",last5Dates:"Last 5 dates"}},S2={toolbar:{undo:"Undo",redo:"Redo",paragraphFormat:"Paragraph Format",bold:"Bold",italic:"Italic",underline:"Underline",citation:"Citation",insertLink:"Insert Link",removeLink:"Remove Link",bulletList:"Bullet List",numberList:"Number List",image:"Image",comment:"Comment",askAi:"Ask AI"},paragraph:{heading1:"Heading 1",heading2:"Heading 2",heading3:"Heading 3",heading4:"Heading 4",heading5:"Heading 5",heading6:"Heading 6",paragraph:"Paragraph"},link:{editLink:"Edit Link",altText:"Alt text:",url:"URL:",enterAltText:"Enter alt text...",enterUrl:"Enter URL...",cancel:"Cancel",save:"Save"},image:{addImage:"Add Image",editImage:"Edit Image",upload:"Upload",imageLink:"Image Link",uploadImage:"Upload image:",imageUrl:"Image URL:",altText:"Alt text:",width:"Width (px):",height:"Height (px):",enterAltText:"Enter alt text...",enterImageUrl:"https://example.com/image.jpg",auto:"Auto",noAlt:"No alt",cancel:"Cancel",save:"Save"},comment:{placeholder:"Add a comment",send:"Send",delete:"Delete comment"},started_conversation:"Started conversation",labels:{title:"Title",description:"Description"},placeholders:{title:"Enter title...",description:"Enter description...",startTyping:"Start typing..."},footer:{word:"word",words:"words",character:"character",characters:"characters"}},eo={chart:E2,table:V2,datepicker:N2,textEditor:S2},B2={contextMenu:{addMarker:"Ajouter un marqueur",clearAllMarkers:"Effacer tous les marqueurs",downloadSvg:"Télécharger SVG",downloadPng:"Télécharger PNG",downloadCsv:"Télécharger CSV"},modalMarker:{editMarker:"Modifier le marqueur",viewMarker:"Voir le marqueur",title:"Titre",description:"Description",iconType:"Type d'icône",defaultIcon:"Logo par défaut",iconPreview:"Aperçu de l'icône",deleteMarker:"Supprimer le marqueur",cancel:"Annuler",close:"Fermer",save:"Enregistrer",placeholderTitle:"Entrez le titre du marqueur",placeholderDescription:"Entrez la description du marqueur (requise)"},zoom:{doubleClickToReset:"(Double-cliquez pour réinitialiser)"},csv:{chartTitle:"Titre du graphique",chartSubtitle:"Sous-titre du graphique",generated:"Généré"},fallback:{item:"Élément",axis:"Axe"},tooltip:{flags:"Drapeaux",markers:"Marqueurs",manualFlags:"Drapeaux manuels",autoFlags:"Drapeaux automatiques"}},M2={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa"},_2={selectDate:"Sélectionner une date",selectRange:"Sélectionner une plage",startDate:"Date de début",endDate:"Date de fin",prevMonth:"Mois précédent",nextMonth:"Mois suivant",quickSelect:{today:"Aujourd'hui",lastWeek:"Dernière semaine",last15Days:"15 derniers jours",last30Days:"30 derniers jours",thisMonth:"Ce mois",last3Months:"3 derniers mois",last6Months:"6 derniers mois",last12Months:"12 derniers mois",lastYear:"Dernière année",allDates:"Toutes les dates",last2Dates:"2 dernières dates",last3Dates:"3 dernières dates",last4Dates:"4 dernières dates",last5Dates:"5 dernières dates"}},$2={toolbar:{undo:"Annuler",redo:"Rétablir",paragraphFormat:"Format de paragraphe",bold:"Gras",italic:"Italique",underline:"Souligné",citation:"Citation",insertLink:"Insérer un lien",removeLink:"Supprimer le lien",bulletList:"Liste à puces",numberList:"Liste numérotée",image:"Image",comment:"Commentaire",askAi:"Demander à l'IA"},paragraph:{heading1:"En-tête 1",heading2:"En-tête 2",heading3:"En-tête 3",heading4:"En-tête 4",heading5:"En-tête 5",heading6:"En-tête 6",paragraph:"Paragraphe"},link:{editLink:"Modifier le lien",altText:"Texte alternatif :",url:"URL :",enterAltText:"Entrez le texte alternatif...",enterUrl:"Entrez l'URL...",cancel:"Annuler",save:"Enregistrer"},image:{addImage:"Ajouter une image",editImage:"Modifier l'image",upload:"Télécharger",imageLink:"Lien de l'image",uploadImage:"Télécharger l'image :",imageUrl:"URL de l'image :",altText:"Texte alternatif :",width:"Largeur (px) :",height:"Hauteur (px) :",enterAltText:"Entrez le texte alternatif...",enterImageUrl:"https://exemple.com/image.jpg",auto:"Auto",noAlt:"Pas de texte alternatif",cancel:"Annuler",save:"Enregistrer"},comment:{placeholder:"Ajouter un commentaire",send:"Envoyer",delete:"Supprimer le commentaire"},started_conversation:"A démarré la conversation",labels:{title:"Titre",description:"Description"},placeholders:{title:"Entrez le titre...",description:"Entrez la description...",startTyping:"Commencez à taper..."},footer:{word:"mot",words:"mots",character:"caractère",characters:"caractères"}},to={chart:B2,table:M2,datepicker:_2,textEditor:$2},T2={contextMenu:{addMarker:"Markering toevoegen",clearAllMarkers:"Alle markeringen wissen",downloadSvg:"SVG downloaden",downloadPng:"PNG downloaden",downloadCsv:"CSV downloaden"},modalMarker:{editMarker:"Markering bewerken",viewMarker:"Markering bekijken",title:"Titel",description:"Beschrijving",iconType:"Pictogramtype",defaultIcon:"Standaard logo",iconPreview:"Pictogramvoorbeeld",deleteMarker:"Markering verwijderen",cancel:"Annuleren",close:"Sluiten",save:"Opslaan",placeholderTitle:"Voer markeringstitel in",placeholderDescription:"Voer markeringsbeschrijving in (optioneel)"},zoom:{doubleClickToReset:"(Dubbelklik om te resetten)"},csv:{chartTitle:"Grafiek titel",chartSubtitle:"Grafiek ondertitel",generated:"Gegenereerd"},fallback:{item:"Item",axis:"As"},tooltip:{flags:"Vlaggen",markers:"Markeringen",manualFlags:"Handmatige vlaggen",autoFlags:"Automatische vlaggen"}},L2={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj"},H2={selectDate:"Selecteer datum",selectRange:"Selecteer bereik",startDate:"Startdatum",endDate:"Einddatum",prevMonth:"Vorige maand",nextMonth:"Volgende maand",quickSelect:{today:"Vandaag",lastWeek:"Afgelopen week",last15Days:"Laatste 15 dagen",last30Days:"Laatste 30 dagen",thisMonth:"Deze maand",last3Months:"Laatste 3 maanden",last6Months:"Laatste 6 maanden",last12Months:"Laatste 12 maanden",lastYear:"Afgelopen jaar",allDates:"Alle datums",last2Dates:"Laatste 2 datums",last3Dates:"Laatste 3 datums",last4Dates:"Laatste 4 datums",last5Dates:"Laatste 5 datums"}},A2={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},no={chart:T2,table:L2,datepicker:H2,textEditor:A2},Ro={en:eo,fr:to,nl:no};function D2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Ro).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Ro[I])})}const Fo={en:{textEditor:eo.textEditor},fr:{textEditor:to.textEditor},nl:{textEditor:no.textEditor}};function R2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Fo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Fo[I])})}const Io={en:{table:eo.table},fr:{table:to.table},nl:{table:no.table}};function F2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(Io).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,Io[I])})}const zo={en:{datepicker:eo.datepicker},fr:{datepicker:to.datepicker},nl:{datepicker:no.datepicker}};function I2(R){if(!R||!R.global)return;const be=R.global.availableLocales||[];Object.keys(zo).forEach(I=>{be.includes(I)&&R.global.mergeLocaleMessage(I,zo[I])})}const z2={en:{...eo},fr:{...to},nl:{...no}};Jl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:z2});exports.DSSChart=$i;exports.DSSChartMessages=Ro;exports.DSSColorPicker=tm;exports.DSSConfetti=Mm;exports.DSSDatepicker=Po;exports.DSSDatepickerMessages=zo;exports.DSSDnd=Sm;exports.DSSFilter=x2;exports.DSSLoader=vm;exports.DSSModal=Do;exports.DSSSkeleton=fm;exports.DSSTable=Yc;exports.DSSTableMessages=Io;exports.DSSTextEditor=I1;exports.DSSTextEditorMessages=Fo;exports.addDSSChartTranslations=D2;exports.addDSSDatepickerTranslations=I2;exports.addDSSTableTranslations=F2;exports.addDSSTextEditorTranslations=R2;
|