dsp-semactic 0.6.16 → 0.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +33 -33
- package/dist/index.es.js +6487 -5653
- package/package.json +48 -48
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ol=require("vue-i18n"),Jl={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ea=["value"],ta=["placeholder","value","disabled"],na=["placeholder","value"],oa={key:0,class:"dss-datepicker__double-wrap"},la={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},aa=["onClick"],sa={class:"dss-datepicker__double-calendars"},ra={class:"dss-datepicker__double-calendar"},ia={class:"dss-datepicker__calendar-header"},ca=["aria-label"],da={class:"dss-datepicker__month-year-row"},ua=["aria-label"],ma={class:"dss-datepicker__weekdays"},pa={class:"dss-datepicker__grid"},va=["disabled","onClick","onMouseenter"],fa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},Ca=["aria-label"],ya={class:"dss-datepicker__month-year-row"},ka=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__calendar-header"},Sa=["aria-label"],Na={class:"dss-datepicker__month-year-row"},Ma=["aria-label"],Ba={class:"dss-datepicker__weekdays"},_a={class:"dss-datepicker__grid"},Ta=["disabled","onClick","onMouseenter"],$a={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},La={class:"dss-datepicker__calendar-header"},Ha={class:"dss-datepicker__month-year-row"},Aa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Da={class:"dss-datepicker__months-grid"},Ra=["onClick"],Ia={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Fa={class:"dss-datepicker__month-year"},za={class:"dss-datepicker__years-grid"},Pa=["onClick"],Wl=15,Ul={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:H=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(H)},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(H,{emit:pe}){const D=H,I=pe,{t:we,locale:y}=ol.useI18n(),_e=e.ref(!1),ne=e.ref("days"),tt=new Date,v=e.computed(()=>D.minDate instanceof Date?D.minDate:tt),fe=e.ref(v.value.getMonth()),Te=e.ref(v.value.getFullYear()),ge=e.ref(v.value.getMonth()),Q=e.ref(v.value.getFullYear()),V=e.ref(v.value.getMonth()),ue=e.ref(v.value.getFullYear()),Ke=e.ref("start"),Me=e.ref(null),he=e.ref(null);function F(){const $=v.value,P=$.getMonth(),A=$.getFullYear(),K=P===11?0:P+1,Ce=P===11?A+1:A;return{left:{month:P,year:A},right:{month:K,year:Ce}}}const lt=e.ref(null),ut=e.ref(null),ke=e.ref(null),$t=e.ref(null),Nt=e.ref(null),st=e.ref(null),He=new Date().getFullYear(),ve=e.computed(()=>["single","singleFromAvailable"].includes(D.mode)),Mt=e.computed(()=>["range","rangeFromAvailable"].includes(D.mode)),ht=e.computed(()=>{if(D.mode!=="single"&&D.mode!=="singleFromAvailable")return null;const $=D.modelValue;return $ instanceof Date?$:null}),Ue=e.computed(()=>{if(!Mt.value)return{start:null,end:null};const $=D.modelValue;return!$||typeof $!="object"?{start:null,end:null}:{start:$.start instanceof Date?$.start:null,end:$.end instanceof Date?$.end:null}});function Dt($){if(!$||!($ instanceof Date))return"";const P=$.getDate(),A=$.getMonth()+1,K=$.getFullYear(),Ce=Pe=>String(Pe).padStart(2,"0");return`${Ce(P)}/${Ce(A)}/${K}`}const Rt=e.computed(()=>Dt(ht.value)),mn=e.computed(()=>{const{start:$,end:P}=Ue.value;if(!$&&!P)return"";const A=!P||$&&$<=P?$:P,K=!$||P&&P>=$?P:$;return Z(A,K)?Dt(A):`${Dt(A)} - ${Dt(K)}`}),vt=e.computed(()=>{if(D.mode!=="readonly")return"—";const $=D.modelValue;if($ instanceof Date)return Dt($)||"—";if($&&typeof $=="object"&&("start"in $||"end"in $)){const P=$.start instanceof Date?$.start:null,A=$.end instanceof Date?$.end:null;if(!P&&!A)return"—";const K=!A||P&&P<=A?P:A,Ce=!P||A&&A>=P?A:P;return Z(K,Ce)?Dt(K):`${Dt(K)} - ${Dt(Ce)}`}return"—"});e.computed(()=>{const $=new Date(Te.value,fe.value,1);return new Intl.DateTimeFormat(y.value,{month:"long",year:"numeric"}).format($)});const Ge=e.computed(()=>he.value==="left"?ge.value:he.value==="right"?V.value:fe.value),Ze=e.computed(()=>he.value==="left"?Q.value:he.value==="right"?ue.value:Te.value),en=e.computed(()=>{const $=new Date(Te.value,fe.value,1);return new Intl.DateTimeFormat(y.value,{month:"long"}).format($)}),It=e.computed(()=>{const $=new Date(Ze.value,Ge.value,1);return new Intl.DateTimeFormat(y.value,{month:"long"}).format($)}),Bt=e.computed(()=>{const $=new Intl.DateTimeFormat(y.value,{month:"short"});return Array.from({length:12},(P,A)=>$.format(new Date(2024,A,1)))}),O=e.computed(()=>{const P=(he.value?Ze.value:Te.value)-Math.floor(Wl/2);return Array.from({length:Wl},(A,K)=>P+K)}),Ae=e.computed(()=>{const $=O.value;return $.length?`${$[0]} – ${$[$.length-1]}`:""}),xe=e.computed(()=>{const $=new Intl.DateTimeFormat(y.value,{weekday:"short"}),P=new Date(2024,0,1),A=[];for(let K=0;K<7;K++){const Ce=new Date(P);Ce.setDate(P.getDate()+K),A.push($.format(Ce).slice(0,2))}return A});function ae($,P){const A=new Date($,P,1),K=new Date($,P+1,0),Ce=A.getDay(),Pe=K.getDate(),Xe=[];for(let Be=0;Be<Ce;Be++)Xe.push(null);for(let Be=1;Be<=Pe;Be++)Xe.push(new Date($,P,Be));return Xe}const et=e.computed(()=>ae(Te.value,fe.value)),Ct=e.computed(()=>ae(Q.value,ge.value)),Fe=e.computed(()=>ae(ue.value,V.value));e.computed(()=>{const $=new Date(Q.value,ge.value,1);return new Intl.DateTimeFormat(y.value,{month:"long",year:"numeric"}).format($)}),e.computed(()=>{const $=new Date(ue.value,V.value,1);return new Intl.DateTimeFormat(y.value,{month:"long",year:"numeric"}).format($)});const at=e.computed(()=>{const $=new Date(Q.value,ge.value,1);return new Intl.DateTimeFormat(y.value,{month:"long"}).format($)}),nt=e.computed(()=>{const $=new Date(ue.value,V.value,1);return new Intl.DateTimeFormat(y.value,{month:"long"}).format($)}),xt=e.computed(()=>D.availableDates&&D.availableDates.length>0),Qe=e.computed(()=>xt.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"}]),mt=e.ref({top:0,left:0});function ye(){if(!$t.value||!_e.value)return;const $=$t.value.getBoundingClientRect(),P=window.innerWidth||document.documentElement.clientWidth,A=window.innerHeight||document.documentElement.clientHeight;let K=$.left,Ce=$.bottom+4;const Pe=Nt.value;if(Pe){const Xe=Pe.offsetWidth,Be=Pe.offsetHeight;if(K+Xe>P-8&&(K=$.right-Xe,K<8&&(K=8)),Ce+Be>A-8){const We=$.top-4-Be;We>=8?Ce=We:Ce=Math.max(8,A-Be-8)}}mt.value={top:Ce,left:K}}const ot=e.computed(()=>!$t.value||!_e.value?{}:{position:"fixed",left:`${mt.value.left}px`,top:`${mt.value.top}px`,zIndex:1002});function Z($,P){return!$||!P?!1:$.getFullYear()===P.getFullYear()&&$.getMonth()===P.getMonth()&&$.getDate()===P.getDate()}function q($){return new Date($.getFullYear(),$.getMonth(),$.getDate()).getTime()}function Y($){return!D.availableDates||!D.availableDates.length?!0:D.availableDates.some(P=>P instanceof Date&&Z(P,$))}function ee($){const P=q($);return!(D.minDate instanceof Date&&P<q(D.minDate)||D.maxDate instanceof Date&&P>q(D.maxDate))}function Ee($){return!D.exceptDates||!D.exceptDates.length?!1:D.exceptDates.some(P=>P instanceof Date&&Z(P,$))}function je($){return Ee($)?!1:["singleFromAvailable","rangeFromAvailable"].includes(D.mode)?Y($):ee($)}function Se($){const P=ht.value,A=Ue.value,K=q($),Ce=Mt.value&&A.start&&A.end&&K>q(A.start)&&K<q(A.end),Pe=Mt.value&&A.start&&Z($,A.start),Xe=Mt.value&&A.end&&Z($,A.end),Be=Pe&&Xe,We=ve.value&&P&&Z($,P)||Pe||Xe;let ln=!1;if(Mt.value&&A.start&&!A.end&&Me.value){const Vn=q(A.start),tn=q(Me.value),Hn=Math.min(Vn,tn),Cn=Math.max(Vn,tn);ln=K>Hn&&K<Cn}return{"dss-datepicker__day--selected":We&&!Be,"dss-datepicker__day--range-start":Pe&&!Be,"dss-datepicker__day--range-end":Xe&&!Be,"dss-datepicker__day--range-single":Be,"dss-datepicker__day--in-range":Ce&&!Pe&&!Xe,"dss-datepicker__day--in-range-preview":ln&&!Pe&&!Xe&&!Ce,"dss-datepicker__day--disabled":!je($)}}function ze($){if(!Mt.value)return;const P=Ue.value;if(!P.start||P.end){Me.value=null;return}if(!je($)){Me.value=null;return}Me.value=new Date($.getFullYear(),$.getMonth(),$.getDate())}function ft(){Me.value=null}function Et(){if(!D.doubleCalendar||!Mt.value)return;const $=Ue.value,{start:P,end:A}=$;if(P&&A){const Pe=P<=A?P:A,Xe=P<=A?A:P,Be=Pe.getMonth(),We=Pe.getFullYear(),ln=Xe.getMonth(),Vn=Xe.getFullYear();if(Be!==ln||We!==Vn){const tn=ge.value===Be&&Q.value===We,Hn=V.value===ln&&ue.value===Vn;if(tn&&Hn)return;ge.value=Be,Q.value=We,V.value=ln,ue.value=Vn}else{const tn=Be===0?11:Be-1,Hn=Be===0?We-1:We;ge.value===tn&&Q.value===Hn&&V.value===Be&&ue.value===We||(ge.value=Be,Q.value=We,Be===11?(V.value=0,ue.value=We+1):(V.value=Be+1,ue.value=We))}return}const K=P||A;if(K){const Pe=K.getMonth(),Xe=K.getFullYear(),Be=ge.value===Pe&&Q.value===Xe,We=V.value===Pe&&ue.value===Xe;if(Be||We)return;ge.value=Pe,Q.value=Xe,Pe===11?(V.value=0,ue.value=Xe+1):(V.value=Pe+1,ue.value=Xe);return}const Ce=F();ge.value=Ce.left.month,Q.value=Ce.left.year,V.value=Ce.right.month,ue.value=Ce.right.year}function Ft($="start"){if(D.mode==="readonly")return;Ke.value=$;const P=ht.value,A=Ue.value;if(ve.value&&P)fe.value=P.getMonth(),Te.value=P.getFullYear();else if(Mt.value)if(D.doubleCalendar)Et();else{const K=$==="start"&&A.start?A.start:A.end||A.start;K&&(fe.value=K.getMonth(),Te.value=K.getFullYear())}$t.value=ve.value?lt.value?.closest(".dss-datepicker__input-wrap"):ut.value,ne.value="days",he.value=null,_e.value=!0,e.nextTick(()=>{ye()})}function Zt(){ne.value="days",he.value=null,Me.value=null,_e.value=!1}function Ie($,P){he.value=$,ne.value=P}function yt(){ne.value="days",he.value=null}function kt($){const P=new Date,A=P.getFullYear(),K=P.getMonth(),Ce=P.getDate();let Pe,Xe;if(xt.value){const Be=[...D.availableDates].filter(We=>We instanceof Date).map(We=>new Date(We.getFullYear(),We.getMonth(),We.getDate()));if(Be.sort((We,ln)=>We.getTime()-ln.getTime()),Be.length===0)return;if($==="all")Pe=Be[0],Xe=Be[Be.length-1];else{const We=parseInt($.replace("last",""),10);if(We<2||We>5)return;const ln=Be.slice(-We);Pe=ln[0],Xe=ln[ln.length-1]}}else{const Be=new Date(A,K,Ce);switch($){case"today":Pe=Be,Xe=Be;break;case"lastWeek":Pe=new Date(A,K,Ce-6),Xe=Be;break;case"last15Days":Pe=new Date(A,K,Ce-14),Xe=Be;break;case"last30Days":Pe=new Date(A,K,Ce-29),Xe=Be;break;case"thisMonth":Pe=new Date(A,K,1),Xe=Be;break;case"last3Months":Pe=new Date(A,K-3,1),Xe=new Date(A,K,0);break;case"last6Months":Pe=new Date(A,K-6,1),Xe=new Date(A,K,0);break;case"last12Months":Pe=new Date(A,K-12,1),Xe=new Date(A,K,0);break;case"lastYear":Pe=new Date(A-1,0,1),Xe=new Date(A-1,11,31);break;default:return}}I("update:modelValue",{start:Pe,end:Xe}),Et()}function Mn($){he.value==="left"?ge.value=$:he.value==="right"?V.value=$:fe.value=$,yt()}function qt($){he.value==="left"?Q.value=$:he.value==="right"?ue.value=$:Te.value=$,yt()}function Vt(){fe.value===0?(fe.value=11,Te.value--):fe.value--}function Lt(){fe.value===11?(fe.value=0,Te.value++):fe.value++}function Tn(){ge.value===0?(ge.value=11,Q.value--):ge.value--}function $n(){ge.value===11?(ge.value=0,Q.value++):ge.value++}function sn(){V.value===0?(V.value=11,ue.value--):V.value--}function hn(){V.value===11?(V.value=0,ue.value++):V.value++}function on($){if(!je($))return;const P=new Date($.getFullYear(),$.getMonth(),$.getDate());if(ve.value){I("update:modelValue",P),Zt();return}const A=Ue.value;if(!A.start&&!A.end){I("update:modelValue",{start:P,end:null}),Ke.value="end";return}if(A.start&&A.end){I("update:modelValue",{start:P,end:null}),Ke.value="end";return}if(Ke.value==="start"){let K=P,Ce=A.end;K&&Ce&&K>Ce&&([K,Ce]=[Ce,K]),I("update:modelValue",{start:K||Ce,end:Ce||K}),Ke.value="end"}else{let K=A.start,Ce=P;K&&Ce&&Ce<K&&([K,Ce]=[Ce,K]),I("update:modelValue",{start:K||Ce,end:Ce||K}),Ke.value="start"}}e.watch(Ue,()=>{D.doubleCalendar&&Mt.value&&_e.value&&Et()},{deep:!0});let rn=null,zn=null,Ln=null;function Co(){rn&&(document.removeEventListener("keydown",rn),rn=null),zn&&(window.removeEventListener("resize",zn),zn=null),Ln&&(window.removeEventListener("scroll",Ln,!0),Ln=null)}return e.watch(_e,$=>{Co(),$&&(rn=P=>{P.key==="Escape"&&(ne.value==="years"||ne.value==="months"?yt():Zt())},zn=()=>{ye()},Ln=()=>{ye()},document.addEventListener("keydown",rn),window.addEventListener("resize",zn),window.addEventListener("scroll",Ln,!0))}),e.onBeforeUnmount(()=>{Co()}),($,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":H.mode==="readonly"}])},[H.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Jl,[P[9]||(P[9]=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:vt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ea)])):ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:P[0]||(P[0]=A=>Ft("start"))},[P[10]||(P[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",{ref_key:"inputSingleRef",ref:lt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectDate"),value:Rt.value,readonly:"",disabled:H.mode==="readonly"},null,8,ta)])):Mt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:ut,onClick:P[1]||(P[1]=A=>Ft("start"))},[P[11]||(P[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:"inputRangeRef",ref:ke,type:"text",class:"dss-datepicker__input",placeholder:e.unref(we)("datepicker.selectRange"),value:mn.value,readonly:""},null,8,na)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_e.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Zt,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Nt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":H.doubleCalendar&&Mt.value&&ne.value==="days","dss-datepicker__dropdown--quick-select":H.doubleCalendar&&Mt.value&&ne.value==="days"&&H.quickSelect}]),style:e.normalizeStyle(ot.value)},[ne.value==="days"&&H.doubleCalendar&&Mt.value?(e.openBlock(),e.createElementBlock("div",oa,[H.quickSelect?(e.openBlock(),e.createElementBlock("nav",la,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Qe.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:K=>kt(A.id)},e.toDisplayString(e.unref(we)(A.labelKey)),9,aa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",sa,[e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Tn}," ‹ ",8,ca),e.createElementVNode("div",da,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[2]||(P[2]=A=>Ie("left","months"))},e.toDisplayString(at.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[3]||(P[3]=A=>Ie("left","years"))},e.toDisplayString(Q.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:$n}," › ",8,ua)]),e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ct.value,(A,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+K},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Se(A)]),disabled:!je(A),onClick:Ce=>on(A),onMouseenter:Ce=>ze(A),onMouseleave:ft},e.toDisplayString(A.getDate()),43,va)):(e.openBlock(),e.createElementBlock("span",fa))],64))),128))])]),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:sn}," ‹ ",8,Ca),e.createElementVNode("div",ya,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[4]||(P[4]=A=>Ie("right","months"))},e.toDisplayString(nt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[5]||(P[5]=A=>Ie("right","years"))},e.toDisplayString(ue.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:hn}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,(A,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+K},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Se(A)]),disabled:!je(A),onClick:Ce=>on(A),onMouseenter:Ce=>ze(A),onMouseleave:ft},e.toDisplayString(A.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])])])])):ne.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.prevMonth"),onClick:Vt}," ‹ ",8,Sa),e.createElementVNode("div",Na,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[6]||(P[6]=A=>ne.value="months")},e.toDisplayString(en.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[7]||(P[7]=A=>ne.value="years")},e.toDisplayString(Te.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(we)("datepicker.nextMonth"),onClick:Lt}," › ",8,Ma)]),e.createElementVNode("div",Ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xe.value,A=>(e.openBlock(),e.createElementBlock("span",{key:A,class:"dss-datepicker__weekday"},e.toDisplayString(A),1))),128))]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(et.value,(A,K)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:K},[A?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Se(A)]),disabled:!je(A),onClick:Ce=>on(A),onMouseenter:Ce=>ze(A),onMouseleave:ft},e.toDisplayString(A.getDate()),43,Ta)):(e.openBlock(),e.createElementBlock("span",$a))],64))),128))])],64)):ne.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",La,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:yt}," ‹ "),e.createElementVNode("div",Ha,[e.createElementVNode("span",Aa,e.toDisplayString(It.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:P[8]||(P[8]=A=>ne.value="years")},e.toDisplayString(Ze.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:yt}," › ")]),e.createElementVNode("div",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,(A,K)=>(e.openBlock(),e.createElementBlock("button",{key:K,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":K===Ge.value}]),onClick:Ce=>Mn(K)},e.toDisplayString(A),11,Ra))),128))])],64)):ne.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Ia,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:yt}," ‹ "),e.createElementVNode("span",Fa,e.toDisplayString(Ae.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav",onClick:yt}," › ")]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:st},[e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(O.value,A=>(e.openBlock(),e.createElementBlock("button",{key:A,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":A===Ze.value,"dss-datepicker__year-cell--current":A===e.unref(He)}]),onClick:K=>qt(A)},e.toDisplayString(A),11,Pa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Oa=["data-chart-type"],Za={class:"dss-chart-header-titles"},Wa={key:0,class:"dss-chart-title"},qa={key:1,class:"dss-chart-subtitle"},Ua=["onClick","onMouseenter"],Xa={class:"dss-legend-text"},Ya=["onClick","onMouseenter"],ja={class:"dss-legend-text"},Ka=["title"],Ga=["src"],Qa={class:"dss-chart-area-wrapper"},Ja={key:0,class:"dss-chart-z-axis-label"},es=["width","height","data-smooth","data-animated"],ts={id:"chart-clip"},ns=["y","width","height"],os=["id"],ls=["d"],as=["id"],ss=["d"],rs={key:0},is={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},cs=["x1","x2","y1","y2"],ds={class:"dss-axes"},us=["x1","x2","y1","y2"],ms=["x1","x2","y1","y2"],ps={class:"dss-axis-labels"},vs=["x","y"],fs=["x","y"],gs=["x","y"],hs=["y","transform"],Cs={key:1,class:"dss-flag-markers"},ys={"clip-path":"url(#chart-clip)"},ks=["x1","x2","y1","y2","onMouseover"],bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["cx","cy","onMouseover"],Es=["cx","cy","fill","onMouseover"],Vs=["x","y"],Ss={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ns={key:0},Ms=["d","onMouseover"],Bs=["x","y","width","height","fill","onMouseover"],_s={class:"dss-line-chart"},Ts=["d","stroke","stroke-width"],$s=["d","stroke","stroke-width","opacity"],Ls=["cx","cy","r","fill","onMouseover"],Hs={key:1},As=["d","stroke","stroke-width"],Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width","opacity"],Is=["cx","cy","r","fill","onMouseover"],Fs={key:2},zs=["id"],Ps=["x","y","width","height"],Os=["d","fill","fill-opacity","mask"],Zs=["d","stroke","stroke-width"],Ws=["d","fill","onMouseover"],qs=["x","y","width","height","onMouseover"],Us={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Xs=["x1","x2","y1","y2","stroke"],Ys=["cx","cy","r","fill"],js={key:1,class:"dss-bubble-chart"},Ks={key:0,class:"dss-bubble-group"},Gs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Qs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Js=["transform"],er=["cx","cy","r"],tr=["data-chart-type","clip-path"],nr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],or={key:1,class:"dss-radial-segment-data-labels"},lr=["x","y"],ar=["x","y","font-size","fill"],sr=["x1","y1","x2","y2","stroke"],rr=["x1","y1","x2","y2","stroke"],ir=["x","y","text-anchor","font-size"],cr=["transform"],dr={key:0,class:"dss-spider-grid"},ur=["cx","cy","r"],mr={class:"dss-spider-grid-labels"},pr=["x","y"],vr=["x","y"],fr=["x1","x2","y1","y2"],gr={class:"dss-spider-labels"},hr=["x","y","text-anchor","dominant-baseline"],Cr=["points","fill","fill-opacity","stroke","stroke-width"],yr=["cx","cy","r","fill","onMouseover"],kr={class:"dss-chart-logos"},br=["cx","cy","r","fill"],wr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],xr=["onClick","onMouseenter"],Er=["src"],Vr={class:"dss-marker-tooltip-category"},Sr={key:0,class:"dss-marker-tooltip-description"},Nr={key:0,class:"dss-tooltip-section"},Mr={key:0,class:"dss-tooltip-title"},Br={class:"dss-tooltip-series-name"},_r={class:"dss-tooltip-series-value"},Tr={key:1,class:"dss-tooltip-section"},$r={key:0,class:"dss-tooltip-title"},Lr={class:"dss-bubble-tooltip-data"},Hr={key:2,class:"dss-tooltip-section"},Ar={class:"dss-tooltip-title"},Dr={class:"dss-tooltip-value"},Rr={key:0,class:"dss-tooltip-section"},Ir={class:"dss-tooltip-section-title"},Fr={class:"dss-tooltip-group-header"},zr={class:"dss-tooltip-item-content"},Pr={class:"dss-tooltip-item-text"},Or={key:1,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-section-title"},Wr={class:"dss-tooltip-item-content"},qr={class:"dss-tooltip-item-title"},Ur={key:0,class:"dss-tooltip-item-description"},Xr={class:"dss-tooltip-section"},Yr={class:"dss-tooltip-title"},jr={key:0,class:"dss-bubble-tooltip-data"},Kr={class:"dss-tooltip-series-name"},Gr={class:"dss-tooltip-series-value"},Qr={key:0,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-group-header"},ti={class:"dss-tooltip-item-content"},ni={class:"dss-tooltip-item-text"},oi={key:1,class:"dss-tooltip-section"},li={class:"dss-tooltip-section-title"},ai={class:"dss-tooltip-item-content"},si={class:"dss-tooltip-item-title"},ri={key:0,class:"dss-tooltip-item-description"},ii={key:1,class:"dss-context-menu-separator"},ci={key:0,class:"dss-context-menu-separator"},di={key:0,class:"dss-context-menu-separator"},ui=["onClick"],mi=["innerHTML"],pi={key:0,class:"dss-context-menu-icon"},vi={class:"dss-marker-modal-header"},fi={class:"dss-marker-modal-body"},gi={class:"dss-form-group"},hi={class:"dss-form-group"},Ci={for:"dss-marker-description"},yi={key:0,class:"dss-form-text-display"},ki=["placeholder"],bi={class:"dss-marker-modal-footer"},wi={class:"modal-footer-left"},xi={class:"dss-modal-footer-right"},Ei=["disabled"],Vi={name:"DSSChart"},Si=Object.assign(Vi,{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:H=>typeof H=="object"&&H!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(H,{emit:pe}){const{t:D,locale:I}=ol.useI18n(),we=pe,y=e.ref(null),_e=e.ref(null),ne=e.ref(null),tt=e.ref(0),v=e.ref(0);let fe=null,Te=null;const ge=20,Q=e.computed(()=>{if(v.value,tt.value,!y.value||!_e.value)return 0;try{const t=y.value.getBoundingClientRect();return _e.value.getBoundingClientRect().top-t.top}catch{return 0}}),V=H,ue={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},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 Ke(t,s){const n=Object.assign({},t);return he(t)&&he(s)&&Object.keys(s).forEach(i=>{he(s[i])?i in t?n[i]=Ke(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const Me=()=>{let t=20,s=0,n=0;if(ht.value&&(t+=30),Ue.value&&(t+=25),Bt.value&&V.series.length>0){const i=V.series.filter((p,g)=>!St.value.has(g)).length;if(O.value==="top"||O.value==="bottom"){if(Ae.value==="horizontal"){const g=Math.floor(ke.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 he(t){return t&&typeof t=="object"&&!Array.isArray(t)}const F=e.computed(()=>Ke(ue,V.options)),lt=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.width==="auto"}),ut=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=F.value;return lt.value?tt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),$t=e.ref(ge),Nt=e.computed(()=>{if(ut.value){const t=Nt.value;return t??Math.max(0,(v.value||400)-$t.value*5)}}),st=e.computed(()=>{const t=F.value;if(ut.value){const s=Nt.value;return s??Math.max(0,(v.value||400)-$t.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),He=e.computed(()=>ut.value&&ve.value==="semi-radial"&&Nt.value!=null?$t.value+st.value+"px":ut.value?"100%":un.value?$t.value+st.value+"px":st.value+(Bt.value?20:0)+"px"),ve=e.computed(()=>{const t=F.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Mt=e.computed(()=>{const t=V.series.map(s=>s.type||ve.value);return new Set(t).size>1}),ht=e.computed(()=>{const t=F.value;return t&&t.title&&t.title.text?t.title.text:""}),Ue=e.computed(()=>{const t=F.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Dt=e.computed(()=>{const t=F.value;if(!t||!t.zAxis)return"";const s=t.zAxis;return typeof s=="string"?s:s&&typeof s.label=="string"?s.label:""}),Rt=e.computed(()=>{const t=F.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),mn=e.computed(()=>{const t=F.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),vt=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.min;return typeof s=="number"||s===Xn?s:Xn}),Ge=e.computed(()=>{const t=F.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.max;return typeof s=="number"||s===Xn?s:Xn}),Ze=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),en=e.computed(()=>{const t=F.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),It=e.computed(()=>{const t=F.value;return t&&t.grid&&t.grid.show!==!1}),Bt=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.show!==!1}),O=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ae=e.computed(()=>{const t=F.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),xe=e.computed(()=>{const t=F.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),ae=e.computed(()=>{const t=F.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),et=e.computed(()=>{const t=F.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Ct=e.computed(()=>{const t=F.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Fe=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),at=e.computed(()=>{const t=F.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),nt=e.computed(()=>{const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),xt=e.computed(()=>{if(!un.value)return 0;const t=F.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),Qe=e.computed(()=>{const t=F.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),mt=e.computed(()=>{const{maxX:t}=At.value;return t===0}),ye=(t,s)=>mt.value&&s===0?5:s,ot=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Z=e.computed(()=>{const t=F.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),q=e.computed(()=>{const t=F.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Y=e.computed(()=>{const t=F.value;return Z.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ee=e.computed(()=>{const t=F.value,s=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return s.length>0?s:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),Ee=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.enabled!==!1}),je=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),Se=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),ze=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),ft=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Et=e.computed(()=>{const t=F.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ft=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Zt=e.computed(()=>{const t=F.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),Ie=e.computed(()=>{const t=F.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),yt=e.computed(()=>F.value?.spider?.gridSteps||5),kt=e.computed(()=>{const t=[],s=yt.value;for(let n=1;n<=s;n++)t.push(qe.value/s*n);return t}),Mn=t=>{const s=qt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=kt.value[t];return Math.round(n/qe.value*100)+"%"},qt=e.computed(()=>F.value?.spider?.gridLabels||null),Vt=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Lt=e.computed(()=>{const t=F.value,s={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...s,...t.contextMenu.items}:s}),Tn=e.computed(()=>{const t=F.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),$n=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.icon?t.markers.icon:We.value}),sn=e.computed(()=>{const t=F.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),hn=e.computed(()=>{const t=F.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),on=e.computed(()=>{const s=F.value?.valueFormat?.extension;return typeof s=="string"?s:""}),rn=t=>{const s=on.value;if(t==null)return"";const n=String(t);return s?n+s:n},zn=e.computed(()=>!R.value.isZooming);e.computed(()=>bt.value.map(t=>{if(t.categoryIndex!==void 0&&(an.value||zt.value)){const s=Ot(t.categoryIndex),n=Q.value+L.value.bottom-hn.value/2;return{...t,x:s,y:n}}return t}));function Ln(t,s){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,w,k]=t.split("-"),_=Number(k?.length===2?`20${k}`:k);n=new Date(_,Number(w)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,w)=>{const[k,_,B]=g.split("-"),T=Number(B?.length===2?`20${B}`:B),S=new Date(T,Number(_)-1,Number(k)),U=Math.abs(S-n);U<p&&(p=U,i=w)}),i}const Co=e.computed(()=>{const t=V.markers.map(n=>{const i=Ln(n.marker_date,V.categories),p=Ot(i),g=Q.value+L.value.bottom-hn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),s=bt.value.map(n=>{if(n.categoryIndex!==void 0&&(an.value||zt.value)){const i=Ot(n.categoryIndex),p=Q.value+L.value.bottom-hn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),$=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.enabled===!0}),P=e.computed(()=>{const t=F.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),A=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),K=e.computed(()=>{const t=F.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Ce=e.computed(()=>{const t={left:L.value.left,top:L.value.top,width:L.value.width,height:L.value.height};let s,n;const i=String(A.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}}),Pe=e.computed(()=>{const{width:t,height:s}=Ce.value,n=K.value;let i,p;const g=L.value.left,w=L.value.right,k=L.value.top,_=L.value.bottom,B=L.value.width,T=L.value.height;switch(n){case"center":i=g+(B-t)/2,p=k+(T-s)/2;break;case"top-left":i=g+15,p=k+90;break;case"top-right":i=w-t-15,p=k+90;break;case"bottom-left":i=g+15,p=_-s+75;break;case"bottom-right":default:i=w-t-15,p=_-s+75;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),Xe=t=>!V.flags||!V.flags.length?[]:V.flags.filter(s=>s.categoryIndex===t),Be=t=>{const s=Xe(t),n=il(t),i=s.filter(w=>w.manual),p=s.filter(w=>!w.manual),g=[];return i.length>0&&g.push({type:D("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(w=>({text:w.text,color:"#047395"}))}),p.length>0&&g.push({type:D("chart.tooltip.autoFlags"),color:"#0dbf89",flags:p.map(w=>({text:w.text,color:"#0dbf89"}))}),{flagGroups:g,markers:n.map(w=>({title:w.title,description:w.description,type:D("chart.tooltip.markers"),color:w.color||"#FF6B6B"}))}},We=e.computed(()=>{const t=V.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),no=require("vue-i18n"),Jo={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},ea=["value"],ta=["placeholder","value","disabled"],na=["placeholder","value"],la={key:0,class:"dss-datepicker__double-wrap"},oa={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},aa=["onClick"],sa={class:"dss-datepicker__double-calendars"},ra={class:"dss-datepicker__double-calendar"},ia={class:"dss-datepicker__calendar-header"},ca=["aria-label"],ua={class:"dss-datepicker__month-year-row"},da=["aria-label"],ma={class:"dss-datepicker__weekdays"},pa={class:"dss-datepicker__grid"},fa=["disabled","onClick","onMouseenter"],va={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},ga={class:"dss-datepicker__double-calendar"},ha={class:"dss-datepicker__calendar-header"},ya=["aria-label"],Ca={class:"dss-datepicker__month-year-row"},ka=["aria-label"],ba={class:"dss-datepicker__weekdays"},wa={class:"dss-datepicker__grid"},xa=["disabled","onClick","onMouseenter"],Ea={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Va={class:"dss-datepicker__calendar-header"},Na=["aria-label"],Sa={class:"dss-datepicker__month-year-row"},Ba=["aria-label"],Ma={class:"dss-datepicker__weekdays"},_a={class:"dss-datepicker__grid"},$a=["disabled","onClick","onMouseenter"],Ta={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},La={class:"dss-datepicker__calendar-header"},Ha={class:"dss-datepicker__month-year-row"},Aa={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},Da={class:"dss-datepicker__months-grid"},Ra=["onClick"],Fa={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},Ia={class:"dss-datepicker__month-year"},za={class:"dss-datepicker__years-grid"},Pa=["data-year","onClick"],qo=27,zo={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:D=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(D)},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(D,{emit:ke}){const z=D,R=ke,{t:Me,locale:C}=no.useI18n(),Te=e.ref(!1),ie=e.ref("days"),nt=new Date,f=e.computed(()=>z.minDate instanceof Date?z.minDate:nt),ue=e.ref(f.value.getMonth()),ve=e.ref(f.value.getFullYear()),de=e.ref(f.value.getMonth()),te=e.ref(f.value.getFullYear()),S=e.ref(f.value.getMonth()),ae=e.ref(f.value.getFullYear()),Ze=e.ref("start"),He=e.ref(null),Ve=e.ref(null);function O(){const A=f.value,q=A.getMonth(),I=A.getFullYear(),ne=q===11?0:q+1,Be=q===11?I+1:I;return{left:{month:q,year:I},right:{month:ne,year:Be}}}const lt=e.ref(null),je=e.ref(null),Ne=e.ref(null),Ht=e.ref(null),Bt=e.ref(null),pt=e.ref(null),Re=new Date().getFullYear(),ge=e.computed(()=>["single","singleFromAvailable"].includes(z.mode)),gt=e.computed(()=>["range","rangeFromAvailable"].includes(z.mode)),wt=e.computed(()=>{if(z.mode!=="single"&&z.mode!=="singleFromAvailable")return null;const A=z.modelValue;return A instanceof Date?A:null}),tt=e.computed(()=>{if(!gt.value)return{start:null,end:null};const A=z.modelValue;return!A||typeof A!="object"?{start:null,end:null}:{start:A.start instanceof Date?A.start:null,end:A.end instanceof Date?A.end:null}});function Mt(A){if(!A||!(A instanceof Date))return"";const q=A.getDate(),I=A.getMonth()+1,ne=A.getFullYear(),Be=Je=>String(Je).padStart(2,"0");return`${Be(q)}/${Be(I)}/${ne}`}const Ft=e.computed(()=>Mt(wt.value)),on=e.computed(()=>{const{start:A,end:q}=tt.value;if(!A&&!q)return"";const I=!q||A&&A<=q?A:q,ne=!A||q&&q>=A?q:A;return X(I,ne)?Mt(I):`${Mt(I)} - ${Mt(ne)}`}),xt=e.computed(()=>{if(z.mode!=="readonly")return"—";const A=z.modelValue;if(A instanceof Date)return Mt(A)||"—";if(A&&typeof A=="object"&&("start"in A||"end"in A)){const q=A.start instanceof Date?A.start:null,I=A.end instanceof Date?A.end:null;if(!q&&!I)return"—";const ne=!I||q&&q<=I?q:I,Be=!q||I&&I>=q?I:q;return X(ne,Be)?Mt(ne):`${Mt(ne)} - ${Mt(Be)}`}return"—"});e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)});const Ke=e.computed(()=>Ve.value==="left"?de.value:Ve.value==="right"?S.value:ue.value),Ge=e.computed(()=>Ve.value==="left"?te.value:Ve.value==="right"?ae.value:ve.value),Zt=e.computed(()=>{const A=new Date(ve.value,ue.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),At=e.computed(()=>{const A=new Date(Ge.value,Ke.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),_t=e.computed(()=>{const A=new Intl.DateTimeFormat(C.value,{month:"short"});return Array.from({length:12},(q,I)=>A.format(new Date(2024,I,1)))}),U=e.computed(()=>{const q=(Ve.value?Ge.value:ve.value)-Math.floor(qo/2);return Array.from({length:qo},(I,ne)=>q+ne)}),Ie=e.computed(()=>{const A=U.value;return A.length?`${A[0]} – ${A[A.length-1]}`:""}),_e=e.computed(()=>{const A=new Intl.DateTimeFormat(C.value,{weekday:"short"}),q=new Date(2024,0,1),I=[];for(let ne=0;ne<7;ne++){const Be=new Date(q);Be.setDate(q.getDate()+ne),I.push(A.format(Be).slice(0,2))}return I});function fe(A,q){const I=new Date(A,q,1),ne=new Date(A,q+1,0),Be=I.getDay(),Je=ne.getDate(),rt=[];for(let Fe=0;Fe<Be;Fe++)rt.push(null);for(let Fe=1;Fe<=Je;Fe++)rt.push(new Date(A,q,Fe));return rt}const ct=e.computed(()=>fe(ve.value,ue.value)),Et=e.computed(()=>fe(te.value,de.value)),We=e.computed(()=>fe(ae.value,S.value));e.computed(()=>{const A=new Date(te.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)}),e.computed(()=>{const A=new Date(ae.value,S.value,1);return new Intl.DateTimeFormat(C.value,{month:"long",year:"numeric"}).format(A)});const ft=e.computed(()=>{const A=new Date(te.value,de.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),dt=e.computed(()=>{const A=new Date(ae.value,S.value,1);return new Intl.DateTimeFormat(C.value,{month:"long"}).format(A)}),$t=e.computed(()=>z.availableDates&&z.availableDates.length>0),ot=e.computed(()=>$t.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"}]),bt=e.ref({top:0,left:0});function Se(){if(!Ht.value||!Te.value)return;const A=Ht.value.getBoundingClientRect(),q=window.innerWidth||document.documentElement.clientWidth,I=window.innerHeight||document.documentElement.clientHeight;let ne=A.left,Be=A.bottom+4;const Je=Bt.value;if(Je){const rt=Je.offsetWidth,Fe=Je.offsetHeight;if(ne+rt>q-8&&(ne=A.right-rt,ne<8&&(ne=8)),Be+Fe>I-8){const at=A.top-4-Fe;at>=8?Be=at:Be=Math.max(8,I-Fe-8)}}bt.value={top:Be,left:ne}}const ut=e.computed(()=>!Ht.value||!Te.value?{}:{position:"fixed",left:`${bt.value.left}px`,top:`${bt.value.top}px`,zIndex:1002});function X(A,q){return!A||!q?!1:A.getFullYear()===q.getFullYear()&&A.getMonth()===q.getMonth()&&A.getDate()===q.getDate()}function j(A){return new Date(A.getFullYear(),A.getMonth(),A.getDate()).getTime()}function Q(A){return!z.availableDates||!z.availableDates.length?!0:z.availableDates.some(q=>q instanceof Date&&X(q,A))}function re(A){const q=j(A);return!(z.minDate instanceof Date&&q<j(z.minDate)||z.maxDate instanceof Date&&q>j(z.maxDate))}function x(A){return!z.exceptDates||!z.exceptDates.length?!1:z.exceptDates.some(q=>q instanceof Date&&X(q,A))}function k(A){return x(A)?!1:["singleFromAvailable","rangeFromAvailable"].includes(z.mode)?Q(A):re(A)}function V(A){const q=wt.value,I=tt.value,ne=j(A),Be=gt.value&&I.start&&I.end&&ne>j(I.start)&&ne<j(I.end),Je=gt.value&&I.start&&X(A,I.start),rt=gt.value&&I.end&&X(A,I.end),Fe=Je&&rt,at=ge.value&&q&&X(A,q)||Je||rt;let sn=!1;if(gt.value&&I.start&&!I.end&&He.value){const Nn=j(I.start),nn=j(He.value),Hn=Math.min(Nn,nn),Cn=Math.max(Nn,nn);sn=ne>Hn&&ne<Cn}return{"dss-datepicker__day--selected":at&&!Fe,"dss-datepicker__day--range-start":Je&&!Fe,"dss-datepicker__day--range-end":rt&&!Fe,"dss-datepicker__day--range-single":Fe,"dss-datepicker__day--in-range":Be&&!Je&&!rt,"dss-datepicker__day--in-range-preview":sn&&!Je&&!rt&&!Be,"dss-datepicker__day--disabled":!k(A)}}function P(A){if(!gt.value)return;const q=tt.value;if(!q.start||q.end){He.value=null;return}if(!k(A)){He.value=null;return}He.value=new Date(A.getFullYear(),A.getMonth(),A.getDate())}function Y(){He.value=null}function xe(){if(!z.doubleCalendar||!gt.value)return;const A=tt.value,{start:q,end:I}=A;if(q&&I){const Je=q<=I?q:I,rt=q<=I?I:q,Fe=Je.getMonth(),at=Je.getFullYear(),sn=rt.getMonth(),Nn=rt.getFullYear();if(Fe!==sn||at!==Nn){const nn=de.value===Fe&&te.value===at,Hn=S.value===sn&&ae.value===Nn;if(nn&&Hn)return;de.value=Fe,te.value=at,S.value=sn,ae.value=Nn}else{const nn=Fe===0?11:Fe-1,Hn=Fe===0?at-1:at;de.value===nn&&te.value===Hn&&S.value===Fe&&ae.value===at||(de.value=Fe,te.value=at,Fe===11?(S.value=0,ae.value=at+1):(S.value=Fe+1,ae.value=at))}return}const ne=q||I;if(ne){const Je=ne.getMonth(),rt=ne.getFullYear(),Fe=de.value===Je&&te.value===rt,at=S.value===Je&&ae.value===rt;if(Fe||at)return;de.value=Je,te.value=rt,Je===11?(S.value=0,ae.value=rt+1):(S.value=Je+1,ae.value=rt);return}const Be=O();de.value=Be.left.month,te.value=Be.left.year,S.value=Be.right.month,ae.value=Be.right.year}function Ye(A="start"){if(z.mode==="readonly")return;Ze.value=A;const q=wt.value,I=tt.value;if(ge.value&&q)ue.value=q.getMonth(),ve.value=q.getFullYear();else if(gt.value)if(z.doubleCalendar)xe();else{const ne=A==="start"&&I.start?I.start:I.end||I.start;ne&&(ue.value=ne.getMonth(),ve.value=ne.getFullYear())}Ht.value=ge.value?lt.value?.closest(".dss-datepicker__input-wrap"):je.value,ie.value="days",Ve.value=null,Te.value=!0,e.nextTick(()=>{Se()})}function Le(){ie.value="days",Ve.value=null,He.value=null,Te.value=!1}function le(A,q){Ve.value=A,ie.value=q}function Qe(){ie.value="days",Ve.value=null}function qe(A){const q=new Date,I=q.getFullYear(),ne=q.getMonth(),Be=q.getDate();let Je,rt;if($t.value){const Fe=[...z.availableDates].filter(at=>at instanceof Date).map(at=>new Date(at.getFullYear(),at.getMonth(),at.getDate()));if(Fe.sort((at,sn)=>at.getTime()-sn.getTime()),Fe.length===0)return;if(A==="all")Je=Fe[0],rt=Fe[Fe.length-1];else{const at=parseInt(A.replace("last",""),10);if(at<2||at>5)return;const sn=Fe.slice(-at);Je=sn[0],rt=sn[sn.length-1]}}else{const Fe=new Date(I,ne,Be);switch(A){case"today":Je=Fe,rt=Fe;break;case"lastWeek":Je=new Date(I,ne,Be-6),rt=Fe;break;case"last15Days":Je=new Date(I,ne,Be-14),rt=Fe;break;case"last30Days":Je=new Date(I,ne,Be-29),rt=Fe;break;case"thisMonth":Je=new Date(I,ne,1),rt=Fe;break;case"last3Months":Je=new Date(I,ne-3,1),rt=new Date(I,ne,0);break;case"last6Months":Je=new Date(I,ne-6,1),rt=new Date(I,ne,0);break;case"last12Months":Je=new Date(I,ne-12,1),rt=new Date(I,ne,0);break;case"lastYear":Je=new Date(I-1,0,1),rt=new Date(I-1,11,31);break;default:return}}R("update:modelValue",{start:Je,end:rt}),xe()}function Vt(A){Ve.value==="left"?de.value=A:Ve.value==="right"?S.value=A:ue.value=A,Qe()}function vt(A){Ve.value==="left"?te.value=A:Ve.value==="right"?ae.value=A:ve.value=A,Qe()}function Ue(){ue.value===0?(ue.value=11,ve.value--):ue.value--}function Dt(){ue.value===11?(ue.value=0,ve.value++):ue.value++}function $n(){de.value===0?(de.value=11,te.value--):de.value--}function Tn(){de.value===11?(de.value=0,te.value++):de.value++}function cn(){S.value===0?(S.value=11,ae.value--):S.value--}function yn(){S.value===11?(S.value=0,ae.value++):S.value++}function an(A){if(!k(A))return;const q=new Date(A.getFullYear(),A.getMonth(),A.getDate());if(ge.value){R("update:modelValue",q),Le();return}const I=tt.value;if(!I.start&&!I.end){R("update:modelValue",{start:q,end:null}),Ze.value="end";return}if(I.start&&I.end){R("update:modelValue",{start:q,end:null}),Ze.value="end";return}if(Ze.value==="start"){let ne=q,Be=I.end;ne&&Be&&ne>Be&&([ne,Be]=[Be,ne]),R("update:modelValue",{start:ne||Be,end:Be||ne}),Ze.value="end"}else{let ne=I.start,Be=q;ne&&Be&&Be<ne&&([ne,Be]=[Be,ne]),R("update:modelValue",{start:ne||Be,end:Be||ne}),Ze.value="start"}}e.watch(tt,()=>{z.doubleCalendar&>.value&&Te.value&&xe()},{deep:!0});let un=null,zn=null,Ln=null;function hl(){un&&(document.removeEventListener("keydown",un),un=null),zn&&(window.removeEventListener("resize",zn),zn=null),Ln&&(window.removeEventListener("scroll",Ln,!0),Ln=null)}return e.watch(ie,A=>{A==="years"&&e.nextTick(()=>{pt.value?.querySelector(`[data-year="${Ge.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(Te,A=>{hl(),A&&(un=q=>{q.key==="Escape"&&(ie.value==="years"||ie.value==="months"?Qe():Le())},zn=()=>{Se()},Ln=()=>{Se()},document.addEventListener("keydown",un),window.addEventListener("resize",zn),window.addEventListener("scroll",Ln,!0))}),e.onBeforeUnmount(()=>{hl()}),(A,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":D.mode==="readonly"}])},[D.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Jo,[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:xt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,ea)])):ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:q[0]||(q[0]=I=>Ye("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:lt,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectDate"),value:Ft.value,readonly:"",disabled:D.mode==="readonly"},null,8,ta)])):gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:je,onClick:q[1]||(q[1]=I=>Ye("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:Ne,type:"text",class:"dss-datepicker__input",placeholder:e.unref(Me)("datepicker.selectRange"),value:on.value,readonly:""},null,8,na)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Te.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers(Le,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Bt,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":D.doubleCalendar&>.value&&ie.value==="days","dss-datepicker__dropdown--quick-select":D.doubleCalendar&>.value&&ie.value==="days"&&D.quickSelect}]),onClick:q[9]||(q[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(ut.value)},[ie.value==="days"&&D.doubleCalendar&>.value?(e.openBlock(),e.createElementBlock("div",la,[D.quickSelect?(e.openBlock(),e.createElementBlock("nav",oa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ot.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:ne=>qe(I.id)},e.toDisplayString(e.unref(Me)(I.labelKey)),9,aa))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",sa,[e.createElementVNode("div",ra,[e.createElementVNode("div",ia,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:$n}," ‹ ",8,ca),e.createElementVNode("div",ua,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[2]||(q[2]=I=>le("left","months"))},e.toDisplayString(ft.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[3]||(q[3]=I=>le("left","years"))},e.toDisplayString(te.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Tn}," › ",8,da)]),e.createElementVNode("div",ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",pa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Et.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,fa)):(e.openBlock(),e.createElementBlock("span",va))],64))),128))])]),e.createElementVNode("div",ga,[e.createElementVNode("div",ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:cn}," ‹ ",8,ya),e.createElementVNode("div",Ca,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[4]||(q[4]=I=>le("right","months"))},e.toDisplayString(dt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[5]||(q[5]=I=>le("right","years"))},e.toDisplayString(ae.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:yn}," › ",8,ka)]),e.createElementVNode("div",ba,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",wa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,xa)):(e.openBlock(),e.createElementBlock("span",Ea))],64))),128))])])])])):ie.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Va,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.prevMonth"),onClick:Ue}," ‹ ",8,Na),e.createElementVNode("div",Sa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[6]||(q[6]=I=>ie.value="months")},e.toDisplayString(Zt.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[7]||(q[7]=I=>ie.value="years")},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(Me)("datepicker.nextMonth"),onClick:Dt}," › ",8,Ba)]),e.createElementVNode("div",Ma,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_e.value,I=>(e.openBlock(),e.createElementBlock("span",{key:I,class:"dss-datepicker__weekday"},e.toDisplayString(I),1))),128))]),e.createElementVNode("div",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ct.value,(I,ne)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ne},[I?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",V(I)]),disabled:!k(I),onClick:Be=>an(I),onMouseenter:Be=>P(I),onMouseleave:Y},e.toDisplayString(I.getDate()),43,$a)):(e.openBlock(),e.createElementBlock("span",Ta))],64))),128))])],64)):ie.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",La,[e.createElementVNode("div",Ha,[e.createElementVNode("span",Aa,e.toDisplayString(At.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:q[8]||(q[8]=I=>ie.value="years")},e.toDisplayString(Ge.value),1)])]),e.createElementVNode("div",Da,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t.value,(I,ne)=>(e.openBlock(),e.createElementBlock("button",{key:ne,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":ne===Ke.value}]),onClick:Be=>Vt(ne)},e.toDisplayString(I),11,Ra))),128))])],64)):ie.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",Fa,[e.createElementVNode("span",Ia,e.toDisplayString(Ie.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:pt},[e.createElementVNode("div",za,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(U.value,I=>(e.openBlock(),e.createElementBlock("button",{key:I,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":I===Ge.value,"dss-datepicker__year-cell--current":I===e.unref(Re)}]),"data-year":I,onClick:ne=>vt(I)},e.toDisplayString(I),11,Pa))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},Oa=["data-chart-type"],Za={class:"dss-chart-header-titles"},Wa={key:0,class:"dss-chart-title"},qa={key:1,class:"dss-chart-subtitle"},Ua=["onClick","onMouseenter"],Xa={class:"dss-legend-text"},Ya=["onClick","onMouseenter"],ja={class:"dss-legend-text"},Ka=["title"],Ga=["src"],Qa={class:"dss-chart-area-wrapper"},Ja={key:0,class:"dss-chart-z-axis-label"},es=["width","height","data-smooth","data-animated"],ts={id:"chart-clip"},ns=["y","width","height"],ls=["id"],os=["d"],as=["id"],ss=["d"],rs={key:0},is={key:0,class:"dss-grid-lines","clip-path":"url(#chart-clip)"},cs=["x1","x2","y1","y2"],us={class:"dss-axes"},ds=["x1","x2","y1","y2"],ms=["x1","x2","y1","y2"],ps={class:"dss-axis-labels"},fs=["x","y"],vs=["x","y"],gs=["x","y"],hs=["y","transform"],ys={key:1,class:"dss-flag-markers"},Cs={"clip-path":"url(#chart-clip)"},ks=["x1","x2","y1","y2","onMouseover"],bs=["x1","x2","y1","y2","onMouseover"],ws=["x1","x2","y1","y2","onMouseover"],xs=["cx","cy","onMouseover"],Es=["cx","cy","fill","onMouseover"],Vs=["x","y"],Ns={class:"dss-chart-data","clip-path":"url(#chart-clip)"},Ss={key:0},Bs=["d","onMouseover"],Ms=["x","y","width","height","fill","onMouseover"],_s={class:"dss-line-chart"},$s=["d","stroke","stroke-width"],Ts=["d","stroke","stroke-width","opacity"],Ls=["cx","cy","r","fill","onMouseover"],Hs={key:1},As=["d","stroke","stroke-width"],Ds=["d","stroke","stroke-width"],Rs=["d","stroke","stroke-width","opacity"],Fs=["cx","cy","r","fill","onMouseover"],Is={key:2},zs=["id"],Ps=["x","y","width","height"],Os=["d","fill","fill-opacity","mask"],Zs=["d","stroke","stroke-width"],Ws=["d","fill","onMouseover"],qs=["x","y","width","height","onMouseover"],Us={key:2,class:"dss-crosshair","clip-path":"url(#chart-clip)"},Xs=["x1","x2","y1","y2","stroke"],Ys=["cx","cy","r","fill"],js={key:1,class:"dss-bubble-chart"},Ks={key:0,class:"dss-bubble-group"},Gs=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Qs=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Js=["transform"],er=["cx","cy","r"],tr=["data-chart-type","clip-path"],nr=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],lr={key:1,class:"dss-radial-segment-data-labels"},or=["x","y"],ar=["x","y","font-size","fill"],sr=["x1","y1","x2","y2","stroke"],rr=["x1","y1","x2","y2","stroke"],ir=["x","y","text-anchor","font-size"],cr=["transform"],ur={key:0,class:"dss-spider-grid"},dr=["cx","cy","r"],mr={class:"dss-spider-grid-labels"},pr=["x","y"],fr=["x","y"],vr=["x1","x2","y1","y2"],gr={class:"dss-spider-labels"},hr=["x","y","text-anchor","dominant-baseline"],yr=["points","fill","fill-opacity","stroke","stroke-width"],Cr=["cx","cy","r","fill","onMouseover"],kr={class:"dss-chart-logos"},br=["cx","cy","r","fill"],wr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],xr=["onClick","onMouseenter"],Er=["src"],Vr={class:"dss-marker-tooltip-category"},Nr={key:0,class:"dss-marker-tooltip-description"},Sr={key:0,class:"dss-tooltip-section"},Br={key:0,class:"dss-tooltip-title"},Mr={class:"dss-tooltip-series-name"},_r={class:"dss-tooltip-series-value"},$r={key:1,class:"dss-tooltip-section"},Tr={key:0,class:"dss-tooltip-title"},Lr={class:"dss-bubble-tooltip-data"},Hr={key:2,class:"dss-tooltip-section"},Ar={class:"dss-tooltip-title"},Dr={class:"dss-tooltip-value"},Rr={key:0,class:"dss-tooltip-section"},Fr={class:"dss-tooltip-section-title"},Ir={class:"dss-tooltip-group-header"},zr={class:"dss-tooltip-item-content"},Pr={class:"dss-tooltip-item-text"},Or={key:1,class:"dss-tooltip-section"},Zr={class:"dss-tooltip-section-title"},Wr={class:"dss-tooltip-item-content"},qr={class:"dss-tooltip-item-title"},Ur={key:0,class:"dss-tooltip-item-description"},Xr={class:"dss-tooltip-section"},Yr={class:"dss-tooltip-title"},jr={key:0,class:"dss-bubble-tooltip-data"},Kr={class:"dss-tooltip-series-name"},Gr={class:"dss-tooltip-series-value"},Qr={key:0,class:"dss-tooltip-section"},Jr={class:"dss-tooltip-section-title"},ei={class:"dss-tooltip-group-header"},ti={class:"dss-tooltip-item-content"},ni={class:"dss-tooltip-item-text"},li={key:1,class:"dss-tooltip-section"},oi={class:"dss-tooltip-section-title"},ai={class:"dss-tooltip-item-content"},si={class:"dss-tooltip-item-title"},ri={key:0,class:"dss-tooltip-item-description"},ii={key:1,class:"dss-context-menu-separator"},ci={key:0,class:"dss-context-menu-separator"},ui={key:0,class:"dss-context-menu-separator"},di=["onClick"],mi=["innerHTML"],pi={key:0,class:"dss-context-menu-icon"},fi={class:"dss-marker-modal-header"},vi={class:"dss-marker-modal-body"},gi={class:"dss-form-group"},hi={class:"dss-form-group"},yi={for:"dss-marker-description"},Ci={key:0,class:"dss-form-text-display"},ki=["placeholder"],bi={class:"dss-marker-modal-footer"},wi={class:"modal-footer-left"},xi={class:"dss-modal-footer-right"},Ei=["disabled"],Vi={name:"DSSChart"},Ni=Object.assign(Vi,{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:D=>typeof D=="object"&&D!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(D,{emit:ke}){const{t:z,locale:R}=no.useI18n(),Me=ke,C=e.ref(null),Te=e.ref(null),ie=e.ref(null),nt=e.ref(0),f=e.ref(0);let ue=null,ve=null;const de=20,te=e.computed(()=>{if(f.value,nt.value,!C.value||!Te.value)return 0;try{const t=C.value.getBoundingClientRect();return Te.value.getBoundingClientRect().top-t.top}catch{return 0}}),S=D,ae={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 Ze(t,s){const n=Object.assign({},t);return Ve(t)&&Ve(s)&&Object.keys(s).forEach(i=>{Ve(s[i])?i in t?n[i]=Ze(t[i],s[i]):Object.assign(n,{[i]:s[i]}):Object.assign(n,{[i]:s[i]})}),n}const He=()=>{let t=20,s=0,n=0;if(wt.value&&(t+=30),tt.value&&(t+=25),_t.value&&S.series.length>0){const i=S.series.filter((p,g)=>!Rt.value.has(g)).length;if(U.value==="top"||U.value==="bottom"){if(Ie.value==="horizontal"){const g=Math.floor(Ne.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 Ve(t){return t&&typeof t=="object"&&!Array.isArray(t)}const O=e.computed(()=>Ze(ae,S.options)),lt=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.width==="auto"}),je=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.height==="auto"}),Ne=e.computed(()=>{const t=O.value;return lt.value?nt.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),Ht=e.ref(de),Bt=e.computed(()=>{if(je.value){const t=Bt.value;return t??Math.max(0,(f.value||400)-Ht.value*5)}}),pt=e.computed(()=>{const t=O.value;if(je.value){const s=Bt.value;return s??Math.max(0,(f.value||400)-Ht.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),Re=e.computed(()=>je.value&&ge.value==="semi-radial"&&Bt.value!=null?Ht.value+pt.value+"px":je.value?"100%":pn.value?Ht.value+pt.value+"px":pt.value+(_t.value?20:0)+"px"),ge=e.computed(()=>{const t=O.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),gt=e.computed(()=>{const t=S.series.map(s=>s.type||ge.value);return new Set(t).size>1}),wt=e.computed(()=>{const t=O.value;return t&&t.title&&t.title.text?t.title.text:""}),tt=e.computed(()=>{const t=O.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Mt=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:""}),Ft=e.computed(()=>{const t=O.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),on=e.computed(()=>{const t=O.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),xt=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.min;return typeof s=="number"||s===Xn?s:Xn}),Ke=e.computed(()=>{const t=O.value;if(!t||!t.yAxis)return Xn;const s=t.yAxis.max;return typeof s=="number"||s===Xn?s:Xn}),Ge=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Zt=e.computed(()=>{const t=O.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),At=e.computed(()=>{const t=O.value;return t&&t.grid&&t.grid.show!==!1}),_t=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.show!==!1}),U=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Ie=e.computed(()=>{const t=O.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),_e=e.computed(()=>{const t=O.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),fe=e.computed(()=>{const t=O.value;if(!t||!t.crosshair)return!1;const s=t.crosshair.show;return s===!0||s==="true"}),ct=e.computed(()=>{const t=O.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Et=e.computed(()=>{const t=O.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),We=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),ft=e.computed(()=>{const t=O.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),dt=e.computed(()=>{const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),$t=e.computed(()=>{if(!pn.value)return 0;const t=O.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),ot=e.computed(()=>{const t=O.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),bt=e.computed(()=>{const{maxX:t}=Ot.value;return t===0}),Se=(t,s)=>bt.value&&s===0?5:s,ut=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),X=e.computed(()=>{const t=O.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),j=e.computed(()=>{const t=O.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Q=e.computed(()=>{const t=O.value;return X.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),re=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"]}),x=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.enabled!==!1}),k=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),P=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),Y=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),xe=e.computed(()=>{const t=O.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),Ye=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Le=e.computed(()=>{const t=O.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),le=e.computed(()=>{const t=O.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Qe=e.computed(()=>O.value?.spider?.gridSteps||5),qe=e.computed(()=>{const t=[],s=Qe.value;for(let n=1;n<=s;n++)t.push(st.value/s*n);return t}),Vt=t=>{const s=vt.value;if(s&&Array.isArray(s)&&s[t]!==void 0)return s[t].toString();const n=qe.value[t];return Math.round(n/st.value*100)+"%"},vt=e.computed(()=>O.value?.spider?.gridLabels||null),Ue=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}),$n=e.computed(()=>{const t=O.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Tn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.icon?t.markers.icon:at.value}),cn=e.computed(()=>{const t=O.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),yn=e.computed(()=>{const t=O.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),an=e.computed(()=>{const s=O.value?.valueFormat?.extension;return typeof s=="string"?s:""}),un=t=>{const s=an.value;if(t==null)return"";const n=String(t);return s?n+s:n},zn=e.computed(()=>!Z.value.isZooming);e.computed(()=>Tt.value.map(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=Ut(t.categoryIndex),n=te.value+F.value.bottom-yn.value/2;return{...t,x:s,y:n}}return t}));function Ln(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,b]=t.split("-"),L=Number(b?.length===2?`20${b}`:b);n=new Date(L,Number(E)-1,Number(g))}else return 0;let i=0,p=1/0;return s.forEach((g,E)=>{const[b,L,T]=g.split("-"),H=Number(T?.length===2?`20${T}`:T),M=new Date(H,Number(L)-1,Number(b)),G=Math.abs(M-n);G<p&&(p=G,i=E)}),i}const hl=e.computed(()=>{const t=S.markers.map(n=>{const i=Ln(n.marker_date,S.categories),p=Ut(i),g=te.value+F.value.bottom-yn.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),s=Tt.value.map(n=>{if(n.categoryIndex!==void 0&&(rn.value||Wt.value)){const i=Ut(n.categoryIndex),p=te.value+F.value.bottom-yn.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...s]}),A=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.enabled===!0}),q=e.computed(()=>{const t=O.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),I=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),ne=e.computed(()=>{const t=O.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),Be=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let s,n;const i=String(I.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}}),Je=e.computed(()=>{const{width:t,height:s}=Be.value,n=ne.value;let i,p;const g=F.value.left,E=F.value.right,b=F.value.top,L=F.value.bottom,T=F.value.width,H=F.value.height;switch(n){case"center":i=g+(T-t)/2,p=b+(H-s)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=E-t-15,p=b+5;break;case"bottom-left":i=g+15,p=L-s-5;break;case"bottom-right":default:i=E-t-15,p=L-s-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${s}px`}}),rt=t=>!S.flags||!S.flags.length?[]:S.flags.filter(s=>s.categoryIndex===t),Fe=t=>{const s=rt(t),n=ro(t),i=s.filter(E=>E.manual),p=s.filter(E=>!E.manual),g=[];return i.length>0&&g.push({type:z("chart.tooltip.manualFlags"),color:"#047395",flags:i.map(E=>({text:E.text,color:"#047395"}))}),p.length>0&&g.push({type:z("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:z("chart.tooltip.markers"),color:E.color||"#FF6B6B"}))}},at=e.computed(()=>{const t=S.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),sn=e.computed(()=>{const t=S.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),lo=e.ref({show:!1,x:0,y:0,content:"",count:0}),An=e.computed(()=>F.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),fo=e.computed(()=>{const t=F.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),So=e.computed(()=>F.value?.bubbles?.tooltip?.formatters||{}),St=e.ref(new Set),ie=e.ref(null),No=e.ref(!1),Re=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),Xt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Le=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),$e=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),R=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),bt=e.ref([]),se=e.ref({show:!1,title:"",description:"",color:"#FF6B6B",type:"default",editingMarkerId:null,readonly:!1,categoryIndex:null,fromButton:!1,date:null});e.computed(()=>{const t=["default"];return sn.value&&t.push(...Object.keys(sn.value)),t}),e.computed(()=>{if(!V.categories||V.categories.length===0){const{maxX:t}=At.value;return Array.from({length:t+1},(s,n)=>D("chart.fallback.item",{number:n+1}))}return V.categories});const Bn=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[0],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(n)-1;return!g||!n||!p?null:new Date(p,w,g)}),Ro=e.computed(()=>{if(!V.categories||V.categories.length===0)return null;const t=V.categories[V.categories.length-1],[s,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(n)-1;return!g||!n||!p?null:new Date(p,w,g)}),b=e.computed(()=>se.value.editingMarkerId!==null),C=e.computed(()=>se.value.readonly),E=t=>{St.value.has(t)||(Kn.value=!0,ie.value=t)},z=()=>{Kn.value=!1,ie.value=null},J=t=>{if(Ao.value||Ho.value){Le.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=zt.value?i>=L.value.left-50&&i<=L.value.right+50&&p>=L.value.top-50&&p<=L.value.bottom+100:i>=L.value.left&&i<=L.value.right&&p>=L.value.top&&p<=L.value.bottom;if(No.value=g,zt.value){if(!ae.value||!g||R.value.isDragging||R.value.isZooming){Le.value.show=!1;return}if(Yn.value.find(j=>!j||j.isHidden?!1:Math.sqrt(Math.pow(j.x-i,2)+Math.pow(j.y-p,2))<=j.radius+3))Le.value.show=!1;else{const j=Yn.value.filter(le=>!le||le.isHidden?!1:Math.sqrt(Math.pow(le.x-i,2)+Math.pow(le.y-p,2))<=250);if(j.length>0){let le=j[0],re=Math.sqrt(Math.pow(le.x-i,2)+Math.pow(le.y-p,2));j.forEach(ce=>{const de=Math.sqrt(Math.pow(ce.x-i,2)+Math.pow(ce.y-p,2));de<re&&(re=de,le=ce)});const G=30,De=Yn.value.filter(ce=>!ce||ce.isHidden?!1:Math.abs(ce.x-le.x)<=G).sort((ce,de)=>ce.y-de.y);Le.value={show:!0,x:le.x,categoryIndex:Math.round(le.originalX),data:(()=>{const ce=An.value,de=fo.value,Ne=[];return De.forEach(Ve=>{ce.forEach(ct=>{const dt=de[ct]||ct,En=d(ct,Ve);En&&Ne.push({seriesName:Ve.seriesName,label:Ve.label,value:`${dt}: ${En}`,color:Ve.color,y:Ve.y})})}),Ne})()}}else Le.value.show=!1}return}if(R.value.isDragging&&R.value.scale>1&&an.value&&Ct.value){Le.value.show=!1;const me=t.clientX-R.value.lastMouseX,{minX:j,maxX:le}=At.value,re=le-j||1,De=me*.8;R.value.offsetX+=De;const ce=re/R.value.scale,de=re-ce,Ne=0,Ve=-de/re*L.value.width,ct=Ne;R.value.offsetX=Math.max(Ve,Math.min(ct,R.value.offsetX)),R.value.lastMouseX=t.clientX,R.value.lastMouseY=t.clientY;return}if(!ae.value||!an.value||R.value.isDragging||R.value.isZooming||!g){Le.value.show=!1;return}const{minX:w,maxX:k}=At.value,_=k-w||1,B=_/R.value.scale,T=w-R.value.offsetX/L.value.width*_,S=(i-L.value.left)/L.value.width,U=T+S*B,te=Math.round(U);if(te>=0&&te<=k){const me=Ot(te),j=Un.value.map((le,re)=>{const G=V.series.findIndex(ce=>ce===le),De=le.data[te];return{seriesName:le.name,value:De!==void 0?De:null,color:wt(G),y:De!==void 0?Kt(De):null}}).filter(le=>le.value!==null);Le.value={show:!0,x:me,categoryIndex:te,data:j}}},Je=()=>{Le.value.show=!1,No.value=!1,Ho.value=!1,Ao.value||(lo.value.show=!1),R.value.isDragging&&(R.value.isDragging=!1),R.value.zoomTimeout&&(clearTimeout(R.value.zoomTimeout),R.value.zoomTimeout=null),R.value.isZooming=!1,setTimeout(()=>{ie.value=null,Re.value.show=!1},150)},Oe=t=>{if(t.preventDefault(),t.stopPropagation(),!Vt.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(un.value){$e.value.show=!1,e.nextTick(()=>{$e.value.show=!0,$e.value.x=t.clientX,$e.value.y=t.clientY,$e.value.categoryIndex=null});return}const p=Math.max(0,L.value.left-20),g=L.value.right,w=L.value.top,k=L.value.bottom+80;n>=p&&n<=g&&i>=w&&i<=k&&($e.value.show=!1,e.nextTick(()=>{$e.value.show=!0,$e.value.x=t.clientX,$e.value.y=t.clientY,$e.value.categoryIndex=null;const _=Math.max(L.value.left,Math.min(n,L.value.right))-L.value.left,T=L.value.width/Oo.value.length,S=Math.floor(_/T);S>=0&&S<Oo.value.length&&($e.value.categoryIndex=S)}))},rt=t=>{if(!(t&&t.button===2)){if($e.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}$e.value.show=!1}},dn=t=>{if(typeof t.template=="function"){const s={series:V.series,categories:V.categories,markers:bt.value},n={chartX:$e.value.chartX,chartY:$e.value.chartY,dataX:$e.value.mouseDataX,dataY:$e.value.mouseDataY,categoryIndex:$e.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},_t=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},kn=t=>t.style||{},jo=t=>t.type&&sn.value[t.type]?sn.value[t.type]:t.customIcon?t.customIcon:$n.value,rl=t=>t==null?"":V.categories&&V.categories[t]?V.categories[t]:"",il=t=>bt.value.length?bt.value.filter(s=>s.categoryIndex===t):[],bn=t=>{if(!an.value&&!zt.value)return{x:0,y:0};const s=Ot(t),n=Q.value+L.value.bottom-hn.value/2;return{x:s,y:n}},Ko=()=>{bt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(an.value||zt.value)){const s=bn(t.categoryIndex);t.x=s.x,t.y=s.y}})},cl=()=>{if(se.value.description&&se.value.description.length&&se.value.date){if(b.value){const t=bt.value.findIndex(s=>s.id===se.value.editingMarkerId);t!==-1?(bt.value[t].description=se.value.description||"",bt.value[t].color=se.value.color||"",bt.value[t].type=se.value.type||"default",we("update-marker",bt.value[t])):we("update-marker",{id:se.value.editingMarkerId,description:se.value.description||"",color:se.value.color||"",type:se.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Ln(se.value.date,V.categories||[]);if(zt.value){const{maxX:w}=At.value;s=Math.max(0,Math.min(s,Math.floor(w)))}else an.value&&(s=Math.max(0,Math.min(s,At.value.maxX)));const n=Ot(s),i=Q.value+L.value.bottom-hn.value/2,p=Array.isArray(V.categories)?V.categories[s]:null,g={id:t,title:"",description:se.value.description||"",color:se.value.color||"",type:se.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:p||null};se.value.categoryIndex=s,bt.value.push(g),we("add-marker",g)}ao(),Go()}},ao=()=>{se.value.show=!1,se.value.title="",se.value.description="",se.value.color="#FF6B6B",se.value.type="default",se.value.editingMarkerId=null,se.value.readonly=!1,se.value.categoryIndex=null,se.value.fromButton=!1,se.value.date=null},dl=()=>{b.value&&(ul(se.value.editingMarkerId),ao())},ul=t=>{const s=bt.value.findIndex(n=>n.id===t);s!==-1&&(bt.value.splice(s,1),Go()),we("delete-marker",t)},Sn=t=>{if(se.value.show=!0,se.value.title=t?.title??t?.comment??"",se.value.description=t?.description??t?.comment??"",se.value.color=t?.color??"",se.value.type=t?.type??"default",se.value.editingMarkerId=t?.id??t?.marker_id??null,se.value.readonly=t?.readonly??!1,se.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[s,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(s),w=Number(n)-1;g&&n&&p?se.value.date=new Date(p,w,g):se.value.date=null}else se.value.date=null},Go=()=>{try{const t=`dss-chart-markers-${V.chartId}`;localStorage.setItem(t,JSON.stringify(bt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},Sl=()=>{try{const t=`dss-chart-markers-${V.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(bt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),bt.value=[]}},Yt=t=>{const s=ht.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}`},Jn=()=>{const t=Le.value.show,s=Re.value.show;return Le.value.show=!1,Re.value.show=!1,{originalCrosshair:t,originalTooltip:s}},_n=t=>{Le.value.show=t.originalCrosshair,Re.value.show=t.originalTooltip},eo=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 w=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(w);try{const k=document.createElement("canvas"),_=k.getContext("2d");k.width=s,k.height=n,_.fillStyle="#fafafa",_.fillRect(0,0,s,n),_.drawImage(g,0,0,s,n);const B=k.toDataURL("image/png");i(B)}catch(k){console.warn("Canvas conversion failed:",k),i(t)}},g.onerror=k=>{clearTimeout(w),console.warn("Failed to load image:",t,k),i(t)},g.src=t}),to=async()=>{try{const t=Jn();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),_n(t);return}const n=Me(),i=ke.value,p=st.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(G=>G.remove());const k=g.querySelectorAll("image"),_=Array.from(k).map(async G=>{const De=G.getAttribute("xlink:href")||G.getAttribute("href");if(De&&!De.startsWith("data:"))try{const ce=await eo(De,32,32);G.setAttribute("xlink:href",ce),G.setAttribute("href",ce)}catch(ce){console.warn("Failed to convert logo to base64:",ce)}});await Promise.all(_);const T=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let S="",U=30;if(ht.value&&(S+=`
|
|
46
|
-
<text x="24" y="${
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),Nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),nn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=O.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const Hn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Cn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),dn=e.computed(()=>{const t=O.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),fn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels;return s&&(s.show===!0||s.enabled===!0)}),Pn=e.computed(()=>{const s=O.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof s=="number"&&s>=0?s:20}),yl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter;return En.value&&s&&(s.show===!0||s.enabled===!0)}),Xl=e.computed(()=>{if(!yl.value||!ml.value.length)return"";const n=O.value?.radialBar?.dataCenter?.showValueOnly===!0?ml.value[0]?.value??0:ml.value.reduce((i,p)=>i+(p.value??0),0);return un(n)}),Cl=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.fontSize;return typeof s=="number"&&s>0?s:24}),kl=e.computed(()=>({x:St.value,y:Nt.value-Cl.value/2})),kn=e.computed(()=>{const s=O.value?.radialBar?.dataCenter?.color;return typeof s=="string"&&s?s:"#333"}),vn=e.computed(()=>{if(!fn.value||!pn.value||!ml.value.length)return[];const t=Pn.value*Math.PI/180,s=(Pt.value+st.value)/2;return ml.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=St.value+Math.cos(n.midAngle)*s,E=Nt.value+Math.sin(n.midAngle)*s;return{value:un(n.value),x:g,y:E,show:p,color:n.color,contrastColor:dl(n.color)}})}),Al=e.computed(()=>{if(!S.flags||!S.flags.length)return[];const t=new Map;return S.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=Ut(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
|
+
`)}})}),ol=e.ref({show:!1,x:0,y:0,content:"",count:0}),An=e.computed(()=>O.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),fl=e.computed(()=>{const t=O.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Vl=e.computed(()=>O.value?.bubbles?.tooltip?.formatters||{}),Rt=e.ref(new Set),Ce=e.ref(null),Nl=e.ref(!1),Xe=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderSeries:[]}),jt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Pe=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),ze=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),Z=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Tt=e.ref([]),he=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 cn.value&&t.push(...Object.keys(cn.value)),t}),e.computed(()=>{if(!S.categories||S.categories.length===0){const{maxX:t}=Ot.value;return Array.from({length:t+1},(s,n)=>z("chart.fallback.item",{number:n+1}))}return S.categories});const Mn=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.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)}),Dl=e.computed(()=>{if(!S.categories||S.categories.length===0)return null;const t=S.categories[S.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)}),w=e.computed(()=>he.value.editingMarkerId!==null),y=e.computed(()=>he.value.readonly),B=t=>{Rt.value.has(t)||(Kn.value=!0,Ce.value=t)},W=()=>{Kn.value=!1,Ce.value=null},se=t=>{if(Hl.value||Ll.value){Pe.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=Wt.value?i>=F.value.left-50&&i<=F.value.right+50&&p>=F.value.top-50&&p<=F.value.bottom+100:i>=F.value.left&&i<=F.value.right&&p>=F.value.top&&p<=F.value.bottom;if(Nl.value=g,Wt.value){if(!fe.value||!g||Z.value.isDragging||Z.value.isZooming){Pe.value.show=!1;return}if(Yn.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=Yn.value.filter(pe=>!pe||pe.isHidden?!1:Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-p,2))<=250);if(ee.length>0){let pe=ee[0],ye=Math.sqrt(Math.pow(pe.x-i,2)+Math.pow(pe.y-p,2));ee.forEach(be=>{const we=Math.sqrt(Math.pow(be.x-i,2)+Math.pow(be.y-p,2));we<ye&&(ye=we,pe=be)});const oe=30,Oe=Yn.value.filter(be=>!be||be.isHidden?!1:Math.abs(be.x-pe.x)<=oe).sort((be,we)=>be.y-we.y);Pe.value={show:!0,x:pe.x,categoryIndex:Math.round(pe.originalX),data:(()=>{const be=An.value,we=fl.value,De=[];return Oe.forEach(Ae=>{be.forEach(Ct=>{const kt=we[Ct]||Ct,Vn=u(Ct,Ae);Vn&&De.push({seriesName:Ae.seriesName,label:Ae.label,value:`${kt}: ${Vn}`,color:Ae.color,y:Ae.y})})}),De})()}}else Pe.value.show=!1}return}if(Z.value.isDragging&&Z.value.scale>1&&rn.value&&Et.value){Pe.value.show=!1;const Ee=t.clientX-Z.value.lastMouseX,{minX:ee,maxX:pe}=Ot.value,ye=pe-ee||1,Oe=Ee*.8;Z.value.offsetX+=Oe;const be=ye/Z.value.scale,we=ye-be,De=0,Ae=-we/ye*F.value.width,Ct=De;Z.value.offsetX=Math.max(Ae,Math.min(Ct,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY;return}if(!fe.value||!rn.value||Z.value.isDragging||Z.value.isZooming||!g){Pe.value.show=!1;return}const{minX:E,maxX:b}=Ot.value,L=b-E||1,T=L/Z.value.scale,H=E-Z.value.offsetX/F.value.width*L,M=(i-F.value.left)/F.value.width,G=H+M*T,ce=Math.round(G);if(ce>=0&&ce<=b){const Ee=Ut(ce),ee=Un.value.map((pe,ye)=>{const oe=S.series.findIndex(be=>be===pe),Oe=pe.data[ce];return{seriesName:pe.name,value:Oe!==void 0?Oe:null,color:Lt(oe),y:Oe!==void 0?Qt(Oe):null}}).filter(pe=>pe.value!==null);Pe.value={show:!0,x:Ee,categoryIndex:ce,data:ee}}},mt=()=>{Pe.value.show=!1,Nl.value=!1,Ll.value=!1,Hl.value||(ol.value.show=!1),Z.value.isDragging&&(Z.value.isDragging=!1),Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1,setTimeout(()=>{Ce.value=null,Xe.value.show=!1},150)},et=t=>{if(t.preventDefault(),t.stopPropagation(),!Ue.value)return;const s=t.currentTarget.getBoundingClientRect(),n=t.clientX-s.left,i=t.clientY-s.top;if(pn.value){ze.value.show=!1,e.nextTick(()=>{ze.value.show=!0,ze.value.x=t.clientX,ze.value.y=t.clientY,ze.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,E=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=E&&i<=b&&(ze.value.show=!1,e.nextTick(()=>{ze.value.show=!0,ze.value.x=t.clientX,ze.value.y=t.clientY,ze.value.categoryIndex=null;const L=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,H=F.value.width/Pl.value.length,M=Math.floor(L/H);M>=0&&M<Pl.value.length&&(ze.value.categoryIndex=M)}))},ht=t=>{if(!(t&&t.button===2)){if(ze.value.show&&t&&t.type==="click"){const s=document.querySelector(".dss-context-menu");if(s&&s.contains(t.target))return}ze.value.show=!1}},mn=t=>{if(typeof t.template=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:ze.value.chartX,chartY:ze.value.chartY,dataX:ze.value.mouseDataX,dataY:ze.value.mouseDataY,categoryIndex:ze.value.categoryIndex};return t.template(s,n)}return t.template||t.label||""},It=t=>{const s=["dss-context-menu-item"];return t.cssClass&&s.push(t.cssClass),s},bn=t=>t.style||{},Yl=t=>t.type&&cn.value[t.type]?cn.value[t.type]:t.customIcon?t.customIcon:Tn.value,so=t=>t==null?"":S.categories&&S.categories[t]?S.categories[t]:"",ro=t=>Tt.value.length?Tt.value.filter(s=>s.categoryIndex===t):[],wn=t=>{if(!rn.value&&!Wt.value)return{x:0,y:0};const s=Ut(t),n=te.value+F.value.bottom-yn.value/2;return{x:s,y:n}},jl=()=>{Tt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(rn.value||Wt.value)){const s=wn(t.categoryIndex);t.x=s.x,t.y=s.y}})},io=()=>{if(he.value.description&&he.value.description.length&&he.value.date){if(w.value){const t=Tt.value.findIndex(s=>s.id===he.value.editingMarkerId);t!==-1?(Tt.value[t].description=he.value.description||"",Tt.value[t].color=he.value.color||"",Tt.value[t].type=he.value.type||"default",Me("update-marker",Tt.value[t])):Me("update-marker",{id:he.value.editingMarkerId,description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let s=Ln(he.value.date,S.categories||[]);if(Wt.value){const{maxX:E}=Ot.value;s=Math.max(0,Math.min(s,Math.floor(E)))}else rn.value&&(s=Math.max(0,Math.min(s,Ot.value.maxX)));const n=Ut(s),i=te.value+F.value.bottom-yn.value/2,p=Array.isArray(S.categories)?S.categories[s]:null,g={id:t,title:"",description:he.value.description||"",color:he.value.color||"",type:he.value.type||"default",categoryIndex:s,x:n,y:i,marker_date:p||null};he.value.categoryIndex=s,Tt.value.push(g),Me("add-marker",g)}al(),Kl()}},al=()=>{he.value.show=!1,he.value.title="",he.value.description="",he.value.color="#FF6B6B",he.value.type="default",he.value.editingMarkerId=null,he.value.readonly=!1,he.value.categoryIndex=null,he.value.fromButton=!1,he.value.date=null},co=()=>{w.value&&(uo(he.value.editingMarkerId),al())},uo=t=>{const s=Tt.value.findIndex(n=>n.id===t);s!==-1&&(Tt.value.splice(s,1),Kl()),Me("delete-marker",t)},Sn=t=>{if(he.value.show=!0,he.value.title=t?.title??t?.comment??"",he.value.description=t?.description??t?.comment??"",he.value.color=t?.color??"",he.value.type=t?.type??"default",he.value.editingMarkerId=t?.id??t?.marker_id??null,he.value.readonly=t?.readonly??!1,he.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?he.value.date=new Date(p,E,g):he.value.date=null}else he.value.date=null},Kl=()=>{try{const t=`dss-chart-markers-${S.chartId}`;localStorage.setItem(t,JSON.stringify(Tt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},No=()=>{try{const t=`dss-chart-markers-${S.chartId}`,s=localStorage.getItem(t);if(s){const n=JSON.parse(s);Array.isArray(n)&&(Tt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Tt.value=[]}},Kt=t=>{const s=wt.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}`},Jn=()=>{const t=Pe.value.show,s=Xe.value.show;return Pe.value.show=!1,Xe.value.show=!1,{originalCrosshair:t,originalTooltip:s}},_n=t=>{Pe.value.show=t.originalCrosshair,Xe.value.show=t.originalTooltip},el=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 b=document.createElement("canvas"),L=b.getContext("2d");b.width=s,b.height=n,L.fillStyle="#fafafa",L.fillRect(0,0,s,n),L.drawImage(g,0,0,s,n);const T=b.toDataURL("image/png");i(T)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(E),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),tl=async()=>{try{const t=Jn();setTimeout(async()=>{try{const s=document.querySelector(".dss-chart-svg");if(!s){console.error("Chart SVG element not found"),_n(t);return}const n=He(),i=Ne.value,p=pt.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(oe=>oe.remove());const b=g.querySelectorAll("image"),L=Array.from(b).map(async oe=>{const Oe=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(Oe&&!Oe.startsWith("data:"))try{const be=await el(Oe,32,32);oe.setAttribute("xlink:href",be),oe.setAttribute("href",be)}catch(be){console.warn("Failed to convert logo to base64:",be)}});await Promise.all(L);const H=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let M="",G=30;if(wt.value&&(M+=`
|
|
46
|
+
<text x="24" y="${G}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
52
|
-
</text>`,
|
|
53
|
-
<text x="24" y="${
|
|
51
|
+
${wt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
|
+
</text>`,G+=30),tt.value&&(M+=`
|
|
53
|
+
<text x="24" y="${G}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
|
-
${
|
|
58
|
-
</text>`,
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${
|
|
57
|
+
${tt.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
+
</text>`,G+=25),_t.value&&S.series.length>0){let oe=i-200,Oe=wt.value||tt.value?35:25;const be=Math.floor((i-250)/120);let we=0;S.series.forEach((De,Ae)=>{if(!Rt.value.has(Ae)){const Ct=Lt(Ae),kt=De.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");M+=`<circle cx="${oe+6}" cy="${Oe-4}" r="6" fill="${Ct}"/>`,M+=`<text x="${oe+18}" y="${Oe}" font-family="Arial, sans-serif" font-size="12" fill="#333">${kt}</text>`,we++,we%be===0?(oe=i-200,Oe+=20):oe+=Math.min(120,kt.length*8+35)}})}let ce="";if(A.value)try{const{width:oe,height:Oe}=Be.value,be=ne.value,we=F.value.left,De=F.value.right,Ae=F.value.top,Ct=F.value.bottom,kt=F.value.width,Vn=F.value.height;let Yt,pl;switch(be){case"center":Yt=we+(kt-oe)/2,pl=Ae+(Vn-Oe)/2;break;case"top-left":Yt=we+15,pl=Ae+5;break;case"top-right":Yt=De-oe-5,pl=Ae+5;break;case"bottom-left":Yt=we+15,pl=Ct-Oe-5;break;case"bottom-right":default:Yt=De-oe-5,pl=Ct-Oe-5;break}ce=`
|
|
59
|
+
<g opacity="${q.value}">
|
|
60
|
+
<g transform="translate(${Yt}, ${pl}) scale(${oe/499})">
|
|
61
61
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
62
62
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
63
63
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
<path d="M47.5201 77.18H66.2501C73.5601 77.18 79.4801 71.26 79.4801 63.95C79.4801 56.64 73.5601 50.72 66.2501 50.72H47.3601C46.3801 50.72 45.5901 51.52 45.6001 52.5L45.7601 75.44C45.7601 76.41 46.5501 77.19 47.5201 77.19V77.18Z" fill="#07ACDD"/>
|
|
73
73
|
<path d="M28.4201 76.12C35.1082 76.12 40.5301 70.6982 40.5301 64.01C40.5301 57.3218 35.1082 51.9 28.4201 51.9C21.7319 51.9 16.3101 57.3218 16.3101 64.01C16.3101 70.6982 21.7319 76.12 28.4201 76.12Z" fill="#fafafa"/>
|
|
74
74
|
</g>
|
|
75
|
-
</g>`}catch(
|
|
75
|
+
</g>`}catch(oe){console.warn("Watermark processing failed, skipping watermark in SVG:",oe),ce=""}const Ee=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${i}" height="${p}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -84,34 +84,34 @@
|
|
|
84
84
|
</style>
|
|
85
85
|
</defs>
|
|
86
86
|
<rect width="100%" height="100%" fill="#fafafa"/>
|
|
87
|
-
${
|
|
87
|
+
${M}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
|
-
${
|
|
90
|
-
${
|
|
89
|
+
${H}
|
|
90
|
+
${ce}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,
|
|
93
|
-
`),
|
|
94
|
-
`),t+=`# ${
|
|
92
|
+
</svg>`,ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(ee),ye=document.createElement("a");ye.href=pe,ye.download=Kt("svg"),document.body.appendChild(ye),ye.click(),document.body.removeChild(ye),URL.revokeObjectURL(pe),_n(t),ht()}catch(s){console.error("Error downloading SVG:",s),_n(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},sl=async()=>{try{const t=Jn();document.querySelector(".dss-custom-chart-container").offsetHeight,await new Promise(oe=>setTimeout(oe,300));const s=He(),n=Ne.value,i=pt.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 b=30;if(wt.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(wt.value,24,b),b+=30),tt.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(tt.value,24,b),b+=25),_t.value&&S.series.length>0){let oe=n-200,Oe=wt.value||tt.value?35:25;const be=Math.floor((n-250)/120);let we=0;g.font="12px Arial, sans-serif",S.series.forEach((De,Ae)=>{if(!Rt.value.has(Ae)){const Ct=Lt(Ae);g.beginPath(),g.arc(oe+6,Oe-4,6,0,2*Math.PI),g.fillStyle=Ct,g.fill(),g.fillStyle="#333",g.fillText(De.name,oe+18,Oe),we++,we%be===0?(oe=n-200,Oe+=20):oe+=Math.min(120,De.name.length*8+35)}})}const T=document.querySelector(".dss-chart-svg").cloneNode(!0),H=T.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),M=T.querySelectorAll(".dss-crosshair"),G=T.querySelectorAll('[class*="tooltip"]');H.forEach(oe=>oe.remove()),M.forEach(oe=>oe.remove()),G.forEach(oe=>oe.remove()),T.querySelectorAll("image").forEach((oe,Oe)=>{const be=oe.getAttribute("xlink:href")||oe.getAttribute("href");if(be&&!be.startsWith("data:")){const we=zt.value[Oe],De=we?Lt(we.seriesIndex):"#3B82F6",Ae=oe.getAttribute("x")||0,Ct=oe.getAttribute("y")||0,kt=oe.getAttribute("width")||32,Vn=oe.getAttribute("height")||32,Yt=document.createElementNS("http://www.w3.org/2000/svg","circle");Yt.setAttribute("cx",parseFloat(Ae)+parseFloat(kt)/2),Yt.setAttribute("cy",parseFloat(Ct)+parseFloat(Vn)/2),Yt.setAttribute("r",Math.min(parseFloat(kt),parseFloat(Vn))/2-1),Yt.setAttribute("fill",De),Yt.setAttribute("stroke","#fafafa"),Yt.setAttribute("stroke-width","2"),oe.parentNode.replaceChild(Yt,oe)}});const Ee=new XMLSerializer().serializeToString(T),ee=new Blob([Ee],{type:"image/svg+xml;charset=utf-8"}),pe=URL.createObjectURL(ee),ye=new Image;return new Promise((oe,Oe)=>{ye.onload=async()=>{try{if(g.drawImage(ye,0,s.height),zt.value.forEach(be=>{const we=be.x,De=be.y+s.height,Ae=(be.width||32)/2,Ct=Lt(be.seriesIndex);g.save(),g.beginPath(),g.arc(we,De,Ae-1,0,2*Math.PI),g.fillStyle=Ct,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),A.value){const be=new Image,we=()=>{const{width:Ae,height:Ct}=Be.value,kt=ne.value,Vn=F.value.left,Yt=F.value.right,pl=F.value.top,Wo=F.value.bottom,Go=F.value.width,Qo=F.value.height;let ql,Ul;switch(kt){case"center":ql=Vn+(Go-Ae)/2,Ul=pl+s.height+(Qo-Ct)/2;break;case"top-left":ql=Vn+15,Ul=pl+s.height+10;break;case"top-right":ql=Yt-Ae-5,Ul=pl+s.height+10;break;case"bottom-left":ql=Vn+15,Ul=Wo+s.height-Ct-5;break;case"bottom-right":default:ql=Yt-Ae-5,Ul=Wo+s.height-Ct-5;break}g.globalAlpha=q.value,g.drawImage(be,ql,Ul,Ae,Ct),g.globalAlpha=1,De()},De=()=>{p.toBlob(Ae=>{const Ct=URL.createObjectURL(Ae),kt=document.createElement("a");kt.href=Ct,kt.download=Kt("png"),document.body.appendChild(kt),kt.click(),document.body.removeChild(kt),URL.revokeObjectURL(Ct),URL.revokeObjectURL(pe),_n(t),ht(),oe()},"image/png")};be.onload=we,be.onerror=De,be.src=sn.value}else p.toBlob(be=>{const we=URL.createObjectURL(be),De=document.createElement("a");De.href=we,De.download=Kt("png"),document.body.appendChild(De),De.click(),document.body.removeChild(De),URL.revokeObjectURL(we),URL.revokeObjectURL(pe),_n(t),ht(),oe()},"image/png")}catch(be){URL.revokeObjectURL(pe),_n(t),Oe(be)}},ye.onerror=()=>{URL.revokeObjectURL(pe),_n(t),Oe(new Error("Failed to load SVG image"))},ye.src=pe})}catch(t){console.error("Error downloading PNG:",t)}},rl=()=>{try{let t="";wt.value&&(t+=`# ${z("chart.csv.chartTitle")}: ${wt.value}
|
|
93
|
+
`),tt.value&&(t+=`# ${z("chart.csv.chartSubtitle")}: ${tt.value}
|
|
94
|
+
`),t+=`# ${z("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),p=document.createElement("a");p.href=i,p.download=Yt("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),rt()}catch(t){console.error("Error downloading CSV:",t)}},Nn=t=>{if(typeof t.action=="function"){const s={series:V.series,categories:V.categories,markers:bt.value},n={chartX:$e.value.chartX,chartY:$e.value.chartY,dataX:$e.value.mouseDataX,dataY:$e.value.mouseDataY,categoryIndex:clampedCategoryIndex||$e.value.categoryIndex};t.action(s,n)}rt()},Qo=()=>{ao(),se.value.show=!0,se.value.categoryIndex=$e.value.categoryIndex,se.value.fromButton=!1,rt()},Mo=()=>{ao(),se.value.show=!0,se.value.categoryIndex=0,se.value.fromButton=!0},ml=t=>{if($e.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&($e.value.show=!1)}},Io=t=>{$e.value.show&&!t.target.closest(".context-menu")&&($e.value.show=!1)},Jo=t=>{if(!an.value||!Ct.value)return;t.preventDefault(),t.stopPropagation(),R.value.isZooming=!0,Le.value.show=!1,R.value.zoomTimeout&&clearTimeout(R.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<L.value.left-50||i>L.value.right+50||p<L.value.top-50||p>L.value.bottom+100){R.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,w=Math.max(R.value.minScale,Math.min(R.value.maxScale,R.value.scale*g));if(w!==R.value.scale){const{minX:k,maxX:_}=At.value,B=_-k||1,T=B/R.value.scale,S=k-R.value.offsetX/L.value.width*B,U=(i-L.value.left)/L.value.width,te=S+U*T;R.value.scale=w;const me=B/R.value.scale,j=te-U*me;R.value.offsetX=-(j-k)/B*L.value.width,R.value.scale<=1.01&&(R.value.scale=1,R.value.offsetX=0)}R.value.zoomTimeout=setTimeout(()=>{R.value.isZooming=!1,R.value.zoomTimeout=null},300)},Nl=t=>{if(!an.value||!Ct.value||R.value.scale<=1)return;Le.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,R.value.isDragging=!0,R.value.lastMouseX=t.clientX,R.value.lastMouseY=t.clientY,t.preventDefault()},Ml=()=>{R.value.isDragging=!1},Fo=()=>{!an.value||!Ct.value||(R.value.scale=1,R.value.offsetX=0,R.value.isDragging=!1,R.value.zoomTimeout&&(clearTimeout(R.value.zoomTimeout),R.value.zoomTimeout=null),R.value.isZooming=!1)},Bl=()=>!an.value||!No.value||!Ct.value?"default":R.value.isDragging?"grabbing":R.value.scale>1?"grab":"dss-crosshair",el=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],w=t[Math.min(n+2,t.length-1)],k=p.x+(g.x-i.x)/6*q.value,_=p.y+(g.y-i.y)/6*q.value,B=g.x-(w.x-p.x)/6*q.value,T=g.y-(w.y-p.y)/6*q.value;s+=` C ${k} ${_} ${B} ${T} ${g.x} ${g.y}`}return s},wn=e.computed(()=>{const s=F.value?.chart?.padding,n=typeof s=="number"?s:null,i=s&&typeof s=="object"?s:null,p=50;let g=p+(Rt.value?30:0)+60;if(On.value){const S={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??S.left,top:i.top??S.top,right:i.right??S.right,bottom:i.bottom??S.bottom}:S}if(un.value){const S=!Bt.value,U=Vn.value,te=U?Hn.value+Cn.value+Math.max(24,tn.value+16):0,me=S?12:p;let j=0;ht.value&&(j+=S?8:15),Ue.value&&(j+=S?6:10);const le=Me();let re=me+(S?4:16)+(U?te:0),G=me+(U?te:0);Bt.value&&O.value==="left"?re+=le.legendWidth||150:Bt.value&&O.value==="right"&&(G+=le.legendWidth||150);const ce=ve.value==="semi-radial"?U?te:8:U?te:S?8:p+80,de=U?14:0,Ne=me+j+de,Ve={left:re,top:Ne,right:G,bottom:ce};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Ve.left,top:i.top??Ve.top,right:i.right??Ve.right,bottom:i.bottom??Ve.bottom}:Ve}let w=0;ht.value&&(w+=15),Ue.value&&(w+=10);const k=Me();let _=p+16,B=p;Bt.value&&O.value==="left"?_+=k.legendWidth||150:Bt.value&&O.value==="right"&&(B+=k.legendWidth||150),Bt.value&&O.value==="bottom"&&(g+=k.legendHeight||0);const T={left:_,top:p+w,right:B,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??T.left,top:i.top??T.top,right:i.right??T.right,bottom:i.bottom??T.bottom}:T}),L=e.computed(()=>({left:wn.value.left,top:wn.value.top,right:ke.value-wn.value.right,bottom:st.value-wn.value.bottom,width:ke.value-(wn.value.left+wn.value.right),height:st.value-(wn.value.top+wn.value.bottom)})),an=e.computed(()=>["line","area","bar"].includes(ve.value)||Mt.value),Dn=e.computed(()=>Mt.value),un=e.computed(()=>["radial","semi-radial"].includes(ve.value)),On=e.computed(()=>ve.value==="spider"),zt=e.computed(()=>ve.value==="bubble"),jt=e.computed(()=>F.value?.chart?.orientation==="horizontal"&&(ve.value==="bar"||Dn.value)),io=t=>{const{minY:s,maxY:n}=At.value,i=n-s||1;return L.value.left+(t-s)/i*L.value.width},go=t=>{const{maxX:s}=At.value,n=s+1,p=L.value.height/n;return L.value.top+(t+.5)*p},gt=e.computed(()=>un.value?wn.value.left+(ke.value-wn.value.left-wn.value.right)/2:ke.value/2),pt=e.computed(()=>On.value?st.value/2-40:un.value?wn.value.top+(st.value-wn.value.top-wn.value.bottom)/2:st.value/2),qe=e.computed(()=>{if(On.value){const t=L.value.width-80,s=L.value.height-80;return Math.min(t,s)/2}return Math.min(L.value.width,L.value.height)/2}),Ht=e.computed(()=>{const t=F.value,s=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof s=="number"&&s>=0&&s<=1?s:.45;return qe.value*n}),zo=e.computed(()=>{const t=F.value,s=typeof V.innerSize=="number"?V.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(un.value||On.value)?1:1+s/100}),pl=e.computed(()=>{const t=zo.value;if(t===1||t<=0)return;const s=gt.value,n=pt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Bo=e.ref(0),Po=e.computed(()=>`semi-radial-fill-clip-${V.chartId}`),xn=e.computed(()=>ve.value==="semi-radial"),Zn=e.computed(()=>xn.value&&Ee.value&&!Gn.value),Wn=e.computed(()=>xn.value&&Ee.value&&!Gn.value&&je.value==="fill"),_o=e.computed(()=>{const t=Zn.value?Bo.value:1,s=gt.value,n=pt.value,i=Ht.value,p=qe.value,g=Math.PI,w=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const k=s+p*Math.cos(g),_=n+p*Math.sin(g),B=s+p*Math.cos(w),T=n+p*Math.sin(w),S=s+i*Math.cos(w),U=n+i*Math.sin(w),te=s+i*Math.cos(g),me=n+i*Math.sin(g),j=t>.5?1:0;return`M ${s} ${n} L ${k} ${_} A ${p} ${p} 0 ${j} 1 ${B} ${T} L ${S} ${U} A ${i} ${i} 0 ${j} 1 ${te} ${me} Z`}),Pt=e.computed(()=>{if(!(!xn.value||!Zn.value)&&!Wn.value)return`url(#${Po.value})`}),vl=t=>{if(!(!Wn.value||t!==0))return`url(#${Po.value})`},co=e.ref(0),uo=e.computed(()=>`radial-reveal-clip-${V.chartId}`),fn=e.computed(()=>ve.value==="radial"),wo=e.computed(()=>{const t=fn.value?co.value:1,s=gt.value,n=pt.value,i=Math.max(qe.value*1.5,ke.value,st.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const S=s-i,U=s+i;return`M ${S} ${n} A ${i} ${i} 0 0 1 ${U} ${n} A ${i} ${i} 0 0 1 ${S} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,w=s+i*Math.cos(p),k=n+i*Math.sin(p),_=s+i*Math.cos(g),B=n+i*Math.sin(g),T=t>=.5?1:0;return`M ${s} ${n} L ${w} ${k} A ${i} ${i} 0 ${T} 1 ${_} ${B} Z`}),ho=e.computed(()=>{if(Pt.value)return Pt.value;if(fn.value)return`url(#${uo.value})`});let qn=null;const _l=()=>{if(!Zn.value)return;Bo.value=0;const t=Se.value,s=performance.now(),n=i=>{const p=i-s,g=Math.min(1,p/t);Bo.value=Vo(ft.value,g),g<1&&(qn=requestAnimationFrame(n))};qn=requestAnimationFrame(n)},fl=e.computed(()=>F.value?.bubbles?.minSize||8),To=e.computed(()=>F.value?.bubbles?.maxSize||50),tl=e.computed(()=>F.value?.bubbles?.opacity||.7),xo=(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)},gl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},Tl=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},no=e.computed(()=>V.series),Un=e.computed(()=>V.series.filter((t,s)=>!St.value.has(s))),Xn="auto",At=e.computed(()=>{if(zt.value)return $l();if(!Un.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Un.value.forEach(k=>{k.data&&k.data.length&&(n=Math.max(n,k.data.length-1),k.data.forEach(_=>{typeof _=="number"&&(t=Math.min(t,_),s=Math.max(s,_))}))}),V.categories.length>0&&(n=Math.max(n,V.categories.length-1)),t===1/0&&(t=0,s=100);const i=vt.value,p=Ge.value;let g,w;if(i===Xn){const k=s-t,_=k>0?k*.1:1;g=Math.max(0,t-_)}else if(typeof i=="number")g=i;else{const k=s-t,_=k>0?k*.1:1;g=Math.max(0,t-_)}if(p===Xn){const k=s-t,_=k>0?k*.1:2;w=s+_}else if(typeof p=="number")w=p;else{const k=s-t,_=k>0?k*.1:2;w=s+_}return{minX:0,maxX:n,minY:g,maxY:w}}),$l=()=>{if(!Un.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,w=!1;if(Un.value.forEach((te,me)=>{te?.data?.length&&te.data.forEach((j,le)=>{let re,G,De;if(typeof j=="object"&&j!==null&&!Array.isArray(j))re=typeof j.x=="number"?j.x:le,G=typeof j.y=="number"?j.y:0,De=typeof j.size=="number"?j.size:20;else if(Array.isArray(j)&&j.length>=3)re=typeof j[0]=="number"?j[0]:le,G=typeof j[1]=="number"?j[1]:0,De=typeof j[2]=="number"?j[2]:20;else if(typeof j=="number")re=le,G=j,De=xo(me,le);else return;isFinite(re)&&isFinite(G)&&isFinite(De)&&(t=Math.min(t,re),s=Math.max(s,re),n=Math.min(n,G),i=Math.max(i,G),p=Math.min(p,De),g=Math.max(g,De),w=!0)})}),!w)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===s&&(t=Math.min(t,0),s=Math.max(s,V.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const k=s-t,_=i-n;let B,T,S,U;return Ze.value!==null?B=Ze.value:B=t-k*.1,en.value!==null?T=en.value:T=s+k*.1,vt.value!==null&&typeof vt.value=="number"?S=vt.value:S=Math.max(0,n-_*.1),Ge.value!==null&&typeof Ge.value=="number"?U=Ge.value:U=i+_*.1,{minX:B,maxX:T,minY:S,maxY:U,minSize:p,maxSize:g}},Ot=t=>{if(zt.value){const{minX:k,maxX:_}=At.value,B=_-k||1;return L.value.left+(t-k)/B*L.value.width}const{minX:s,maxX:n}=At.value,i=n-s;if(n===0||i===0)return L.value.left+L.value.width/2;const p=i/R.value.scale,g=s-R.value.offsetX/L.value.width*i,w=(t-g)/p;return L.value.left+w*L.value.width},Kt=t=>{const{minY:s,maxY:n}=At.value,i=n-s||1;return L.value.bottom-(t-s)/i*L.value.height},hl=t=>{if(!zt.value)return Qe.value||4;const{maxSize:s}=At.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return fl.value+i*(To.value-fl.value)},Ll=e.computed(()=>yl.value.map(t=>({y:t.y}))),Oo=e.computed(()=>{if(zt.value)return Cl();if(ve.value==="bar"){if(jt.value){const ce=[],{minY:de,maxY:Ne}=At.value,Ve=5,ct=Ne-de||1;for(let dt=0;dt<=Ve;dt++){const En=de+ct*(dt/Ve),Ut=io(En);ce.push({x:Ut,y:L.value.bottom+20,text:rn(Math.round(En))})}return ce}const me=[],{maxX:j}=At.value,le=j+1,re=5,De=(L.value.width-re*2)/le;for(let ce=0;ce<=j;ce++){const de=L.value.left+re+(ce+.5)*De;me.push({x:de,y:L.value.bottom+20,text:V.categories[ce]||D("chart.fallback.item",{number:ce+1})})}return me}const t=[],{minX:s,maxX:n}=At.value,i=n-s||1,p=i/R.value.scale,g=s-R.value.offsetX/L.value.width*i,w=g+p,k=Math.max(0,Math.floor(g-2)),_=Math.min(n,Math.ceil(w+2)),B=_-k,T=L.value.width,U=Math.floor(T/60);let te=1;B>U&&(te=Math.ceil(B/U));for(let me=k;me<=_;me+=te)if(me>=0&&me<=n){const j=Ot(me);j>=L.value.left-100&&j<=L.value.right+100&&t.push({x:j,y:L.value.bottom+20,text:V.categories[me]||`Item ${me+1}`})}return t}),Cl=()=>{const t=[],{minX:s,maxX:n}=At.value,i=n-s||1,p=Math.min(8,Math.max(4,Math.floor(L.value.width/80)));for(let g=0;g<=p;g++){const w=s+i*g/p,k=Ot(w);if(k>=L.value.left-10&&k<=L.value.right+10){const _=Math.round(w),B=V.categories?.[_];t.push({x:k,y:L.value.bottom+20,text:B||(Number.isInteger(w)?w.toString():w.toFixed(1))})}}return t},yl=e.computed(()=>{if(jt.value){const p=[],{maxX:g}=At.value;for(let w=0;w<=g;w++)p.push({x:L.value.left-10,y:go(w),text:V.categories[w]||`Item ${w+1}`});return p}const t=[],{minY:s,maxY:n}=At.value,i=5;for(let p=0;p<=i;p++){const g=s+(n-s)*(p/i),w=Math.round(g);t.push({x:L.value.left-10,y:Kt(g),text:rn(w)})}return t}),wt=t=>{const s=ee.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]},mo=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 k=s.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)$/i);if(k)n=Number(k[1])/255,i=Number(k[2])/255,p=Number(k[3])/255;else{const _=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(_){let B=_[1];B.length===3&&(B=B[0]+B[0]+B[1]+B[1]+B[2]+B[2]),n=parseInt(B.slice(0,2),16)/255,i=parseInt(B.slice(2,4),16)/255,p=parseInt(B.slice(4,6),16)/255}else if(typeof document<"u"){const B=document.createElement("span");B.style.color=s,B.style.display="none",document.body.appendChild(B);const T=getComputedStyle(B).color;document.body.removeChild(B);const S=T.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(S)n=Number(S[1])/255,i=Number(S[2])/255,p=Number(S[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},$o=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)),w=Math.max(0,Math.floor(Number(n[2])*.65)),k=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${w}, ${k})`}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)),w=Math.max(0,Math.floor(Number(i[2])*.65)),k=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${w}, ${k}, ${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 w=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(0,2),16)*.65))),k=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),_=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[w,k,_].map(B=>B.toString(16).padStart(2,"0")).join("")}`}return s},Zo=(t,s)=>{const i=F.value?.stroke?.color;return i==null?$o(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??$o(s):$o(s)},nl=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},kl=e.computed(()=>ve.value==="line"||Dn.value?(Dn.value?V.series.filter(s=>(s.type||ve.value)==="line"):no.value).map((s,n)=>{const i=V.series.findIndex(S=>S===s),p=[];let g=[];s.data.forEach((S,U)=>{S==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:jt.value?io(S):Ot(U),y:jt.value?go(U):Kt(S),index:U})}),g.length>0&&p.push(g);let w="";p.forEach(S=>{if(S.length>0){let U="";Z.value?U=el(S):U=`M ${S[0].x} ${S[0].y}`+S.slice(1).map(te=>` L ${te.x} ${te.y}`).join(""),w+=(w?" ":"")+U}});const k=p.reduce((S,U)=>S+nl(U),0),_=St.value.has(i),B=ie.value===i,T=ie.value!==null&&ie.value!==i;return{path:w,color:wt(i),pathLength:k,seriesIndex:i,animationDelay:n*Et.value,isHighlighted:B,isDimmed:T,isHidden:_}}):[]),bl=e.computed(()=>{if(!(ve.value==="line"||Dn.value))return[];const t=Dn.value?V.series.filter(n=>(n.type||ve.value)==="line"):no.value,s=[];return t.forEach((n,i)=>{const p=V.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const w=n.data[g];if(w!=null){let k=-1,_=0;for(let B=g+1;B<n.data.length;B++){const T=n.data[B];if(T==null)_++;else{k=B;break}}if(_>0&&k!==-1){const B=n.data[k],T=jt.value?io(w):Ot(g),S=jt.value?go(g):Kt(w),U=jt.value?io(B):Ot(k),te=jt.value?go(k):Kt(B),me=St.value.has(p),j=ie.value===p,le=ie.value!==null&&ie.value!==p;s.push({path:`M ${T} ${S} L ${U} ${te}`,color:wt(p),seriesIndex:p,animationDelay:i*Et.value,isHighlighted:j,isDimmed:le,isHidden:me,gapSize:_}),g=k-1}}}}),s}),Wo=e.computed(()=>ve.value==="line"||Dn.value?!Ee.value||Gn.value||it.value.hasAnimated?[]:(Dn.value?V.series.filter(s=>(s.type||ve.value)==="line"):no.value).map((s,n)=>{const i=V.series.findIndex(_=>_===s);let p="",g=null;s.data.forEach((_,B)=>{if(_!=null){const T={x:jt.value?io(_):Ot(B),y:jt.value?go(B):Kt(_)};g===null?p+=`M ${T.x} ${T.y}`:p+=` L ${T.x} ${T.y}`,g=T}else if(g!==null){const T=s.data.findIndex((S,U)=>U>B&&S!==null&&S!==void 0);if(T!==-1){const S={x:jt.value?io(s.data[T]):Ot(T),y:jt.value?go(T):Kt(s.data[T])};p+=` L ${S.x} ${S.y}`,g=S}}});const w=s.data.map((_,B)=>_==null?null:{x:jt.value?io(_):Ot(B),y:jt.value?go(B):Kt(_)}).filter(_=>_!==null),k=nl(w);return{path:p,pathLength:k,color:wt(i),animationDelay:n*Et.value,seriesIndex:i}}):[]),Rn=e.computed(()=>{if(ve.value!=="line")return[];const t=[];return no.value.forEach((s,n)=>{const i=ie.value===n,p=ie.value!==null&&ie.value!==n,g=St.value.has(n);s.data.forEach((w,k)=>{w!=null&&t.push({x:Ot(k),y:Kt(w),color:wt(n),value:w,label:V.categories[k]||k.toString(),seriesName:s.name,categoryIndex:k,dataIndex:k,animationDelay:(n*s.data.length+k)*(Et.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Hl=e.computed(()=>{if(!Dn.value)return[];const t=[];return V.series.filter(n=>(n.type||ve.value)==="line").forEach((n,i)=>{const p=V.series.findIndex(_=>_===n),g=ie.value===p,w=ie.value!==null&&ie.value!==p,k=St.value.has(p);n.data.forEach((_,B)=>{_!=null&&t.push({x:Ot(B),y:Kt(_),color:wt(p),value:_,label:V.categories[B]||B.toString(),seriesName:n.name,categoryIndex:B,dataIndex:B,animationDelay:(i*n.data.length+B)*(Et.value/8),isHighlighted:g,isDimmed:w,isHidden:k})})}),t}),Yn=e.computed(()=>{if(!zt.value)return[];const t=[];return no.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=ie.value,p=i!==null&&i===n,g=i!==null&&i!==n,w=St.value.has(n);s.data.forEach((k,_)=>{let B,T,S,U,te;if(typeof k=="object"&&k!==null&&!Array.isArray(k))B=typeof k.x=="number"?k.x:_,T=typeof k.y=="number"?k.y:0,S=typeof k.size=="number"?k.size:20,U=k.label||V.categories?.[_]||`Point ${_+1}`,te=k.image||k.imageUrl;else if(Array.isArray(k)&&k.length>=3)B=typeof k[0]=="number"?k[0]:_,T=typeof k[1]=="number"?k[1]:0,S=typeof k[2]=="number"?k[2]:20,U=k[3]||V.categories?.[_]||`Point ${_+1}`,te=k[4];else if(typeof k=="number")B=_,T=k,S=xo(n,_),U=V.categories?.[_]||`Point ${_+1}`;else return;!isFinite(B)||!isFinite(T)||!isFinite(S)||t.push({x:Ot(B),y:Kt(T),radius:hl(S),originalX:B,originalY:T,originalSize:S,color:wt(n),seriesName:s.name||`Series ${n+1}`,label:U,imageUrl:te,seriesIndex:n,dataIndex:_,categoryIndex:Math.round(B),isHighlighted:p,isDimmed:g,isHidden:w,opacity:tl.value})})}),t}),Lo=e.computed(()=>ve.value!=="area"?[]:no.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((S,U)=>{S==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Ot(U),y:Kt(S),index:U})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:wt(s),isHidden:St.value.has(s)};const p=L.value.bottom+1;let g="",w="";n.forEach((S,U)=>{if(S.length===0)return;let te=`M ${S[0].x} ${S[0].y}`;Z.value&&S.length>1?te=el(S):S.slice(1).forEach(j=>{te+=` L ${j.x} ${j.y}`}),g+=(g?" ":"")+te;let me=`M ${S[0].x} ${p}`;if(me+=` L ${S[0].x} ${S[0].y}`,Z.value&&S.length>1){const j=el(S),le=j.substring(j.indexOf("C")||j.indexOf("Q")||j.indexOf("L"));le?me+=" "+le:S.slice(1).forEach(re=>{me+=` L ${re.x} ${re.y}`})}else S.slice(1).forEach(j=>{me+=` L ${j.x} ${j.y}`});me+=` L ${S[S.length-1].x} ${p} Z`,w+=(w?" ":"")+me});const k=ie.value===s,_=ie.value!==null&&ie.value!==s,B=St.value.has(s),T=n.reduce((S,U)=>S+nl(U),0);return{linePath:g,areaPath:w,color:wt(s),pathLength:T,isHighlighted:k,isDimmed:_,isHidden:B}})),wl=e.computed(()=>{if(!(["bar"].includes(ve.value)||Dn.value))return[];const t=[],{maxX:s}=At.value,n=Dn.value?V.series.filter(p=>(p.type||ve.value)==="bar"):no.value,i=n.length;if(jt.value){const p=s+1,w=L.value.height/p,k=w*(2/3),_=Math.min(4,k/i*.15),B=k-(i-1)*_,T=Math.max(4,B/i);n.forEach((S,U)=>{const te=V.series.findIndex(re=>re===S),me=ie.value===te,j=ie.value!==null&&ie.value!==te,le=St.value.has(te);S.data.forEach((re,G)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const de=L.value.top+(G+.5)*w-k/2+U*(T+_),Ne=L.value.left,Ve=Math.abs(io(re)-L.value.left);let ct="";if(Z.value&&Ve>0){const dt=Math.min(Y.value,T/2,Ve/2);ct=[`M ${Ne} ${de}`,`L ${Ne+Ve-dt} ${de}`,`Q ${Ne+Ve} ${de} ${Ne+Ve} ${de+dt}`,`L ${Ne+Ve} ${de+T-dt}`,`Q ${Ne+Ve} ${de+T} ${Ne+Ve-dt} ${de+T}`,`L ${Ne} ${de+T}`,"Z"].join(" ")}t.push({x:Ne,y:de,width:Ve,height:T,color:wt(i===1?G:te),value:re,label:V.categories[G]||G.toString(),seriesName:S.name,animationDelay:(U*n.length+G)*(Et.value/4),isHighlighted:me,isDimmed:j,isHidden:le,barPath:ct,isSmooth:Z.value&&Ve>0})})})}else{const p=s+1,w=L.value.width/p,k=w*.8,_=k/i,B=_*.05,T=_-B;n.forEach((S,U)=>{const te=V.series.findIndex(re=>re===S),me=ie.value===te,j=ie.value!==null&&ie.value!==te,le=St.value.has(te);S.data.forEach((re,G)=>{if(re==null||typeof re!="number"||!isFinite(re))return;const de=L.value.left+(G+.5)*w-k/2+U*_+B/2,Ne=Kt(Math.max(0,re)),Ve=Math.abs(Kt(0)-Kt(re));let ct="";if(Z.value&&Ve>0){const dt=Math.min(Y.value,T/2,Ve/2);ct=[`M ${de} ${Ne+Ve}`,`L ${de} ${Ne+dt}`,`Q ${de} ${Ne} ${de+dt} ${Ne}`,`L ${de+T-dt} ${Ne}`,`Q ${de+T} ${Ne} ${de+T} ${Ne+dt}`,`L ${de+T} ${Ne+Ve}`,"Z"].join(" ")}t.push({x:de,y:Ne,width:T,height:Ve,color:wt(i===1?G:te),value:re,label:V.categories[G]||G.toString(),seriesName:S.name,animationDelay:(U*n.length+G)*(Et.value/4),isHighlighted:me,isDimmed:j,isHidden:le,barPath:ct,isSmooth:Z.value&&Ve>0})})})}return t}),po=e.computed(()=>{if(!un.value)return[];const t=no.value.map((g,w)=>({series:g,originalIndex:w})).filter(({originalIndex:g})=>!St.value.has(g));if(t.length===0)return[];let s=ve.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ve.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:w}=t[0],k=g.data[0]||0,_=s,B=s+n-.001,T=_+n/2,S=gt.value+Math.cos(_)*Ht.value,U=pt.value+Math.sin(_)*Ht.value,te=gt.value+Math.cos(B)*Ht.value,me=pt.value+Math.sin(B)*Ht.value,j=gt.value+Math.cos(B)*qe.value,le=pt.value+Math.sin(B)*qe.value,re=gt.value+Math.cos(_)*qe.value,G=pt.value+Math.sin(_)*qe.value,De=1,ce=[`M ${S} ${U}`,`A ${Ht.value} ${Ht.value} 0 ${De} 1 ${te} ${me}`,`L ${j} ${le}`,`A ${qe.value} ${qe.value} 0 ${De} 0 ${re} ${G}`,"Z"].join(" "),de=wt(w);return i.push({path:ce,color:de,strokeWidth:xt.value,strokeColor:Zo(0,de),value:k,seriesName:g.name,opacity:.8,isHighlighted:ie.value===w,isDimmed:!1,isHidden:!1,startAngle:_,endAngle:B,midAngle:T}),i}if(Wn.value&&t.length===2){const g=t[0],w=t[1],k=Math.min(100,Math.max(0,g.series.data[0]||0)),_=k/100*n,B=(T,S,U,te,me)=>{const j=T+(S-T)/2,le=S-T,re=gt.value+Math.cos(T)*Ht.value,G=pt.value+Math.sin(T)*Ht.value,De=gt.value+Math.cos(S)*Ht.value,ce=pt.value+Math.sin(S)*Ht.value,de=gt.value+Math.cos(S)*qe.value,Ne=pt.value+Math.sin(S)*qe.value,Ve=gt.value+Math.cos(T)*qe.value,ct=pt.value+Math.sin(T)*qe.value,dt=le>Math.PI?1:0,En=[`M ${re} ${G}`,`A ${Ht.value} ${Ht.value} 0 ${dt} 1 ${De} ${ce}`,`L ${de} ${Ne}`,`A ${qe.value} ${qe.value} 0 ${dt} 0 ${Ve} ${ct}`,"Z"].join(" "),Ut=wt(te);return{path:En,color:Ut,strokeWidth:xt.value,strokeColor:Zo(i.length,Ut),value:me,seriesName:U.name,opacity:.8,isHighlighted:ie.value===te,isDimmed:ie.value!==null&&ie.value!==te,isHidden:!1,startAngle:T,endAngle:S,midAngle:j}};return i.push(B(s,s+_,g.series,g.originalIndex,k)),i.push(B(s,s+n,w.series,w.originalIndex,100)),i}const p=t.reduce((g,{series:w})=>g+(w.data[0]||0),0);return p===0?[]:(t.forEach(({series:g,originalIndex:w})=>{const k=g.data[0]||0,_=k/p*n,B=s,T=s+_,S=B+_/2,U=gt.value+Math.cos(B)*Ht.value,te=pt.value+Math.sin(B)*Ht.value,me=gt.value+Math.cos(T)*Ht.value,j=pt.value+Math.sin(T)*Ht.value,le=gt.value+Math.cos(T)*qe.value,re=pt.value+Math.sin(T)*qe.value,G=gt.value+Math.cos(B)*qe.value,De=pt.value+Math.sin(B)*qe.value,ce=_>Math.PI?1:0,de=[`M ${U} ${te}`,`A ${Ht.value} ${Ht.value} 0 ${ce} 1 ${me} ${j}`,`L ${le} ${re}`,`A ${qe.value} ${qe.value} 0 ${ce} 0 ${G} ${De}`,"Z"].join(" "),Ne=wt(w);i.push({path:de,color:Ne,strokeWidth:xt.value,strokeColor:Zo(i.length,Ne),value:k,seriesName:g.name,opacity:.8,isHighlighted:ie.value===w,isDimmed:ie.value!==null&&ie.value!==w,isHidden:!1,startAngle:B,endAngle:T,midAngle:S}),s=T}),i)}),xl=e.computed(()=>{const t=po.value;return Wn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),l=e.computed(()=>{if(!Vn.value||!un.value)return[];const t=tn.value,s=Hn.value,n=Cn.value,i=cn.value,p=15,g=t*1.3,w=.55,k=(S,U)=>{const te=gt.value+Math.cos(S.midAngle)*qe.value,me=pt.value+Math.sin(S.midAngle)*qe.value,j=gt.value+Math.cos(S.midAngle)*(qe.value+s),le=pt.value+Math.sin(S.midAngle)*(qe.value+s),G=j+n*(U?1:-1),De=U?j+p:j-p,ce=le-i,de=`${S.seriesName}: ${rn(S.value)}`,Ne=de.length*t*w;return{pointerStartX:te,pointerStartY:me,pointerEndX:j,pointerEndY:le,horizontalEndX:G,horizontalEndY:le,textX:De,textY:ce,text:de,textWidth:Ne,textAnchor:U?"start":"end",isRightSide:U,pointerLineLength:Math.hypot(j-te,le-me),horizontalLineLength:Math.hypot(G-j,0)}},_=(S,U)=>{const te=Math.abs(S.textY-U.textY)<g,me=S.isRightSide?S.textX:S.textX-S.textWidth,j=S.isRightSide?S.textX+S.textWidth:S.textX,le=U.isRightSide?U.textX:U.textX-U.textWidth,re=U.isRightSide?U.textX+U.textWidth:U.textX,G=me<re&&le<j;return te&&G},B=po.value.filter(S=>!S.isHidden),T=[];for(let S=0;S<B.length;S++){const U=B[S];let te=Math.cos(U.midAngle)>=0;if(S>0){const j=T[S-1],le=k(U,te);_(j,le)&&(te=!te)}const me=k(U,te);T.push({...me,color:U.color,isHighlighted:U.isHighlighted,isDimmed:U.isDimmed})}return T}),o=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||tl.value||.7;return ie.value===null||ie.value===void 0?s:ie.value!==null?t.seriesIndex===ie.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},a=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return ie.value!==null?t.seriesIndex===ie.value?Math.min(1,s+.1):s*.7:s},r=(t,s)=>{if(t)try{if(ie.value===t.seriesIndex?ie.value=null:ie.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:V.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},c=(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(" ")},u=(t,s)=>{if(!t||(s.stopPropagation(),Ho.value=!0,ie.value=t.seriesIndex,Le.value.show=!1,!xe.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 w=200,k=120;p+w>ke.value&&(p=s.clientX-i.left-w-10),g+k>i.height&&(g=s.clientY-i.top-k-10),p<0&&(p=10),g<0&&(g=10);const _=An.value,B=fo.value,T=_.map(S=>{const U=B[S]||S,te=d(S,t);return te?{seriesName:t.seriesName,label:t.label,value:`${U}: ${te}`,color:t.color}:null}).filter(Boolean);Re.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:T,categoryIndex:void 0,spiderSeries:[]}},d=(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=So.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const p=n.toFixed(1);return on.value?p+on.value:p}return n?.toString()||""},m=()=>{if(!zt.value||!Le.value.data||Le.value.data.length===0)return"Bubbles";const t=[],s=new Set;return Le.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"},f=(t,s)=>{t&&(Ho.value=!1,ie.value=null,Re.value.show=!1,Re.value.bubbleData=[])},h=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=rl(t.categoryIndex),g=t.description||t.comment||"";let w=s.clientX-i.left+15,k=s.clientY-i.top-10;const _=200,B=g?80:50;w+_>ke.value&&(w=s.clientX-i.left-_-15),k+B>st.value&&(k=s.clientY-i.top-B-10),w<0&&(w=10),k<0&&(k=10),Xt.value={show:!0,x:w,y:k,categoryValue:p,description:g}},N=()=>{Xt.value.show=!1},M=e.computed(()=>V.categories.length||Math.max(...Un.value.map(t=>t.data.length))),x=e.computed(()=>{let t=0;return Un.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),X=e.computed(()=>{const t=[],s=M.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,p=gt.value+Math.cos(i)*qe.value,g=pt.value+Math.sin(i)*qe.value;t.push({x:p,y:g,angle:i,index:n})}return t}),W=e.computed(()=>{const t=[],s=M.value;return X.value.forEach((n,i)=>{const p=qe.value+15,g=i*2*Math.PI/s-Math.PI/2,w=gt.value+Math.cos(g)*p,k=pt.value+Math.sin(g)*p+5;let _="middle",B="middle";Math.abs(Math.cos(g))>.5&&(_=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(B=Math.sin(g)>0?"hanging":"auto"),t.push({x:w,y:k,text:V.categories[i]||`Axis ${i+1}`,anchor:_,baseline:B})}),t}),be=e.ref(new Set),oe=(t,s,n)=>{const i=`current-${n}`,p=be.value.has(i);return!p&&ie.value===null?s.fillOpacity||Ie.value:s.isHighlighted||p?(s.fillOpacity||Ie.value)+.15:s.isDimmed?(s.fillOpacity||Ie.value)*.3:s.fillOpacity||Ie.value},Ye=e.computed(()=>{if(!On.value)return[];const t=[],s=M.value;return no.value.forEach((n,i)=>{const p=[],g=[],w=[],k=ie.value===i,_=ie.value!==null&&ie.value!==i,B=St.value.has(i);for(let T=0;T<s;T++){const S=n.data[T]||0,te=S/x.value*qe.value,me=T*2*Math.PI/s-Math.PI/2,j=gt.value+Math.cos(me)*te,le=pt.value+Math.sin(me)*te;p.push(`${j},${le}`),g.push({x:j,y:le}),w.push({x:j,y:le,value:S,label:V.categories[T]||`Axis ${T+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:w,color:wt(i),fillOpacity:Ie.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:k,isDimmed:_,isHidden:B,seriesIndex:i})}),t}),nn=(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,w=s[i].y,k=s[p].x,_=s[p].y;w>t.y!=_>t.y&&t.x<(k-g)*(t.y-w)/(_-w)+g&&(n=!n)}return n},Gt=t=>{if(!On.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=_e.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,w=Ye.value.filter(k=>k.isHidden?!1:nn({x:p,y:g},k.polygonPoints));if(w.length>0){w.length,ie.value=w[0].seriesIndex;const k=t.clientX-n.left+10,_=t.clientY-n.top-10,B=200,T=50+w.length*25;let S=k,U=_;S+B>ke.value&&(S=t.clientX-n.left-B-10),U+T>st.value&&(U=t.clientY-n.top-T-10),S<0&&(S=10),U<0&&(U=10);const te=w.map(me=>{let j=me.dataPoints[0],le=1/0;return me.dataPoints.forEach(re=>{const G=Math.sqrt(Math.pow(re.x-p,2)+Math.pow(re.y-g,2));G<le&&(le=G,j=re)}),{seriesName:me.seriesName,color:me.color,value:rn(j.value!==void 0?j.value:me.value)}});Re.value={show:!0,x:S,y:U,title:w.length===1?w[0].seriesName:"",value:"",bubbleData:[],spiderSeries:te}}else In()},Tt=e.computed(()=>{const t=F.value;return t.logos.map((s,n)=>{const i=V.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||St.value.has(s.seriesIndex))return null;let p,g;if(an.value){let k=-1,_=null;for(let T=i.data.length-1;T>=0;T--)if(i.data[T]!==null&&i.data[T]!==void 0){k=T,_=i.data[T];break}if(k===-1||_===null)return null;const B=i.data.map((T,S)=>T==null?null:{x:Ot(S),y:Kt(T),index:S}).filter(T=>T!==null);if(t.animations.enabled&&!Gn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(it.value.isAnimating||!it.value.hasAnimated))if(it.value.isAnimating){const T=it.value.currentFrame/it.value.totalFrames,S=Vo(t.animations.easing,Math.min(T,1)),U=Kl(B,S);p=U.x+(s.offsetX||0),g=U.y+(s.offsetY||0)}else p=B[0].x+(s.offsetX||0),g=B[0].y+(s.offsetY||0);else p=Ot(k)+(s.offsetX||0),g=Kt(_)+(s.offsetY||0)}else if(un.value||On.value){const k=Math.PI*2/t.logos.length*n;p=gt.value+Math.cos(k)*(qe.value+30)+(s.offsetX||0),g=pt.value+Math.sin(k)*(qe.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),Qt=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")},Jt=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Wt=t=>{St.value.has(t)?St.value.delete(t):St.value.add(t)},jn=e.computed(()=>{if(!Re.value.show&&!(ae.value&&Le.value.show&&!R.value.isZooming))return{display:"none"};let t,s;if(ae.value&&Le.value.show&&!R.value.isZooming){t=Le.value.x+15,s=L.value.top;const n=zt.value?200:150;t+n>ke.value&&(t=Le.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"}}),gn=(t,s)=>{if(!xe.value||Ao.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 w=200,k=120,_=ke.value,B=st.value;p+w>_&&(p=s.clientX-i.left-w-10),g+k>B&&(g=s.clientY-i.top-k-10),p<0&&(p=10),g<0&&(g=10);let T;typeof t.categoryIndex=="number"?T=t.categoryIndex:typeof t.dataIndex=="number"?T=t.dataIndex:t.label&&V.categories.includes(t.label)&&(T=V.categories.indexOf(t.label));const S=(jt.value||ve.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Re.value={show:!0,x:p,y:g,title:S,value:rn(t.value)||"",categoryIndex:T,spiderSeries:[]}},Kn=e.ref(!1),Ho=e.ref(!1),In=()=>{Re.value.show=!1,Re.value.spiderSeries=[],Re.value.bubbleData=[],Le.value.show=!1,Kn.value||(ie.value=null)},Ao=e.ref(!1),Eo=(t,s)=>{Ao.value=!0,Re.value.show=!1,Le.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 w=250;p+w>ke.value&&(p=s.clientX-i.left-w-15),p<0&&(p=10),g<0&&(g=10),lo.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},qo=()=>{Ao.value=!1,lo.value.show=!1},it=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Vo=(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}},Gn=e.computed(()=>Zt.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Qn=()=>{if(!Ee.value||Gn.value){it.value.hasAnimated=!0,fn.value&&(co.value=1);return}fn.value&&(co.value=0),it.value.isAnimating=!0,it.value.currentFrame=0,it.value.totalFrames=Math.ceil(Se.value/16.67);const t=()=>{const s=it.value.currentFrame/it.value.totalFrames,n=Vo(ft.value,Math.min(s,1));oo(n),fn.value&&(co.value=n),s<1?(it.value.currentFrame++,it.value.animationId=requestAnimationFrame(t)):Fn()};it.value.animationId=requestAnimationFrame(t)},oo=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},Fn=()=>{it.value.isAnimating=!1,it.value.hasAnimated=!0,fn.value&&(co.value=1),it.value.animationId&&(cancelAnimationFrame(it.value.animationId),it.value.animationId=null)},El=e.computed(()=>!un.value||it.value.hasAnimated?!0:fn.value?co.value>=1:xn.value?Bo.value>=1:!0),zl=e.computed(()=>Vn.value&&El.value),Vl=e.ref(!1);e.watch(zl,t=>{t?(Vl.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vl.value=!0})})):Vl.value=!1},{immediate:!0});const Xl=e.computed(()=>{if(!Ee.value||Gn.value||it.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${Se.value}ms`,t["--dss-animation-easing"]=Yl(ft.value),t["--dss-stagger-delay"]=`${Et.value}ms`,t}),Yl=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",jl=()=>{if(!Ee.value||Gn.value)return"";const t=["dss-chart-animated"];return it.value.hasAnimated||t.push(`dss-animate-${je.value}`),it.value.hasAnimated||(un.value&&ve.value!=="semi-radial"?t.push("dss-animate-fill"):un.value||t.push(`dss-animate-${je.value}`)),it.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>V.series,(t,s)=>{Ft.value&&s&&it.value.hasAnimated&&(it.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Qn(),ze.value)}))},{deep:!0}),e.watch(()=>R.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{Ko()},50)}),e.watch(()=>[R.value.scale,R.value.offsetX],()=>{!R.value.isZooming&&!R.value.isDragging&&Ko()},{flush:"post"}),e.watch([Fe,at],([t,s])=>{R.value.minScale=t,R.value.maxScale=s,(R.value.scale<t||R.value.scale>s)&&Fo()},{immediate:!0}),e.watch(()=>V.locale,t=>{t&&t!==I.value&&(I.value=t)},{immediate:!0}),e.watch(()=>$e.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Io)}):document.removeEventListener("click",Io)}),e.onMounted(()=>{ie.value=null,fn.value&&(!Ee.value||Gn.value)&&(co.value=1),Sl(),y.value&&typeof ResizeObserver<"u"&&(fe=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=null;const{width:n,height:i}=s.contentRect;tt.value=Math.round(n),v.value=Math.round(i),ne.value&&($t.value=ne.value.offsetHeight||ge)}))}),fe.observe(y.value)),Ee.value&&!Gn.value?ve.value==="semi-radial"?setTimeout(()=>_l(),ze.value):setTimeout(()=>Qn(),ze.value):(it.value.hasAnimated=!0,ve.value==="semi-radial"&&(Bo.value=1)),document.addEventListener("mousemove",Pl),document.addEventListener("mouseup",Ol),document.addEventListener("click",ml)}),e.onUnmounted(()=>{Te&&cancelAnimationFrame(Te),fe&&y.value&&(fe.unobserve(y.value),fe.disconnect(),fe=null),it.value.animationId&&cancelAnimationFrame(it.value.animationId),qn&&(cancelAnimationFrame(qn),qn=null),R.value.zoomTimeout&&clearTimeout(R.value.zoomTimeout),document.removeEventListener("mousemove",Pl),document.removeEventListener("mouseup",Ol),document.removeEventListener("click",ml),document.removeEventListener("click",Io)});const Pl=t=>{if(R.value.isDragging&&R.value.scale>1&&an.value){Le.value.show=!1;const s=t.clientX-R.value.lastMouseX,{minX:n,maxX:i}=At.value,p=i-n||1,w=s*.8;R.value.offsetX+=w;const k=p/R.value.scale,_=p-k,B=0,T=-_/p*L.value.width,S=B;R.value.offsetX=Math.max(T,Math.min(S,R.value.offsetX)),R.value.lastMouseX=t.clientX,R.value.lastMouseY=t.clientY}},Ol=()=>{R.value.isDragging&&(R.value.isDragging=!1,setTimeout(()=>{!R.value.isDragging&&R.value.isZooming},100))},Kl=(t,s)=>{const n=t.filter(k=>k!=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 k=1;k<n.length;k++){const _=n[k].x-n[k-1].x,B=n[k].y-n[k-1].y,T=Math.sqrt(_*_+B*B);p.push(T),i+=T}const g=i*s;let w=0;for(let k=0;k<p.length;k++){const _=w+p[k];if(g<=_){const B=(g-w)/p[k],T=n[k],S=n[k+1];return{x:T.x+(S.x-T.x)*B,y:T.y+(S.y-T.y)*B}}w=_}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",[jl(),{"dss-chart-fill-width":lt.value,"dss-chart-fill-height":ut.value,"dss-chart-compact":un.value&&!Bt.value}]]),style:e.normalizeStyle({width:lt.value?"100%":ke.value+"px",height:He.value,...lt.value||ut.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Xl.value,cursor:Bl()}),"data-chart-type":ve.value,ref_key:"containerEl",ref:y,onWheel:Jo,onMousedown:Nl,onMousemove:J,onMouseup:Ml,onMouseleave:Je,onDblclick:Fo,onContextmenu:e.withModifiers(Oe,["prevent"]),onClick:e.withModifiers(rt,["left"]),onWheelCapture:Jo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ne},[e.createElementVNode("div",Za,[ht.value?(e.openBlock(),e.createElementBlock("div",Wa,e.toDisplayString(ht.value),1)):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(Ue.value),1)):e.createCommentVNode("",!0)]),Bt.value&&(O.value==="top"||O.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ae.value==="horizontal","dss-legend-vertical":Ae.value==="vertical","dss-legend-top":O.value==="top","dss-legend-bottom":O.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":St.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>Wt(i),onMouseenter:p=>E(i),onMouseleave:z,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:wt(i)})},null,4),e.createElementVNode("span",Xa,e.toDisplayString(n.name),1)],46,Ua))),128))],2)):e.createCommentVNode("",!0),Bt.value&&(O.value==="left"||O.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":O.value==="left","dss-legend-right":O.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":St.value.has(i),"dss-legend-hovered":ie.value===i,"dss-legend-dimmed":ie.value!==null&&ie.value!==i}]),onClick:p=>Wt(i),onMouseenter:p=>E(i),onMouseleave:z,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:wt(i)})},null,4),e.createElementVNode("span",ja,e.toDisplayString(n.name),1)],46,Ya))),128))],2)):e.createCommentVNode("",!0)],512),H.showAddMarkerButton&&Vt.value&&Lt.value.addMarker&&(an.value||zt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Mo,title:e.unref(D)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:$n.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,Ga),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,Ka)):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[zt.value&&Dt.value?(e.openBlock(),e.createElementBlock("div",Ja,"Bubble size: "+e.toDisplayString(Dt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ke.value,height:st.value,class:"dss-chart-svg","data-smooth":Z.value,"data-animated":Ee.value,ref_key:"svgEl",ref:_e},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ts,[e.createElementVNode("rect",{x:0,y:L.value.top,width:ke.value,height:L.value.height*4},null,8,ns)]),xn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Po.value},[e.createElementVNode("path",{d:_o.value},null,8,ls)],8,os)):e.createCommentVNode("",!0),fn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:uo.value},[e.createElementVNode("path",{d:wo.value},null,8,ss)],8,as)):e.createCommentVNode("",!0)]),an.value||zt.value?(e.openBlock(),e.createElementBlock("g",rs,[It.value?(e.openBlock(),e.createElementBlock("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ll.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:L.value.left,x2:L.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,cs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",ds,[e.createElementVNode("line",{x1:L.value.left,x2:L.value.right,y1:L.value.bottom,y2:L.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,us),e.createElementVNode("line",{x1:L.value.left,x2:L.value.left,y1:L.value.top,y2:L.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms)]),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oo.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,vs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yl.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,fs))),128)),Rt.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:L.value.left+L.value.width/2,y:L.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Rt.value),9,gs)):e.createCommentVNode("",!0),mn.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:L.value.top+12+L.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${L.value.top+L.value.height/2})`},e.toDisplayString(mn.value),9,hs)):e.createCommentVNode("",!0)]),Do.value.length>0?(e.openBlock(),e.createElementBlock("g",Cs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Do.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",ys,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Eo(n,i),onMouseleave:qo},null,40,ks)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Eo(n,i),onMouseleave:qo},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:L.value.bottom,y2:L.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>Eo(n,i),onMouseleave:qo},null,40,ws)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,L.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>Eo(n,i),onMouseleave:qo},null,40,xs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,L.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=>Eo(n,i),onMouseleave:qo},null,40,Es),e.createElementVNode("text",{x:n.x,y:Math.max(15,L.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,Vs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ss,[Dn.value?(e.openBlock(),e.createElementBlock("g",Ns,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":jt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.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=>gn(n,p),onMouseleave:In},null,46,Ms)):(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=>gn(n,p),onMouseleave:In},null,46,Bs))],64))),128))],2),e.createElementVNode("g",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?nt.value+2:nt.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,Ts))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?nt.value+2:nt.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,$s))),128)),Qe.value>0||mt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Hl.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?ye(n,Qe.value)+2:ye(n,Qe.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=>gn(n,p),onMouseleave:In},null,46,Ls))),128)):e.createCommentVNode("",!0)])])):ve.value==="line"?(e.openBlock(),e.createElementBlock("g",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":nt.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,As))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?nt.value+2:nt.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,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?nt.value+2:nt.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,Rs))),128)),Qe.value>0||mt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Rn.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?ye(n,Qe.value)+2:ye(n,Qe.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=>gn(n,p),onMouseleave:In},null,46,Is))),128)):e.createCommentVNode("",!0)])):ve.value==="area"?(e.openBlock(),e.createElementBlock("g",Fs,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${H.chartId}`},[e.createElementVNode("rect",{x:L.value.left-10,y:L.value.top-10,width:L.value.width+20,height:L.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${L.value.width+20}px`})},null,12,Ps)],8,zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ot.value+.2:ot.value,mask:`url(#area-mask-${i}-${H.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,Os))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?nt.value+1:nt.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass({"dss-area-line-animated":!0,"dss-series-highlighted":n.isHighlighted,"dss-series-dimmed":n.isDimmed,"dss-series-hidden":n.isHidden}),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${i*Et.value}ms`})},null,14,Zs))),128))])):ve.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":jt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wl.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=>gn(n,p),onMouseleave:In},null,46,Ws)):(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=>gn(n,p),onMouseleave:In},null,46,qs))],64))),128))],2)):e.createCommentVNode("",!0)]),ae.value&&Le.value.show&&!R.value.isZooming?(e.openBlock(),e.createElementBlock("g",Us,[e.createElementVNode("line",{x1:Le.value.x,x2:Le.value.x,y1:L.value.top,y2:L.value.bottom,stroke:et.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Xs),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Le.value.x,cy:n.y,r:Qe.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ys))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),zt.value?(e.openBlock(),e.createElementBlock("g",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Ks,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":o(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(c(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>u(n,p),onMouseleave:p=>f(n),onClick:p=>r(n,p)},null,42,Gs),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:a(n)}),onLoad:p=>gl(i),onError:p=>Tl(i),onMouseenter:p=>u(n,p),onMouseleave:p=>f(n),onClick:p=>r(n,p)},null,46,Qs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),un.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:pl.value},[ve.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:gt.value,cy:pt.value,r:qe.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,er)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ve.value,"clip-path":ho.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xl.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=>gn(n.segment,p),onMouseleave:In},null,42,nr))),128))],8,tr),pn.value&&El.value?(e.openBlock(),e.createElementBlock("g",or,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.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,lr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yo.value&&(El.value||xn.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:bo.value.x,y:bo.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":ko.value,fill:yn.value,class:"dss-radial-data-center"},e.toDisplayString(Yo.value),9,ar)):e.createCommentVNode("",!0),zl.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vl.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.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,sr),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,rr),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,ir)],6))),128))],2)):e.createCommentVNode("",!0)],8,Js)):e.createCommentVNode("",!0),On.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:pl.value},[It.value?(e.openBlock(),e.createElementBlock("g",dr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:gt.value,cy:pt.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,ur))),128)),e.createElementVNode("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(kt.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:gt.value-16,y:pt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,pr),e.createElementVNode("text",{x:gt.value,y:pt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Mn(i)),9,vr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(X.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:gt.value,x2:n.x,y1:pt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,fr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/M.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/M.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,hr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Gt,onMouseleave:In},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ye.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":oe("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?nt.value+1:nt.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*Et.value}ms`,transition:"all 0.2s ease"})},null,14,Cr),(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:n.isHighlighted?Qe.value+1:Qe.value>0?Qe.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*Et.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:w=>gn(p,w),onMouseleave:In},null,46,yr))),128))]))),128))],32)],8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",kr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:n.width/2,fill:wt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,br))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tt.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=>Qt(i),onError:p=>Jt(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,wr))),128))])],8,es))]),$.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:ke.value+"px",height:st.value+"px",backgroundImage:`url('${ln.value}')`,backgroundRepeat:"no-repeat",...Pe.value,opacity:P.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.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:hn.value+"px",height:hn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Sn(n),["stop"]),onMouseenter:p=>h(n,p),onMouseleave:N},[e.createElementVNode("img",{src:jo(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Er)],44,xr)),[[e.vShow,zn.value]])),128)),Xt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Xt.value.x+"px",top:Xt.value.y+"px"})},[e.createElementVNode("div",Vr,e.toDisplayString(Xt.value.categoryValue),1),Xt.value.description?(e.openBlock(),e.createElementBlock("div",Sr,e.toDisplayString(Xt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),xe.value&&(Re.value.show||ae.value&&Le.value.show&&!R.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":ae.value&&Le.value.show&&!R.value.isZooming}]),style:e.normalizeStyle(jn.value)},[!ae.value||!Le.value.show||R.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[On.value&&Re.value.spiderSeries&&Re.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Nr,[Re.value.title?(e.openBlock(),e.createElementBlock("div",Mr,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",Br,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",_r,e.toDisplayString(n.value),1)]))),128))])):zt.value&&Re.value.bubbleData&&Re.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",Tr,[Re.value.title?(e.openBlock(),e.createElementBlock("div",$r,e.toDisplayString(Re.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Lr,[(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",Hr,[e.createElementVNode("div",Ar,e.toDisplayString(Re.value.title),1),e.createElementVNode("div",Dr,e.toDisplayString(Re.value.value),1)])),Re.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Be(Re.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ir,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be(Re.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Fr,[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",Pr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Be(Re.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Or,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zr,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be(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",Wr,[e.createElementVNode("div",qr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Ur,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",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(zt.value?m():H.categories[Le.value.categoryIndex]||`Category ${Le.value.categoryIndex+1}`),1),zt.value?(e.openBlock(),e.createElementBlock("div",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Le.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(Le.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",Kr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Gr,e.toDisplayString(rn(n.value)),1)]))),128))]),Be(Le.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(D)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be(Le.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ei,[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",ti,[e.createElementVNode("div",ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Be(Le.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",oi,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",li,e.toDisplayString(e.unref(D)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be(Le.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",ai,[e.createElementVNode("div",si,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),an.value&&Ct.value&&R.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Fo},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(R.value.scale*100))+"% "+e.toDisplayString(e.unref(D)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Oa),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:$e.value.x+"px",top:$e.value.y+"px"}),onClick:s[0]||(s[0]=e.withModifiers(()=>{},["stop"]))},[Lt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:Qo},e.toDisplayString(e.unref(D)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Lt.value.addMarker&&(Lt.value.downloadSvg||Lt.value.downloadPng||Lt.value.downloadCsv||Tn.value.length>0)?(e.openBlock(),e.createElementBlock("div",ii)):e.createCommentVNode("",!0),Lt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:to},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Lt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:so},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Lt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:ro},e.toDisplayString(e.unref(D)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Tn.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Lt.value.downloadSvg||Lt.value.downloadPng||Lt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",di)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(_t(n)),style:e.normalizeStyle(kn(n)),onClick:p=>Nn(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:dn(n),class:"dss-custom-menu-content"},null,8,mi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",pi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,ui)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),se.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:ao},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",vi,[e.createElementVNode("h3",null,e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.viewMarker"):b.value?e.unref(D)("chart.modalMarker.editMarker"):e.unref(D)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:ao},"×")]),e.createElementVNode("div",fi,[e.createElementVNode("div",gi,[e.createVNode(Ul,{id:"dss-marker-date",mode:"single",modelValue:se.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>se.value.date=n),"min-date":Bn.value,"max-date":Ro.value,disabled:C.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",hi,[e.createElementVNode("label",Ci,e.toDisplayString(e.unref(D)("chart.modalMarker.description")),1),C.value?(e.openBlock(),e.createElementBlock("div",yi,e.toDisplayString(se.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>se.value.description=n),placeholder:e.unref(D)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ki)),[[e.vModelText,se.value.description]])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",wi,[b.value&&!C.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:dl},e.toDisplayString(e.unref(D)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:ao},e.toDisplayString(C.value?e.unref(D)("chart.modalMarker.close"):e.unref(D)("chart.modalMarker.cancel")),1),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:cl,disabled:!(se.value.description&&se.value.description.length)},e.toDisplayString(b.value?e.unref(D)("chart.modalMarker.save"):e.unref(D)("chart.contextMenu.addMarker")),9,Ei))])])])])):e.createCommentVNode("",!0)],64))}}),Ni={class:"dss-modal-title"},Mi={class:"dss-modal-actions"},Al={__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(H,{emit:pe}){const D=H,I=pe,we=e.ref(null),y=e.ref(null),_e=e.computed(()=>{const V={"max-width":D.width};return D.height!=="auto"&&(V.height=D.height,V["min-height"]="0"),V}),ne=e.computed(()=>({}));function tt(){I("close-modal")}function v(){D.backDrop&&!we.value&&I("close-modal")}function fe(V){V.target.tagName==="INPUT"&&(we.value=V.target.tagName)}function Te(){setTimeout(()=>{we.value=null},300)}function ge(){const V=document.body,ue=document.documentElement;y.value={bodyOverflow:V.style.overflow,bodyPosition:V.style.position,bodyTop:V.style.top,bodyWidth:V.style.width,htmlOverflow:ue.style.overflow,scrollY:window.scrollY},V.style.overflow="hidden",V.style.position="fixed",V.style.top=`-${y.value.scrollY}px`,V.style.width="100%",V.style.left="0",ue.style.overflow="hidden"}function Q(){if(!y.value)return;const V=document.body,ue=document.documentElement,{bodyOverflow:Ke,bodyPosition:Me,bodyTop:he,bodyWidth:F,htmlOverflow:lt,scrollY:ut}=y.value;V.style.overflow=Ke||"",V.style.position=Me||"",V.style.top=he||"",V.style.width=F||"",V.style.left="",ue.style.overflow=lt||"",window.scrollTo(0,ut||0)}return e.watch(()=>D.showModal,V=>{if(V)ge(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.addEventListener("focusin",fe),ue.addEventListener("focusout",Te))},100);else{Q(),document.body.classList.remove("dss-modal-open");const ue=document.getElementById("dss-modal-backdrop");ue&&(ue.removeEventListener("focusin",fe),ue.removeEventListener("focusout",Te))}},{immediate:!0}),e.onUnmounted(()=>{D.showModal&&Q()}),(V,ue)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.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(_e.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ue[0]||(ue[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":H.headerType,"font-size":H.titleSize})},[e.createElementVNode("h1",Ni,[e.renderSlot(V.$slots,"title",{},()=>[ue[1]||(ue[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(V.$slots,"title-data"),H.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:tt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ne.value)},[e.renderSlot(V.$slots,"content",{},()=>[ue[2]||(ue[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Mi,[e.renderSlot(V.$slots,"actions")])])],4),[[e.vShow,H.showModal]])])):e.createCommentVNode("",!0)]))}},Bi={key:0,class:"dss-table-toolbar"},_i={class:"dss-table-toolbar-left"},Ti=["aria-expanded"],$i={class:"dss-pagination-select-dropdown",role:"listbox"},Li={class:"dss-table-column-visibility-label"},Hi={class:"dss-table-checkbox-wrapper"},Ai=["checked","onChange"],Di={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ri={class:"dss-table-column-visibility-text"},Ii={class:"dss-table-toolbar-right"},Fi=["placeholder"],zi=["aria-expanded"],Pi={key:1,class:"dss-table-toolbar-extra"},Oi={class:"dss-table-thead"},Zi={key:0,class:"dss-table-th dss-table-selection-column"},Wi={key:0,class:"dss-table-checkbox-wrapper"},qi=["checked","indeterminate"],Ui={key:0,class:"dss-table-checkbox__indeterminate"},Xi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ji=["onClick"],Ki={class:"dss-table-th-content"},Gi={class:"dss-table-th-text"},Qi={key:0},Ji={key:1},ec={key:2},tc=["data-filter-column-key","aria-expanded","onClick"],nc={class:"dss-table-tbody"},oc=["onClick"],lc={class:"dss-table-checkbox-wrapper"},ac=["type","name","checked","onChange"],sc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},rc={key:1,class:"dss-table-checkbox__dot"},ic=["onClick"],cc=["aria-expanded","aria-label"],dc={key:0,class:"dss-table-expansion-row"},uc=["colspan"],mc=["colspan"],pc={key:1,class:"dss-table-pagination"},vc={class:"dss-pagination-center"},fc={class:"dss-pagination-controls"},gc=["disabled","title"],hc=["disabled","title"],Cc={class:"dss-pagination-pages"},yc=["onClick"],kc={key:1,class:"dss-pagination-ellipsis"},bc=["disabled","title"],wc=["disabled","title"],xc=["aria-expanded"],Ec={class:"dss-pagination-select-dropdown",role:"listbox"},Vc=["aria-selected","onClick"],Sc={key:0,class:"dss-table-filter-row"},Nc=["value","placeholder"],Mc=["min","max","value"],Bc=["min","max","value"],_c={class:"dss-table-filter-double-range-values"},Tc={key:2,class:"dss-table-filter-daterange"},$c={class:"dss-table-filter-daterange-row"},Lc={class:"dss-table-filter-daterange-label"},Hc=["value"],Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Ic=["value","placeholder"],Fc={class:"dss-table-filter-list"},zc=["checked","onChange"],Pc={class:"dss-table-filter-actions"},Oc={name:"DSSTable"},Zc=Object.assign(Oc,{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:H=>typeof H=="object"&&H!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(H,{emit:pe}){const{t:D,locale:I}=ol.useI18n(),we=H,y=pe,_e={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 ne(b,C){const E=Object.assign({},b);return tt(b)&&tt(C)&&Object.keys(C).forEach(z=>{tt(C[z])?z in b?E[z]=ne(b[z],C[z]):Object.assign(E,{[z]:C[z]}):Object.assign(E,{[z]:C[z]})}),E}function tt(b){return b&&typeof b=="object"&&!Array.isArray(b)}const v=e.computed(()=>ne(_e,we.options)),fe=e.computed(()=>{const b=v.value.table.width;return b==="auto"?null:typeof b=="number"?b:null}),Te=e.computed(()=>v.value.table.height),ge=e.computed(()=>v.value.table.rowHeight??"auto"),Q=e.computed(()=>({height:ge.value})),V=e.computed(()=>v.value.table.expandable===!0),ue=e.computed(()=>v.value.table.truncated===!0),Ke=e.computed(()=>v.value.table.striped),Me=e.computed(()=>v.value.table.bordered),he=e.computed(()=>v.value.table.hoverable),F=e.computed(()=>v.value.table.size),lt=e.computed(()=>v.value.table.align||"left");e.computed(()=>v.value.title.text),e.computed(()=>v.value.subtitle.text);const ut=e.computed(()=>v.value.selection.enabled),ke=e.computed(()=>v.value.selection.mode),$t=e.computed(()=>v.value.sorting.enabled),Nt=e.computed(()=>v.value.sorting.mode),st=e.computed(()=>v.value.pagination.enabled),He=e.computed(()=>v.value.pagination.rows),ve=e.computed(()=>v.value.pagination.rowsPerPageOptions),Mt=e.computed(()=>v.value.scrollable),ht=e.computed(()=>v.value.emptyMessage),Ue=e.computed(()=>v.value.toolbar?.downloads?.pdf!==!1),Dt=e.computed(()=>v.value.toolbar?.downloads?.excel!==!1),Rt=e.computed(()=>v.value.toolbar?.search!==!1),mn=e.computed(()=>Ue.value||Dt.value||Rt.value||vt.value),vt=e.computed(()=>v.value.toolbar?.columnVisibility!==!1),Ge=e.ref(""),Ze=e.ref(!1),en=e.ref(null);let It=null;function Bt(){Ze.value?(It&&(clearTimeout(It),It=null),Ze.value=!1,Ge.value="",y("search",""),en.value?.blur()):(Ze.value=!0,It=setTimeout(()=>{It=null,en.value?.focus()},80))}function O(){Ge.value||(Ze.value=!1)}function Ae(){Ge.value="",y("search",""),en.value?.focus()}const xe=e.computed(()=>({"dss-table-striped":Ke.value,"dss-table-bordered":Me.value,"dss-table-hoverable":he.value,[`dss-table-${F.value}`]:F.value!=="default","dss-table-truncated":ue.value})),ae=(b,C)=>b?.field??b?.key??C,et=e.ref(new Set);function Ct(){const b=new Set;we.columns.forEach((C,E)=>{C?.hidden!==!0&&b.add(ae(C,E))}),et.value=b}const Fe=e.computed(()=>we.columns.filter((b,C)=>et.value.has(ae(b,C)))),at=b=>{const C=we.columns.findIndex(E=>E===b);return ae(b,C>=0?C:0)},nt=(b,C)=>et.value.has(ae(b,C));function xt(b,C){const E=ae(b,C),z=new Set(et.value);z.has(E)?z.delete(E):z.add(E),et.value=z}const Qe=e.ref(null),mt=e.ref(!1);function ye(b){Qe.value&&!Qe.value.contains(b.target)&&(mt.value=!1)}const ot=e.computed(()=>Fe.value.length+(ut.value?1:0)+(V.value?1:0)),Z=(b,C)=>b?.id??b?.key??C,q=e.ref(new Set),Y=e.ref(null),ee=(b,C)=>q.value.has(Z(b,C)),Ee=(b,C,E)=>{E&&E.stopPropagation();const z=Z(b,C),J=new Set(q.value);J.has(z)?(J.delete(z),y("row-collapse",{data:b,index:C})):(J.add(z),y("row-expand",{data:b,index:C})),q.value=J},je=(b,C)=>{if(!ue.value)return;const E=Z(b,C);Y.value!==E&&(Y.value=E)},Se=e.ref(null),ze=e.ref(0),ft=e.ref([]),Et=b=>{if(Nt.value==="single")return Se.value===b.field?ze.value:0;{const C=ft.value.find(E=>E.field===b.field);return C?C.order:0}},Ft=b=>{const C=Et(b);return{"dss-sort-active":C!==0,"dss-sort-asc":C===1,"dss-sort-desc":C===-1}},Zt=e.ref({}),Ie=e.ref(null),yt=e.ref(null),kt=220,Mn=e.ref(null),qt=e.computed(()=>Fe.value.find(b=>at(b)===Ie.value)??null),Vt=e.computed(()=>{if(!qt.value||qt.value.filter!=="range")return null;const b=qt.value,C=Ie.value,{min:E,max:z}=A(b),J=b.filterMin??E,Je=b.filterMax??z,Oe=sn(C),rt=Oe.min??J,dn=Oe.max??Je,_t=Je-J,kn=_t===0?0:(rt-J)/_t*100,jo=_t===0?100:(dn-J)/_t*100;return{rangeMin:J,rangeMax:Je,currentMin:rt,currentMax:dn,minPct:kn,maxPct:jo}}),Lt=e.ref(null),Tn=e.ref("max");function $n(b){const C=Lt.value,E=Vt.value;if(!C||!E)return;const z=C.getBoundingClientRect(),Je=(b.clientX-z.left)/z.width*100,Oe=(E.minPct+E.maxPct)/2;Tn.value=Je<Oe?"min":"max"}function sn(b){return Zt.value[b]??{}}function hn(b,C){Zt.value={...Zt.value,[b]:C}}function on(b){const C=Zt.value[b];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 rn(b){const C={...Zt.value};delete C[b],Zt.value=C,Ie.value=null,yt.value=null}function zn(){if(!Ie.value){yt.value=null;return}const b=Mn.value;if(!b)return;const C=b.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ie.value}"]`);if(!C)return;const E=C.getBoundingClientRect();yt.value={top:E.bottom+6,left:Math.max(8,E.right-kt)}}const Ln=e.computed(()=>{let b=[...we.data];const C=(Ge.value??"").trim().toLowerCase();return C&&(b=b.filter(E=>we.columns.some(z=>{if(!z||!z.field)return!1;const J=bt(E,z);return String(J??"").toLowerCase().includes(C)}))),Fe.value.forEach(E=>{const z=at(E),J=Zt.value[z];if(!J)return;const Je=E.field;if(Je){if(J.type==="string"&&J.value?.trim()){const Oe=J.value.trim().toLowerCase();b=b.filter(rt=>{const dn=bt(rt,E);return String(dn??"").toLowerCase().includes(Oe)})}else if(J.type==="range")b=b.filter(Oe=>{const rt=se(Oe,Je),dn=Number(rt);return!(Number.isNaN(dn)||J.min!=null&&dn<J.min||J.max!=null&&dn>J.max)});else if(J.type==="dateRange"){const Oe=J.from?new Date(J.from).getTime():null,rt=J.to?new Date(J.to).getTime():null;b=b.filter(dn=>{const _t=se(dn,Je),kn=_t?new Date(_t).getTime():NaN;return!(Number.isNaN(kn)||Oe!=null&&kn<Oe||rt!=null&&kn>rt)})}else if(J.type==="list"&&J.selected?.length){const Oe=new Set(J.selected);b=b.filter(rt=>{const dn=bt(rt,E);return Oe.has(dn!=null?String(dn):"")})}}}),b});function Co(b){const C=new Set;return we.data.forEach(E=>{const z=bt(E,b);C.add(z!=null?String(z):"")}),Array.from(C).sort((E,z)=>String(E).localeCompare(String(z)))}function $(b,C){if(Ie.value===b){Ie.value=null,yt.value=null;return}if(Ie.value=b,C?.currentTarget){const E=C.currentTarget.getBoundingClientRect();yt.value={top:E.bottom+6,left:Math.max(8,E.right-kt)}}else zn()}function P(b,C){hn(b,{type:"string",value:C})}function A(b){const C=b.field;if(!C)return{min:0,max:100};let E=1/0,z=-1/0;return we.data.forEach(J=>{const Je=se(J,C),Oe=Number(Je);Number.isNaN(Oe)||(E=Math.min(E,Oe),z=Math.max(z,Oe))}),{min:E===1/0?0:E,max:z===-1/0?100:z}}function K(b,C,E){const z={...sn(b),type:"range"},J=E===""?null:Number(E),Je=J===null||Number.isNaN(J)?null:J;z[C]=Je,Je!=null&&(C==="min"&&z.max!=null&&Je>z.max&&(z.max=Je),C==="max"&&z.min!=null&&Je<z.min&&(z.min=Je)),hn(b,z)}function Ce(b,C,E){const z={...sn(b),type:"dateRange"};z[C]=E||"",hn(b,z)}const Pe=e.reactive({});function Xe(b,C){Pe[b]=C}function Be(b){const C=at(b),E=(Pe[C]??"").trim().toLowerCase(),z=Co(b);return E?z.filter(J=>String(J).toLowerCase().includes(E)):z}function We(b,C){return(sn(b).selected??[]).includes(C!=null?String(C):"")}function ln(b,C){const z=[...sn(b).selected??[]],J=C!=null?String(C):"",Je=z.indexOf(J);Je>=0?z.splice(Je,1):z.push(J),hn(b,{type:"list",selected:z})}function Vn(b){Ie.value&&!b.target.closest(".dss-table-filter-wrap")&&!b.target.closest(".dss-table-filter-dropdown")&&(Ie.value=null,yt.value=null)}function tn(){zn()}const Hn=b=>{if(!(b.sortable===!1||!$t.value))if(Nt.value==="single")Se.value===b.field?ze.value=ze.value===1?-1:ze.value===-1?0:1:(Se.value=b.field,ze.value=1),ze.value===0&&(Se.value=null),y("sort",{field:Se.value,order:ze.value});else{const C=ft.value.findIndex(E=>E.field===b.field);C>=0?ft.value[C].order===1?ft.value[C].order=-1:ft.value.splice(C,1):ft.value.push({field:b.field,order:1}),y("sort",{multiSortMeta:ft.value})}},Cn=e.computed(()=>{if(!$t.value)return Ln.value;let b=[...Ln.value];return Nt.value==="single"&&Se.value&&ze.value!==0?b.sort((C,E)=>{const z=se(C,Se.value),J=se(E,Se.value);return z===J?0:z==null?1:J==null?-1:(z<J?-1:z>J?1:0)*ze.value}):Nt.value==="multiple"&&ft.value.length>0&&b.sort((C,E)=>{for(const z of ft.value){const J=se(C,z.field),Je=se(E,z.field);if(J===Je)continue;if(J==null)return 1;if(Je==null)return-1;const Oe=J<Je?-1:J>Je?1:0;if(Oe!==0)return Oe*z.order}return 0}),b}),cn=e.ref(0),pn=e.ref(He.value),Pn=e.ref(!1),yo=e.ref(null),Yo=b=>{pn.value=b,Pn.value=!1,cn.value=0,y("page",{page:0,rows:pn.value})};function ko(b){yo.value&&!yo.value.contains(b.target)&&(Pn.value=!1)}const bo=e.computed(()=>Cn.value.length),yn=e.computed(()=>Math.ceil(bo.value/pn.value)),vn=e.computed(()=>st.value?cn.value*pn.value:0),Do=e.computed(()=>st.value?Math.min((cn.value+1)*pn.value,bo.value):bo.value),lo=e.computed(()=>{if(!st.value)return Cn.value;const b=vn.value,C=Do.value;return Cn.value.slice(b,C)}),An=e.ref(new Set),fo=e.computed(()=>Cn.value.filter((b,C)=>An.value.has(Z(b,C)))),So=e.computed(()=>{const b=Cn.value.length;return b>0&&An.value.size===b}),St=e.computed(()=>{const b=Cn.value.length,C=An.value.size;return C>0&&C<b}),ie=(b,C)=>An.value.has(Z(b,C)),No=()=>{if(So.value)An.value=new Set,y("unselect-all");else{const b=new Set;Cn.value.forEach((C,E)=>b.add(Z(C,E))),An.value=b,y("select-all",fo.value)}},Re=(b,C)=>{const E=Z(b,C),z=new Set(An.value),J=z.has(E);ke.value==="single"?J?(z.delete(E),y("row-unselect",b)):(z.clear(),z.add(E),y("row-select",b)):J?(z.delete(E),y("row-unselect",b)):(z.add(E),y("row-select",b)),An.value=z},Xt=e.computed(()=>{const b=yn.value,C=cn.value+1,E=2,z=[],J=[];let Je;for(let Oe=1;Oe<=b;Oe++)(Oe===1||Oe===b||Oe>=C-E&&Oe<=C+E)&&z.push(Oe);for(const Oe of z)Je&&(Oe-Je===2?J.push(Je+1):Oe-Je!==1&&J.push("...")),J.push(Oe),Je=Oe;return J}),Le=b=>{b<0||b>=yn.value||(cn.value=b,y("page",{page:b,rows:pn.value}))},$e=(b,C,E)=>{y("row-click",{data:b,index:C,originalEvent:E}),je(b,vn.value+C)},R=(b,C)=>{const E=vn.value+C;return{"dss-table-row-selected":ie(b,E),"dss-table-row-even":C%2===0,"dss-table-row-odd":C%2!==0,"dss-table-row-truncated-clickable":ue.value,"dss-table-row-truncated-expanded":Y.value===Z(b,E)}},bt=(b,C)=>C.field?se(b,C.field):"",se=(b,C)=>C.split(".").reduce((E,z)=>E&&E[z],b),Bn=b=>{const C=b.align??lt.value;return{"dss-table-sortable":b.sortable!==!1&&$t.value,"dss-table-align-left":C==="left","dss-table-align-center":C==="center","dss-table-align-right":C==="right",[b.className]:b.className}},Ro=b=>{const C={};return b.width&&(C.width=typeof b.width=="number"?`${b.width}px`:b.width),b.minWidth&&(C.minWidth=typeof b.minWidth=="number"?`${b.minWidth}px`:b.minWidth),b.maxWidth&&(C.maxWidth=typeof b.maxWidth=="number"?`${b.maxWidth}px`:b.maxWidth),C};return e.watch(()=>we.locale,b=>{b&&b!==I.value&&(I.value=b)},{immediate:!0}),e.watch(He,b=>{pn.value=b,cn.value=0}),e.watch(Ge,b=>{y("search",b??"")}),e.watch(()=>we.columns,()=>{Ct()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",ko),document.addEventListener("click",ye),document.addEventListener("click",Vn),window.addEventListener("resize",tn),window.addEventListener("scroll",tn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",ko),document.removeEventListener("click",ye),document.removeEventListener("click",Vn),window.removeEventListener("resize",tn),window.removeEventListener("scroll",tn,!0)}),(b,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Mn,style:e.normalizeStyle({width:fe.value+"px",height:Te.value?Te.value+"px":"auto"})},[mn.value?(e.openBlock(),e.createElementBlock("div",Bi,[e.createElementVNode("div",_i,[Ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:C[0]||(C[0]=E=>y("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(D)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Dt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:C[1]||(C[1]=E=>y("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(D)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),vt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:Qe},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":mt.value}]),onClick:C[2]||(C[2]=E=>mt.value=!mt.value),"aria-expanded":mt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(D)("table.columnVisibility"))+" ",1),C[23]||(C[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,Ti),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",$i,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.columns,(E,z)=>(e.openBlock(),e.createElementBlock("li",{key:ae(E,z),role:"option",class:"dss-table-column-visibility-option",onClick:C[3]||(C[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Li,[e.createElementVNode("span",Hi,[e.createElementVNode("input",{type:"checkbox",checked:nt(E,z),onChange:J=>xt(E,z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ai),nt(E,z)?(e.openBlock(),e.createElementBlock("span",Di,[...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",Ri,e.toDisplayString(E.header),1)])]))),128))],512),[[e.vShow,mt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ii,[Rt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ze.value||Ge.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:en,"onUpdate:modelValue":C[4]||(C[4]=E=>Ge.value=E),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(D)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:C[5]||(C[5]=E=>Ze.value=!0),onBlur:O},null,40,Fi),[[e.vModelText,Ge.value]]),Ge.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ae},[...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||!!Ge.value,onMousedown:e.withModifiers(Bt,["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,zi)],2)):e.createCommentVNode("",!0),b.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(b.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Mt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",xe.value])},[e.createElementVNode("thead",Oi,[e.createElementVNode("tr",null,[ut.value?(e.openBlock(),e.createElementBlock("th",Zi,[ke.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Wi,[e.createElementVNode("input",{type:"checkbox",checked:So.value,indeterminate:St.value,onChange:No,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,qi),St.value?(e.openBlock(),e.createElementBlock("span",Ui)):So.value?(e.openBlock(),e.createElementBlock("span",Xi,[...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),V.value?(e.openBlock(),e.createElementBlock("th",Yi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,(E,z)=>(e.openBlock(),e.createElementBlock("th",{key:at(E),class:e.normalizeClass(["dss-table-th",Bn(E)]),style:e.normalizeStyle(Ro(E)),onClick:J=>Hn(E)},[e.createElementVNode("div",Ki,[e.createElementVNode("span",Gi,e.toDisplayString(E.header),1),E.sortable!==!1&&$t.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ft(E)])},[Et(E)===0?(e.openBlock(),e.createElementBlock("span",Qi,[...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)])])):Et(E)===1?(e.openBlock(),e.createElementBlock("span",Ji,[...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)])])):Et(E)===-1?(e.openBlock(),e.createElementBlock("span",ec,[...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),E.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ie.value===at(E)}]),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":on(at(E))}]),"data-filter-column-key":at(E),"aria-expanded":Ie.value===at(E),"aria-label":"Filter column",onClick:J=>$(at(E),J)},[...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,tc)],2)):e.createCommentVNode("",!0)])],14,ji))),128))])]),e.createElementVNode("tbody",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(lo.value,(E,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Z(E,vn.value+z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",R(E,z)]),style:e.normalizeStyle(Q.value),onClick:J=>$e(E,z,J)},[ut.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",lc,[e.createElementVNode("input",{type:ke.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${H.tableId}`,checked:ie(E,vn.value+z),onChange:J=>Re(E,vn.value+z),class:e.normalizeClass(["dss-table-checkbox",ke.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ac),ke.value==="multiple"&&ie(E,vn.value+z)?(e.openBlock(),e.createElementBlock("span",sc,[...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)])])):ke.value==="single"&&ie(E,vn.value+z)?(e.openBlock(),e.createElementBlock("span",rc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(J=>Ee(E,vn.value+z,J),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":ee(E,vn.value+z),"aria-label":ee(E,vn.value+z)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":ee(E,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,cc)],8,ic)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,(J,Je)=>(e.openBlock(),e.createElementBlock("td",{key:at(J),class:e.normalizeClass(["dss-table-td",Bn(J)]),style:e.normalizeStyle(Ro(J))},[e.renderSlot(b.$slots,`cell-${J.field}`,{data:E,column:J,rowIndex:z},()=>[e.createTextVNode(e.toDisplayString(bt(E,J)),1)])],6))),128))],14,oc),V.value&&ee(E,vn.value+z)?(e.openBlock(),e.createElementBlock("tr",dc,[e.createElementVNode("td",{colspan:ot.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(b.$slots,"expansion",{data:E,rowIndex:z})],8,uc)])):e.createCommentVNode("",!0)],64))),128)),lo.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(Q.value)},[e.createElementVNode("td",{colspan:ot.value,class:"dss-table-empty-cell"},[e.renderSlot(b.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(ht.value),1)])],8,mc)],4))])],2)],2),st.value?(e.openBlock(),e.createElementBlock("div",pc,[e.createElementVNode("div",vc,[e.createElementVNode("div",fc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cn.value===0,onClick:C[8]||(C[8]=E=>Le(0)),title:e.unref(D)("table.firstPage")},[...C[34]||(C[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,gc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cn.value===0,onClick:C[9]||(C[9]=E=>Le(cn.value-1)),title:e.unref(D)("table.previousPage")}," ‹ ",8,hc),e.createElementVNode("span",Cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xt.value,E=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:E},[E!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":E===cn.value+1}]),onClick:z=>Le(E-1)},e.toDisplayString(E),11,yc)):(e.openBlock(),e.createElementBlock("span",kc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cn.value>=yn.value-1,onClick:C[10]||(C[10]=E=>Le(cn.value+1)),title:e.unref(D)("table.nextPage")}," › ",8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:cn.value>=yn.value-1,onClick:C[11]||(C[11]=E=>Le(yn.value-1)),title:e.unref(D)("table.lastPage")},[...C[35]||(C[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,wc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:yo},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Pn.value}]),onClick:C[12]||(C[12]=E=>Pn.value=!Pn.value),"aria-expanded":Pn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(pn.value)+" ",1),C[36]||(C[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,xc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E,role:"option","aria-selected":E===pn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":E===pn.value}]),onClick:z=>Yo(E)},e.toDisplayString(E),11,Vc))),128))],512),[[e.vShow,Pn.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(yt.value?{top:yt.value.top+"px",left:yt.value.left+"px",width:kt+"px"}:void 0),onClick:C[20]||(C[20]=e.withModifiers(()=>{},["stop"]))},[qt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[qt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Sc,[e.createElementVNode("input",{type:"text",value:sn(Ie.value).value??"",onInput:C[13]||(C[13]=E=>P(Ie.value,E.target.value)),class:"dss-table-filter-input",placeholder:e.unref(D)("table.search")||"Search..."},null,40,Nc)])):qt.value.filter==="range"&&Vt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Vt.value.minPct+"%","--range-max-pct":Vt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Lt,class:"dss-table-filter-double-range-track",onMousemove:$n,onMouseenter:$n},[e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMin,onInput:C[14]||(C[14]=E=>K(Ie.value,"min",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Tn.value==="min"?2:1})},null,44,Mc),e.createElementVNode("input",{type:"range",min:Vt.value.rangeMin,max:Vt.value.rangeMax,value:Vt.value.currentMax,onInput:C[15]||(C[15]=E=>K(Ie.value,"max",E.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Tn.value==="max"?2:1})},null,44,Bc)],544),e.createElementVNode("div",_c,e.toDisplayString(Vt.value.currentMin)+" – "+e.toDisplayString(Vt.value.currentMax),1)],4)):qt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",Tc,[e.createElementVNode("div",$c,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(D)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:sn(Ie.value).from??"",onInput:C[16]||(C[16]=E=>Ce(Ie.value,"from",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Hc)]),e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(D)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:sn(Ie.value).to??"",onInput:C[17]||(C[17]=E=>Ce(Ie.value,"to",E.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)])])):qt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Pe[Ie.value]??"",onInput:C[18]||(C[18]=E=>Xe(Ie.value,E.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(D)("table.search")||"Search..."},null,40,Ic),e.createElementVNode("div",Fc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Be(qt.value),E=>(e.openBlock(),e.createElementBlock("label",{key:E,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:We(Ie.value,E),onChange:z=>ln(Ie.value,E)},null,40,zc),e.createElementVNode("span",null,e.toDisplayString(E),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:C[19]||(C[19]=E=>rn(Ie.value))},e.toDisplayString(e.unref(D)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ie.value&&qt.value&&yt.value]])]),_:1})]))],64))}}),Wc={class:"dss-toolbar-left"},qc=["title"],Uc=["title"],Xc={class:"dss-toolbar-dropdown-wrapper"},Yc=["title"],jc={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"},Kc={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"},Gc={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"},Qc={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"},Jc={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"},ed={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"},td={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},nd=["title"],od=["title"],ld=["title"],ad=["title"],sd=["title"],rd=["title"],id=["title"],cd=["title"],dd=["title"],ud={key:2,class:"dss-toolbar-separator"},md=["title"],pd={key:4,class:"dss-toolbar-separator"},vd={key:5,class:"dss-toolbar-dropdown-wrapper"},fd=["title"],gd={class:"dss-toolbar-dropdown-ai"},hd={class:"dss-toolbar-right"},Cd={key:0,class:"dss-toolbar-custom-group"},yd={key:1,class:"dss-toolbar-separator"},kd={class:"dss-link-modal-content"},bd={class:"dss-link-modal-field"},wd={class:"dss-link-modal-label"},xd=["placeholder"],Ed={class:"dss-link-modal-field"},Vd={class:"dss-link-modal-label"},Sd=["placeholder"],Nd={class:"dss-image-modal-tabs"},Md={key:0,class:"dss-image-tab-content"},Bd={class:"dss-link-modal-content"},_d={class:"dss-link-modal-field"},Td={key:0,class:"dss-link-modal-label"},$d=["src"],Ld={class:"dss-link-modal-field"},Hd={class:"dss-link-modal-label"},Ad=["placeholder"],Dd={class:"dss-link-modal-field"},Rd={class:"dss-link-modal-label"},Id=["placeholder"],Fd={class:"dss-link-modal-field"},zd={class:"dss-link-modal-label"},Pd=["placeholder"],Od={key:1,class:"dss-image-tab-content"},Zd={class:"dss-link-modal-content"},Wd={class:"dss-link-modal-field"},qd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-link-modal-field"},Gd={class:"dss-link-modal-label"},Qd=["placeholder"],Jd={class:"dss-link-modal-field"},eu={class:"dss-link-modal-label"},tu=["placeholder"],nu={class:"dss-text-editor-title-input-container"},ou={key:0,class:"dss-text-editor-title-preview"},lu={key:0},au={key:1,class:"dss-text-editor-preview-placeholder"},su=["value","placeholder","disabled"],ru={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},iu={class:"dss-text-editor-description-input-container"},cu={key:0,class:"dss-text-editor-description-preview"},du={key:0},uu={key:1,class:"dss-text-editor-preview-placeholder"},mu=["value","placeholder","disabled"],pu={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},vu=["data-comment-id","onMouseenter"],fu=["onClick"],gu=["src","alt"],hu={key:1},Cu=["onClick"],yu=["src","alt"],ku={key:1},bu=["data-has-second-user","onClick"],wu={class:"editor-comment-marker-count"},xu={key:4,class:"dss-text-editor-textarea-wrapper"},Eu=["value","placeholder","rows","disabled"],Vu={class:"dss-text-editor-footer"},Su={class:"dss-text-editor-footer-content"},Nu={class:"dss-text-editor-footer-stat"},Mu={class:"dss-text-editor-footer-stat"},Bu={key:5,class:"dss-text-editor-content-wrapper"},_u={key:0,class:"dss-comment-overlay-body"},Tu={class:"dss-comment-selection-wrapper"},$u=["innerHTML"],Lu={class:"dss-comment-messages-wrapper"},Hu={key:0,class:"dss-comment-avatar-wrapper"},Au={class:"dss-comment-avatar"},Du=["src","alt"],Ru={key:1},Iu={class:"dss-comment-header"},Fu={class:"dss-comment-header-text"},zu={class:"dss-comment-author"},Pu={key:0,class:"dss-comment-date"},Ou=["onClick","title"],Zu={class:"dss-comment-overlay-inner"},Wu=["placeholder","onKeydown"],qu={class:"dss-text-editor-footer"},Uu={class:"dss-text-editor-footer-content"},Xu={class:"dss-text-editor-footer-stat"},Yu={class:"dss-text-editor-footer-stat"},ju=["title"],Ku=["title"],Gu={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:""},Qu={class:"dss-image-popup-content"},Ju={key:0,class:"dss-image-popup-no-alt-icon"},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:""},o1={class:"dss-toolbar-left"},l1=["title"],a1=["title"],s1={class:"dss-toolbar-dropdown-wrapper"},r1=["title"],i1={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"},c1={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"},d1={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"},u1={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"},m1={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"},p1={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"},v1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},f1=["title"],g1=["title"],h1=["title"],C1=["title"],y1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1={key:2,class:"dss-toolbar-separator"},S1={key:3,class:"dss-toolbar-dropdown-wrapper"},N1=["title"],M1={class:"dss-toolbar-dropdown-ai"},B1={key:0,class:"dss-toolbar-right"},_1={key:0,class:"dss-toolbar-separator"},T1={key:0,class:"dss-toolbar-custom-group"},$1={key:1,class:"dss-toolbar-separator"},L1={name:"DSSTextEditor"},H1=Object.assign(L1,{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:H=>typeof H=="object"&&H!==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:H=>typeof H=="object"&&H!==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(H,{expose:pe,emit:D}){const{t:I,locale:we}=ol.useI18n(),y=H,_e=D,ne=e.useSlots(),tt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
96
|
+
`,t+="Category",S.series.forEach(g=>{const E=g.name.replace(/"/g,'""');t+=',"'+E+'"'}),t+=`
|
|
97
|
+
`;const s=Math.max(...S.series.map(g=>g.data?.length||0));for(let g=0;g<s;g++){let L='"'+(S.categories[g]||z("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';S.series.forEach(T=>{const H=T.data&&T.data[g]!==void 0?T.data[g]:"";L+=","+H}),t+=L+`
|
|
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=Kt("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),ht()}catch(t){console.error("Error downloading CSV:",t)}},Bn=t=>{if(typeof t.action=="function"){const s={series:S.series,categories:S.categories,markers:Tt.value},n={chartX:ze.value.chartX,chartY:ze.value.chartY,dataX:ze.value.mouseDataX,dataY:ze.value.mouseDataY,categoryIndex:clampedCategoryIndex||ze.value.categoryIndex};t.action(s,n)}ht()},Gl=()=>{al(),he.value.show=!0,he.value.categoryIndex=ze.value.categoryIndex,he.value.fromButton=!1,ht()},Sl=()=>{al(),he.value.show=!0,he.value.categoryIndex=0,he.value.fromButton=!0},mo=t=>{if(ze.value.show){const s=document.querySelector(".dss-context-menu");s&&!s.contains(t.target)&&(ze.value.show=!1)}},Rl=t=>{ze.value.show&&!t.target.closest(".context-menu")&&(ze.value.show=!1)},Ql=t=>{if(!rn.value||!Et.value)return;t.preventDefault(),t.stopPropagation(),Z.value.isZooming=!0,Pe.value.show=!1,Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||p<F.value.top-50||p>F.value.bottom+100){Z.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,E=Math.max(Z.value.minScale,Math.min(Z.value.maxScale,Z.value.scale*g));if(E!==Z.value.scale){const{minX:b,maxX:L}=Ot.value,T=L-b||1,H=T/Z.value.scale,M=b-Z.value.offsetX/F.value.width*T,G=(i-F.value.left)/F.value.width,ce=M+G*H;Z.value.scale=E;const Ee=T/Z.value.scale,ee=ce-G*Ee;Z.value.offsetX=-(ee-b)/T*F.value.width,Z.value.scale<=1.01&&(Z.value.scale=1,Z.value.offsetX=0)}Z.value.zoomTimeout=setTimeout(()=>{Z.value.isZooming=!1,Z.value.zoomTimeout=null},300)},So=t=>{if(!rn.value||!Et.value||Z.value.scale<=1)return;Pe.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,Z.value.isDragging=!0,Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY,t.preventDefault()},Bo=()=>{Z.value.isDragging=!1},Fl=()=>{!rn.value||!Et.value||(Z.value.scale=1,Z.value.offsetX=0,Z.value.isDragging=!1,Z.value.zoomTimeout&&(clearTimeout(Z.value.zoomTimeout),Z.value.zoomTimeout=null),Z.value.isZooming=!1)},Mo=()=>!rn.value||!Nl.value||!Et.value?"default":Z.value.isDragging?"grabbing":Z.value.scale>1?"grab":"dss-crosshair",Jl=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)],b=p.x+(g.x-i.x)/6*j.value,L=p.y+(g.y-i.y)/6*j.value,T=g.x-(E.x-p.x)/6*j.value,H=g.y-(E.y-p.y)/6*j.value;s+=` C ${b} ${L} ${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,p=50;let g=p+(Ft.value?30:0)+60;if(On.value){const M={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??M.left,top:i.top??M.top,right:i.right??M.right,bottom:i.bottom??M.bottom}:M}if(pn.value){const M=!_t.value,G=Nn.value,ce=G?Hn.value+Cn.value+Math.max(24,nn.value+16):0,Ee=M?12:p;let ee=0;wt.value&&(ee+=M?8:15),tt.value&&(ee+=M?6:10);const pe=He();let ye=Ee+(M?4:16)+(G?ce:0),oe=Ee+(G?ce:0);_t.value&&U.value==="left"?ye+=pe.legendWidth||150:_t.value&&U.value==="right"&&(oe+=pe.legendWidth||150);const be=ge.value==="semi-radial"?G?ce:8:G?ce:M?8:p+80,we=G?14:0,De=Ee+ee+we,Ae={left:ye,top:De,right:oe,bottom:be};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??Ae.left,top:i.top??Ae.top,right:i.right??Ae.right,bottom:i.bottom??Ae.bottom}:Ae}let E=0;wt.value&&(E+=15),tt.value&&(E+=10);const b=He();let L=p+16,T=p;_t.value&&U.value==="left"?L+=b.legendWidth||150:_t.value&&U.value==="right"&&(T+=b.legendWidth||150),_t.value&&U.value==="bottom"&&(g+=b.legendHeight||0);const H={left:L,top:p+E,right:T,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}),F=e.computed(()=>({left:xn.value.left,top:xn.value.top,right:Ne.value-xn.value.right,bottom:pt.value-xn.value.bottom,width:Ne.value-(xn.value.left+xn.value.right),height:pt.value-(xn.value.top+xn.value.bottom)})),rn=e.computed(()=>["line","area","bar"].includes(ge.value)||gt.value),Dn=e.computed(()=>gt.value),pn=e.computed(()=>["radial","semi-radial"].includes(ge.value)),On=e.computed(()=>ge.value==="spider"),Wt=e.computed(()=>ge.value==="bubble"),Gt=e.computed(()=>O.value?.chart?.orientation==="horizontal"&&(ge.value==="bar"||Dn.value)),il=t=>{const{minY:s,maxY:n}=Ot.value,i=n-s||1;return F.value.left+(t-s)/i*F.value.width},vl=t=>{const{maxX:s}=Ot.value,n=s+1,p=F.value.height/n;return F.value.top+(t+.5)*p},St=e.computed(()=>pn.value?xn.value.left+(Ne.value-xn.value.left-xn.value.right)/2:Ne.value/2),Nt=e.computed(()=>On.value?pt.value/2-40:pn.value?xn.value.top+(pt.value-xn.value.top-xn.value.bottom)/2:pt.value/2),st=e.computed(()=>{if(On.value){const t=F.value.width-80,s=F.value.height-80;return Math.min(t,s)/2}return Math.min(F.value.width,F.value.height)/2}),Pt=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 st.value*n}),Il=e.computed(()=>{const t=O.value,s=typeof S.innerSize=="number"?S.innerSize:t?.innerSize;return typeof s!="number"||s<=-100||!(pn.value||On.value)?1:1+s/100}),po=e.computed(()=>{const t=Il.value;if(t===1||t<=0)return;const s=St.value,n=Nt.value;return`translate(${s}, ${n}) scale(${t}) translate(${-s}, ${-n})`}),Bl=e.ref(0),zl=e.computed(()=>`semi-radial-fill-clip-${S.chartId}`),En=e.computed(()=>ge.value==="semi-radial"),Zn=e.computed(()=>En.value&&x.value&&!Gn.value),Wn=e.computed(()=>En.value&&x.value&&!Gn.value&&k.value==="fill"),Ml=e.computed(()=>{const t=Zn.value?Bl.value:1,s=St.value,n=Nt.value,i=Pt.value,p=st.value,g=Math.PI,E=Math.PI+t*Math.PI;if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;const b=s+p*Math.cos(g),L=n+p*Math.sin(g),T=s+p*Math.cos(E),H=n+p*Math.sin(E),M=s+i*Math.cos(E),G=n+i*Math.sin(E),ce=s+i*Math.cos(g),Ee=n+i*Math.sin(g),ee=t>.5?1:0;return`M ${s} ${n} L ${b} ${L} A ${p} ${p} 0 ${ee} 1 ${T} ${H} L ${M} ${G} A ${i} ${i} 0 ${ee} 1 ${ce} ${Ee} Z`}),qt=e.computed(()=>{if(!(!En.value||!Zn.value)&&!Wn.value)return`url(#${zl.value})`}),fo=t=>{if(!(!Wn.value||t!==0))return`url(#${zl.value})`},cl=e.ref(0),ul=e.computed(()=>`radial-reveal-clip-${S.chartId}`),gn=e.computed(()=>ge.value==="radial"),bl=e.computed(()=>{const t=gn.value?cl.value:1,s=St.value,n=Nt.value,i=Math.max(st.value*1.5,Ne.value,pt.value);if(t<=0)return`M ${s} ${n} L ${s} ${n} Z`;if(t>=1){const M=s-i,G=s+i;return`M ${M} ${n} A ${i} ${i} 0 0 1 ${G} ${n} A ${i} ${i} 0 0 1 ${M} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,E=s+i*Math.cos(p),b=n+i*Math.sin(p),L=s+i*Math.cos(g),T=n+i*Math.sin(g),H=t>=.5?1:0;return`M ${s} ${n} L ${E} ${b} A ${i} ${i} 0 ${H} 1 ${L} ${T} Z`}),gl=e.computed(()=>{if(qt.value)return qt.value;if(gn.value)return`url(#${ul.value})`});let qn=null;const _o=()=>{if(!Zn.value)return;Bl.value=0;const t=V.value,s=performance.now(),n=i=>{const p=i-s,g=Math.min(1,p/t);Bl.value=El(Y.value,g),g<1&&(qn=requestAnimationFrame(n))};qn=requestAnimationFrame(n)},vo=e.computed(()=>O.value?.bubbles?.minSize||8),_l=e.computed(()=>O.value?.bubbles?.maxSize||50),eo=e.computed(()=>O.value?.bubbles?.opacity||.7),wl=(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)},go=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.opacity="1")},$o=t=>{const s=document.querySelector(`.dss-bubble-image-${t}`);s&&(s.style.display="none")},nl=e.computed(()=>S.series),Un=e.computed(()=>S.series.filter((t,s)=>!Rt.value.has(s))),Xn="auto",Ot=e.computed(()=>{if(Wt.value)return To();if(!Un.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=1/0,s=-1/0,n=0;Un.value.forEach(b=>{b.data&&b.data.length&&(n=Math.max(n,b.data.length-1),b.data.forEach(L=>{typeof L=="number"&&(t=Math.min(t,L),s=Math.max(s,L))}))}),S.categories.length>0&&(n=Math.max(n,S.categories.length-1)),t===1/0&&(t=0,s=100);const i=xt.value,p=Ke.value;let g,E;if(i===Xn){const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}else if(typeof i=="number")g=i;else{const b=s-t,L=b>0?b*.1:1;g=Math.max(0,t-L)}if(p===Xn){const b=s-t,L=b>0?b*.1:2;E=s+L}else if(typeof p=="number")E=p;else{const b=s-t,L=b>0?b*.1:2;E=s+L}return{minX:0,maxX:n,minY:g,maxY:E}}),To=()=>{if(!Un.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(Un.value.forEach((ce,Ee)=>{ce?.data?.length&&ce.data.forEach((ee,pe)=>{let ye,oe,Oe;if(typeof ee=="object"&&ee!==null&&!Array.isArray(ee))ye=typeof ee.x=="number"?ee.x:pe,oe=typeof ee.y=="number"?ee.y:0,Oe=typeof ee.size=="number"?ee.size:20;else if(Array.isArray(ee)&&ee.length>=3)ye=typeof ee[0]=="number"?ee[0]:pe,oe=typeof ee[1]=="number"?ee[1]:0,Oe=typeof ee[2]=="number"?ee[2]:20;else if(typeof ee=="number")ye=pe,oe=ee,Oe=wl(Ee,pe);else return;isFinite(ye)&&isFinite(oe)&&isFinite(Oe)&&(t=Math.min(t,ye),s=Math.max(s,ye),n=Math.min(n,oe),i=Math.max(i,oe),p=Math.min(p,Oe),g=Math.max(g,Oe),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,S.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=s-t,L=i-n;let T,H,M,G;return Ge.value!==null?T=Ge.value:T=t-b*.1,Zt.value!==null?H=Zt.value:H=s+b*.1,xt.value!==null&&typeof xt.value=="number"?M=xt.value:M=Math.max(0,n-L*.1),Ke.value!==null&&typeof Ke.value=="number"?G=Ke.value:G=i+L*.1,{minX:T,maxX:H,minY:M,maxY:G,minSize:p,maxSize:g}},Ut=t=>{if(Wt.value){const{minX:b,maxX:L}=Ot.value,T=L-b||1;return F.value.left+(t-b)/T*F.value.width}const{minX:s,maxX:n}=Ot.value,i=n-s;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=(t-g)/p;return F.value.left+E*F.value.width},Qt=t=>{const{minY:s,maxY:n}=Ot.value,i=n-s||1;return F.value.bottom-(t-s)/i*F.value.height},ho=t=>{if(!Wt.value)return ot.value||4;const{maxSize:s}=Ot.value,n=Math.max(1,s),i=Math.min(1,Math.max(0,t/n));return vo.value+i*(_l.value-vo.value)},Lo=e.computed(()=>Co.value.map(t=>({y:t.y}))),Pl=e.computed(()=>{if(Wt.value)return yo();if(ge.value==="bar"){if(Gt.value){const be=[],{minY:we,maxY:De}=Ot.value,Ae=5,Ct=De-we||1;for(let kt=0;kt<=Ae;kt++){const Vn=we+Ct*(kt/Ae),Yt=il(Vn);be.push({x:Yt,y:F.value.bottom+20,text:un(Math.round(Vn))})}return be}const Ee=[],{maxX:ee}=Ot.value,pe=ee+1,ye=5,Oe=(F.value.width-ye*2)/pe;for(let be=0;be<=ee;be++){const we=F.value.left+ye+(be+.5)*Oe;Ee.push({x:we,y:F.value.bottom+20,text:S.categories[be]||z("chart.fallback.item",{number:be+1})})}return Ee}const t=[],{minX:s,maxX:n}=Ot.value,i=n-s||1,p=i/Z.value.scale,g=s-Z.value.offsetX/F.value.width*i,E=g+p,b=Math.max(0,Math.floor(g-2)),L=Math.min(n,Math.ceil(E+2)),T=L-b,H=F.value.width,G=Math.floor(H/60);let ce=1;T>G&&(ce=Math.ceil(T/G));for(let Ee=b;Ee<=L;Ee+=ce)if(Ee>=0&&Ee<=n){const ee=Ut(Ee);ee>=F.value.left-100&&ee<=F.value.right+100&&t.push({x:ee,y:F.value.bottom+20,text:S.categories[Ee]||`Item ${Ee+1}`})}return t}),yo=()=>{const t=[],{minX:s,maxX:n}=Ot.value,i=n-s||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const E=s+i*g/p,b=Ut(E);if(b>=F.value.left-10&&b<=F.value.right+10){const L=Math.round(E),T=S.categories?.[L];t.push({x:b,y:F.value.bottom+20,text:T||(Number.isInteger(E)?E.toString():E.toFixed(1))})}}return t},Co=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Ot.value;for(let E=0;E<=g;E++)p.push({x:F.value.left-10,y:vl(E),text:S.categories[E]||`Item ${E+1}`});return p}const t=[],{minY:s,maxY:n}=Ot.value,i=5;for(let p=0;p<=i;p++){const g=s+(n-s)*(p/i),E=Math.round(g);t.push({x:F.value.left-10,y:Qt(g),text:un(E)})}return t}),Lt=t=>{const s=re.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]},dl=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 b=s.match(/^rgba\s*\(\s*(\d+)\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{const L=s.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(L){let T=L[1];T.length===3&&(T=T[0]+T[0]+T[1]+T[1]+T[2]+T[2]),n=parseInt(T.slice(0,2),16)/255,i=parseInt(T.slice(2,4),16)/255,p=parseInt(T.slice(4,6),16)/255}else if(typeof document<"u"){const T=document.createElement("span");T.style.color=s,T.style.display="none",document.body.appendChild(T);const H=getComputedStyle(T).color;document.body.removeChild(T);const M=H.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(M)n=Number(M[1])/255,i=Number(M[2])/255,p=Number(M[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},$l=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)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${E}, ${b})`}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)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${E}, ${b}, ${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))),b=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(2,4),16)*.65))),L=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[E,b,L].map(T=>T.toString(16).padStart(2,"0")).join("")}`}return s},Ol=(t,s)=>{const i=O.value?.stroke?.color;return i==null?$l(s):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??$l(s):$l(s)},to=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},ko=e.computed(()=>ge.value==="line"||Dn.value?(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(M=>M===s),p=[];let g=[];s.data.forEach((M,G)=>{M==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Gt.value?il(M):Ut(G),y:Gt.value?vl(G):Qt(M),index:G})}),g.length>0&&p.push(g);let E="";p.forEach(M=>{if(M.length>0){let G="";X.value?G=Jl(M):G=`M ${M[0].x} ${M[0].y}`+M.slice(1).map(ce=>` L ${ce.x} ${ce.y}`).join(""),E+=(E?" ":"")+G}});const b=p.reduce((M,G)=>M+to(G),0),L=Rt.value.has(i),T=Ce.value===i,H=Ce.value!==null&&Ce.value!==i;return{path:E,color:Lt(i),pathLength:b,seriesIndex:i,animationDelay:n*xe.value,isHighlighted:T,isDimmed:H,isHidden:L}}):[]),bo=e.computed(()=>{if(!(ge.value==="line"||Dn.value))return[];const t=Dn.value?S.series.filter(n=>(n.type||ge.value)==="line"):nl.value,s=[];return t.forEach((n,i)=>{const p=S.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const E=n.data[g];if(E!=null){let b=-1,L=0;for(let T=g+1;T<n.data.length;T++){const H=n.data[T];if(H==null)L++;else{b=T;break}}if(L>0&&b!==-1){const T=n.data[b],H=Gt.value?il(E):Ut(g),M=Gt.value?vl(g):Qt(E),G=Gt.value?il(T):Ut(b),ce=Gt.value?vl(b):Qt(T),Ee=Rt.value.has(p),ee=Ce.value===p,pe=Ce.value!==null&&Ce.value!==p;s.push({path:`M ${H} ${M} L ${G} ${ce}`,color:Lt(p),seriesIndex:p,animationDelay:i*xe.value,isHighlighted:ee,isDimmed:pe,isHidden:Ee,gapSize:L}),g=b-1}}}}),s}),Zl=e.computed(()=>ge.value==="line"||Dn.value?!x.value||Gn.value||yt.value.hasAnimated?[]:(Dn.value?S.series.filter(s=>(s.type||ge.value)==="line"):nl.value).map((s,n)=>{const i=S.series.findIndex(L=>L===s);let p="",g=null;s.data.forEach((L,T)=>{if(L!=null){const H={x:Gt.value?il(L):Ut(T),y:Gt.value?vl(T):Qt(L)};g===null?p+=`M ${H.x} ${H.y}`:p+=` L ${H.x} ${H.y}`,g=H}else if(g!==null){const H=s.data.findIndex((M,G)=>G>T&&M!==null&&M!==void 0);if(H!==-1){const M={x:Gt.value?il(s.data[H]):Ut(H),y:Gt.value?vl(H):Qt(s.data[H])};p+=` L ${M.x} ${M.y}`,g=M}}});const E=s.data.map((L,T)=>L==null?null:{x:Gt.value?il(L):Ut(T),y:Gt.value?vl(T):Qt(L)}).filter(L=>L!==null),b=to(E);return{path:p,pathLength:b,color:Lt(i),animationDelay:n*xe.value,seriesIndex:i}}):[]),Rn=e.computed(()=>{if(ge.value!=="line")return[];const t=[];return nl.value.forEach((s,n)=>{const i=Ce.value===n,p=Ce.value!==null&&Ce.value!==n,g=Rt.value.has(n);s.data.forEach((E,b)=>{E!=null&&t.push({x:Ut(b),y:Qt(E),color:Lt(n),value:E,label:S.categories[b]||b.toString(),seriesName:s.name,categoryIndex:b,dataIndex:b,animationDelay:(n*s.data.length+b)*(xe.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),Ho=e.computed(()=>{if(!Dn.value)return[];const t=[];return S.series.filter(n=>(n.type||ge.value)==="line").forEach((n,i)=>{const p=S.series.findIndex(L=>L===n),g=Ce.value===p,E=Ce.value!==null&&Ce.value!==p,b=Rt.value.has(p);n.data.forEach((L,T)=>{L!=null&&t.push({x:Ut(T),y:Qt(L),color:Lt(p),value:L,label:S.categories[T]||T.toString(),seriesName:n.name,categoryIndex:T,dataIndex:T,animationDelay:(i*n.data.length+T)*(xe.value/8),isHighlighted:g,isDimmed:E,isHidden:b})})}),t}),Yn=e.computed(()=>{if(!Wt.value)return[];const t=[];return nl.value.forEach((s,n)=>{if(!s?.data?.length)return;const i=Ce.value,p=i!==null&&i===n,g=i!==null&&i!==n,E=Rt.value.has(n);s.data.forEach((b,L)=>{let T,H,M,G,ce;if(typeof b=="object"&&b!==null&&!Array.isArray(b))T=typeof b.x=="number"?b.x:L,H=typeof b.y=="number"?b.y:0,M=typeof b.size=="number"?b.size:20,G=b.label||S.categories?.[L]||`Point ${L+1}`,ce=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)T=typeof b[0]=="number"?b[0]:L,H=typeof b[1]=="number"?b[1]:0,M=typeof b[2]=="number"?b[2]:20,G=b[3]||S.categories?.[L]||`Point ${L+1}`,ce=b[4];else if(typeof b=="number")T=L,H=b,M=wl(n,L),G=S.categories?.[L]||`Point ${L+1}`;else return;!isFinite(T)||!isFinite(H)||!isFinite(M)||t.push({x:Ut(T),y:Qt(H),radius:ho(M),originalX:T,originalY:H,originalSize:M,color:Lt(n),seriesName:s.name||`Series ${n+1}`,label:G,imageUrl:ce,seriesIndex:n,dataIndex:L,categoryIndex:Math.round(T),isHighlighted:p,isDimmed:g,isHidden:E,opacity:eo.value})})}),t}),Tl=e.computed(()=>ge.value!=="area"?[]:nl.value.map((t,s)=>{const n=[];let i=[];if(t.data.forEach((M,G)=>{M==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Ut(G),y:Qt(M),index:G})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:Lt(s),isHidden:Rt.value.has(s)};const p=F.value.bottom+1;let g="",E="";n.forEach((M,G)=>{if(M.length===0)return;let ce=`M ${M[0].x} ${M[0].y}`;X.value&&M.length>1?ce=Jl(M):M.slice(1).forEach(ee=>{ce+=` L ${ee.x} ${ee.y}`}),g+=(g?" ":"")+ce;let Ee=`M ${M[0].x} ${p}`;if(Ee+=` L ${M[0].x} ${M[0].y}`,X.value&&M.length>1){const ee=Jl(M),pe=ee.substring(ee.indexOf("C")||ee.indexOf("Q")||ee.indexOf("L"));pe?Ee+=" "+pe:M.slice(1).forEach(ye=>{Ee+=` L ${ye.x} ${ye.y}`})}else M.slice(1).forEach(ee=>{Ee+=` L ${ee.x} ${ee.y}`});Ee+=` L ${M[M.length-1].x} ${p} Z`,E+=(E?" ":"")+Ee});const b=Ce.value===s,L=Ce.value!==null&&Ce.value!==s,T=Rt.value.has(s),H=n.reduce((M,G)=>M+to(G),0);return{linePath:g,areaPath:E,color:Lt(s),pathLength:H,isHighlighted:b,isDimmed:L,isHidden:T}})),wo=e.computed(()=>{if(!(["bar"].includes(ge.value)||Dn.value))return[];const t=[],{maxX:s}=Ot.value,n=Dn.value?S.series.filter(p=>(p.type||ge.value)==="bar"):nl.value,i=n.length;if(Gt.value){const p=s+1,E=F.value.height/p,b=E*(2/3),L=Math.min(4,b/i*.15),T=b-(i-1)*L,H=Math.max(4,T/i);n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Ce.value===ce,ee=Ce.value!==null&&Ce.value!==ce,pe=Rt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.top+(oe+.5)*E-b/2+G*(H+L),De=F.value.left,Ae=Math.abs(il(ye)-F.value.left);let Ct="";if(X.value&&Ae>0){const kt=Math.min(Q.value,H/2,Ae/2);Ct=[`M ${De} ${we}`,`L ${De+Ae-kt} ${we}`,`Q ${De+Ae} ${we} ${De+Ae} ${we+kt}`,`L ${De+Ae} ${we+H-kt}`,`Q ${De+Ae} ${we+H} ${De+Ae-kt} ${we+H}`,`L ${De} ${we+H}`,"Z"].join(" ")}t.push({x:De,y:we,width:Ae,height:H,color:Lt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(G*n.length+oe)*(xe.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:pe,barPath:Ct,isSmooth:X.value&&Ae>0})})})}else{const p=s+1,E=F.value.width/p,b=E*.8,L=b/i,T=L*.05,H=L-T;n.forEach((M,G)=>{const ce=S.series.findIndex(ye=>ye===M),Ee=Ce.value===ce,ee=Ce.value!==null&&Ce.value!==ce,pe=Rt.value.has(ce);M.data.forEach((ye,oe)=>{if(ye==null||typeof ye!="number"||!isFinite(ye))return;const we=F.value.left+(oe+.5)*E-b/2+G*L+T/2,De=Qt(Math.max(0,ye)),Ae=Math.abs(Qt(0)-Qt(ye));let Ct="";if(X.value&&Ae>0){const kt=Math.min(Q.value,H/2,Ae/2);Ct=[`M ${we} ${De+Ae}`,`L ${we} ${De+kt}`,`Q ${we} ${De} ${we+kt} ${De}`,`L ${we+H-kt} ${De}`,`Q ${we+H} ${De} ${we+H} ${De+kt}`,`L ${we+H} ${De+Ae}`,"Z"].join(" ")}t.push({x:we,y:De,width:H,height:Ae,color:Lt(i===1?oe:ce),value:ye,label:S.categories[oe]||oe.toString(),seriesName:M.name,animationDelay:(G*n.length+oe)*(xe.value/4),isHighlighted:Ee,isDimmed:ee,isHidden:pe,barPath:Ct,isSmooth:X.value&&Ae>0})})})}return t}),ml=e.computed(()=>{if(!pn.value)return[];const t=nl.value.map((g,E)=>({series:g,originalIndex:E})).filter(({originalIndex:g})=>!Rt.value.has(g));if(t.length===0)return[];let s=ge.value==="semi-radial"?Math.PI:-Math.PI/2;const n=ge.value==="semi-radial"?Math.PI:Math.PI*2,i=[];if(t.length===1){const{series:g,originalIndex:E}=t[0],b=g.data[0]||0,L=s,T=s+n-.001,H=L+n/2,M=St.value+Math.cos(L)*Pt.value,G=Nt.value+Math.sin(L)*Pt.value,ce=St.value+Math.cos(T)*Pt.value,Ee=Nt.value+Math.sin(T)*Pt.value,ee=St.value+Math.cos(T)*st.value,pe=Nt.value+Math.sin(T)*st.value,ye=St.value+Math.cos(L)*st.value,oe=Nt.value+Math.sin(L)*st.value,Oe=1,be=[`M ${M} ${G}`,`A ${Pt.value} ${Pt.value} 0 ${Oe} 1 ${ce} ${Ee}`,`L ${ee} ${pe}`,`A ${st.value} ${st.value} 0 ${Oe} 0 ${ye} ${oe}`,"Z"].join(" "),we=Lt(E);return i.push({path:be,color:we,strokeWidth:$t.value,strokeColor:Ol(0,we),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:!1,isHidden:!1,startAngle:L,endAngle:T,midAngle:H}),i}if(Wn.value&&t.length===2){const g=t[0],E=t[1],b=Math.min(100,Math.max(0,g.series.data[0]||0)),L=b/100*n,T=(H,M,G,ce,Ee)=>{const ee=H+(M-H)/2,pe=M-H,ye=St.value+Math.cos(H)*Pt.value,oe=Nt.value+Math.sin(H)*Pt.value,Oe=St.value+Math.cos(M)*Pt.value,be=Nt.value+Math.sin(M)*Pt.value,we=St.value+Math.cos(M)*st.value,De=Nt.value+Math.sin(M)*st.value,Ae=St.value+Math.cos(H)*st.value,Ct=Nt.value+Math.sin(H)*st.value,kt=pe>Math.PI?1:0,Vn=[`M ${ye} ${oe}`,`A ${Pt.value} ${Pt.value} 0 ${kt} 1 ${Oe} ${be}`,`L ${we} ${De}`,`A ${st.value} ${st.value} 0 ${kt} 0 ${Ae} ${Ct}`,"Z"].join(" "),Yt=Lt(ce);return{path:Vn,color:Yt,strokeWidth:$t.value,strokeColor:Ol(i.length,Yt),value:Ee,seriesName:G.name,opacity:.8,isHighlighted:Ce.value===ce,isDimmed:Ce.value!==null&&Ce.value!==ce,isHidden:!1,startAngle:H,endAngle:M,midAngle:ee}};return i.push(T(s,s+L,g.series,g.originalIndex,b)),i.push(T(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 b=g.data[0]||0,L=b/p*n,T=s,H=s+L,M=T+L/2,G=St.value+Math.cos(T)*Pt.value,ce=Nt.value+Math.sin(T)*Pt.value,Ee=St.value+Math.cos(H)*Pt.value,ee=Nt.value+Math.sin(H)*Pt.value,pe=St.value+Math.cos(H)*st.value,ye=Nt.value+Math.sin(H)*st.value,oe=St.value+Math.cos(T)*st.value,Oe=Nt.value+Math.sin(T)*st.value,be=L>Math.PI?1:0,we=[`M ${G} ${ce}`,`A ${Pt.value} ${Pt.value} 0 ${be} 1 ${Ee} ${ee}`,`L ${pe} ${ye}`,`A ${st.value} ${st.value} 0 ${be} 0 ${oe} ${Oe}`,"Z"].join(" "),De=Lt(E);i.push({path:we,color:De,strokeWidth:$t.value,strokeColor:Ol(i.length,De),value:b,seriesName:g.name,opacity:.8,isHighlighted:Ce.value===E,isDimmed:Ce.value!==null&&Ce.value!==E,isHidden:!1,startAngle:T,endAngle:H,midAngle:M}),s=H}),i)}),xo=e.computed(()=>{const t=ml.value;return Wn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((s,n)=>({segment:s,originalIndex:n}))}),o=e.computed(()=>{if(!Nn.value||!pn.value)return[];const t=nn.value,s=Hn.value,n=Cn.value,i=dn.value,p=15,g=t*1.3,E=.55,b=(M,G)=>{const ce=St.value+Math.cos(M.midAngle)*st.value,Ee=Nt.value+Math.sin(M.midAngle)*st.value,ee=St.value+Math.cos(M.midAngle)*(st.value+s),pe=Nt.value+Math.sin(M.midAngle)*(st.value+s),oe=ee+n*(G?1:-1),Oe=G?ee+p:ee-p,be=pe-i,we=`${M.seriesName}: ${un(M.value)}`,De=we.length*t*E;return{pointerStartX:ce,pointerStartY:Ee,pointerEndX:ee,pointerEndY:pe,horizontalEndX:oe,horizontalEndY:pe,textX:Oe,textY:be,text:we,textWidth:De,textAnchor:G?"start":"end",isRightSide:G,pointerLineLength:Math.hypot(ee-ce,pe-Ee),horizontalLineLength:Math.hypot(oe-ee,0)}},L=(M,G)=>{const ce=Math.abs(M.textY-G.textY)<g,Ee=M.isRightSide?M.textX:M.textX-M.textWidth,ee=M.isRightSide?M.textX+M.textWidth:M.textX,pe=G.isRightSide?G.textX:G.textX-G.textWidth,ye=G.isRightSide?G.textX+G.textWidth:G.textX,oe=Ee<ye&&pe<ee;return ce&&oe},T=ml.value.filter(M=>!M.isHidden),H=[];for(let M=0;M<T.length;M++){const G=T[M];let ce=Math.cos(G.midAngle)>=0;if(M>0){const ee=H[M-1],pe=b(G,ce);L(ee,pe)&&(ce=!ce)}const Ee=b(G,ce);H.push({...Ee,color:G.color,isHighlighted:G.isHighlighted,isDimmed:G.isDimmed})}return H}),l=t=>{if(!t||t.isHidden)return 0;const s=t.opacity||eo.value||.7;return Ce.value===null||Ce.value===void 0?s:Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):Math.max(.5,s*.8):s},a=t=>{if(!t||t.isHidden)return 0;const s=t.radius>20?.9:.8;return Ce.value!==null?t.seriesIndex===Ce.value?Math.min(1,s+.1):s*.7:s},r=(t,s)=>{if(t)try{if(Ce.value===t.seriesIndex?Ce.value=null:Ce.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:s,chartId:S.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},c=(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(" ")},d=(t,s)=>{if(!t||(s.stopPropagation(),Ll.value=!0,Ce.value=t.seriesIndex,Pe.value.show=!1,!_e.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,b=120;p+E>Ne.value&&(p=s.clientX-i.left-E-10),g+b>i.height&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const L=An.value,T=fl.value,H=L.map(M=>{const G=T[M]||M,ce=u(M,t);return ce?{seriesName:t.seriesName,label:t.label,value:`${G}: ${ce}`,color:t.color}:null}).filter(Boolean);Xe.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:H,categoryIndex:void 0,spiderSeries:[]}},u=(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=Vl.value[t];if(typeof i=="function")return i(n,s);if(typeof n=="number"){const p=n.toFixed(1);return an.value?p+an.value:p}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"},v=(t,s)=>{t&&(Ll.value=!1,Ce.value=null,Xe.value.show=!1,Xe.value.bubbleData=[])},h=(t,s)=>{const n=s.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=so(t.categoryIndex),g=t.description||t.comment||"";let E=s.clientX-i.left+15,b=s.clientY-i.top-10;const L=200,T=g?80:50;E+L>Ne.value&&(E=s.clientX-i.left-L-15),b+T>pt.value&&(b=s.clientY-i.top-T-10),E<0&&(E=10),b<0&&(b=10),jt.value={show:!0,x:E,y:b,categoryValue:p,description:g}},_=()=>{jt.value.show=!1},$=e.computed(()=>S.categories.length||Math.max(...Un.value.map(t=>t.data.length))),N=e.computed(()=>{let t=0;return Un.value.forEach(s=>{s.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),J=e.computed(()=>{const t=[],s=$.value;for(let n=0;n<s;n++){const i=n*2*Math.PI/s-Math.PI/2,p=St.value+Math.cos(i)*st.value,g=Nt.value+Math.sin(i)*st.value;t.push({x:p,y:g,angle:i,index:n})}return t}),K=e.computed(()=>{const t=[],s=$.value;return J.value.forEach((n,i)=>{const p=st.value+15,g=i*2*Math.PI/s-Math.PI/2,E=St.value+Math.cos(g)*p,b=Nt.value+Math.sin(g)*p+5;let L="middle",T="middle";Math.abs(Math.cos(g))>.5&&(L=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(T=Math.sin(g)>0?"hanging":"auto"),t.push({x:E,y:b,text:S.categories[i]||`Axis ${i+1}`,anchor:L,baseline:T})}),t}),$e=e.ref(new Set),me=(t,s,n)=>{const i=`current-${n}`,p=$e.value.has(i);return!p&&Ce.value===null?s.fillOpacity||le.value:s.isHighlighted||p?(s.fillOpacity||le.value)+.15:s.isDimmed?(s.fillOpacity||le.value)*.3:s.fillOpacity||le.value},it=e.computed(()=>{if(!On.value)return[];const t=[],s=$.value;return nl.value.forEach((n,i)=>{const p=[],g=[],E=[],b=Ce.value===i,L=Ce.value!==null&&Ce.value!==i,T=Rt.value.has(i);for(let H=0;H<s;H++){const M=n.data[H]||0,ce=M/N.value*st.value,Ee=H*2*Math.PI/s-Math.PI/2,ee=St.value+Math.cos(Ee)*ce,pe=Nt.value+Math.sin(Ee)*ce;p.push(`${ee},${pe}`),g.push({x:ee,y:pe}),E.push({x:ee,y:pe,value:M,label:S.categories[H]||`Axis ${H+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:E,color:Lt(i),fillOpacity:le.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:L,isHidden:T,seriesIndex:i})}),t}),ln=(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,b=s[p].x,L=s[p].y;E>t.y!=L>t.y&&t.x<(b-g)*(t.y-E)/(L-E)+g&&(n=!n)}return n},Jt=t=>{if(!On.value)return;const s=t.currentTarget.closest(".dss-custom-chart-container");if(!s)return;const n=s.getBoundingClientRect(),i=Te.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,E=it.value.filter(b=>b.isHidden?!1:ln({x:p,y:g},b.polygonPoints));if(E.length>0){E.length,Ce.value=E[0].seriesIndex;const b=t.clientX-n.left+10,L=t.clientY-n.top-10,T=200,H=50+E.length*25;let M=b,G=L;M+T>Ne.value&&(M=t.clientX-n.left-T-10),G+H>pt.value&&(G=t.clientY-n.top-H-10),M<0&&(M=10),G<0&&(G=10);const ce=E.map(Ee=>{let ee=Ee.dataPoints[0],pe=1/0;return Ee.dataPoints.forEach(ye=>{const oe=Math.sqrt(Math.pow(ye.x-p,2)+Math.pow(ye.y-g,2));oe<pe&&(pe=oe,ee=ye)}),{seriesName:Ee.seriesName,color:Ee.color,value:un(ee.value!==void 0?ee.value:Ee.value)}});Xe.value={show:!0,x:M,y:G,title:E.length===1?E[0].seriesName:"",value:"",bubbleData:[],spiderSeries:ce}}else Fn()},zt=e.computed(()=>{const t=O.value;return t.logos.map((s,n)=>{const i=S.series[s.seriesIndex];if(!i||!i.data||i.data.length===0||Rt.value.has(s.seriesIndex))return null;let p,g;if(rn.value){let b=-1,L=null;for(let H=i.data.length-1;H>=0;H--)if(i.data[H]!==null&&i.data[H]!==void 0){b=H,L=i.data[H];break}if(b===-1||L===null)return null;const T=i.data.map((H,M)=>H==null?null:{x:Ut(M),y:Qt(H),index:M}).filter(H=>H!==null);if(t.animations.enabled&&!Gn.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(yt.value.isAnimating||!yt.value.hasAnimated))if(yt.value.isAnimating){const H=yt.value.currentFrame/yt.value.totalFrames,M=El(t.animations.easing,Math.min(H,1)),G=Ko(T,M);p=G.x+(s.offsetX||0),g=G.y+(s.offsetY||0)}else p=T[0].x+(s.offsetX||0),g=T[0].y+(s.offsetY||0);else p=Ut(b)+(s.offsetX||0),g=Qt(L)+(s.offsetY||0)}else if(pn.value||On.value){const b=Math.PI*2/t.logos.length*n;p=St.value+Math.cos(b)*(st.value+30)+(s.offsetX||0),g=Nt.value+Math.sin(b)*(st.value+30)+(s.offsetY||0)}return{...s,x:p,y:g,seriesIndex:s.seriesIndex}}).filter(Boolean)}),en=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")},tn=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const s=document.querySelector(`.dss-logo-image-${t}`);s&&(s.style.display="none")},Xt=t=>{Rt.value.has(t)?Rt.value.delete(t):Rt.value.add(t)},jn=e.computed(()=>{if(!Xe.value.show&&!(fe.value&&Pe.value.show&&!Z.value.isZooming))return{display:"none"};let t,s;if(fe.value&&Pe.value.show&&!Z.value.isZooming){t=Pe.value.x+15,s=F.value.top;const n=Wt.value?200:150;t+n>Ne.value&&(t=Pe.value.x-n-15),t<0&&(t=10),s<10&&(s=10)}else t=Xe.value.x,s=Xe.value.y;return{left:t+"px",top:s+"px"}}),hn=(t,s)=>{if(!_e.value||Hl.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,b=120,L=Ne.value,T=pt.value;p+E>L&&(p=s.clientX-i.left-E-10),g+b>T&&(g=s.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let H;typeof t.categoryIndex=="number"?H=t.categoryIndex:typeof t.dataIndex=="number"?H=t.dataIndex:t.label&&S.categories.includes(t.label)&&(H=S.categories.indexOf(t.label));const M=(Gt.value||ge.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";Xe.value={show:!0,x:p,y:g,title:M,value:un(t.value)||"",categoryIndex:H,spiderSeries:[]}},Kn=e.ref(!1),Ll=e.ref(!1),Fn=()=>{Xe.value.show=!1,Xe.value.spiderSeries=[],Xe.value.bubbleData=[],Pe.value.show=!1,Kn.value||(Ce.value=null)},Hl=e.ref(!1),xl=(t,s)=>{Hl.value=!0,Xe.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>Ne.value&&(p=s.clientX-i.left-E-15),p<0&&(p=10),g<0&&(g=10),ol.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},Wl=()=>{Hl.value=!1,ol.value.show=!1},yt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),El=(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}},Gn=e.computed(()=>Le.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),Qn=()=>{if(!x.value||Gn.value){yt.value.hasAnimated=!0,gn.value&&(cl.value=1);return}gn.value&&(cl.value=0),yt.value.isAnimating=!0,yt.value.currentFrame=0,yt.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const s=yt.value.currentFrame/yt.value.totalFrames,n=El(Y.value,Math.min(s,1));ll(n),gn.value&&(cl.value=n),s<1?(yt.value.currentFrame++,yt.value.animationId=requestAnimationFrame(t)):In()};yt.value.animationId=requestAnimationFrame(t)},ll=t=>{const s=document.querySelector(".dss-custom-chart-container");s&&s.style.setProperty("--dss-animation-progress",t)},In=()=>{yt.value.isAnimating=!1,yt.value.hasAnimated=!0,gn.value&&(cl.value=1),yt.value.animationId&&(cancelAnimationFrame(yt.value.animationId),yt.value.animationId=null)},Eo=e.computed(()=>!pn.value||yt.value.hasAnimated?!0:gn.value?cl.value>=1:En.value?Bl.value>=1:!0),Po=e.computed(()=>Nn.value&&Eo.value),Vo=e.ref(!1);e.watch(Po,t=>{t?(Vo.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Vo.value=!0})})):Vo.value=!1},{immediate:!0});const Xo=e.computed(()=>{if(!x.value||Gn.value||yt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Yo(Y.value),t["--dss-stagger-delay"]=`${xe.value}ms`,t}),Yo=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",jo=()=>{if(!x.value||Gn.value)return"";const t=["dss-chart-animated"];return yt.value.hasAnimated||t.push(`dss-animate-${k.value}`),yt.value.hasAnimated||(pn.value&&ge.value!=="semi-radial"?t.push("dss-animate-fill"):pn.value||t.push(`dss-animate-${k.value}`)),yt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>S.series,(t,s)=>{Ye.value&&s&&yt.value.hasAnimated&&(yt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>Qn(),P.value)}))},{deep:!0}),e.watch(()=>Z.value.isZooming,(t,s)=>{s&&!t&&setTimeout(()=>{jl()},50)}),e.watch(()=>[Z.value.scale,Z.value.offsetX],()=>{!Z.value.isZooming&&!Z.value.isDragging&&jl()},{flush:"post"}),e.watch([We,ft],([t,s])=>{Z.value.minScale=t,Z.value.maxScale=s,(Z.value.scale<t||Z.value.scale>s)&&Fl()},{immediate:!0}),e.watch(()=>S.locale,t=>{t&&t!==R.value&&(R.value=t)},{immediate:!0}),e.watch(()=>ze.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",Rl)}):document.removeEventListener("click",Rl)}),e.onMounted(()=>{Ce.value=null,gn.value&&(!x.value||Gn.value)&&(cl.value=1),No(),C.value&&typeof ResizeObserver<"u"&&(ue=new ResizeObserver(t=>{const s=t[0];!s||!s.contentRect||(ve&&cancelAnimationFrame(ve),ve=requestAnimationFrame(()=>{ve=null;const{width:n,height:i}=s.contentRect;nt.value=Math.round(n),f.value=Math.round(i),ie.value&&(Ht.value=ie.value.offsetHeight||de)}))}),ue.observe(C.value)),x.value&&!Gn.value?ge.value==="semi-radial"?setTimeout(()=>_o(),P.value):setTimeout(()=>Qn(),P.value):(yt.value.hasAnimated=!0,ge.value==="semi-radial"&&(Bl.value=1)),document.addEventListener("mousemove",Oo),document.addEventListener("mouseup",Zo),document.addEventListener("click",mo)}),e.onUnmounted(()=>{ve&&cancelAnimationFrame(ve),ue&&C.value&&(ue.unobserve(C.value),ue.disconnect(),ue=null),yt.value.animationId&&cancelAnimationFrame(yt.value.animationId),qn&&(cancelAnimationFrame(qn),qn=null),Z.value.zoomTimeout&&clearTimeout(Z.value.zoomTimeout),document.removeEventListener("mousemove",Oo),document.removeEventListener("mouseup",Zo),document.removeEventListener("click",mo),document.removeEventListener("click",Rl)});const Oo=t=>{if(Z.value.isDragging&&Z.value.scale>1&&rn.value){Pe.value.show=!1;const s=t.clientX-Z.value.lastMouseX,{minX:n,maxX:i}=Ot.value,p=i-n||1,E=s*.8;Z.value.offsetX+=E;const b=p/Z.value.scale,L=p-b,T=0,H=-L/p*F.value.width,M=T;Z.value.offsetX=Math.max(H,Math.min(M,Z.value.offsetX)),Z.value.lastMouseX=t.clientX,Z.value.lastMouseY=t.clientY}},Zo=()=>{Z.value.isDragging&&(Z.value.isDragging=!1,setTimeout(()=>{!Z.value.isDragging&&Z.value.isZooming},100))},Ko=(t,s)=>{const n=t.filter(b=>b!=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 b=1;b<n.length;b++){const L=n[b].x-n[b-1].x,T=n[b].y-n[b-1].y,H=Math.sqrt(L*L+T*T);p.push(H),i+=H}const g=i*s;let E=0;for(let b=0;b<p.length;b++){const L=E+p[b];if(g<=L){const T=(g-E)/p[b],H=n[b],M=n[b+1];return{x:H.x+(M.x-H.x)*T,y:H.y+(M.y-H.y)*T}}E=L}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",[jo(),{"dss-chart-fill-width":lt.value,"dss-chart-fill-height":je.value,"dss-chart-compact":pn.value&&!_t.value}]]),style:e.normalizeStyle({width:lt.value?"100%":Ne.value+"px",height:Re.value,...lt.value||je.value?{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...Xo.value,cursor:Mo()}),"data-chart-type":ge.value,ref_key:"containerEl",ref:C,onWheel:Ql,onMousedown:So,onMousemove:se,onMouseup:Bo,onMouseleave:mt,onDblclick:Fl,onContextmenu:e.withModifiers(et,["prevent"]),onClick:e.withModifiers(ht,["left"]),onWheelCapture:Ql},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:ie},[e.createElementVNode("div",Za,[wt.value?(e.openBlock(),e.createElementBlock("div",Wa,e.toDisplayString(wt.value),1)):e.createCommentVNode("",!0),tt.value?(e.openBlock(),e.createElementBlock("div",qa,e.toDisplayString(tt.value),1)):e.createCommentVNode("",!0)]),_t.value&&(U.value==="top"||U.value==="bottom")?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Ie.value==="horizontal","dss-legend-vertical":Ie.value==="vertical","dss-legend-top":U.value==="top","dss-legend-bottom":U.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Rt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Xt(i),onMouseenter:p=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",Xa,e.toDisplayString(n.name),1)],46,Ua))),128))],2)):e.createCommentVNode("",!0),_t.value&&(U.value==="left"||U.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":U.value==="left","dss-legend-right":U.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":Rt.value.has(i),"dss-legend-hovered":Ce.value===i,"dss-legend-dimmed":Ce.value!==null&&Ce.value!==i}]),onClick:p=>Xt(i),onMouseenter:p=>B(i),onMouseleave:W,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:Lt(i)})},null,4),e.createElementVNode("span",ja,e.toDisplayString(n.name),1)],46,Ya))),128))],2)):e.createCommentVNode("",!0)],512),D.showAddMarkerButton&&Ue.value&&Dt.value.addMarker&&(rn.value||Wt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:Sl,title:e.unref(z)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Tn.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,Ga),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,Ka)):e.createCommentVNode("",!0),e.createElementVNode("div",Qa,[Wt.value&&Mt.value?(e.openBlock(),e.createElementBlock("div",Ja,"Bubble size: "+e.toDisplayString(Mt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ne.value,height:pt.value,class:"dss-chart-svg","data-smooth":X.value,"data-animated":x.value,ref_key:"svgEl",ref:Te},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",ts,[e.createElementVNode("rect",{x:0,y:F.value.top,width:Ne.value,height:F.value.height*4},null,8,ns)]),En.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:zl.value},[e.createElementVNode("path",{d:Ml.value},null,8,os)],8,ls)):e.createCommentVNode("",!0),gn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:ul.value},[e.createElementVNode("path",{d:bl.value},null,8,ss)],8,as)):e.createCommentVNode("",!0)]),rn.value||Wt.value?(e.openBlock(),e.createElementBlock("g",rs,[At.value?(e.openBlock(),e.createElementBlock("g",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`h-grid-${i}`,x1:F.value.left,x2:F.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,cs))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",us,[e.createElementVNode("line",{x1:F.value.left,x2:F.value.right,y1:F.value.bottom,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ds),e.createElementVNode("line",{x1:F.value.left,x2:F.value.left,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,ms)]),e.createElementVNode("g",ps,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.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,fs))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Co.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,vs))),128)),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:0,x:F.value.left+F.value.width/2,y:F.value.bottom+45,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333"},e.toDisplayString(Ft.value),9,gs)):e.createCommentVNode("",!0),on.value?(e.openBlock(),e.createElementBlock("text",{key:1,x:15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(-90, 15, ${F.value.top+F.value.height/2})`},e.toDisplayString(on.value),9,hs)):e.createCommentVNode("",!0)]),Al.value.length>0?(e.openBlock(),e.createElementBlock("g",ys,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Al.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",Cs,[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ks)):e.createCommentVNode("",!0),n.hasAuto&&!n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:1,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#0dbf89","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,bs)):e.createCommentVNode("",!0),n.hasAuto&&n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:2,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#047395","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,ws)):e.createCommentVNode("",!0)]),n.hasManual&&n.hasAuto?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:n.x+8,cy:Math.max(15,F.value.top-10),r:"14",fill:"#0dbf89",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>xl(n,i),onMouseleave:Wl},null,40,xs)):e.createCommentVNode("",!0),e.createElementVNode("circle",{cx:n.x,cy:Math.max(15,F.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=>xl(n,i),onMouseleave:Wl},null,40,Es),e.createElementVNode("text",{x:n.x,y:Math.max(15,F.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,Vs)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Ns,[Dn.value?(e.openBlock(),e.createElementBlock("g",Ss,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.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=>hn(n,p),onMouseleave:Fn},null,46,Bs)):(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=>hn(n,p),onMouseleave:Fn},null,46,Ms))],64))),128))],2),e.createElementVNode("g",_s,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,$s))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Ts))),128)),ot.value>0||bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Ho.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Se(n,ot.value)+2:Se(n,ot.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=>hn(n,p),onMouseleave:Fn},null,46,Ls))),128)):e.createCommentVNode("",!0)])])):ge.value==="line"?(e.openBlock(),e.createElementBlock("g",Hs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":dt.value,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":yt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,As))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ko.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Ds))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bo.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+2:dt.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,Rs))),128)),ot.value>0||bt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(Rn.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:n.isHighlighted?Se(n,ot.value)+2:Se(n,ot.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=>hn(n,p),onMouseleave:Fn},null,46,Fs))),128)):e.createCommentVNode("",!0)])):ge.value==="area"?(e.openBlock(),e.createElementBlock("g",Is,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${D.chartId}`},[e.createElementVNode("rect",{x:F.value.left-10,y:F.value.top-10,width:F.value.width+20,height:F.value.height+20,fill:"#fafafa",class:"dss-area-mask-rect",style:e.normalizeStyle({"--dss-mask-width":`${F.value.width+20}px`})},null,12,Ps)],8,zs))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?ut.value+.2:ut.value,mask:`url(#area-mask-${i}-${D.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,Os))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Tl.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?dt.value+1:dt.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*xe.value}ms`})},null,14,Zs))),128))])):ge.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Gt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(wo.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=>hn(n,p),onMouseleave:Fn},null,46,Ws)):(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=>hn(n,p),onMouseleave:Fn},null,46,qs))],64))),128))],2)):e.createCommentVNode("",!0)]),fe.value&&Pe.value.show&&!Z.value.isZooming?(e.openBlock(),e.createElementBlock("g",Us,[e.createElementVNode("line",{x1:Pe.value.x,x2:Pe.value.x,y1:F.value.top,y2:F.value.bottom,stroke:ct.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,Xs),(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:ot.value+2,fill:n.color,stroke:"none",opacity:"0.9"},null,8,Ys))),128))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("g",js,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yn.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Ks,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:n.radius,fill:n.color,"fill-opacity":l(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(c(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>d(n,p),onMouseleave:p=>v(n),onClick:p=>r(n,p)},null,42,Gs),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:a(n)}),onLoad:p=>go(i),onError:p=>$o(i),onMouseenter:p=>d(n,p),onMouseleave:p=>v(n),onClick:p=>r(n,p)},null,46,Qs)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),pn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:po.value},[ge.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:St.value,cy:Nt.value,r:st.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,er)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":ge.value,"clip-path":gl.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xo.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":fo(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=>hn(n.segment,p),onMouseleave:Fn},null,42,nr))),128))],8,tr),fn.value&&Eo.value?(e.openBlock(),e.createElementBlock("g",lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.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,or)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),yl.value&&(Eo.value||En.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:kl.value.x,y:kl.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Cl.value,fill:kn.value,class:"dss-radial-data-center"},e.toDisplayString(Xl.value),9,ar)):e.createCommentVNode("",!0),Po.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Vo.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.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,sr),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,rr),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,ir)],6))),128))],2)):e.createCommentVNode("",!0)],8,Js)):e.createCommentVNode("",!0),On.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:po.value},[At.value?(e.openBlock(),e.createElementBlock("g",ur,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:St.value,cy:Nt.value,r:n,fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,dr))),128)),e.createElementVNode("g",mr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:St.value-16,y:Nt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,pr),e.createElementVNode("text",{x:St.value,y:Nt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Vt(i)),9,fr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:St.value,x2:n.x,y1:Nt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,vr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",gr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/$.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/$.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,hr))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:Jt,onMouseleave:Fn},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(it.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":me("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?dt.value+1:dt.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*xe.value}ms`,transition:"all 0.2s ease"})},null,14,yr),(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:n.isHighlighted?ot.value+1:ot.value>0?ot.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*xe.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:E=>hn(p,E),onMouseleave:Fn},null,46,Cr))),128))]))),128))],32)],8,cr)):e.createCommentVNode("",!0),e.createElementVNode("g",kr,[(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:n.width/2,fill:Lt(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,br))),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=>en(i),onError:p=>tn(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,wr))),128))])],8,es))]),A.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ne.value+"px",height:pt.value+"px",backgroundImage:`url('${sn.value}')`,backgroundRepeat:"no-repeat",...Je.value,opacity:q.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(hl.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:yn.value+"px",height:yn.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Sn(n),["stop"]),onMouseenter:p=>h(n,p),onMouseleave:_},[e.createElementVNode("img",{src:Yl(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Er)],44,xr)),[[e.vShow,zn.value]])),128)),jt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:jt.value.x+"px",top:jt.value.y+"px"})},[e.createElementVNode("div",Vr,e.toDisplayString(jt.value.categoryValue),1),jt.value.description?(e.openBlock(),e.createElementBlock("div",Nr,e.toDisplayString(jt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_e.value&&(Xe.value.show||fe.value&&Pe.value.show&&!Z.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":fe.value&&Pe.value.show&&!Z.value.isZooming}]),style:e.normalizeStyle(jn.value)},[!fe.value||!Pe.value.show||Z.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[On.value&&Xe.value.spiderSeries&&Xe.value.spiderSeries.length>0?(e.openBlock(),e.createElementBlock("div",Sr,[Xe.value.title?(e.openBlock(),e.createElementBlock("div",Br,e.toDisplayString(Xe.value.title),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.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",Mr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",_r,e.toDisplayString(n.value),1)]))),128))])):Wt.value&&Xe.value.bubbleData&&Xe.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",$r,[Xe.value.title?(e.openBlock(),e.createElementBlock("div",Tr,e.toDisplayString(Xe.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.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",Hr,[e.createElementVNode("div",Ar,e.toDisplayString(Xe.value.title),1),e.createElementVNode("div",Dr,e.toDisplayString(Xe.value.value),1)])),Xe.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Fe(Xe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Rr,[s[5]||(s[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Fr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Xe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",Ir,[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",Pr,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Fe(Xe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Or,[s[6]||(s[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Zr,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Xe.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",Wr,[e.createElementVNode("div",qr,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Ur,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",Xr,[e.createElementVNode("div",Yr,e.toDisplayString(Wt.value?m():D.categories[Pe.value.categoryIndex]||`Category ${Pe.value.categoryIndex+1}`),1),Wt.value?(e.openBlock(),e.createElementBlock("div",jr,[(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",Kr,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Gr,e.toDisplayString(un(n.value)),1)]))),128))]),Fe(Pe.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Qr,[s[7]||(s[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Jr,e.toDisplayString(e.unref(z)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(Pe.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",ei,[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",ti,[e.createElementVNode("div",ni,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Fe(Pe.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",li,[s[8]||(s[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",oi,e.toDisplayString(e.unref(z)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(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",ai,[e.createElementVNode("div",si,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),rn.value&&Et.value&&Z.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:Fl},[s[9]||(s[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(Z.value.scale*100))+"% "+e.toDisplayString(e.unref(z)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,Oa),ze.value.show?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-chart-context-menu",style:e.normalizeStyle({left:ze.value.x+"px",top:ze.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:Gl},e.toDisplayString(e.unref(z)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Dt.value.addMarker&&(Dt.value.downloadSvg||Dt.value.downloadPng||Dt.value.downloadCsv||$n.value.length>0)?(e.openBlock(),e.createElementBlock("div",ii)):e.createCommentVNode("",!0),Dt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:tl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Dt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:sl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Dt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:rl},e.toDisplayString(e.unref(z)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),$n.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",ci)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($n.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",ui)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(It(n)),style:e.normalizeStyle(bn(n)),onClick:p=>Bn(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:mn(n),class:"dss-custom-menu-content"},null,8,mi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",pi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,di)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),he.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-marker-modal-overlay",onClick:al},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:s[3]||(s[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",fi,[e.createElementVNode("h3",null,e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.viewMarker"):w.value?e.unref(z)("chart.modalMarker.editMarker"):e.unref(z)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:al},"×")]),e.createElementVNode("div",vi,[e.createElementVNode("div",gi,[e.createVNode(zo,{id:"dss-marker-date",mode:"single",modelValue:he.value.date,"onUpdate:modelValue":s[1]||(s[1]=n=>he.value.date=n),"min-date":Mn.value,"max-date":Dl.value,disabled:y.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",hi,[e.createElementVNode("label",yi,e.toDisplayString(e.unref(z)("chart.modalMarker.description")),1),y.value?(e.openBlock(),e.createElementBlock("div",Ci,e.toDisplayString(he.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":s[2]||(s[2]=n=>he.value.description=n),placeholder:e.unref(z)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,ki)),[[e.vModelText,he.value.description]])])]),e.createElementVNode("div",bi,[e.createElementVNode("div",wi,[w.value&&!y.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:co},e.toDisplayString(e.unref(z)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",xi,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:al},e.toDisplayString(y.value?e.unref(z)("chart.modalMarker.close"):e.unref(z)("chart.modalMarker.cancel")),1),y.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:io,disabled:!(he.value.description&&he.value.description.length)},e.toDisplayString(w.value?e.unref(z)("chart.modalMarker.save"):e.unref(z)("chart.contextMenu.addMarker")),9,Ei))])])])])):e.createCommentVNode("",!0)],64))}}),Si={class:"dss-modal-title"},Bi={class:"dss-modal-actions"},Ao={__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(D,{emit:ke}){const z=D,R=ke,Me=e.ref(null),C=e.ref(null),Te=e.computed(()=>{const S={"max-width":z.width};return z.height!=="auto"&&(S.height=z.height,S["min-height"]="0"),S}),ie=e.computed(()=>({}));function nt(){R("close-modal")}function f(){z.backDrop&&!Me.value&&R("close-modal")}function ue(S){S.target.tagName==="INPUT"&&(Me.value=S.target.tagName)}function ve(){setTimeout(()=>{Me.value=null},300)}function de(){const S=document.body,ae=document.documentElement;C.value={bodyOverflow:S.style.overflow,bodyPosition:S.style.position,bodyTop:S.style.top,bodyWidth:S.style.width,htmlOverflow:ae.style.overflow,scrollY:window.scrollY},S.style.overflow="hidden",S.style.position="fixed",S.style.top=`-${C.value.scrollY}px`,S.style.width="100%",S.style.left="0",ae.style.overflow="hidden"}function te(){if(!C.value)return;const S=document.body,ae=document.documentElement,{bodyOverflow:Ze,bodyPosition:He,bodyTop:Ve,bodyWidth:O,htmlOverflow:lt,scrollY:je}=C.value;S.style.overflow=Ze||"",S.style.position=He||"",S.style.top=Ve||"",S.style.width=O||"",S.style.left="",ae.style.overflow=lt||"",window.scrollTo(0,je||0)}return e.watch(()=>z.showModal,S=>{if(S)de(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.addEventListener("focusin",ue),ae.addEventListener("focusout",ve))},100);else{te(),document.body.classList.remove("dss-modal-open");const ae=document.getElementById("dss-modal-backdrop");ae&&(ae.removeEventListener("focusin",ue),ae.removeEventListener("focusout",ve))}},{immediate:!0}),e.onUnmounted(()=>{z.showModal&&te()}),(S,ae)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:f},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(Te.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ae[0]||(ae[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":D.headerType,"font-size":D.titleSize})},[e.createElementVNode("h1",Si,[e.renderSlot(S.$slots,"title",{},()=>[ae[1]||(ae[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(S.$slots,"title-data"),D.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:nt,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(ie.value)},[e.renderSlot(S.$slots,"content",{},()=>[ae[2]||(ae[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",Bi,[e.renderSlot(S.$slots,"actions")])])],4),[[e.vShow,D.showModal]])])):e.createCommentVNode("",!0)]))}},Mi={key:0,class:"dss-table-toolbar"},_i={class:"dss-table-toolbar-left"},$i=["aria-expanded"],Ti={class:"dss-pagination-select-dropdown",role:"listbox"},Li={class:"dss-table-column-visibility-label"},Hi={class:"dss-table-checkbox-wrapper"},Ai=["checked","onChange"],Di={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ri={class:"dss-table-column-visibility-text"},Fi={class:"dss-table-toolbar-right"},Ii=["placeholder"],zi=["aria-expanded"],Pi={key:1,class:"dss-table-toolbar-extra"},Oi={class:"dss-table-thead"},Zi={key:0,class:"dss-table-th dss-table-selection-column"},Wi={key:0,class:"dss-table-checkbox-wrapper"},qi=["checked","indeterminate"],Ui={key:0,class:"dss-table-checkbox__indeterminate"},Xi={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Yi={key:1,class:"dss-table-th dss-table-expansion-column","aria-label":"Expand row"},ji=["onClick"],Ki={class:"dss-table-th-content"},Gi={class:"dss-table-th-text"},Qi={key:0},Ji={key:1},ec={key:2},tc=["data-filter-column-key","aria-expanded","onClick"],nc={class:"dss-table-tbody"},lc=["onClick"],oc={class:"dss-table-checkbox-wrapper"},ac=["type","name","checked","onChange"],sc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},rc={key:1,class:"dss-table-checkbox__dot"},ic=["onClick"],cc=["aria-expanded","aria-label"],uc={key:0,class:"dss-table-expansion-row"},dc=["colspan"],mc=["colspan"],pc={key:1,class:"dss-table-pagination"},fc={class:"dss-pagination-center"},vc={class:"dss-pagination-controls"},gc=["disabled","title"],hc=["disabled","title"],yc={class:"dss-pagination-pages"},Cc=["onClick"],kc={key:1,class:"dss-pagination-ellipsis"},bc=["disabled","title"],wc=["disabled","title"],xc=["aria-expanded"],Ec={class:"dss-pagination-select-dropdown",role:"listbox"},Vc=["aria-selected","onClick"],Nc={key:0,class:"dss-table-filter-row"},Sc=["value","placeholder"],Bc=["min","max","value"],Mc=["min","max","value"],_c={class:"dss-table-filter-double-range-values"},$c={key:2,class:"dss-table-filter-daterange"},Tc={class:"dss-table-filter-daterange-row"},Lc={class:"dss-table-filter-daterange-label"},Hc=["value"],Ac={class:"dss-table-filter-daterange-row"},Dc={class:"dss-table-filter-daterange-label"},Rc=["value"],Fc=["value","placeholder"],Ic={class:"dss-table-filter-list"},zc=["checked","onChange"],Pc={class:"dss-table-filter-actions"},Oc={name:"DSSTable"},Zc=Object.assign(Oc,{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:D=>typeof D=="object"&&D!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(D,{emit:ke}){const{t:z,locale:R}=no.useI18n(),Me=D,C=ke,Te={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 ie(w,y){const B=Object.assign({},w);return nt(w)&&nt(y)&&Object.keys(y).forEach(W=>{nt(y[W])?W in w?B[W]=ie(w[W],y[W]):Object.assign(B,{[W]:y[W]}):Object.assign(B,{[W]:y[W]})}),B}function nt(w){return w&&typeof w=="object"&&!Array.isArray(w)}const f=e.computed(()=>ie(Te,Me.options)),ue=e.computed(()=>{const w=f.value.table.width;return w==="auto"?null:typeof w=="number"?w:null}),ve=e.computed(()=>f.value.table.height),de=e.computed(()=>f.value.table.rowHeight??"auto"),te=e.computed(()=>({height:de.value})),S=e.computed(()=>f.value.table.expandable===!0),ae=e.computed(()=>f.value.table.truncated===!0),Ze=e.computed(()=>f.value.table.striped),He=e.computed(()=>f.value.table.bordered),Ve=e.computed(()=>f.value.table.hoverable),O=e.computed(()=>f.value.table.size),lt=e.computed(()=>f.value.table.align||"left");e.computed(()=>f.value.title.text),e.computed(()=>f.value.subtitle.text);const je=e.computed(()=>f.value.selection.enabled),Ne=e.computed(()=>f.value.selection.mode),Ht=e.computed(()=>f.value.sorting.enabled),Bt=e.computed(()=>f.value.sorting.mode),pt=e.computed(()=>f.value.pagination.enabled),Re=e.computed(()=>f.value.pagination.rows),ge=e.computed(()=>f.value.pagination.rowsPerPageOptions),gt=e.computed(()=>f.value.scrollable),wt=e.computed(()=>f.value.emptyMessage),tt=e.computed(()=>f.value.toolbar?.downloads?.pdf!==!1),Mt=e.computed(()=>f.value.toolbar?.downloads?.excel!==!1),Ft=e.computed(()=>f.value.toolbar?.search!==!1),on=e.computed(()=>tt.value||Mt.value||Ft.value||xt.value),xt=e.computed(()=>f.value.toolbar?.columnVisibility!==!1),Ke=e.ref(""),Ge=e.ref(!1),Zt=e.ref(null);let At=null;function _t(){Ge.value?(At&&(clearTimeout(At),At=null),Ge.value=!1,Ke.value="",C("search",""),Zt.value?.blur()):(Ge.value=!0,At=setTimeout(()=>{At=null,Zt.value?.focus()},80))}function U(){Ke.value||(Ge.value=!1)}function Ie(){Ke.value="",C("search",""),Zt.value?.focus()}const _e=e.computed(()=>({"dss-table-striped":Ze.value,"dss-table-bordered":He.value,"dss-table-hoverable":Ve.value,[`dss-table-${O.value}`]:O.value!=="default","dss-table-truncated":ae.value})),fe=(w,y)=>w?.field??w?.key??y,ct=e.ref(new Set);function Et(){const w=new Set;Me.columns.forEach((y,B)=>{y?.hidden!==!0&&w.add(fe(y,B))}),ct.value=w}const We=e.computed(()=>Me.columns.filter((w,y)=>ct.value.has(fe(w,y)))),ft=w=>{const y=Me.columns.findIndex(B=>B===w);return fe(w,y>=0?y:0)},dt=(w,y)=>ct.value.has(fe(w,y));function $t(w,y){const B=fe(w,y),W=new Set(ct.value);W.has(B)?W.delete(B):W.add(B),ct.value=W}const ot=e.ref(null),bt=e.ref(!1);function Se(w){ot.value&&!ot.value.contains(w.target)&&(bt.value=!1)}const ut=e.computed(()=>We.value.length+(je.value?1:0)+(S.value?1:0)),X=(w,y)=>w?.id??w?.key??y,j=e.ref(new Set),Q=e.ref(null),re=(w,y)=>j.value.has(X(w,y)),x=(w,y,B)=>{B&&B.stopPropagation();const W=X(w,y),se=new Set(j.value);se.has(W)?(se.delete(W),C("row-collapse",{data:w,index:y})):(se.add(W),C("row-expand",{data:w,index:y})),j.value=se},k=(w,y)=>{if(!ae.value)return;const B=X(w,y);Q.value!==B&&(Q.value=B)},V=e.ref(null),P=e.ref(0),Y=e.ref([]),xe=w=>{if(Bt.value==="single")return V.value===w.field?P.value:0;{const y=Y.value.find(B=>B.field===w.field);return y?y.order:0}},Ye=w=>{const y=xe(w);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},Le=e.ref({}),le=e.ref(null),Qe=e.ref(null),qe=220,Vt=e.ref(null),vt=e.computed(()=>We.value.find(w=>ft(w)===le.value)??null),Ue=e.computed(()=>{if(!vt.value||vt.value.filter!=="range")return null;const w=vt.value,y=le.value,{min:B,max:W}=I(w),se=w.filterMin??B,mt=w.filterMax??W,et=cn(y),ht=et.min??se,mn=et.max??mt,It=mt-se,bn=It===0?0:(ht-se)/It*100,Yl=It===0?100:(mn-se)/It*100;return{rangeMin:se,rangeMax:mt,currentMin:ht,currentMax:mn,minPct:bn,maxPct:Yl}}),Dt=e.ref(null),$n=e.ref("max");function Tn(w){const y=Dt.value,B=Ue.value;if(!y||!B)return;const W=y.getBoundingClientRect(),mt=(w.clientX-W.left)/W.width*100,et=(B.minPct+B.maxPct)/2;$n.value=mt<et?"min":"max"}function cn(w){return Le.value[w]??{}}function yn(w,y){Le.value={...Le.value,[w]:y}}function an(w){const y=Le.value[w];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function un(w){const y={...Le.value};delete y[w],Le.value=y,le.value=null,Qe.value=null}function zn(){if(!le.value){Qe.value=null;return}const w=Vt.value;if(!w)return;const y=w.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${le.value}"]`);if(!y)return;const B=y.getBoundingClientRect();Qe.value={top:B.bottom+6,left:Math.max(8,B.right-qe)}}const Ln=e.computed(()=>{let w=[...Me.data];const y=(Ke.value??"").trim().toLowerCase();return y&&(w=w.filter(B=>Me.columns.some(W=>{if(!W||!W.field)return!1;const se=Tt(B,W);return String(se??"").toLowerCase().includes(y)}))),We.value.forEach(B=>{const W=ft(B),se=Le.value[W];if(!se)return;const mt=B.field;if(mt){if(se.type==="string"&&se.value?.trim()){const et=se.value.trim().toLowerCase();w=w.filter(ht=>{const mn=Tt(ht,B);return String(mn??"").toLowerCase().includes(et)})}else if(se.type==="range")w=w.filter(et=>{const ht=he(et,mt),mn=Number(ht);return!(Number.isNaN(mn)||se.min!=null&&mn<se.min||se.max!=null&&mn>se.max)});else if(se.type==="dateRange"){const et=se.from?new Date(se.from).getTime():null,ht=se.to?new Date(se.to).getTime():null;w=w.filter(mn=>{const It=he(mn,mt),bn=It?new Date(It).getTime():NaN;return!(Number.isNaN(bn)||et!=null&&bn<et||ht!=null&&bn>ht)})}else if(se.type==="list"&&se.selected?.length){const et=new Set(se.selected);w=w.filter(ht=>{const mn=Tt(ht,B);return et.has(mn!=null?String(mn):"")})}}}),w});function hl(w){const y=new Set;return Me.data.forEach(B=>{const W=Tt(B,w);y.add(W!=null?String(W):"")}),Array.from(y).sort((B,W)=>String(B).localeCompare(String(W)))}function A(w,y){if(le.value===w){le.value=null,Qe.value=null;return}if(le.value=w,y?.currentTarget){const B=y.currentTarget.getBoundingClientRect();Qe.value={top:B.bottom+6,left:Math.max(8,B.right-qe)}}else zn()}function q(w,y){yn(w,{type:"string",value:y})}function I(w){const y=w.field;if(!y)return{min:0,max:100};let B=1/0,W=-1/0;return Me.data.forEach(se=>{const mt=he(se,y),et=Number(mt);Number.isNaN(et)||(B=Math.min(B,et),W=Math.max(W,et))}),{min:B===1/0?0:B,max:W===-1/0?100:W}}function ne(w,y,B){const W={...cn(w),type:"range"},se=B===""?null:Number(B),mt=se===null||Number.isNaN(se)?null:se;W[y]=mt,mt!=null&&(y==="min"&&W.max!=null&&mt>W.max&&(W.max=mt),y==="max"&&W.min!=null&&mt<W.min&&(W.min=mt)),yn(w,W)}function Be(w,y,B){const W={...cn(w),type:"dateRange"};W[y]=B||"",yn(w,W)}const Je=e.reactive({});function rt(w,y){Je[w]=y}function Fe(w){const y=ft(w),B=(Je[y]??"").trim().toLowerCase(),W=hl(w);return B?W.filter(se=>String(se).toLowerCase().includes(B)):W}function at(w,y){return(cn(w).selected??[]).includes(y!=null?String(y):"")}function sn(w,y){const W=[...cn(w).selected??[]],se=y!=null?String(y):"",mt=W.indexOf(se);mt>=0?W.splice(mt,1):W.push(se),yn(w,{type:"list",selected:W})}function Nn(w){le.value&&!w.target.closest(".dss-table-filter-wrap")&&!w.target.closest(".dss-table-filter-dropdown")&&(le.value=null,Qe.value=null)}function nn(){zn()}const Hn=w=>{if(!(w.sortable===!1||!Ht.value))if(Bt.value==="single")V.value===w.field?P.value=P.value===1?-1:P.value===-1?0:1:(V.value=w.field,P.value=1),P.value===0&&(V.value=null),C("sort",{field:V.value,order:P.value});else{const y=Y.value.findIndex(B=>B.field===w.field);y>=0?Y.value[y].order===1?Y.value[y].order=-1:Y.value.splice(y,1):Y.value.push({field:w.field,order:1}),C("sort",{multiSortMeta:Y.value})}},Cn=e.computed(()=>{if(!Ht.value)return Ln.value;let w=[...Ln.value];return Bt.value==="single"&&V.value&&P.value!==0?w.sort((y,B)=>{const W=he(y,V.value),se=he(B,V.value);return W===se?0:W==null?1:se==null?-1:(W<se?-1:W>se?1:0)*P.value}):Bt.value==="multiple"&&Y.value.length>0&&w.sort((y,B)=>{for(const W of Y.value){const se=he(y,W.field),mt=he(B,W.field);if(se===mt)continue;if(se==null)return 1;if(mt==null)return-1;const et=se<mt?-1:se>mt?1:0;if(et!==0)return et*W.order}return 0}),w}),dn=e.ref(0),fn=e.ref(Re.value),Pn=e.ref(!1),yl=e.ref(null),Xl=w=>{fn.value=w,Pn.value=!1,dn.value=0,C("page",{page:0,rows:fn.value})};function Cl(w){yl.value&&!yl.value.contains(w.target)&&(Pn.value=!1)}const kl=e.computed(()=>Cn.value.length),kn=e.computed(()=>Math.ceil(kl.value/fn.value)),vn=e.computed(()=>pt.value?dn.value*fn.value:0),Al=e.computed(()=>pt.value?Math.min((dn.value+1)*fn.value,kl.value):kl.value),ol=e.computed(()=>{if(!pt.value)return Cn.value;const w=vn.value,y=Al.value;return Cn.value.slice(w,y)}),An=e.ref(new Set),fl=e.computed(()=>Cn.value.filter((w,y)=>An.value.has(X(w,y)))),Vl=e.computed(()=>{const w=Cn.value.length;return w>0&&An.value.size===w}),Rt=e.computed(()=>{const w=Cn.value.length,y=An.value.size;return y>0&&y<w}),Ce=(w,y)=>An.value.has(X(w,y)),Nl=()=>{if(Vl.value)An.value=new Set,C("unselect-all");else{const w=new Set;Cn.value.forEach((y,B)=>w.add(X(y,B))),An.value=w,C("select-all",fl.value)}},Xe=(w,y)=>{const B=X(w,y),W=new Set(An.value),se=W.has(B);Ne.value==="single"?se?(W.delete(B),C("row-unselect",w)):(W.clear(),W.add(B),C("row-select",w)):se?(W.delete(B),C("row-unselect",w)):(W.add(B),C("row-select",w)),An.value=W},jt=e.computed(()=>{const w=kn.value,y=dn.value+1,B=2,W=[],se=[];let mt;for(let et=1;et<=w;et++)(et===1||et===w||et>=y-B&&et<=y+B)&&W.push(et);for(const et of W)mt&&(et-mt===2?se.push(mt+1):et-mt!==1&&se.push("...")),se.push(et),mt=et;return se}),Pe=w=>{w<0||w>=kn.value||(dn.value=w,C("page",{page:w,rows:fn.value}))},ze=(w,y,B)=>{C("row-click",{data:w,index:y,originalEvent:B}),k(w,vn.value+y)},Z=(w,y)=>{const B=vn.value+y;return{"dss-table-row-selected":Ce(w,B),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":ae.value,"dss-table-row-truncated-expanded":Q.value===X(w,B)}},Tt=(w,y)=>y.field?he(w,y.field):"",he=(w,y)=>y.split(".").reduce((B,W)=>B&&B[W],w),Mn=w=>{const y=w.align??lt.value;return{"dss-table-sortable":w.sortable!==!1&&Ht.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[w.className]:w.className}},Dl=w=>{const y={};return w.width&&(y.width=typeof w.width=="number"?`${w.width}px`:w.width),w.minWidth&&(y.minWidth=typeof w.minWidth=="number"?`${w.minWidth}px`:w.minWidth),w.maxWidth&&(y.maxWidth=typeof w.maxWidth=="number"?`${w.maxWidth}px`:w.maxWidth),y};return e.watch(()=>Me.locale,w=>{w&&w!==R.value&&(R.value=w)},{immediate:!0}),e.watch(Re,w=>{fn.value=w,dn.value=0}),e.watch(Ke,w=>{C("search",w??"")}),e.watch(()=>Me.columns,()=>{Et()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Cl),document.addEventListener("click",Se),document.addEventListener("click",Nn),window.addEventListener("resize",nn),window.addEventListener("scroll",nn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Cl),document.removeEventListener("click",Se),document.removeEventListener("click",Nn),window.removeEventListener("resize",nn),window.removeEventListener("scroll",nn,!0)}),(w,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Vt,style:e.normalizeStyle({width:ue.value+"px",height:ve.value?ve.value+"px":"auto"})},[on.value?(e.openBlock(),e.createElementBlock("div",Mi,[e.createElementVNode("div",_i,[tt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=B=>C("download-pdf"))},[y[21]||(y[21]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Mt.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=B=>C("download-excel"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(z)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),xt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:ot},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":bt.value}]),onClick:y[2]||(y[2]=B=>bt.value=!bt.value),"aria-expanded":bt.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(z)("table.columnVisibility"))+" ",1),y[23]||(y[23]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,$i),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ti,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,(B,W)=>(e.openBlock(),e.createElementBlock("li",{key:fe(B,W),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",Li,[e.createElementVNode("span",Hi,[e.createElementVNode("input",{type:"checkbox",checked:dt(B,W),onChange:se=>$t(B,W),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,Ai),dt(B,W)?(e.openBlock(),e.createElementBlock("span",Di,[...y[24]||(y[24]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",Ri,e.toDisplayString(B.header),1)])]))),128))],512),[[e.vShow,bt.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Fi,[Ft.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Ge.value||Ke.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Zt,"onUpdate:modelValue":y[4]||(y[4]=B=>Ke.value=B),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(z)("table.searchPlaceholder"),"aria-label":"Search table",onFocus:y[5]||(y[5]=B=>Ge.value=!0),onBlur:U},null,40,Ii),[[e.vModelText,Ke.value]]),Ke.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":"Clear search",onClick:Ie},[...y[25]||(y[25]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])])):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":"Search","aria-expanded":Ge.value||!!Ke.value,onMousedown:e.withModifiers(_t,["prevent"])},[...y[26]||(y[26]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,zi)],2)):e.createCommentVNode("",!0),w.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",Pi,[e.renderSlot(w.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":gt.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",_e.value])},[e.createElementVNode("thead",Oi,[e.createElementVNode("tr",null,[je.value?(e.openBlock(),e.createElementBlock("th",Zi,[Ne.value==="multiple"?(e.openBlock(),e.createElementBlock("span",Wi,[e.createElementVNode("input",{type:"checkbox",checked:Vl.value,indeterminate:Rt.value,onChange:Nl,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,qi),Rt.value?(e.openBlock(),e.createElementBlock("span",Ui)):Vl.value?(e.openBlock(),e.createElementBlock("span",Xi,[...y[27]||(y[27]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("th",Yi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(B,W)=>(e.openBlock(),e.createElementBlock("th",{key:ft(B),class:e.normalizeClass(["dss-table-th",Mn(B)]),style:e.normalizeStyle(Dl(B)),onClick:se=>Hn(B)},[e.createElementVNode("div",Ki,[e.createElementVNode("span",Gi,e.toDisplayString(B.header),1),B.sortable!==!1&&Ht.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ye(B)])},[xe(B)===0?(e.openBlock(),e.createElementBlock("span",Qi,[...y[28]||(y[28]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):xe(B)===1?(e.openBlock(),e.createElementBlock("span",Ji,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):xe(B)===-1?(e.openBlock(),e.createElementBlock("span",ec,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),B.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":le.value===ft(B)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":an(ft(B))}]),"data-filter-column-key":ft(B),"aria-expanded":le.value===ft(B),"aria-label":"Filter column",onClick:se=>A(ft(B),se)},[...y[31]||(y[31]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,tc)],2)):e.createCommentVNode("",!0)])],14,ji))),128))])]),e.createElementVNode("tbody",nc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ol.value,(B,W)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:X(B,vn.value+W)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",Z(B,W)]),style:e.normalizeStyle(te.value),onClick:se=>ze(B,W,se)},[je.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",oc,[e.createElementVNode("input",{type:Ne.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${D.tableId}`,checked:Ce(B,vn.value+W),onChange:se=>Xe(B,vn.value+W),class:e.normalizeClass(["dss-table-checkbox",Ne.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,ac),Ne.value==="multiple"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",sc,[...y[32]||(y[32]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ne.value==="single"&&Ce(B,vn.value+W)?(e.openBlock(),e.createElementBlock("span",rc)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),S.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(se=>x(B,vn.value+W,se),["stop"])},[e.createElementVNode("button",{type:"button",class:"dss-table-expansion-trigger","aria-expanded":re(B,vn.value+W),"aria-label":re(B,vn.value+W)?"Collapse row":"Expand row"},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":re(B,vn.value+W)}]),"aria-hidden":"true"},[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,cc)],8,ic)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,(se,mt)=>(e.openBlock(),e.createElementBlock("td",{key:ft(se),class:e.normalizeClass(["dss-table-td",Mn(se)]),style:e.normalizeStyle(Dl(se))},[e.renderSlot(w.$slots,`cell-${se.field}`,{data:B,column:se,rowIndex:W},()=>[e.createTextVNode(e.toDisplayString(Tt(B,se)),1)])],6))),128))],14,lc),S.value&&re(B,vn.value+W)?(e.openBlock(),e.createElementBlock("tr",uc,[e.createElementVNode("td",{colspan:ut.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(w.$slots,"expansion",{data:B,rowIndex:W})],8,dc)])):e.createCommentVNode("",!0)],64))),128)),ol.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(te.value)},[e.createElementVNode("td",{colspan:ut.value,class:"dss-table-empty-cell"},[e.renderSlot(w.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(wt.value),1)])],8,mc)],4))])],2)],2),pt.value?(e.openBlock(),e.createElementBlock("div",pc,[e.createElementVNode("div",fc,[e.createElementVNode("div",vc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[8]||(y[8]=B=>Pe(0)),title:e.unref(z)("table.firstPage")},[...y[34]||(y[34]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,gc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value===0,onClick:y[9]||(y[9]=B=>Pe(dn.value-1)),title:e.unref(z)("table.previousPage")}," ‹ ",8,hc),e.createElementVNode("span",yc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jt.value,B=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:B},[B!=="..."?(e.openBlock(),e.createElementBlock("button",{key:0,class:e.normalizeClass(["dss-pagination-page",{"dss-active":B===dn.value+1}]),onClick:W=>Pe(B-1)},e.toDisplayString(B),11,Cc)):(e.openBlock(),e.createElementBlock("span",kc,"..."))],64))),128))]),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[10]||(y[10]=B=>Pe(dn.value+1)),title:e.unref(z)("table.nextPage")}," › ",8,bc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:dn.value>=kn.value-1,onClick:y[11]||(y[11]=B=>Pe(kn.value-1)),title:e.unref(z)("table.lastPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,wc)]),e.createElementVNode("div",{class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:yl},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Pn.value}]),onClick:y[12]||(y[12]=B=>Pn.value=!Pn.value),"aria-expanded":Pn.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(fn.value)+" ",1),y[36]||(y[36]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,xc),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",Ec,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,B=>(e.openBlock(),e.createElementBlock("li",{key:B,role:"option","aria-selected":B===fn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":B===fn.value}]),onClick:W=>Xl(B)},e.toDisplayString(B),11,Vc))),128))],512),[[e.vShow,Pn.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(Qe.value?{top:Qe.value.top+"px",left:Qe.value.left+"px",width:qe+"px"}:void 0),onClick:y[20]||(y[20]=e.withModifiers(()=>{},["stop"]))},[vt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[vt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",Nc,[e.createElementVNode("input",{type:"text",value:cn(le.value).value??"",onInput:y[13]||(y[13]=B=>q(le.value,B.target.value)),class:"dss-table-filter-input",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Sc)])):vt.value.filter==="range"&&Ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ue.value.minPct+"%","--range-max-pct":Ue.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Dt,class:"dss-table-filter-double-range-track",onMousemove:Tn,onMouseenter:Tn},[e.createElementVNode("input",{type:"range",min:Ue.value.rangeMin,max:Ue.value.rangeMax,value:Ue.value.currentMin,onInput:y[14]||(y[14]=B=>ne(le.value,"min",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:$n.value==="min"?2:1})},null,44,Bc),e.createElementVNode("input",{type:"range",min:Ue.value.rangeMin,max:Ue.value.rangeMax,value:Ue.value.currentMax,onInput:y[15]||(y[15]=B=>ne(le.value,"max",B.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:$n.value==="max"?2:1})},null,44,Mc)],544),e.createElementVNode("div",_c,e.toDisplayString(Ue.value.currentMin)+" – "+e.toDisplayString(Ue.value.currentMax),1)],4)):vt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",$c,[e.createElementVNode("div",Tc,[e.createElementVNode("label",Lc,e.toDisplayString(e.unref(z)("table.filterFrom")||"From:"),1),e.createElementVNode("input",{type:"date",value:cn(le.value).from??"",onInput:y[16]||(y[16]=B=>Be(le.value,"from",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Hc)]),e.createElementVNode("div",Ac,[e.createElementVNode("label",Dc,e.toDisplayString(e.unref(z)("table.filterTo")||"To:"),1),e.createElementVNode("input",{type:"date",value:cn(le.value).to??"",onInput:y[17]||(y[17]=B=>Be(le.value,"to",B.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,Rc)])])):vt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:Je[le.value]??"",onInput:y[18]||(y[18]=B=>rt(le.value,B.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(z)("table.search")||"Search..."},null,40,Fc),e.createElementVNode("div",Ic,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe(vt.value),B=>(e.openBlock(),e.createElementBlock("label",{key:B,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:at(le.value,B),onChange:W=>sn(le.value,B)},null,40,zc),e.createElementVNode("span",null,e.toDisplayString(B),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",Pc,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[19]||(y[19]=B=>un(le.value))},e.toDisplayString(e.unref(z)("table.clearFilter")||"Clear"),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,le.value&&vt.value&&Qe.value]])]),_:1})]))],64))}}),Wc={class:"dss-toolbar-left"},qc=["title"],Uc=["title"],Xc={class:"dss-toolbar-dropdown-wrapper"},Yc=["title"],jc={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"},Kc={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"},Gc={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"},Qc={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"},Jc={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"},eu={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"},tu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},nu=["title"],lu=["title"],ou=["title"],au=["title"],su=["title"],ru=["title"],iu=["title"],cu=["title"],uu=["title"],du={key:2,class:"dss-toolbar-separator"},mu=["title"],pu={key:4,class:"dss-toolbar-separator"},fu={key:5,class:"dss-toolbar-dropdown-wrapper"},vu=["title"],gu={class:"dss-toolbar-dropdown-ai"},hu={class:"dss-toolbar-right"},yu={key:0,class:"dss-toolbar-custom-group"},Cu={key:1,class:"dss-toolbar-separator"},ku={class:"dss-link-modal-content"},bu={class:"dss-link-modal-field"},wu={class:"dss-link-modal-label"},xu=["placeholder"],Eu={class:"dss-link-modal-field"},Vu={class:"dss-link-modal-label"},Nu=["placeholder"],Su={class:"dss-image-modal-tabs"},Bu={key:0,class:"dss-image-tab-content"},Mu={class:"dss-link-modal-content"},_u={class:"dss-link-modal-field"},$u={key:0,class:"dss-link-modal-label"},Tu=["src"],Lu={class:"dss-link-modal-field"},Hu={class:"dss-link-modal-label"},Au=["placeholder"],Du={class:"dss-link-modal-field"},Ru={class:"dss-link-modal-label"},Fu=["placeholder"],Iu={class:"dss-link-modal-field"},zu={class:"dss-link-modal-label"},Pu=["placeholder"],Ou={key:1,class:"dss-image-tab-content"},Zu={class:"dss-link-modal-content"},Wu={class:"dss-link-modal-field"},qu={class:"dss-link-modal-label"},Uu=["placeholder"],Xu={class:"dss-link-modal-field"},Yu={class:"dss-link-modal-label"},ju=["placeholder"],Ku={class:"dss-link-modal-field"},Gu={class:"dss-link-modal-label"},Qu=["placeholder"],Ju={class:"dss-link-modal-field"},ed={class:"dss-link-modal-label"},td=["placeholder"],nd={class:"dss-text-editor-title-input-container"},ld={key:0,class:"dss-text-editor-title-preview"},od={key:0},ad={key:1,class:"dss-text-editor-preview-placeholder"},sd=["value","placeholder","disabled"],rd={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},id={class:"dss-text-editor-description-input-container"},cd={key:0,class:"dss-text-editor-description-preview"},ud={key:0},dd={key:1,class:"dss-text-editor-preview-placeholder"},md=["value","placeholder","disabled"],pd={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},fd=["data-comment-id","onMouseenter"],vd=["onClick"],gd=["src","alt"],hd={key:1},yd=["onClick"],Cd=["src","alt"],kd={key:1},bd=["data-has-second-user","onClick"],wd={class:"editor-comment-marker-count"},xd={key:4,class:"dss-text-editor-textarea-wrapper"},Ed=["value","placeholder","rows","disabled"],Vd={class:"dss-text-editor-footer"},Nd={class:"dss-text-editor-footer-content"},Sd={class:"dss-text-editor-footer-stat"},Bd={class:"dss-text-editor-footer-stat"},Md={key:5,class:"dss-text-editor-content-wrapper"},_d={key:0,class:"dss-comment-overlay-body"},$d={class:"dss-comment-selection-wrapper"},Td=["innerHTML"],Ld={class:"dss-comment-messages-wrapper"},Hd={key:0,class:"dss-comment-avatar-wrapper"},Ad={class:"dss-comment-avatar"},Dd=["src","alt"],Rd={key:1},Fd={class:"dss-comment-header"},Id={class:"dss-comment-header-text"},zd={class:"dss-comment-author"},Pd={key:0,class:"dss-comment-date"},Od=["onClick","title"],Zd={class:"dss-comment-overlay-inner"},Wd=["placeholder","onKeydown"],qd={class:"dss-text-editor-footer"},Ud={class:"dss-text-editor-footer-content"},Xd={class:"dss-text-editor-footer-stat"},Yd={class:"dss-text-editor-footer-stat"},jd=["title"],Kd=["title"],Gd={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:""},Qd={class:"dss-image-popup-content"},Jd={key:0,class:"dss-image-popup-no-alt-icon"},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-toolbar-left"},o1=["title"],a1=["title"],s1={class:"dss-toolbar-dropdown-wrapper"},r1=["title"],i1={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"},c1={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"},u1={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"},d1={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"},m1={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"},p1={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"},f1={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},v1=["title"],g1=["title"],h1=["title"],y1=["title"],C1=["title"],k1=["title"],b1=["title"],w1=["title"],x1=["title"],E1=["title"],V1={key:2,class:"dss-toolbar-separator"},N1={key:3,class:"dss-toolbar-dropdown-wrapper"},S1=["title"],B1={class:"dss-toolbar-dropdown-ai"},M1={key:0,class:"dss-toolbar-right"},_1={key:0,class:"dss-toolbar-separator"},$1={key:0,class:"dss-toolbar-custom-group"},T1={key:1,class:"dss-toolbar-separator"},L1={name:"DSSTextEditor"},H1=Object.assign(L1,{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:D=>typeof D=="object"&&D!==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:D=>typeof D=="object"&&D!==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(D,{expose:ke,emit:z}){const{t:R,locale:Me}=no.useI18n(),C=D,Te=z,ie=e.useSlots(),nt=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
99
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
100
|
-
</svg>`,v=e.ref(null),fe=e.ref(null),Te=e.ref(!1),ge=e.ref(!1),Q=e.ref(!1),V=e.ref(""),ue=e.ref({}),Ke=e.ref(!1),Me=e.ref(!1),he=e.ref(""),F=e.ref(""),lt=e.ref(null),ut=e.ref(null),ke=e.ref(null),$t=e.ref(null),Nt=e.ref(""),st=e.ref(!1),He=e.ref({}),ve=e.ref(!1),Mt=e.ref({}),ht=e.ref(null),Ue=e.ref(null),Dt=e.ref(!1),Rt=e.ref(""),mn=e.ref(null),vt=e.ref(""),Ge=e.ref(""),Ze=e.ref(""),en=e.ref(null),It=e.ref(null),Bt=e.ref(null),O=e.ref(null),Ae=e.ref(null),xe=e.ref(!1),ae=e.ref(""),et=e.ref({}),Ct=e.ref(!1),Fe=e.ref("upload"),at=e.ref(""),nt=e.ref(null),xt=e.ref(null),Qe=e.ref([]),mt=e.ref([]),ye=e.ref(null),ot=e.ref(!1),Z=e.ref(""),q=e.ref(""),Y=e.ref(""),ee=e.ref(""),Ee=e.ref(""),je=e.ref(""),Se=e.ref(null),ze=e.ref(null),ft=e.ref(null),Et=e.ref(!1),Ft=e.ref(null),Zt=e.ref(!1),Ie=e.ref(!1),yt=e.ref(null),kt=e.ref("p"),Mn=e.ref(!1),qt=e.ref([]),Vt=e.ref(null),Lt=e.ref(null),Tn=e.ref(null),$n=e.ref(!1),sn=e.ref(0),hn=100,on=e.ref(null),rn=e.computed(()=>({"dss-text-editor-no-border":!y.border,"dss-text-editor-rounded":y.rounded,"dss-text-editor-full-height":y.fullHeight,"dss-comment-overlay-open":Yt.value!==null})),zn=e.computed(()=>({})),Ln=e.computed(()=>!y.fixedHeight||y.fullHeight?{}:{height:`${1.6*14*y.rows+24+2}px`,resize:"none",overflowY:"auto"}),Co=e.computed(()=>!y.fixedHeight||y.fullHeight?{}:{height:`${1.6*14*y.rows+32}px`,overflowY:"auto"}),$=e.computed(()=>y.richText&&mt.value.length>0),P=e.computed(()=>{if(!y.modelValue)return"";if(y.richText){let l=y.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return l=l.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),l=l.replace(/<[^>]+>/g,""),l=l.replace(/ /g," "),l=l.replace(/&/g,"&"),l=l.replace(/</g,"<"),l=l.replace(/>/g,">"),l=l.replace(/"/g,'"'),l=l.replace(/'/g,"'"),l=l.replace(/\s+/g," ").trim(),l}return y.modelValue}),A=e.computed(()=>{const l=P.value.trim();return l?l.split(/\s+/).filter(o=>o.length>0).length:0}),K=e.computed(()=>P.value.length),Ce=e.computed(()=>O.value!==null&&Fe.value==="upload"&&vt.value&&vt.value.startsWith("data:")),Pe=e.computed(()=>y.titlePlaceholder||I("textEditor.placeholders.title")),Xe=e.computed(()=>y.descriptionPlaceholder||I("textEditor.placeholders.description")),Be=e.computed(()=>y.placeholder||I("textEditor.placeholders.startTyping")),We=l=>ne&&ne[l]!==void 0,ln=l=>{for(let o=l+1;o<y.customToolbarSlots.length;o++)if(We(y.customToolbarSlots[o]))return!0;return!1},Vn=l=>{for(let o=l+1;o<y.customToolbarSlots.length;o++){const a=y.customToolbarSlots[o];if(We(a)&&tn(a))return!0}return!1},tn=l=>y.customToolbarFloatingMap.hasOwnProperty(l)?y.customToolbarFloatingMap[l]===!0:!0,Hn=e.computed(()=>y.customToolbarSlots.some(l=>We(l)&&tn(l))),Cn=e.computed(()=>We("title-slot")),cn=e.computed(()=>We("description-slot")),pn=l=>{if(!l||l.trim()==="")return"<html></html>";const o=l.trim();return o.startsWith("<html>")&&o.endsWith("</html>")?l:`<html>${l}</html>`},Pn=l=>{if(!l||l.trim()==="")return"";const o=l.replace(/<!--[\s\S]*?-->/g,""),a=o.trim();return a.startsWith("<html>")&&a.endsWith("</html>")?a.slice(6,-7).trim():o},yo=l=>{if(!l)return;const o=document.createTreeWalker(l,NodeFilter.SHOW_COMMENT,null,!1),a=[];let r=o.nextNode();for(;r;)a.push(r),r=o.nextNode();a.forEach(c=>c.remove())},Yo=l=>{try{const o=String(l.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][l.getMonth()],c=l.getFullYear();return`${o} ${r} ${c}`}catch{return""}},ko=l=>{if(!l||typeof l!="string")return!1;const o=l.trim();if(!o)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(o))return!0;try{const c=I("textEditor.started_conversation");if(c&&o===c)return!0}catch{}const r=o.toLowerCase();return r.includes("started conversation")||r.includes("démarré la conversation")||r==="started conversation"||r==="a démarré la conversation"},bo=l=>{const o=l.target.value;_e("update:modelValue",o),_e("change",o)},yn=()=>{if(!Se.value)return;const l=Se.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const c=l.scrollHeight;l.value=r,l.style.setProperty("height",`${c}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},vn=()=>{Zt.value=!0,yn()},Do=()=>{Zt.value=!1,lo()},lo=()=>{if(!Se.value)return;const l=Se.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},An=l=>{const a=l.target.value;Zt.value&&yn(),_e("update:title",a),_e("title-change",a),ft.value="title",y.richText&&(ot.value||(q.value=Z.value,Ee.value=Y.value,je.value=ee.value),ye.value&&clearTimeout(ye.value),ot.value=!0,ye.value=setTimeout(()=>{ot.value=!1,$e()},500))},fo=()=>{if(!ze.value)return;const l=ze.value;if(l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important"),l.value.trim()===""){const r=l.value;l.value="M";const c=l.scrollHeight;l.value=r,l.style.setProperty("height",`${c}px`,"important"),l.style.setProperty("overflow-y","hidden","important");return}l.offsetHeight;const a=l.scrollHeight;l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important")},So=()=>{Ie.value=!0,fo()},St=()=>{Ie.value=!1,ie()},ie=()=>{if(!ze.value)return;const l=ze.value;l.style.setProperty("text-overflow","","important"),l.style.setProperty("white-space","","important"),l.style.setProperty("overflow-x","","important"),l.style.setProperty("height","auto","important");const o=l.value;l.value="M";const a=l.scrollHeight;l.value=o,l.offsetHeight,l.style.setProperty("height",`${a}px`,"important"),l.style.setProperty("overflow-y","hidden","important"),l.style.setProperty("overflow-x","hidden","important"),l.style.setProperty("text-overflow","ellipsis","important"),l.style.setProperty("white-space","nowrap","important")},No=l=>{const a=l.target.value;Ie.value&&fo(),_e("update:description",a),_e("description-change",a),ft.value="description",y.richText&&(ot.value||(q.value=Z.value,Ee.value=Y.value,je.value=ee.value),ye.value&&clearTimeout(ye.value),ot.value=!0,ye.value=setTimeout(()=>{ot.value=!1,$e()},500))},Re=()=>{const l=window.getSelection();if(l.rangeCount===0)return null;const o=l.getRangeAt(0);if(o.startContainer.nodeType===1)return{type:"element",element:o.startContainer,offset:o.startOffset};const a=o.cloneRange();return a.selectNodeContents(v.value),a.setEnd(o.startContainer,o.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+o.toString().length}},Xt=l=>{if(!(!l||!v.value))try{const o=window.getSelection(),a=document.createRange();if(l.type==="element"&&l.element)if(v.value.contains(l.element)){a.setStart(l.element,l.offset),a.collapse(!0),o.removeAllRanges(),o.addRange(a);return}else{v.value.focus();return}let r=0;const c=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=c.pop());)if(u.nodeType===3){const f=r+u.length;!d&&l.start>=r&&l.start<=f&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=f&&(a.setEnd(u,l.end-r),m=!0),r=f}else{let f=u.childNodes.length;for(;f--;)c.push(u.childNodes[f])}o.removeAllRanges(),o.addRange(a)}catch{v.value.focus()}},Le=()=>{if(!v.value)return;v.value.focus();const l=window.getSelection(),o=document.createRange(),a=c=>{if(c.nodeType===3||c.childNodes.length===0)return c;for(let u=c.childNodes.length-1;u>=0;u--){const d=c.childNodes[u],m=a(d);if(m)return m}return c},r=a(v.value);if(r.nodeType===3)o.setStart(r,r.length),o.setEnd(r,r.length);else if(r.childNodes.length>0){const c=a(r);c&&c.nodeType===3?(o.setStart(c,c.length),o.setEnd(c,c.length)):(o.selectNodeContents(r),o.collapse(!1))}else o.setStart(r,0),o.setEnd(r,0);l.removeAllRanges(),l.addRange(o)},$e=(l=!1)=>{if(!v.value)return;const o=v.value.innerHTML,a=y.title||"",r=y.description||"";if(!l&&o===Z.value&&a===Y.value&&r===ee.value)return;const c={content:q.value||Z.value,title:Ee.value!==void 0?Ee.value:Y.value,description:je.value!==void 0?je.value:ee.value},u=Qe.value.length>0?Qe.value[Qe.value.length-1]:null;let d=!0;u&&(typeof u=="string"?d=c.content!==u:d=c.content!==u.content||c.title!==u.title||c.description!==u.description),d&&(Qe.value.push(c),Qe.value.length>50&&Qe.value.shift(),mt.value=[]),Z.value=o,Y.value=a,ee.value=r,q.value=o,Ee.value=a,je.value=r},R=l=>{if(!v.value)return;bt(),v.value&&yo(v.value);let o=null;v.value&&(v.value.querySelector("p")||(o=Re(),se()));const a=l&&l.inputType&&(l.inputType==="insertText"||l.inputType==="insertCompositionText"||l.inputType==="deleteContentBackward"||l.inputType==="deleteContentForward");a&&yt.value&&(yt.value=null),ge.value=!0;const r=v.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=pn(r);_e("update:modelValue",c),_e("change",c),ft.value="editor",ot.value||(q.value=Z.value,Ee.value=Y.value,je.value=ee.value),ye.value&&clearTimeout(ye.value),ot.value=!0,ye.value=setTimeout(()=>{ot.value=!1,$e(),At(),Ot()},500),e.nextTick(()=>{o&&Xt(o),bt();const u=["bold","italic","underline"],d=window.getSelection(),m=d.rangeCount>0?d.getRangeAt(0):null,f=m&&m.collapsed;if(u.forEach(h=>{try{if(f&&yt.value?.command===h){He.value[h]=yt.value.state;return}if(h==="bold")if(m){const N=m.commonAncestorContainer,M=N.nodeType===3?N.parentElement:N;let x=!1;if(M&&((M.tagName==="STRONG"||M.tagName==="B"||M.closest&&M.closest("strong, b"))&&(x=!0),!x&&M.style&&parseInt(M.style.fontWeight)>=600&&(x=!0),!x))try{const X=window.getComputedStyle(M);parseInt(X.fontWeight)>=600&&(x=!0)}catch{}He.value[h]=x}else He.value.hasOwnProperty(h)||(He.value[h]=!1);else if(h==="italic")if(m){const N=m.commonAncestorContainer,M=N.nodeType===3?N.parentElement:N,x=M&&(M.tagName==="EM"||M.tagName==="I"||M.closest&&M.closest("em, i"));He.value[h]=!!x}else{const N=document.queryCommandState(h);He.value[h]=N}else{const N=document.queryCommandState(h);He.value[h]=N}}catch{}}),Sn(),Bn(),z(),Pt(),xn(),Rn("handleRichTextInput"),a&&(l.inputType==="insertText"||l.inputType==="insertCompositionText")){const h=l.data||"";h&&h.length===1&&setTimeout(()=>Ot(h),0),(h===" "||h===`
|
|
101
|
-
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{At()},100)}ge.value=!1})},bt=()=>{if(!v.value)return;const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r)return;const c=r.closest(".dss-image-wrapper");if(c){const u=c.querySelector("img");if(r!==u&&!u?.contains(r)){const d=o.startContainer.nodeType===3?o.startContainer.parentElement:o.startContainer,m=o.endContainer.nodeType===3?o.endContainer.parentElement:o.endContainer;if(c.contains(d)&&d!==u||c.contains(m)&&m!==u){const f=document.createRange();f.setStartAfter(c),f.collapse(!0),l.removeAllRanges(),l.addRange(f)}}}},se=()=>{if(!v.value)return;const l=v.value;if(l.querySelector&&l.querySelector("p"))return;const o=new Set(["P","H1","H2","H3","H4","H5","H6","BLOCKQUOTE","UL","OL","DIV"]),a=Array.from(l.childNodes);let r=null;a.forEach(c=>{if(c.nodeType===Node.TEXT_NODE){if((c.textContent||"").trim()===""){c.parentNode===l&&l.removeChild(c);return}r||(r=document.createElement("p"),l.insertBefore(r,c)),r.appendChild(c);return}if(c.nodeType===Node.ELEMENT_NODE){const u=c,d=u.tagName;if(d==="BR"){r=null;return}if(o.has(d)){r=null;return}r||(r=document.createElement("p"),l.insertBefore(r,u)),r.appendChild(u)}})},Bn=()=>{if(v.value&&!Et.value){Et.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 u=r.getAttribute("src")||r.src||"";if(c){const h=u.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),N=c===u||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||N||N)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const d=!c||c.trim()==="";let m=r.parentElement;const f=m&&m.classList.contains("dss-image-wrapper");if(f){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(d){f?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=tt,m.appendChild(h)}else if(f&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{Et.value=!1}}},Ro=l=>{At(),_e("blur",l),_o()},b=()=>{if(y.disabled||!y.richText||!v.value)return;_t(),ye.value&&(clearTimeout(ye.value),ye.value=null),ot.value&&($e(),ot.value=!1);const l=ft.value==="title",o=ft.value==="description",a=ft.value==="editor";if(Qe.value.length===0){l&&Se.value?Se.value.focus():o&&ze.value?ze.value.focus():v.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{R()});return}const r={content:v.value.innerHTML,title:y.title||"",description:y.description||""};mt.value.push(r);const c=Qe.value.pop();if(c!==void 0){ge.value=!0;const u=typeof c=="string"?c:c.content,d=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=u,Z.value=u,Y.value=d,ee.value=m,q.value=u,Ee.value=d,je.value=m,e.nextTick(()=>{Sn(),bn(),Zn(),Pt();const f=pn(u);_e("update:modelValue",f),_e("update:title",d),_e("update:description",m),_e("change",f),_e("title-change",d),_e("description-change",m),ge.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(ze.value){ze.value.focus();const h=m.length;ze.value.setSelectionRange(h,h)}}else if(a)Le();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(ze.value&&document.activeElement===ze.value){const h=m.length;ze.value.setSelectionRange(h,h)}else v.value&&Le()},10)})})}},C=()=>{if(y.disabled||!y.richText||!v.value)return;_t();const l=ft.value==="title",o=ft.value==="description",a=ft.value==="editor";if(mt.value.length===0){l&&Se.value?Se.value.focus():o&&ze.value?ze.value.focus():v.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{R()});return}const r={content:v.value.innerHTML,title:y.title||"",description:y.description||""};Qe.value.push(r);const c=mt.value.pop();if(c!==void 0){ge.value=!0;const u=typeof c=="string"?c:c.content,d=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";v.value.innerHTML=u,Z.value=u,Y.value=d,ee.value=m,q.value=u,Ee.value=d,je.value=m,e.nextTick(()=>{Sn(),bn(),Zn(),Pt();const f=pn(u);_e("update:modelValue",f),_e("update:title",d),_e("update:description",m),_e("change",f),_e("title-change",d),_e("description-change",m),ge.value=!1,e.nextTick(()=>{setTimeout(()=>{if(l){if(Se.value){Se.value.focus();const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}}else if(o){if(ze.value){ze.value.focus();const h=m.length;ze.value.setSelectionRange(h,h)}}else if(a)Le();else if(Se.value&&document.activeElement===Se.value){const h=d.length;Se.value.setSelectionRange&&Se.value.setSelectionRange(h,h),yn()}else if(ze.value&&document.activeElement===ze.value){const h=m.length;ze.value.setSelectionRange(h,h)}else v.value&&Le()},10)})})}},E=()=>{if(!v.value)return;v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const u=document.createDocumentFragment();for(;r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const u=document.createElement("b");for(u.style.fontWeight="600";r.firstChild;)u.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(u,r)}}),v.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},z=()=>{if(!v.value)return;v.value.querySelectorAll("i, em").forEach(o=>{o.style.fontStyle="italic"})},J=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.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=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=c.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="EM"||d.tagName==="I"){a=!0;break}if(d.style&&d.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{z()}),!1;if(o.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{z()});else try{const r=o.extractContents(),c=document.createElement("em");c.style.fontStyle="italic",c.appendChild(r),o.insertNode(c),o.setStartAfter(c),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{z()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{z()})}return!0},Je=()=>{const l=window.getSelection();if(!l||l.rangeCount===0)return!1;const o=l.getRangeAt(0);let a=!1;if(o.collapsed){const r=o.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=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer:o.commonAncestorContainer.parentNode;if(r){const c=document.createTreeWalker(r,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let u;for(;u=c.nextNode();)if(!(typeof o.intersectsNode=="function"&&!o.intersectsNode(u))){if(u.nodeType===3){let d=u.parentElement;for(;d&&d!==v.value;){if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}d=d.parentElement}}else if(u.nodeType===1){const d=u;if(d.tagName==="STRONG"||d.tagName==="B"){a=!0;break}if(d.style&&parseInt(d.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{E()}),!1;if(o.collapsed)document.execCommand("bold",!1),e.nextTick(()=>{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),u=c.startContainer;let d=u.nodeType===3?u.parentElement:u;for(;d&&d!==v.value;){if(d.tagName==="SPAN"&&d.style.fontWeight){const m=d.style.fontWeight;if(m==="normal"||m==="400"){const f=document.createElement("b");f.style.fontWeight="600";const h=document.createDocumentFragment();for(;d.firstChild;)h.appendChild(d.firstChild);f.appendChild(h),d.parentNode&&d.parentNode.replaceChild(f,d),c.setStart(f,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(d.tagName==="STRONG"||d.tagName==="B"){d.style.fontWeight="600";break}d=d.parentElement}if(!d||d===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)}}E()});else try{const r=o.extractContents(),c=document.createElement("b");c.style.fontWeight="600",c.appendChild(r),o.insertNode(c),o.setStartAfter(c),o.collapse(!0),l.removeAllRanges(),l.addRange(o),e.nextTick(()=>{E()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{E()})}return!0},Oe=(l,o=null)=>{if(y.disabled||!y.richText||!v.value)return;ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e(),_t(),v.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const u=a.getRangeAt(0);!u.collapsed&&Wn(u)&&(r=Re())}if(l==="createLink"&&o){const u=window.getSelection();if(u.rangeCount>0){const d=u.getRangeAt(0);if(d.collapsed)try{d.expand("word")}catch{const f=document.createTextNode(o);d.insertNode(f),d.selectNodeContents(f)}}}if(l==="bold"){const u=Je();He.value.bold=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(yt.value={command:"bold",state:u}),e.nextTick(()=>{r&&(Xt(r),e.nextTick(()=>{const m=rt("bold");He.value.bold=m})),R(),bn(),Pt()});return}if(l==="italic"){const u=J();He.value.italic=u;const d=window.getSelection();d.rangeCount>0&&d.getRangeAt(0).collapsed&&(yt.value={command:"italic",state:u}),e.nextTick(()=>{r&&(Xt(r),e.nextTick(()=>{const m=rt("italic");He.value.italic=m})),R(),z(),bn(),Pt()});return}let c=!1;try{c=document.execCommand(l,!1,o)}catch{}e.nextTick(()=>{if(r&&Xt(r),["bold","italic","underline"].includes(l))try{if(l==="bold")r&&e.nextTick(()=>{const d=rt("bold");He.value.bold=d});else if(l==="italic")if(r)e.nextTick(()=>{const d=rt("italic");He.value.italic=d});else{const d=document.queryCommandState(l);He.value[l]=d}else{const d=document.queryCommandState(l);He.value[l]=d}}catch{He.value.hasOwnProperty(l)?He.value[l]=!He.value[l]:He.value[l]=!0}if(l==="createLink"&&o){const d=window.getSelection();if(d.rangeCount>0){const f=d.getRangeAt(0),h=f.commonAncestorContainer.nodeType===1?f.commonAncestorContainer.closest("a"):f.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",o)}v.value.querySelectorAll("a").forEach(f=>{const h=f.getAttribute("href");(!h||h===""||h==="#")&&f.setAttribute("href",o)})}R(),bn(),Pt()})},rt=(l,o=null)=>{if(y.disabled||!v.value)return!1;try{if(l==="formatBlock"&&o){const r=document.queryCommandValue("formatBlock");if(o==="<blockquote>"){const c=r.toLowerCase();if(c==="blockquote"||c==="<blockquote>")return!0;const u=window.getSelection();if(u.rangeCount>0){const m=u.getRangeAt(0).commonAncestorContainer;return!!(m.nodeType===1?m.tagName==="BLOCKQUOTE"?m:m.closest("blockquote"):m.parentElement?.closest("blockquote"))}}return r===o||r.toLowerCase()===o.toLowerCase()}if(["bold","italic","underline"].includes(l))try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(l==="bold"){let d=!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"))&&(d=!0),!d&&f.style&&parseInt(f.style.fontWeight)>=600&&(d=!0),!d))try{const h=window.getComputedStyle(f);parseInt(h.fontWeight)>=600&&(d=!0)}catch{}return He.value.hasOwnProperty(l)?He.value[l]:(He.value[l]=d,d)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let N;for(;N=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(N))){if(N.nodeType===3){if(!(N.textContent||"").trim())continue;f=!0;let x=N.parentElement;for(;x&&x!==v.value;){if(x.tagName==="STRONG"||x.tagName==="B"){d=!0;break}if(x.style&&parseInt(x.style.fontWeight)>=600){d=!0;break}x=x.parentElement}}else if(N.nodeType===1){const M=N;if(M.tagName==="STRONG"||M.tagName==="B"){d=!0;break}if(M.style&&parseInt(M.style.fontWeight)>=600){d=!0;break}}if(d)break}}return He.value[l]=d&&f,d&&f}}if(l==="italic"){let d=!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"))&&(d=!0),!d&&f.style&&f.style.fontStyle==="italic"&&(d=!0),!d))try{window.getComputedStyle(f).fontStyle==="italic"&&(d=!0)}catch{}return He.value.hasOwnProperty(l)?He.value[l]:(He.value[l]=d,d)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let f=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let N;for(;N=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(N))){if(N.nodeType===3){if(!(N.textContent||"").trim())continue;f=!0;let x=N.parentElement;for(;x&&x!==v.value;){if(x.tagName==="EM"||x.tagName==="I"){d=!0;break}if(x.style&&x.style.fontStyle==="italic"){d=!0;break}x=x.parentElement}}else if(N.nodeType===1){const M=N;if(M.tagName==="EM"||M.tagName==="I"){d=!0;break}if(M.style&&M.style.fontStyle==="italic"){d=!0;break}}if(d)break}}return He.value[l]=d&&f,d&&f}}const u=document.queryCommandState(l);return c.collapsed&&He.value.hasOwnProperty(l)?He.value[l]:(He.value[l]=u,u)}return He.value.hasOwnProperty(l)?He.value[l]:!1}catch{return He.value.hasOwnProperty(l)?He.value[l]:!1}try{return document.queryCommandState(l)}catch{return!1}}catch{return!1}},dn=l=>{y.disabled||!y.richText||(fe.value=fe.value===l?null:l,l==="askAi"&&(Ue.value=null))},_t=()=>{fe.value=null,nt.value=null},kn=l=>{Oe("formatBlock",l),_t()},jo=l=>{if(!l||!v.value)return l;const o=be=>{let oe=be.nodeType===Node.TEXT_NODE?be.parentElement:be;for(;oe&&oe!==v.value;){const Ye=oe.tagName;if(Ye==="P"){const nn=oe.parentElement;if(nn===v.value||nn.tagName==="BLOCKQUOTE")return oe}if(Ye==="BLOCKQUOTE")break;oe=oe.parentElement}return null},a=o(l.startContainer),r=o(l.endContainer);if(!a||!r)return l;const c=[],u=document.createTreeWalker(v.value,NodeFilter.SHOW_ELEMENT,{acceptNode:be=>{const oe=be.tagName;if(oe==="P"){const Ye=be.parentElement;if(Ye===v.value||Ye.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return oe==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let d;for(;d=u.nextNode();)c.push(d);const m=c.indexOf(a),f=c.indexOf(r);if(m===-1||f===-1)return l;const h=Math.min(m,f),N=Math.max(m,f),M=c.slice(h,N+1);if(M.length===0)return l;const x=M[0],X=M[M.length-1],W=document.createRange();return W.setStartBefore(x),W.setEndAfter(X),W},rl=()=>{if(y.disabled||!y.richText||!v.value)return;ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e(),_t(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;let o=l.getRangeAt(0);!o.collapsed&&Wn(o)&&(o=jo(o),l.removeAllRanges(),l.addRange(o));let a=null;!o.collapsed&&Wn(o)&&(a=Re());const r=o.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 d=c.parentNode;Array.from(c.childNodes).forEach(f=>{if(f.nodeType===Node.ELEMENT_NODE)if(f.tagName==="P"||f.tagName==="DIV")d.insertBefore(f,c);else{const h=document.createElement("p");h.appendChild(f.cloneNode(!0)),d.insertBefore(h,c)}else if(f.nodeType===Node.TEXT_NODE&&f.textContent.trim()){const h=document.createElement("p");h.appendChild(f.cloneNode(!0)),d.insertBefore(h,c)}}),c.remove()}}else if(o.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const d=document.createElement("blockquote"),m=o.extractContents();d.appendChild(m),o.insertNode(d);const f=[],h=document.createTreeWalker(d,NodeFilter.SHOW_TEXT,{acceptNode:x=>x.parentNode===d&&x.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let N;for(;N=h.nextNode();)f.push(N);if(f.forEach(x=>{const X=document.createElement("p");x.parentNode.insertBefore(X,x),X.appendChild(x)}),d.querySelectorAll("p, div").forEach(x=>{x.textContent.trim()===""&&!x.querySelector("img")&&(x.innerHTML="<br>")}),d.children.length===0&&d.textContent.trim()===""){const x=document.createElement("p");x.innerHTML="<br>",d.appendChild(x)}}e.nextTick(()=>{a&&Xt(a),Zn(),R(),Pt()})},il=()=>{if(!v.value)return;const l=window.getSelection();if(l.rangeCount===0)return;const a=l.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=N=>{if(!N)return!1;const M=N.textContent||"",X=(N.innerHTML||"").trim();return M.trim()===""||X===""||X==="<br>"||X==="<br/>"||X==="<p></p>"||X==="<p><br></p>"||X==="<p><br/></p>"||X==="<p> </p>"||X==="<p><br> </p>"||X==="<div></div>"||X==="<div><br></div>"||X==="<div><br/></div>"};let u=null;for(a.nodeType===3?u=a.parentElement:a.tagName==="P"||a.tagName==="DIV"?u=a:u=a.closest("p, div"),u&&r.contains(u)&&c(u)&&u.remove();r.lastChild;){const N=r.lastChild;if(N.nodeType===1&&N.tagName==="BR")N.remove();else if(N.nodeType===3)if((N.textContent||"").trim()==="")N.remove();else break;else break}if(r.children.length>0)for(let N=r.children.length-1;N>=0;N--){const M=r.children[N];if((M.tagName==="P"||M.tagName==="DIV")&&c(M))M.remove();else break}let d=r.innerHTML;const m=d;d=d.replace(/(<br\s*\/?>)+$/gi,""),d!==m&&(r.innerHTML=d);const f=document.createElement("p");f.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(f,r.nextSibling):r.parentNode.appendChild(f):v.value&&v.value.appendChild(f);const h=document.createRange();h.selectNodeContents(f),h.collapse(!0),l.removeAllRanges(),l.addRange(h),e.nextTick(()=>{Zn(),R()})},bn=()=>{if(!v.value){Te.value=!1;return}try{const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");Te.value=!!r}else Te.value=!1}catch{Te.value=!1}},Ko=()=>{if(!v.value)return;const l=window.getSelection();l&&l.rangeCount>0&&l.getRangeAt(0),$t.value=Re();const o=window.getSelection();let a="";o.rangeCount>0&&(a=o.getRangeAt(0).toString()),he.value="",F.value=a,Nt.value="",ke.value=null,Me.value=!0,_t(),e.nextTick(()=>{lt.value&<.value.focus()})},cl=()=>{if(!v.value)return;ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e();const l=window.getSelection();let o=null;if(l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer;o=r.nodeType===1?r.closest("a"):r.parentElement?.closest("a")}if(!o&&ke.value&&(o=ke.value),o&&o.parentNode){const a=document.createDocumentFragment();for(;o.firstChild;)a.appendChild(o.firstChild);if(o.parentNode.replaceChild(a,o),a.firstChild){const r=document.createRange();r.setStartBefore(a.firstChild),r.setEndAfter(a.lastChild||a.firstChild),l.removeAllRanges(),l.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),l.removeAllRanges(),l.addRange(r)}ke.value=null}else Oe("unlink");Te.value=!1,_t(),e.nextTick(()=>{R(),bn()})},ao=()=>{y.disabled||!y.richText||v.value&&(ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e(),_t(),v.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sn(),R(),Pt()}))},dl=()=>{y.disabled||!y.richText||v.value&&(ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e(),_t(),v.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sn(),R(),Pt()}))},ul=l=>{const o=l.parentElement;if(!o||o.tagName!=="OL")return null;let a=0,r=l.previousElementSibling;for(;r;)r.tagName==="LI"&&a++,r=r.previousElementSibling;return a+1},Sn=()=>{if(!v.value)return;v.value.querySelectorAll("li > ol").forEach(o=>{const a=o.parentElement;if(a&&a.tagName==="LI"){const r=ul(a);r!==null&&Array.from(o.children).filter(u=>u.tagName==="LI").forEach(u=>{u.setAttribute("data-parent-num",String(r))})}})},Go=()=>{if(y.disabled||!y.richText||!v.value)return;_t(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("indent",!1),e.nextTick(()=>{Sn(),R()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=a.previousElementSibling;if(c&&c.tagName==="LI"){const u=r.tagName.toLowerCase();let d=c.querySelector(`:scope > ${u}`);d||(d=document.createElement(u),c.appendChild(d));const m=ul(c);d.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Sn();const f=document.createRange();f.selectNodeContents(a),f.collapse(!1),l.removeAllRanges(),l.addRange(f),e.nextTick(()=>{R(),Pt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sn(),R(),Pt()})},Sl=()=>{if(y.disabled||!y.richText||!v.value)return;_t(),v.value.focus();const l=window.getSelection();if(l.rangeCount===0)return;const o=l.getRangeAt(0),a=o.commonAncestorContainer.nodeType===1?o.commonAncestorContainer.closest("li"):o.commonAncestorContainer.parentElement?.closest("li");if(!a){document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),R()});return}const r=a.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=r.parentElement;if(c&&c.tagName==="LI"){const u=c.parentElement;if(u&&(u.tagName==="OL"||u.tagName==="UL")){r.tagName==="OL"&&a.removeAttribute("data-parent-num"),u.insertBefore(a,c.nextSibling),r.children.length===0&&r.remove(),Sn();const d=document.createRange();d.selectNodeContents(a),d.collapse(!1),l.removeAllRanges(),l.addRange(d),e.nextTick(()=>{R(),Pt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),R(),Pt()})},Yt=e.ref(null),Jn=e.ref(null),_n=e.ref({}),eo=e.ref(""),to=e.ref(null),so=e.ref("");e.ref("");const ro=e.ref(null);e.ref("");const Nn=e.ref([]),Qo=e.ref(!1),Mo=e.ref(!1),ml=l=>{if(!l)return"";const o=l.cloneRange(),a=document.createElement("div");return a.appendChild(o.cloneContents()),a.innerHTML},Io=()=>{if(y.disabled||!y.richText||!v.value)return;if(Yt.value!==null){Yt.value=null,eo.value="",so.value="",ro.value=null,Nn.value=[],Yn(!0);return}_t(),v.value.focus();const l=window.getSelection();if(!l||l.rangeCount===0)return;const o=l.getRangeAt(0);if(o.collapsed||!Wn(o))return;so.value=ml(o)||"",ro.value=Re();const a=o.getBoundingClientRect(),r=v.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),u=a.bottom-c.top,m=Math.max(u+8,0);_n.value={top:`${m}px`,bottom:"auto"},Yt.value=Date.now(),e.nextTick(()=>{if(eo.value="",to.value){const h=to.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const f=r.querySelector(".dss-comment-overlay");if(f&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const N=r.getBoundingClientRect(),M=f.getBoundingClientRect(),x=h.getBoundingClientRect(),X=M.bottom-N.top,W=x.top-N.top,be=8;if(X>W-be){const oe=x.height;_n.value={bottom:`${oe+be}px`,top:"auto"}}else _n.value={top:`${m}px`,bottom:"auto"}}}})},Jo=()=>{if(!eo.value.trim())return;const l=eo.value.trim(),o=new Date,a={text:l,selectionText:so.value,selectionRange:ro.value,commentId:Yt.value,user:y.commentUser||null,createdAt:o.toISOString()};Nn.value=[...Nn.value,a],_e("comment-submitted",a),el(a),ro.value&&!Ml(ro.value)&&Bl(Yt.value,ro.value),eo.value="",e.nextTick(()=>{if(to.value){const r=to.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rn("sendComment")})},Nl=(l,o)=>{if(!(!y.commentUser||!l.user||l.user.id!==y.commentUser.id)){if(Nn.value=Nn.value.filter((a,r)=>r!==o),Yt.value!==null&&v.value){const a=String(Yt.value),r=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Nn.value.length>0){const c=[],u=new Set;Nn.value.forEach(d=>{d.user&&d.user.id&&!u.has(d.user.id)&&(u.add(d.user.id),c.push(d.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(Nn.value.length))}else r&&Nn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(_e("comment-deleted",{comment:l,index:o,commentId:Yt.value}),y.comments&&Array.isArray(y.comments)){const a=y.comments.filter(r=>!(r.commentId===l.commentId&&r.text===l.text&&r.user?.id===l.user?.id));_e("update:comments",a)}e.nextTick(()=>{Rn("deleteComment")})}},Ml=l=>{if(!l||!v.value)return!1;try{const o=Fo(l);if(!o)return!1;const a=o.commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},Fo=l=>{if(!l||!v.value)return null;try{const o=document.createRange();if(l.type==="element"&&l.element)return v.value.contains(l.element)?(o.setStart(l.element,l.offset),o.collapse(!0),o):null;let a=0;const r=[v.value];let c=null,u=!1,d=!1;for(;!d&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!u&&l.start>=a&&l.start<=m&&(o.setStart(c,l.start-a),u=!0),u&&l.end>=a&&l.end<=m&&(o.setEnd(c,l.end-a),d=!0),a=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return u?o:null}catch{return null}},Bl=(l,o)=>{if(!(!l||!o||!v.value))try{const a=Fo(o);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(l)&&m.getAttribute("data-fake-comment")!==String(l)&&m.setAttribute("data-comment",String(l));return}}const u=document.createElement("span");u.setAttribute("data-comment",String(l));try{const m=a.startContainer,f=a.endContainer,h=a.startOffset,N=a.endOffset,M=m.nodeType===3?m.parentNode:m,x=f.nodeType===3?f.parentNode:f;if(M===x&&h===0&&N===(f.nodeType===3?f.length:x.childNodes.length)&&(M.tagName==="P"||M.tagName==="DIV"||M.tagName==="H1"||M.tagName==="H2"||M.tagName==="H3"||M.tagName==="H4"||M.tagName==="H5"||M.tagName==="H6")){const W=a.extractContents();u.appendChild(W),a.insertNode(u)}else a.surroundContents(u)}catch{const f=a.extractContents();u.appendChild(f),a.insertNode(u)}const d=v.value.querySelector(`[data-comment="${String(l)}"]`);e.nextTick(()=>{Rn("wrapSelectionWithCommentMarker"),R()})}catch{}},el=l=>{if(!l||!l.commentId)return;const o=Array.isArray(y.comments)?[...y.comments]:[],a=typeof l.commentId=="string"&&l.commentId.startsWith("comment-")?Date.now():Number(l.commentId)||l.commentId;let r=o.findIndex(u=>typeof u.conversation_id=="string"&&u.conversation_id.startsWith("comment-")?null:Number(u.conversation_id)===Number(a)||u.conversation_id===a);const c={text:l.text,user:l.user,createdAt:l.createdAt,created_at:l.createdAt,updated_at:l.createdAt};if(r>=0){const u=o[r];if(u.conversation||(u.conversation=[]),u.conversation.push(c),u.updated_at=l.createdAt,!u.article_id&&o.length>0){const d=o.find(m=>m.article_id);d&&(u.article_id=d.article_id)}}else{const u=l.selectionRange,d=o.length>0&&o.find(f=>f.article_id)?.article_id||null,m={conversation_id:a,article_id:d,selection_range:u?{start:u.start||0,end:u.end||0,type:u.type||"text"}:null,selection_text:l.selectionText||"",conversation:[c],created_by_user:l.user,created_at:l.createdAt,updated_at:l.createdAt,status:"active"};o.push(m)}Qo.value=!0,_e("update:comments",o)},wn=(l,o=[])=>{if(y.disabled||!y.richText||!v.value)return;const a=v.value;let r=null;try{r=a.querySelector(l)}catch{return}if(!r)return;_t(),a.focus();const c=document.createRange();c.selectNodeContents(r);const u=window.getSelection();u&&(u.removeAllRanges(),u.addRange(c)),so.value=r.innerHTML||"",ro.value=Re();const d=c.getBoundingClientRect(),m=a.parentElement;if(m){const N=m.getBoundingClientRect(),M=d.bottom-N.top,X=Math.max(M+8,0);_n.value={top:`${X}px`,bottom:"auto"}}const f=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(f&&y.comments&&Array.isArray(y.comments)){const N=y.comments.find(M=>String(M.conversation_id)===String(f));if(N&&N.conversation&&Array.isArray(N.conversation)){const M=N.conversation.map(x=>({id:x.id||x.commentary_id,commentary_id:x.id||x.commentary_id,conversation_id:N.id||N.conversation_id,text:x.text,user:x.user,createdAt:x.created_at||x.createdAt,updated_at:x.updated_at||x.updatedAt}));h.push(...M)}}h.length===0&&Array.isArray(o)&&o.length>0&&(h=o.slice()),h.sort((N,M)=>{const x=be=>{if(!be)return 0;const oe=new Date(be).getTime();return isNaN(oe)?0:oe},X=x(N.createdAt),W=x(M.createdAt);return X===W?0:X-W}),Nn.value=h,Yn(!0),Yt.value=f||null,r&&(Jn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(eo.value="",to.value){const N=to.value;N.style.height="auto",N.style.height=`${N.scrollHeight}px`,N.focus()}if(m){const N=m.querySelector(".dss-comment-overlay");if(N){const M=m.querySelector(".dss-text-editor-footer");if(M){const x=m.getBoundingClientRect(),X=N.getBoundingClientRect(),W=M.getBoundingClientRect(),be=X.bottom-x.top,oe=W.top-x.top,Ye=8;if(be>oe-Ye){const nn=W.height;_n.value={bottom:`${nn+Ye}px`,top:"auto"}}}}}Rn("openCommentOverlayForSelector")})},L=e.ref(null),an=e.ref(0),Dn=l=>{if(!(y.disabled||!y.richText)){if(l.key==="Escape"){const o=window.getSelection();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");if(!!(c&&v.value&&v.value.contains(c))){l.preventDefault();let d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",d&&c.contains(d)&&d.nextSibling?c.insertBefore(m,d.nextSibling):c.appendChild(m),setTimeout(()=>{il()},50);return}}}if(l.key.length===1||l.key==="Enter"){const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0),r=a.commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c){const u=c.closest(".dss-image-wrapper");if(u){const d=u.querySelector("img");if(c!==d&&!d?.contains(c)){const m=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,f=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.contains(m)&&m!==d||u.contains(f)&&f!==d){l.preventDefault();const h=document.createRange();h.setStartAfter(u),h.collapse(!0),o.removeAllRanges(),o.addRange(h);return}}}}}}if(l.key==="Backspace"||l.key==="Delete"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(l.key==="Backspace"){const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===0?d=u.previousSibling||u.parentNode:d=u.parentNode);const m=d.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=d.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const u=a.startContainer;let d=u;u.nodeType===3&&(a.startOffset===u.length?d=u.nextSibling||u.parentNode:d=u.parentNode);const m=d.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=d.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const u=a.commonAncestorContainer,d=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(u.nodeType===1&&u.tagName==="IMG"?(r=u,c=r.closest(".dss-image-wrapper")):(r=u.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const f=c.contains(d)||d===c,h=c.contains(m)||m===c,M=a.cloneContents().textContent?.trim()||"",x=c.textContent?.trim()||"";(!f||!h||M.length>x.length)&&(c=null,r=null)}}if(c){l.preventDefault(),l.stopPropagation();const u=c.parentNode;if(u){const d=document.createTextNode("");u.insertBefore(d,c),c.remove();const m=document.createRange();m.setStartAfter(d),m.collapse(!0),o.removeAllRanges(),o.addRange(m),e.nextTick(()=>{R()});return}}}}if(l.key==="Tab"){l.preventDefault(),l.shiftKey?Sl():Go();return}if(l.key==="Enter"){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0);if(a.collapsed){const d=a.startContainer,m=f=>{if(!f)return!1;let h=f.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const N=f.parentElement;return N&&N!==v.value?m(N):!1};if(d.nodeType===3){const f=d.parentElement;if(f&&(m(f)||m(d))){const h=f.closest("p, div");if(h&&h!==v.value){l.preventDefault(),l.stopPropagation();let N=null;const M=a.startOffset;M<d.length&&(N=d.splitText(M));const x=document.createElement("p");if(N?x.appendChild(N):x.innerHTML="<br>",d.length===0){const W=d.parentElement;W&&(W.removeChild(d),W.childNodes.length===0&&W.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(x,h.nextSibling):h.parentNode.appendChild(x);const X=document.createRange();N?X.setStart(N,0):X.setStart(x,0),X.collapse(!0),o.removeAllRanges(),o.addRange(X),e.nextTick(()=>{R()});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 d=null;r.nodeType===3?d=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?d=r:d=r.closest("p, div");const m=W=>{if(!W)return!1;const be=W.textContent||"",Ye=(W.innerHTML||"").trim(),nn=Ye.replace(/<br\s*\/?>/gi,"").trim();return be.trim()===""||Ye===""||nn===""||Ye==="<br>"||Ye==="<br/>"||Ye==="<p></p>"||Ye==="<p><br></p>"||Ye==="<p><br/></p>"||Ye==="<p> </p>"||Ye==="<p><br> </p>"||Ye==="<div></div>"||Ye==="<div><br></div>"||Ye==="<div><br/></div>"},f=c.lastChild,h=f&&f.nodeType===1&&f.tagName==="BR",N=a.startContainer,M=N.nodeType===3?N.parentElement:N,x=M===c||M&&M.parentElement===c;if(d&&m(d)||h&&x){l.preventDefault(),setTimeout(()=>{il()},50);return}}}}if(l.key===" "){const o=Date.now(),a=o-an.value;if(L.value===" "&&a<300){const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0),u=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer.closest("li"):c.commonAncestorContainer.parentElement?.closest("li");if(u){const d=c.startContainer.textContent?.substring(0,c.startOffset)||"";if((u.textContent||"").indexOf(d.trim())<=10||d.trim().length<=2){l.preventDefault(),Go();return}}}}L.value=" ",an.value=o}else L.value=l.key}},un=l=>{if(y.disabled||!y.richText)return;l.preventDefault();let o=l.clipboardData.getData("text/html"),a=l.clipboardData.getData("text/plain");o&&(o=o.replace(/<!--[\s\S]*?-->/g,"")),a&&(a=a.replace(/<!--[\s\S]*?-->/g,"")),$e();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 u=d=>{const f=new DOMParser().parseFromString(d,"text/html");let h=v.value.querySelector("h1")?1:0;if(f.querySelectorAll("h1").forEach(M=>{if(h>0){const x=f.createElement("p");x.innerHTML=M.innerHTML,M.parentNode.replaceChild(x,M)}else h++}),c){const M=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],x=Array.from(f.body.children).filter(X=>M.includes(X.tagName));if(x.length===1){const X=x[0].tagName,W=c.tagName,be=c.textContent.trim()===""&&!c.querySelector("img");let oe=!1;if(["H1","H2","H3","H4","H5","H6"].includes(W)?oe=!0:be||(X===W||X==="P")&&(oe=!0),oe)return x[0].innerHTML.trim()}}return f.body.innerHTML.trim()};if(o){const d=u(o);document.execCommand("insertHTML",!1,d)}else if(a)if(/<[a-z][\s\S]*>/i.test(a)){const m=u(a);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,a);R()},On=l=>{if(fe.value){const a=l.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&_t()}if(ve.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),c=v.value&&a.closest(".dss-text-editor-content");!r&&!c&&_o()}if(Ue.value){const a=l.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&co()}const o=l.target;if(!o.closest(".dss-toolbar-dropdown")&&!o.closest(".dss-toolbar-dropdown-submenu")&&(nt.value=null),!v.value||!o.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Mn.value=!r.collapsed&&Wn(r)}else Mn.value=!1}if(Yt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const d=a.getBoundingClientRect(),m=l.clientX,f=l.clientY;r=m>=d.left&&m<=d.right&&f>=d.top&&f<=d.bottom}const c=o.closest(".dss-toolbar-button"),u=c&&c.getAttribute("title")==="Comment";!r&&!u&&(Yt.value=null,eo.value="",so.value="",ro.value=null,Nn.value=[],Yn(!0))}},zt=(l,o)=>{l&&l.stopPropagation&&l.stopPropagation(),xt.value&&(clearTimeout(xt.value),xt.value=null),nt.value=o},jt=l=>{const o=l.relatedTarget;if(o){const a=o.closest(".dss-toolbar-dropdown-submenu"),r=o.closest(".dss-toolbar-dropdown-item-has-submenu");if(a||r)return}xt.value&&clearTimeout(xt.value),xt.value=setTimeout(()=>{nt.value=null,xt.value=null},150)},io=l=>{nt.value=null};let go=0;const gt=l=>{if(!l)return;const o=Array.from(l.children);o.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")}),o.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),u=a.nextElementSibling,d=u&&!u.classList.contains("dss-toolbar-dropdown-submenu")&&!u.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&u.tagName==="DIV"&&!u.classList.contains("dss-toolbar-dropdown-item")&&Array.from(u.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||d){const m=`submenu-auto-${++go}`;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):d&&(u.classList.add("dss-toolbar-dropdown-submenu"),f=u),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(N=>{(N.tagName==="BUTTON"||N.tagName==="DIV")&&!N.classList.contains("dss-toolbar-dropdown-item")&&N.classList.add("dss-toolbar-dropdown-item")}))}})},pt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(o=>{gt(o),o.querySelectorAll(".dss-toolbar-dropdown-item-has-submenu").forEach(c=>{const u=c._subMenuHandlers;u&&(c.removeEventListener("mouseenter",u.enter),c.removeEventListener("mouseleave",u.leave));const d=f=>{const h=c.getAttribute("data-submenu-id");h&&zt(f,h)},m=jt;c.addEventListener("mouseenter",d),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:d,leave:m}}),o.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const u=c._subMenuHandlers;u&&(c.removeEventListener("mouseenter",u.enter),c.removeEventListener("mouseleave",u.leave));const d=h=>{const N=c.getAttribute("data-submenu-id");N&&zt(h,N)},m=jt;c.addEventListener("mouseenter",d),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:d,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",io)})})})};let qe=null;const Ht=()=>{if(nt.value){const l=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${nt.value}"]`),o=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${nt.value}"]`);l&&o&&xl(l,o)}if(ve.value&&Pt(),y.richText){if(qe!==null)return;qe=setTimeout(()=>{qe=null,Rn("handleWindowResize")},150)}},zo=()=>{if(!y.richText)return;document.querySelectorAll(".dss-toolbar-custom-group").forEach(o=>{Array.from(o.children).filter(r=>r.tagName==="DIV"&&!r.classList.contains("dss-toolbar-button")).forEach(r=>{r.classList.add("dss-toolbar-button")})})},pl=()=>{const l=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),o=a=>{if(a.preventDefault(),a.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};l.forEach(a=>{a.addEventListener("selectstart",o),a.addEventListener("mousedown",o),a.addEventListener("dragstart",o),a.addEventListener("contextmenu",o),a.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Zt.value?yn():lo(),Ie.value?fo():ie()})}),e.nextTick(()=>{pl()}),y.richText&&v.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",On),window.addEventListener("resize",Ht);let l=null;const o=()=>{l===null&&(l=setTimeout(()=>{l=null,Ht()},150))};window.addEventListener("scroll",o,!0),v.value._windowScrollHandler=o,v.value._windowScrollTimeout=l,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,Ht()},150))};a&&(a.addEventListener("scroll",c),v.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{pt(),zo()}),v.value.addEventListener("click",m=>{const f=m.target;f.closest("a")&&!y.disabled&&m.preventDefault();const N=f.closest(".dss-image-no-alt-icon"),M=f.closest(".dss-image-wrapper");if(N||M&&f===M){m.preventDefault(),m.stopPropagation();const x=window.getSelection(),X=document.createRange();X.setStartAfter(M),X.collapse(!0),x.removeAllRanges(),x.addRange(X)}else M&&f.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const x=window.getSelection();if(x.rangeCount>0){const W=x.getRangeAt(0).commonAncestorContainer,be=W.nodeType===3?W.parentElement:W;if(M.contains(be)&&be!==M.querySelector("img")){const oe=document.createRange();oe.setStartAfter(M),oe.collapse(!0),x.removeAllRanges(),x.addRange(oe)}}else{const X=document.createRange();X.setStartAfter(M),X.collapse(!0),x.addRange(X)}}))},!0),v.value.addEventListener("mousedown",m=>{const f=m.target,h=f.closest(".dss-image-no-alt-icon"),N=f.closest(".dss-image-wrapper");if(h||N&&f.tagName!=="IMG"){m.preventDefault();const M=window.getSelection(),x=document.createRange();N&&(x.setStartAfter(N),x.collapse(!0),M.removeAllRanges(),M.addRange(x))}},!0),v.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!v.value)return;v.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const M=h.getAttribute("alt")||h.alt||"";if(M){const x=h.getAttribute("src")||h.src||"",X=x.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),W=M===x||M===X;(M.startsWith("http://")||M.startsWith("https://")||M.startsWith("data:")||W||W)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Bn()})}),v.value.addEventListener("dragstart",m=>{const f=m.target,h=f.tagName==="IMG"?f:f.closest("img"),N=h?.closest(".dss-image-wrapper");h&&v.value.contains(h)&&(Ft.value=N||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),v.value.addEventListener("dragover",m=>{Ft.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),v.value.addEventListener("dragenter",m=>{Ft.value&&(m.preventDefault(),m.stopPropagation())}),v.value.addEventListener("drop",m=>{if(!Ft.value||!v.value)return;m.preventDefault(),m.stopPropagation();const f=Ft.value,h=f.classList?.contains("dss-image-wrapper"),N=h?f.querySelector("img"):f,M=h?f:N?.closest(".dss-image-wrapper");if(!N||!v.value.contains(N)){Ft.value=null;return}let x=null;const X=m.clientX,W=m.clientY;if(document.caretRangeFromPoint)x=document.caretRangeFromPoint(X,W);else{const Tt=window.getSelection();Tt.rangeCount>0?x=Tt.getRangeAt(0).cloneRange():(x=document.createRange(),x.selectNodeContents(v.value),x.collapse(!1))}if(!x){Ft.value=null;return}const be=x.commonAncestorContainer,oe=be.nodeType===3?be.parentElement:be;if(oe?.closest(".dss-image-wrapper")===M||M&&M.contains(oe)){Ft.value=null;return}if(M&&(oe===M||M.contains(oe))){Ft.value=null;return}const nn=N.getAttribute("src");let Gt=null;M?Gt=M.cloneNode(!0):Gt=N.cloneNode(!0);try{let Tt=x.startContainer;if(Tt.nodeType===3&&(Tt=Tt.parentElement),M&&(Tt===M||M.contains(Tt))){const Wt=document.createRange();Wt.setStartAfter(M),Wt.collapse(!0),x=Wt}x.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)}}}M?M.remove():N.remove(),Ft.value=null,e.nextTick(()=>{const Tt=v.value.querySelectorAll("img");let Qt=!1;Tt.forEach(Jt=>{if(Jt.getAttribute("src")===nn)if(!Qt)Qt=!0;else{const Wt=Jt.closest(".dss-image-wrapper");Wt?Wt.remove():Jt.remove()}}),Bn(),R()})}),v.value.addEventListener("dragend",m=>{Ft.value=null});let u=null;const d=new MutationObserver(m=>{m.forEach(f=>{f.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const N=h.querySelectorAll&&h.querySelectorAll("img");N&&N.forEach(M=>{M.removeAttribute("alt"),M.removeAttribute("data-alt"),M.setAttribute("alt",""),M.setAttribute("data-alt",""),M.alt=""})}})}),u&&clearTimeout(u),u=setTimeout(()=>{Bn(),zo(),u=null},100)});if(d.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(()=>{zo()})});f.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=f}}),y.modelValue){const m=Pn(y.modelValue);v.value.innerHTML=m,se()}e.nextTick(()=>{const m=v.value.innerHTML||"",f=y.title||"",h=y.description||"";Z.value=m,Y.value=f,ee.value=h,Ee.value=f,je.value=h,Sn(),Bn(),z(),xn(),po(),$o()}),bn(),Zn(),v.value._mutationObserver=d}}),e.onUnmounted(()=>{if(document.removeEventListener("click",On),window.removeEventListener("resize",Ht),v.value&&v.value._windowScrollHandler&&window.removeEventListener("scroll",v.value._windowScrollHandler,!0),qe!==null&&(clearTimeout(qe),qe=null),v.value&&v.value._windowScrollTimeout!==null&&clearTimeout(v.value._windowScrollTimeout),ye.value&&clearTimeout(ye.value),xt.value&&clearTimeout(xt.value),v.value&&v.value._mutationObserver&&v.value._mutationObserver.disconnect(),Vt.value&&Vt.value.disconnect(),Lt.value!==null&&(cancelAnimationFrame(Lt.value),Lt.value=null),Tn.value!==null&&(clearTimeout(Tn.value),Tn.value=null),on.value!==null&&(clearTimeout(on.value),on.value=null),Yn(!0),v.value&&v.value._scrollHandlers){const{wrapper:o,content:a,handler:r}=v.value._scrollHandlers;o&&o.removeEventListener("scroll",r),a&&a.removeEventListener("scroll",r)}const l=document.querySelector(".dss-text-editor-toolbar");l&&l._toolbarMutationObserver&&l._toolbarMutationObserver.disconnect()});const Bo=l=>{const o=l.target,a=o.closest("a");if(a&&!y.disabled){l.preventDefault();const c=document.createRange();c.selectNodeContents(a);const u=window.getSelection();u.removeAllRanges(),u.addRange(c)}const r=o.closest(".dss-image-wrapper");r&&o.tagName!=="IMG"?e.nextTick(()=>{const c=window.getSelection();if(c.rangeCount>0){const d=c.getRangeAt(0).commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(r.contains(m)&&m!==r.querySelector("img")){const f=document.createRange();f.setStartAfter(r),f.collapse(!0),c.removeAllRanges(),c.addRange(f)}}Bn(),bn(),Zn(),Pt(),xn()}):e.nextTick(()=>{Bn(),bn(),Zn(),Pt(),xn()})},Po=()=>{bt();const l=window.getSelection();if(l&&l.rangeCount>0){const a=l.getRangeAt(0);Mn.value=!a.collapsed&&Wn(a),!a.collapsed&&yt.value&&(yt.value=null)}else Mn.value=!1;if(Bn(),bn(),Zn(),Pt(),xn(),l&&l.rangeCount>0){const r=l.getRangeAt(0).commonAncestorContainer,c=r.nodeType===3?r.parentElement:r;if(c&&c.closest(".dss-text-editor-footer")){l.removeAllRanges(),Mn.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 u=c.commonAncestorContainer,d=u.nodeType===3?u.parentElement:u;let m=!1;if(d&&((d.tagName==="STRONG"||d.tagName==="B"||d.closest&&d.closest("strong, b"))&&(m=!0),!m&&d.style&&parseInt(d.style.fontWeight)>=600&&(m=!0),!m))try{const f=window.getComputedStyle(d);parseInt(f.fontWeight)>=600&&(m=!0)}catch{}He.value[a]=m}else{const u=document.queryCommandState(a);He.value[a]=u}}}catch{}})},xn=()=>{if(!y.richText||y.disabled||!v.value){kt.value="p";return}try{const l=window.getSelection();if(!l||l.rangeCount===0){kt.value="p";return}const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!v.value.contains(r)){kt.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){kt.value="p";return}const u=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(u)?kt.value=u:kt.value="p"}catch{kt.value="p"}},Zn=()=>{if(!v.value){st.value=!1;return}try{const l=window.getSelection();let o=!1;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");o=!!(c&&v.value.contains(c))}st.value=o}catch{st.value=!1}},Wn=l=>{if(!l||!v.value)return!1;const o=l.commonAncestorContainer;if(!o)return!1;const a=o.nodeType===3?o.parentElement:o;return a?v.value.contains(a):!1},_o=()=>{ve.value=!1},Pt=()=>{if(!y.floatingToolbar||!y.richText||y.disabled){ve.value=!1;return}const l=window.getSelection();if(!l||l.rangeCount===0){ve.value=!1;return}const o=l.getRangeAt(0);if(o.collapsed||!Wn(o)){ve.value=!1;return}const a=o.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ve.value=!1;return}const r=v.value;if(!r){ve.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ve.value=!1;return}const u=40,d=8,m=a.top-u/2+15;let f=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let N=0;ht.value&&(N=ht.value.getBoundingClientRect().width);const M=(N||320)/2;let x=c.left+M,X=c.right-M;if(X<x){const W=c.left+c.width/2;x=W,X=W}if(h>0){const W=M+d,be=h-M-d;if(x=Math.max(x,W),X=Math.min(X,be),X<x){const oe=h/2;x=oe,X=oe}}f<x?f=x:f>X&&(f=X),Mt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${f}px`,transform:"translate(-50%, -100%)",zIndex:10003},ve.value=!0},vl=l=>{y.disabled||!y.richText||(Ue.value=Ue.value===l?null:l,l==="askAi"&&(fe.value=null))},co=()=>{Ue.value=null,nt.value=null},uo=l=>{kn(l),co()};let fn=null,wo=null,ho=null,qn=null;const _l=l=>{if(y.disabled||!y.richText){To(),xo();return}const o=l.target,a=o.closest("a"),r=o.closest("img");if(fn&&(clearTimeout(fn),fn=null),ho&&(clearTimeout(ho),ho=null),a&&a!==wo){xo(),wo=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),ke.value=a,V.value=c,Q.value=!0,Ke.value=!0,tl(a)}else!a&&wo?(wo=null,fn=setTimeout(()=>{Ke.value||To()},150)):a&&a===wo&&tl(a);if(r&&r!==qn){To(),qn=r;let c=r.getAttribute("alt");c===null&&(c=r.alt||"");let u=r.getAttribute("data-alt");u===null&&(u=c),r.hasAttribute("alt")||r.setAttribute("alt",c),r.hasAttribute("data-alt")||r.setAttribute("data-alt",u),O.value=r,ae.value=c.trim()||I("textEditor.image.noAlt"),xe.value=!0,Ct.value=!0,gl(r)}else!r&&qn?(qn=null,ho=setTimeout(()=>{Ct.value||xo()},150)):r&&r===qn&&gl(r)},fl=l=>{const o=l.relatedTarget;(!o||!o.closest(".dss-text-editor-content")&&!o.closest(".dss-link-popup"))&&(wo=null,qn=null,fn&&(clearTimeout(fn),fn=null),ho&&(clearTimeout(ho),ho=null),To(),xo())},To=()=>{Ke.value=!1,setTimeout(()=>{Ke.value||(Q.value=!1,V.value="",Me.value||(ke.value=null))},100)},tl=l=>{if(!l||!v.value)return;const o=l.getBoundingClientRect(),c=o.top-32-8,u=o.left+o.width/2;ue.value={position:"fixed",top:`${c}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},xo=()=>{Ct.value=!1,setTimeout(()=>{Ct.value||(xe.value=!1,ae.value="",Dt.value||(O.value=null))},100)},gl=l=>{if(!l||!v.value)return;const o=l.getBoundingClientRect(),c=o.top-32-8,u=o.left+o.width/2;et.value={position:"fixed",top:`${c}px`,left:`${u}px`,transform:"translateX(-50%)",zIndex:10002}},Tl=()=>{if(!V.value||!ke.value)return;let o=ke.value.getAttribute("href")||V.value;!o.startsWith("http://")&&!o.startsWith("https://")&&!o.startsWith("mailto:")&&(o="https://"+o),window.open(o,"_blank","noopener,noreferrer")},no=()=>{if(ke.value){const l=ke.value.textContent||"",o=ke.value.getAttribute("href")||"",a=ke.value;he.value=o,F.value=l,Nt.value=l,Ke.value=!1,Q.value=!1,V.value="",ke.value=a,Me.value=!0}else if(Te.value){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",u=r.getAttribute("href")||"";he.value=u,F.value=c,Nt.value=c,ke.value=r,Me.value=!0}}}else{$t.value=Re();const l=window.getSelection();let o="";l.rangeCount>0&&(o=l.getRangeAt(0).toString()),he.value="",F.value=o,Nt.value="",ke.value=null,Me.value=!0}e.nextTick(()=>{lt.value&&(lt.value.focus(),lt.value.select())})},Un=()=>{Me.value=!1,he.value="",F.value="",Nt.value="",ke.value=null,$t.value=null},Xn=()=>{if(!he.value.trim()){Un();return}if(ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e(),F.value.trim()||(F.value=he.value.trim()),ke.value&&v.value&&v.value.contains(ke.value)){const l=window.getSelection();l.rangeCount>0&&l.removeAllRanges();const o=ke.value;if(o.setAttribute("href",he.value.trim()),F.value.trim()!==Nt.value.trim()){for(;o.firstChild;)o.removeChild(o.firstChild);o.textContent=F.value.trim()}o.style.color="#60afdf",o.style.textDecoration="underline";const a=document.createRange();a.selectNodeContents(o),a.collapse(!1),l.removeAllRanges(),l.addRange(a),R()}else if(v.value){v.value.focus();const l=window.getSelection();l.removeAllRanges(),$t.value&&Xt($t.value);let o=null;if(l.rangeCount>0&&(o=l.getRangeAt(0)),o&&!o.collapsed){o.toString();const a=document.createElement("a");a.href=he.value.trim(),a.textContent=F.value.trim(),a.style.color="#60afdf",a.style.textDecoration="underline",o.deleteContents(),o.insertNode(a);const r=document.createTextNode(" ");o.setStartAfter(a),o.insertNode(r),o.setStartAfter(r),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}else{o||(o=document.createRange(),o.selectNodeContents(v.value),o.collapse(!1));const a=o.startContainer,r=a.nodeType===3,c=r&&o.startOffset===a.textContent.length,u=document.createElement("a");if(u.href=he.value.trim(),u.textContent=F.value.trim(),u.style.color="#60afdf",u.style.textDecoration="underline",c){let d=a.parentElement;for(;d&&d!==v.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(d.tagName);)d=d.parentElement;if(d&&d!==v.value){let m=d.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(u);const f=document.createTextNode(" ");m.appendChild(f);const h=document.createRange();h.setStartAfter(u),h.collapse(!0),l.removeAllRanges(),l.addRange(h)}else{if(o.startOffset>0){const h=a.textContent.substring(0,o.startOffset),N=h[h.length-1];if(N&&N!==" "&&N!==" "&&N!==`
|
|
102
|
-
`){const
|
|
103
|
-
`){const h=document.createTextNode(" ");o.insertNode(h),o.setStartAfter(h)}}o.insertNode(u);const d=document.createTextNode(" ");o.setStartAfter(u),o.insertNode(d),o.setStartAfter(d),o.collapse(!0),l.removeAllRanges(),l.addRange(o)}}R()}e.nextTick(()=>{bn(),Un()})},At=()=>{if(!v.value||ge.value)return;const l=window.getSelection();let o=null;l&&l.rangeCount>0&&(o=Re());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 u;for(;u=r.nextNode();)c.push(u);let d=!1;for(let m=c.length-1;m>=0;m--){const f=c[m],h=f.textContent;a.lastIndex=0;const N=[...h.matchAll(a)];if(N.length===0)continue;const M=N.filter(W=>{const be=W[0],oe=W.index;if(oe>0&&h[oe-1]==="@"||oe+be.length<h.length&&h[oe+be.length]==="@")return!1;const Ye=f.parentElement;return!(Ye&&Ye.closest("a"))});if(M.length===0)continue;if(M.length===1&&M[0][0]===h.trim()){const W=M[0][0],be=W.startsWith("http://")||W.startsWith("https://")?W:`https://${W}`,oe=document.createElement("a");oe.href=be,oe.textContent=W,oe.style.color="#60afdf",oe.style.textDecoration="underline",f.parentNode&&(f.parentNode.replaceChild(oe,f),d=!0);continue}let x=0;const X=document.createDocumentFragment();if(M.forEach(W=>{const be=W.index,oe=W[0];if(be>x){const Gt=h.substring(x,be);Gt&&X.appendChild(document.createTextNode(Gt))}const Ye=oe.startsWith("http://")||oe.startsWith("https://")?oe:`https://${oe}`,nn=document.createElement("a");nn.href=Ye,nn.textContent=oe,nn.style.color="#60afdf",nn.style.textDecoration="underline",X.appendChild(nn),x=be+oe.length}),x<h.length){const W=h.substring(x);W&&X.appendChild(document.createTextNode(W))}f.parentNode&&X.childNodes.length>0&&(f.parentNode.replaceChild(X,f),d=!0)}d&&o&&e.nextTick(()=>{Xt(o),bn()})},$l=()=>{if(!v.value)return;const l=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,o=document.createTreeWalker(v.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const u=c.parentElement;return!u||u.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=o.nextNode();)a.push(r);for(let c=a.length-1;c>=0;c--){const u=a[c],d=u.textContent,m=[...d.matchAll(l)];if(m.length===0)continue;let f=0;const h=document.createDocumentFragment();m.forEach(N=>{const M=N.index,x=N[0].startsWith("<u>")?"u":"ins",X=N[1]||N[2]||"";M>f&&h.appendChild(document.createTextNode(d.substring(f,M)));const W=document.createElement(x);W.textContent=X,h.appendChild(W),f=M+N[0].length}),f<d.length&&h.appendChild(document.createTextNode(d.substring(f))),u.parentNode&&h.childNodes.length>0&&u.parentNode.replaceChild(h,u)}},Ot=l=>{if(!v.value||ge.value)return;if(!l){$l();return}if(!["*","_",">"].includes(l))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 u=()=>{let Gt="",Tt=0,Qt=!1;const Jt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jn=>jn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Wt=0;for(;Jt.nextNode();){const jn=Jt.currentNode,gn=jn.textContent||"",Kn=Wt;if(Wt+=gn.length,jn===r.startContainer){Gt+=gn.substring(0,r.startOffset),Tt=Kn+r.startOffset,Qt=!0;break}Gt+=gn}return Qt||(Tt=Gt.length),{textBeforeCursor:Gt,cursorCharOffset:Tt}},{textBeforeCursor:d}=u();if(!d.length)return;let m=null,f=null;if(d.endsWith("**")&&(m=d.match(/\*\*(.+?)\*\*$/s))||d.endsWith("__")&&(m=d.match(/__(.+?)__$/s))?f="strong":d.endsWith("*")&&!d.endsWith("**")&&(m=d.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||d.endsWith("_")&&!d.endsWith("__")&&(m=d.match(new RegExp("(?<!_)_([^_]+)_$")))?f="em":l===">"&&((m=d.match(/<u>(.+?)<\/u>$/s))||(m=d.match(/<ins>(.+?)<\/ins>$/s)))&&(f=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],N=m[1],M=d.length-h.length,X=(Gt=>{let Tt=0;const Qt=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Wt=>Wt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let Jt;for(;Jt=Qt.nextNode();){const Wt=(Jt.textContent||"").length;if(Tt+Wt>=Gt)return{node:Jt,offset:Gt-Tt};Tt+=Wt}return null})(M);if(!X)return;const W=document.createRange();W.setStart(X.node,X.offset),W.setEnd(r.endContainer,r.endOffset);const be=document.createElement(f);be.textContent=N,W.deleteContents(),W.insertNode(be);const oe=window.getSelection(),Ye=document.createRange();Ye.setStartAfter(be),Ye.collapse(!0),oe.removeAllRanges(),oe.addRange(Ye);const nn=Re();e.nextTick(()=>{R(),nn&&Xt(nn)})},Kt=()=>{v.value&&(Ae.value=Re(),Rt.value="",vt.value="",at.value="",Ge.value="",Ze.value="",mn.value=null,O.value=null,Fe.value="upload",Dt.value=!0,_t(),e.nextTick(()=>{en.value&&en.value.focus(),It.value&&(It.value.value="")}))},hl=l=>{const o=l.target?.files?.[0];if(!o){mn.value=null,vt.value="";return}mn.value=o;const a=new FileReader;a.onload=r=>{vt.value=r.target?.result||""},a.readAsDataURL(o)},Ll=()=>{It.value&&It.value.click()},Oo=()=>{Ge.value&&(Ze.value="")},Cl=()=>{Ze.value&&(Ge.value="")},yl=()=>{let l=O.value;if(!l){const o=window.getSelection();if(o&&o.rangeCount>0){const r=o.getRangeAt(0).commonAncestorContainer;l=r.nodeType===1?r.closest("img"):r.parentElement?.closest("img")}}if(l){const o=l.getAttribute("data-alt")||l.getAttribute("alt")||"";O.value=l,Rt.value=o.trim()===""||o.trim()==="Image"?"":o;const a=l.getAttribute("src")||l.src||"";a.startsWith("http://")||a.startsWith("https://")?(at.value=a,vt.value="",Fe.value="url"):(vt.value=a,at.value="",Fe.value="upload");const c=l.style.width||l.getAttribute("width")||"",u=l.style.height||l.getAttribute("height")||"";Ge.value=c.endsWith("px")?c.replace("px",""):c,Ze.value=u.endsWith("px")?u.replace("px",""):u,Ae.value=null}else{Kt();return}Dt.value=!0,Ct.value=!1,xe.value=!1,e.nextTick(()=>{Fe.value==="url"&&Bt.value?(Bt.value.focus(),Bt.value.select()):en.value&&(en.value.focus(),en.value.select()),It.value&&(It.value.value="")})},wt=()=>{Dt.value=!1,Rt.value="",vt.value="",at.value="",Ge.value="",Ze.value="",mn.value=null,O.value=null,Ae.value=null,Fe.value="upload"},mo=()=>{const l=(Rt.value||"").trim(),o=v.value?._mutationObserver;o&&o.disconnect(),ot.value?(ye.value&&(clearTimeout(ye.value),ye.value=null),$e(),ot.value=!1):$e();const a=Fe.value==="url"?at.value.trim():vt.value;if(O.value&&v.value&&v.value.contains(O.value)){a&&(O.value.src=a),O.value.setAttribute("alt",l),O.value.setAttribute("data-alt",l),Ge.value?(O.value.style.width=`${Ge.value}px`,O.value.setAttribute("width",Ge.value)):(O.value.style.removeProperty("width"),O.value.removeAttribute("width")),Ze.value?(O.value.style.height=`${Ze.value}px`,O.value.setAttribute("height",Ze.value)):(O.value.style.removeProperty("height"),O.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(O.value),c.collapse(!0),r.addRange(c)}R()}else{if(!a){o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),wt();return}if(v.value){v.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let u=null;if(Ae.value&&(Xt(Ae.value),c&&c.rangeCount>0&&(u=c.getRangeAt(0))),!u&&c&&c.rangeCount>0&&(u=c.getRangeAt(0)),!u&&v.value){if(u=document.createRange(),v.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);c&&(c.removeAllRanges(),c.addRange(u))}if(!u){wt();return}const d=u.commonAncestorContainer,m=d.nodeType===3?d.parentElement:d;if(!v.value.contains(m)){if(u=document.createRange(),v.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",v.value.appendChild(h),u.setStart(h,0),u.collapse(!0)}else u.selectNodeContents(v.value),u.collapse(!1);c&&(c.removeAllRanges(),c.addRange(u))}const f=document.createElement("img");f.src=a,f.setAttribute("alt",l),f.setAttribute("data-alt",l),Ge.value&&(f.style.width=`${Ge.value}px`,f.setAttribute("width",Ge.value)),Ze.value&&(f.style.height=`${Ze.value}px`,f.setAttribute("height",Ze.value));try{u.insertNode(f),u.setStartAfter(f),u.collapse(!0),c&&(c.removeAllRanges(),c.addRange(u))}catch{if(v.value){if(v.value.childNodes.length===0){const M=document.createElement("p");v.value.appendChild(M),M.appendChild(f)}else{const M=v.value.lastChild;if(M&&M.nodeType===1)M.appendChild(f);else{const x=document.createElement("p");v.value.appendChild(x),x.appendChild(f)}}const N=document.createRange();N.setStartAfter(f),N.collapse(!0),c&&(c.removeAllRanges(),c.addRange(N))}}O.value=f,R()}}e.nextTick(()=>{o&&v.value&&o.observe(v.value,{childList:!0,subtree:!0}),bn(),Pt(),wt()})};e.watch(()=>y.modelValue,l=>{if(y.richText&&v.value&&!ge.value){const o=Pn(l||""),r=v.value.innerHTML.replace(/ |\u00A0/g," "),c=o.replace(/ |\u00A0/g," ");if(r!==c){const u=Re();v.value.innerHTML=o,e.nextTick(()=>{se();const d=v.value.innerHTML||"",m=y.title||"",f=y.description||"";Z.value=d,Y.value=m,ee.value=f,q.value=d,Ee.value=m,je.value=f,Qe.value=[],mt.value=[],ye.value&&(clearTimeout(ye.value),ye.value=null),ot.value=!1,u&&Xt(u),Sn(),Bn(),z(),bn(),Pt(),xn(),Rn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>y.richText,l=>{l?(Pt(),e.nextTick(()=>{po()})):(_o(),qt.value=[],Vt.value&&(Vt.value.disconnect(),Vt.value=null)),xn()}),e.watch(()=>y.floatingToolbar,l=>{l?Pt():_o()}),e.watch(()=>y.disabled,l=>{l&&_o(),xn()}),e.watch(()=>y.description,()=>{e.nextTick(()=>{Ie.value?fo():ie()})}),e.watch(()=>y.title,()=>{e.nextTick(()=>{Zt.value?yn():lo()})}),e.watch(()=>y.customToolbarSlots,()=>{e.nextTick(()=>{zo()})},{deep:!0}),e.watch(()=>y.comments,(l,o)=>{if(Qo.value){Qo.value=!1;return}Mo.value||y.richText&&v.value&&e.nextTick(()=>{$o()})},{deep:!0,immediate:!1});const $o=()=>{if(!Mo.value&&!(!y.comments||!Array.isArray(y.comments)||y.comments.length===0)&&!(!y.richText||!v.value)){Mo.value=!0;try{const l=new Set,o=y.comments.filter(d=>{const m=String(d.conversation_id||d.id);return l.has(m)?!1:(l.add(m),!0)}),a=v.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(d=>{const m=d.parentNode;if(m){for(;d.firstChild;)m.insertBefore(d.firstChild,d);m.removeChild(d)}});let c=0;const u=new Set;o.forEach(d=>{if(!d.conversation_id||!d.selection_range)return;const m=typeof d.conversation_id=="string"&&d.conversation_id.startsWith("comment-")?null:Number(d.conversation_id)||d.conversation_id;if(!m)return;const f=String(m);if(u.has(f))return;const h=v.value.querySelector(`[data-comment="${f}"]`);if(h){Wo(h,d),u.add(f);return}try{const N=bl(d.selection_range,d.selection_text);if(N&&!N.collapsed){const M=N.commonAncestorContainer,x=M.nodeType===3?M.parentElement:M;if(x){const be=x.closest("[data-comment], [data-fake-comment]");if(be){const oe=be.getAttribute("data-comment")||be.getAttribute("data-fake-comment");if(String(oe)===String(m)){be.setAttribute("data-comment",f),be.removeAttribute("data-fake-comment"),Wo(be,d),u.add(f);return}else return}}const X=v.value.querySelector(`[data-comment="${f}"]`);if(X){Wo(X,d),u.add(f);return}const W=document.createElement("span");W.setAttribute("data-comment",f),Wo(W,d);try{N.surroundContents(W),c++,u.add(f)}catch{try{const oe=document.createRange();oe.setStart(N.startContainer,N.startOffset),oe.setEnd(N.endContainer,N.endOffset),Zo(oe),oe.surroundContents(W),c++,u.add(f)}catch{try{const Ye=N.extractContents();W.appendChild(Ye),N.insertNode(W),c++,u.add(f)}catch(Ye){console.warn("Failed to create comment marker:",Ye)}}}}}catch{}}),e.nextTick(()=>{Rn("restoreCommentsFromModel"),R(),Mo.value=!1})}catch{Mo.value=!1}}},Zo=l=>{if(!l||!v.value)return l;try{const o=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let a=l.startContainer,r=l.startOffset;if(a.nodeType===3){const d=a.parentElement;d&&o.includes(d.tagName)&&(r===0&&!nl(a)||l.setStartBefore(d))}else a.nodeType===1&&o.includes(a.tagName)&&r>0&&l.setStartBefore(a);let c=l.endContainer,u=l.endOffset;if(c.nodeType===3){const d=c.parentElement;d&&o.includes(d.tagName)&&(u===c.length&&!kl(c)||l.setEndAfter(d))}else c.nodeType===1&&o.includes(c.tagName)&&u<c.childNodes.length&&l.setEndAfter(c);return l}catch{return l}},nl=l=>{let o=l.previousSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.previousSibling}return!1},kl=l=>{let o=l.nextSibling;for(;o;){if(o.nodeType===3&&o.textContent.trim().length>0||o.nodeType===1&&o.textContent.trim().length>0)return!0;o=o.nextSibling}return!1},bl=(l,o)=>{if(!l||!v.value)return null;try{const a=document.createRange();if(l.type==="text"&&typeof l.start=="number"&&typeof l.end=="number"){let r=0;const c=[v.value];let u=null,d=!1,m=!1;for(;!m&&(u=c.pop());)if(u.nodeType===3){const f=r+u.length;!d&&l.start>=r&&l.start<=f&&(a.setStart(u,l.start-r),d=!0),d&&l.end>=r&&l.end<=f&&(a.setEnd(u,l.end-r),m=!0),r=f}else{let f=u.childNodes.length;for(;f--;)c.push(u.childNodes[f])}return d?Zo(a):null}}catch{return null}return null},Wo=(l,o)=>{if(!l||!o)return;const a=o.conversation||[],r=new Set,c=[],u=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};a.length>0&&a.forEach(m=>{m.user&&u(m.user)}),c.length>0?l.setAttribute("data-comment-user",JSON.stringify(c[0])):l.removeAttribute("data-comment-user"),c.length>1?l.setAttribute("data-comment-user-2",JSON.stringify(c[1])):l.removeAttribute("data-comment-user-2");const d=a.length;d>0?l.setAttribute("data-comment-count",String(d)):l.removeAttribute("data-comment-count")},Rn=(l="unknown")=>{if(!y.richText||!v.value){qt.value=[];return}Date.now()-sn.value<hn&&Lt.value!==null||Lt.value===null&&(Lt.value=requestAnimationFrame(()=>{if(Lt.value=null,sn.value=Date.now(),$n.value)return;$n.value=!0;const a={},r=v.value;if(!r){$n.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){$n.value=!1;return}const u=r.querySelectorAll("[data-comment], [data-fake-comment]"),d=[],m=new Set;u.forEach(x=>{const X=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");X&&x.tagName==="SPAN"&&(m.has(X)||(d.push(x),m.add(X)))}),u.forEach(x=>{const X=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");!X||m.has(X)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(x.tagName)?x.querySelector(`span[data-comment="${X}"], span[data-fake-comment="${X}"]`)||(d.push(x),m.add(X)):x.tagName!=="SPAN"&&(d.push(x),m.add(X)))});const f=c.getBoundingClientRect(),h=r.getBoundingClientRect();d.forEach((x,X)=>{let W=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");if(!W)return;if(typeof W=="string"&&W.startsWith("comment-")){const Qn=x.textContent?.trim(),oo=y.comments?.find(Fn=>(typeof Fn.conversation_id=="string"&&Fn.conversation_id.startsWith("comment-")?null:Fn.conversation_id)&&Fn.selection_text?.trim()===Qn);oo?(W=String(oo.conversation_id),x.setAttribute("data-comment",W),x.removeAttribute("data-fake-comment")):(W=String(Date.now()),x.setAttribute("data-comment",W),x.removeAttribute("data-fake-comment"))}const be=x.getBoundingClientRect(),oe=window.getComputedStyle(x),Ye=parseFloat(oe.lineHeight)||parseFloat(oe.fontSize)*1.2,Tt=be.top-h.top+Ye/2-15,Jt=h.top-f.top+Tt;let Wt=null,jn=null,gn=0;const Kn=[],Ho=new Set;if(W&&y.comments){const Qn=y.comments.find(oo=>String(oo.conversation_id||oo.id)===String(W));if(Qn){const oo=Qn.conversation||[];oo.length>0?(oo.forEach(Fn=>{Fn.user&&Fn.user.id&&!Ho.has(Fn.user.id)&&(Ho.add(Fn.user.id),Kn.push(Fn.user))}),gn=oo.length):(gn=0,Wt=null,jn=null),Kn.length>0?Wt=Kn[0]:Wt=null,Kn.length>1?jn=Kn[1]:jn=null}}const In=be.top+Ye/2-15,Ao=In+30,Eo=5,it=Ao>h.top+Eo&&In<h.bottom-Eo?1:0;qt.value.find(Qn=>Qn.id===W);let Vo=x;if(!Vo&&W&&v.value){const Qn=String(W);Vo=v.value.querySelector(`[data-comment="${Qn}"], [data-fake-comment="${Qn}"]`)}const Gn=Kn.length;a[W]?(a[W].top=Jt,a[W].opacity=it,a[W].element=Vo,a[W].firstUser=Wt,a[W].secondUser=jn,a[W].totalCount=gn,a[W].uniqueUserCount=Gn):a[W]={id:W,top:Jt,opacity:it,element:Vo,firstUser:Wt,secondUser:jn,totalCount:gn,uniqueUserCount:Gn}});const N=Object.values(a).map(x=>{const X=Math.max(0,(x.uniqueUserCount??0)-2);if(!x.element&&x.id&&v.value){const be=String(x.id);x.element=v.value.querySelector(`[data-comment="${be}"], [data-fake-comment="${be}"]`)}return{...x,firstUser:x.firstUser||null,secondUser:x.secondUser||null,totalCount:x.totalCount,additionalCount:X}});(qt.value.length!==N.length||N.some((x,X)=>{const W=qt.value[X];if(!W)return!0;const be=(W.firstUser?.id||null)!==(x.firstUser?.id||null),oe=(W.secondUser?.id||null)!==(x.secondUser?.id||null);return W.id!==x.id||Math.abs(W.top-x.top)>1||W.opacity!==x.opacity||W.totalCount!==x.totalCount||W.additionalCount!==x.additionalCount||be||oe||W.element!==x.element}))&&(qt.value=N),$n.value=!1}))},Hl=l=>{if(!l)return;let o=l.element;if(!o&&l.id&&v.value){const a=String(l.id);o=v.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}o&&(Yn(),Jn.value=o,o.classList.add("editor-comment-highlighted"))},Yn=(l=!1)=>{!l&&Yt.value!==null&&Jn.value&&(Jn.value.getAttribute("data-comment")||Jn.value.getAttribute("data-fake-comment"))===Yt.value||(v.value&&v.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jn.value&&(Jn.value.classList.remove("editor-comment-highlighted"),Jn.value=null))},Lo=l=>{if(!l||!l.element)return;Yn(!0);const o=l.element.getAttribute("data-comment")||l.element.getAttribute("data-fake-comment");if(!o)return;const a=`[data-comment="${o}"], [data-fake-comment="${o}"]`;_e("comment-marker-clicked",{commentId:o,selector:a,element:l.element})},wl=()=>{Yn()},po=()=>{!y.richText||!v.value||(Vt.value&&Vt.value.disconnect(),on.value!==null&&(clearTimeout(on.value),on.value=null),Vt.value=new MutationObserver(()=>{on.value===null&&(on.value=setTimeout(()=>{on.value=null,e.nextTick(()=>{Rn("MutationObserver")})},200))}),Vt.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"]}),Rn("setupCommentMarkersObserver-initial"))},xl=(l,o)=>{if(!l||!o)return;const a=o.getBoundingClientRect();let r=a.top,c=a.right+4;l.style.top=`${r}px`,l.style.left=`${c}px`,l.offsetHeight;const u=l.getBoundingClientRect(),d=window.innerWidth,m=window.innerHeight;if(u.right>d){const f=a.left-u.width-4;l.style.left=`${f}px`}if(u.bottom>m){const f=Math.max(8,m-u.height-8);l.style.top=`${f}px`}u.top<0&&(l.style.top="8px")};return e.watch(()=>nt.value,l=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(a=>{const r=a.getAttribute("data-submenu-id");if(r===l&&l){const c=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${r}"]`);if(c){if(a.parentNode!==document.body){const u=a.parentNode;a.dataset.originalParentRef=u===c?"inside":"sibling",document.body.appendChild(a)}a.style.display="block",a.style.visibility="hidden",a.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{xl(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(()=>[fe.value,Ue.value],()=>{fe.value==="askAi"||Ue.value==="askAi"?e.nextTick(()=>{pt()}):(nt.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(o=>{if(o.parentNode===document.body){const a=o.getAttribute("data-submenu-id");if(a){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${a}"]`);if(r)if(o.dataset.originalParentRef==="inside")r.appendChild(o);else{const u=r.closest(".dss-toolbar-dropdown");u&&u.insertBefore(o,r.nextSibling)}}}})}))}),e.watch(()=>y.locale,l=>{l&&l!==we.value&&(we.value=l)},{immediate:!0}),pe({openCommentOverlayForSelector:wn,updateCommentMarkers:Rn,restoreCommentsFromModel:$o}),(l,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",rn.value]),style:e.normalizeStyle(zn.value)},[H.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:o[14]||(o[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:b,title:e.unref(I)("textEditor.toolbar.undo")},[...o[45]||(o[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,qc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!$.value}]),onClick:C,title:e.unref(I)("textEditor.toolbar.redo")},[...o[46]||(o[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,Uc),o[73]||(o[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[0]||(o[0]=a=>dn("paragraph")),title:e.unref(I)("textEditor.toolbar.paragraphFormat")},[kt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",jc,[...o[47]||(o[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)])])):kt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Kc,[...o[48]||(o[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)])])):kt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gc,[...o[49]||(o[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)])])):kt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Qc,[...o[50]||(o[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)])])):kt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Jc,[...o[51]||(o[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)])])):kt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",ed,[...o[52]||(o[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",td,[...o[53]||(o[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)])])),o[54]||(o[54]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Yc),fe.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[8]||(o[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[1]||(o[1]=a=>kn("<h1>"))},[o[55]||(o[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(I)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[2]||(o[2]=a=>kn("<h2>"))},[o[56]||(o[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(I)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[3]||(o[3]=a=>kn("<h3>"))},[o[57]||(o[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(I)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[4]||(o[4]=a=>kn("<h4>"))},[o[58]||(o[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(I)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[5]||(o[5]=a=>kn("<h5>"))},[o[59]||(o[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(I)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[6]||(o[6]=a=>kn("<h6>"))},[o[60]||(o[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(I)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[7]||(o[7]=a=>kn("<p>"))},[o[61]||(o[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(I)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("bold")}]),onClick:o[9]||(o[9]=a=>Oe("bold")),title:e.unref(I)("textEditor.toolbar.bold")},[...o[62]||(o[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,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("italic")}]),onClick:o[10]||(o[10]=a=>Oe("italic")),title:e.unref(I)("textEditor.toolbar.italic")},[...o[63]||(o[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,od),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("underline")}]),onClick:o[11]||(o[11]=a=>Oe("underline")),title:e.unref(I)("textEditor.toolbar.underline")},[...o[64]||(o[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,ld),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st.value}]),onClick:rl,title:e.unref(I)("textEditor.toolbar.citation")},[...o[65]||(o[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,ad),o[74]||(o[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:cl,title:e.unref(I)("textEditor.toolbar.removeLink")},[...o[67]||(o[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,rd)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:Ko,title:e.unref(I)("textEditor.toolbar.insertLink")},[...o[66]||(o[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,sd)),o[75]||(o[75]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("insertUnorderedList")}]),onClick:ao,title:e.unref(I)("textEditor.toolbar.bulletList")},[...o[68]||(o[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,id),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("insertOrderedList")}]),onClick:dl,title:e.unref(I)("textEditor.toolbar.numberList")},[...o[69]||(o[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,cd),o[76]||(o[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Kt,title:e.unref(I)("textEditor.toolbar.image")},[...o[70]||(o[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,dd),Mn.value?(e.openBlock(),e.createElementBlock("div",ud)):e.createCommentVNode("",!0),Mn.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(I)("textEditor.toolbar.comment"),onClick:Io},[...o[71]||(o[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,md)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",vd,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:o[12]||(o[12]=a=>dn("askAi")),title:e.unref(I)("textEditor.toolbar.askAi")},[o[72]||(o[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",gd,e.toDisplayString(e.unref(I)("textEditor.toolbar.askAi")),1)],8,fd),fe.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[13]||(o[13]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",hd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[We(a)?(e.openBlock(),e.createElementBlock("div",Cd,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),We(a)&&r<H.customToolbarSlots.length-1&&ln(r)?(e.openBlock(),e.createElementBlock("div",yd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(fe.value==="paragraph"||fe.value==="askAi")&&H.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:_t})):e.createCommentVNode("",!0),e.createVNode(Al,{showModal:Me.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(I)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",kd,[e.createElementVNode("div",bd,[e.createElementVNode("label",wd,e.toDisplayString(e.unref(I)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:ut,type:"text","onUpdate:modelValue":o[15]||(o[15]=a=>F.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Xn,["enter"])},null,40,xd),[[e.vModelText,F.value]])]),e.createElementVNode("div",Ed,[e.createElementVNode("label",Vd,e.toDisplayString(e.unref(I)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:lt,type:"text","onUpdate:modelValue":o[16]||(o[16]=a=>he.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Xn,["enter"])},null,40,Sd),[[e.vModelText,he.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref(I)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xn},e.toDisplayString(e.unref(I)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Al,{showModal:Dt.value,width:"500px",height:"80vh",onCloseModal:wt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(O.value?e.unref(I)("textEditor.image.editImage"):e.unref(I)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Nd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Fe.value==="upload"}]),onClick:o[17]||(o[17]=a=>Fe.value="upload")},e.toDisplayString(e.unref(I)("textEditor.image.upload")),3),o[77]||(o[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":Fe.value==="url"}]),onClick:o[18]||(o[18]=a=>Fe.value="url")},e.toDisplayString(e.unref(I)("textEditor.image.imageLink")),3)]),Fe.value==="upload"?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",Bd,[e.createElementVNode("div",_d,[Ce.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Td,e.toDisplayString(e.unref(I)("textEditor.image.uploadImage")),1)),Ce.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Ll},[e.createElementVNode("img",{src:vt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,$d),o[78]||(o[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:It,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:hl},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:It,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:hl},null,544))]),e.createElementVNode("div",Ld,[e.createElementVNode("label",Hd,e.toDisplayString(e.unref(I)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:en,type:"text","onUpdate:modelValue":o[19]||(o[19]=a=>Rt.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mo,["enter"])},null,40,Ad),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",Dd,[e.createElementVNode("label",Rd,e.toDisplayString(e.unref(I)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[20]||(o[20]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(mo,["enter"]),onInput:Oo},null,40,Id),[[e.vModelText,Ge.value]])]),e.createElementVNode("div",Fd,[e.createElementVNode("label",zd,e.toDisplayString(e.unref(I)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[21]||(o[21]=a=>Ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(mo,["enter"]),onInput:Cl},null,40,Pd),[[e.vModelText,Ze.value]])])])])):e.createCommentVNode("",!0),Fe.value==="url"?(e.openBlock(),e.createElementBlock("div",Od,[e.createElementVNode("div",Zd,[e.createElementVNode("div",Wd,[e.createElementVNode("label",qd,e.toDisplayString(e.unref(I)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Bt,type:"text","onUpdate:modelValue":o[22]||(o[22]=a=>at.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(mo,["enter"])},null,40,Ud),[[e.vModelText,at.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(I)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":o[23]||(o[23]=a=>Rt.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.enterAltText"),onKeyup:e.withKeys(mo,["enter"])},null,40,jd),[[e.vModelText,Rt.value]])]),e.createElementVNode("div",Kd,[e.createElementVNode("label",Gd,e.toDisplayString(e.unref(I)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[24]||(o[24]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(mo,["enter"]),onInput:Oo},null,40,Qd),[[e.vModelText,Ge.value]])]),e.createElementVNode("div",Jd,[e.createElementVNode("label",eu,e.toDisplayString(e.unref(I)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":o[25]||(o[25]=a=>Ze.value=a),class:"dss-link-modal-input",placeholder:e.unref(I)("textEditor.image.auto"),onKeyup:e.withKeys(mo,["enter"]),onInput:Cl},null,40,tu),[[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:wt},e.toDisplayString(e.unref(I)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:mo},e.toDisplayString(e.unref(I)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Cn.value&&Zt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(I)("textEditor.labels.title")),1),e.createElementVNode("div",nu,[Zt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ou,[H.title?(e.openBlock(),e.createElementBlock("span",lu,e.toDisplayString(H.title),1)):(e.openBlock(),e.createElementBlock("span",au,e.toDisplayString(Pe.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Se,value:H.title,onInput:An,onFocus:vn,onBlur:Do,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Zt.value}]),placeholder:Pe.value,disabled:H.disabled,rows:"1"},null,42,su)])],2),Cn.value&&Zt.value?(e.openBlock(),e.createElementBlock("div",ru,[e.renderSlot(l.$slots,"title-slot")])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-description-wrapper",{"dss-text-editor-no-border-bottom":cn.value&&Ie.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(I)("textEditor.labels.description")),1),e.createElementVNode("div",iu,[Ie.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",cu,[H.description?(e.openBlock(),e.createElementBlock("span",du,e.toDisplayString(H.description),1)):(e.openBlock(),e.createElementBlock("span",uu,e.toDisplayString(Xe.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:ze,value:H.description,onInput:No,onFocus:So,onBlur:St,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!Ie.value}]),placeholder:Xe.value,disabled:H.disabled,rows:"1"},null,42,mu)])],2),cn.value&&Ie.value?(e.openBlock(),e.createElementBlock("div",pu,[e.renderSlot(l.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(qt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Yt.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=>Hl(a),onMouseleave:wl},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Lo(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,gu)):(e.openBlock(),e.createElementBlock("span",hu,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,fu)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Lo(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,yu)):(e.openBlock(),e.createElementBlock("span",ku,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,Cu)):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=>Lo(a),["stop"])},[e.createElementVNode("span",wu,"+"+e.toDisplayString(a.additionalCount),1)],12,bu)):e.createCommentVNode("",!0)],46,vu))),128)),H.richText?(e.openBlock(),e.createElementBlock("div",Bu,[e.createElementVNode("div",{ref_key:"editorRef",ref:v,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":H.disabled,"dss-text-editor-fixed-height":H.fixedHeight}]),style:e.normalizeStyle(Co.value),onInput:R,onBlur:Ro,onClick:Bo,onMouseup:Po,onKeyup:Po,onKeydown:Dn,onPaste:un,onMousemove:_l,onMouseleave:fl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Yt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(_n.value)},[so.value||Nn.value.length>0?(e.openBlock(),e.createElementBlock("div",_u,[e.createElementVNode("div",Tu,[so.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:so.value},null,8,$u)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Lu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Nn.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",Hu,[e.createElementVNode("div",Au,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Du)):(e.openBlock(),e.createElementBlock("span",Ru,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Iu,[e.createElementVNode("div",Fu,[e.createElementVNode("div",zu,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Pu,e.toDisplayString(Yo(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":ko(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),y.commentUser&&a.user&&a.user.id===y.commentUser.id&&!ko(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Nl(a,r),["stop"]),title:e.unref(I)("textEditor.comment.delete")||"Delete comment"},[...o[80]||(o[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,Ou)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zu,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:to,"onUpdate:modelValue":o[26]||(o[26]=a=>eo.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(I)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Jo,["prevent","stop"]),["enter"]),onInput:o[27]||(o[27]=()=>{if(to.value){const a=to.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Wu),[[e.vModelText,eo.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Jo,["stop"])},[...o[81]||(o[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",qu,[e.createElementVNode("div",Uu,[e.createElementVNode("span",Xu,e.toDisplayString(A.value)+" "+e.toDisplayString(A.value===1?e.unref(I)("textEditor.footer.word"):e.unref(I)("textEditor.footer.words")),1),o[82]||(o[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yu,e.toDisplayString(K.value)+" "+e.toDisplayString(K.value===1?e.unref(I)("textEditor.footer.character"):e.unref(I)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",xu,[e.createElementVNode("textarea",{value:H.modelValue,onInput:bo,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":H.fixedHeight}]),placeholder:Be.value,rows:H.rows,disabled:H.disabled,style:e.normalizeStyle(Ln.value)},null,46,Eu),e.createElementVNode("div",Vu,[e.createElementVNode("div",Su,[e.createElementVNode("span",Nu,e.toDisplayString(A.value)+" "+e.toDisplayString(A.value===1?e.unref(I)("textEditor.footer.word"):e.unref(I)("textEditor.footer.words")),1),o[79]||(o[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Mu,e.toDisplayString(K.value)+" "+e.toDisplayString(K.value===1?e.unref(I)("textEditor.footer.character"):e.unref(I)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Q.value&&V.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ue.value),onMouseenter:o[28]||(o[28]=a=>Ke.value=!0),onMouseleave:To},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Tl,["stop"]),title:V.value},e.toDisplayString(V.value),9,ju),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(no,["stop"]),title:e.unref(I)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gu,[...o[83]||(o[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,Ku)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[xe.value&&ae.value&&v.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(et.value),onMouseenter:o[29]||(o[29]=a=>Ct.value=!0),onMouseleave:xo},[e.createElementVNode("div",Qu,[ae.value===e.unref(I)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Ju,[...o[84]||(o[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:ae.value},e.toDisplayString(ae.value),9,e1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(yl,["stop"]),title:e.unref(I)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n1,[...o[85]||(o[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,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[H.floatingToolbar&&H.richText&&ve.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:ht,class:"dss-floating-toolbar",style:e.normalizeStyle(Mt.value),onMousedown:o[44]||(o[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",o1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(b,["stop"]),title:e.unref(I)("textEditor.toolbar.undo")},[...o[86]||(o[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,l1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!$.value}]),onClick:e.withModifiers(C,["stop"]),title:e.unref(I)("textEditor.toolbar.redo")},[...o[87]||(o[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,a1),o[107]||(o[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:o[30]||(o[30]=e.withModifiers(a=>vl("paragraph"),["stop"])),title:e.unref(I)("textEditor.toolbar.paragraphFormat")},[kt.value==="h1"?(e.openBlock(),e.createElementBlock("svg",i1,[...o[88]||(o[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)])])):kt.value==="h2"?(e.openBlock(),e.createElementBlock("svg",c1,[...o[89]||(o[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)])])):kt.value==="h3"?(e.openBlock(),e.createElementBlock("svg",d1,[...o[90]||(o[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)])])):kt.value==="h4"?(e.openBlock(),e.createElementBlock("svg",u1,[...o[91]||(o[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)])])):kt.value==="h5"?(e.openBlock(),e.createElementBlock("svg",m1,[...o[92]||(o[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)])])):kt.value==="h6"?(e.openBlock(),e.createElementBlock("svg",p1,[...o[93]||(o[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",v1,[...o[94]||(o[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)])])),o[95]||(o[95]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,r1),Ue.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[38]||(o[38]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[31]||(o[31]=a=>uo("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[32]||(o[32]=a=>uo("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[33]||(o[33]=a=>uo("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[34]||(o[34]=a=>uo("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[35]||(o[35]=a=>uo("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[36]||(o[36]=a=>uo("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:o[37]||(o[37]=a=>uo("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(I)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),o[108]||(o[108]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("bold")}]),onClick:o[39]||(o[39]=e.withModifiers(a=>Oe("bold"),["stop"])),title:e.unref(I)("textEditor.toolbar.bold")},[...o[96]||(o[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,f1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("italic")}]),onClick:o[40]||(o[40]=e.withModifiers(a=>Oe("italic"),["stop"])),title:e.unref(I)("textEditor.toolbar.italic")},[...o[97]||(o[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,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("underline")}]),onClick:o[41]||(o[41]=e.withModifiers(a=>Oe("underline"),["stop"])),title:e.unref(I)("textEditor.toolbar.underline")},[...o[98]||(o[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,h1),o[109]||(o[109]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":st.value}]),onClick:e.withModifiers(rl,["stop"]),title:e.unref(I)("textEditor.toolbar.citation")},[...o[99]||(o[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,C1),o[110]||(o[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),Te.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(cl,["stop"]),title:e.unref(I)("textEditor.toolbar.removeLink")},[...o[101]||(o[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,k1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(Ko,["stop"]),title:e.unref(I)("textEditor.toolbar.insertLink")},[...o[100]||(o[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,y1)),o[111]||(o[111]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("insertUnorderedList")}]),onClick:e.withModifiers(ao,["stop"]),title:e.unref(I)("textEditor.toolbar.bulletList")},[...o[102]||(o[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,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":rt("insertOrderedList")}]),onClick:e.withModifiers(dl,["stop"]),title:e.unref(I)("textEditor.toolbar.numberList")},[...o[103]||(o[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,w1),o[112]||(o[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Kt,["stop"]),title:e.unref(I)("textEditor.toolbar.image")},[...o[104]||(o[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,x1),o[113]||(o[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(I)("textEditor.toolbar.comment"),onClick:e.withModifiers(Io,["stop"])},[...o[105]||(o[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,E1),H.askAi?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),H.askAi?(e.openBlock(),e.createElementBlock("div",S1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:o[42]||(o[42]=e.withModifiers(a=>vl("askAi"),["stop"])),title:e.unref(I)("textEditor.toolbar.askAi")},[o[106]||(o[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",M1,e.toDisplayString(e.unref(I)("textEditor.toolbar.askAi")),1)],8,N1),Ue.value==="askAi"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:o[43]||(o[43]=e.withModifiers(()=>{},["stop"]))},[e.renderSlot(l.$slots,"ask-ai-dropdown")])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),Hn.value?(e.openBlock(),e.createElementBlock("div",B1,[H.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[We(a)&&tn(a)?(e.openBlock(),e.createElementBlock("div",T1,[e.renderSlot(l.$slots,a)])):e.createCommentVNode("",!0),We(a)&&tn(a)&&r<H.customToolbarSlots.length-1&&Vn(r)?(e.openBlock(),e.createElementBlock("div",$1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),A1={class:"dss-color-picker__section-title"},D1={class:"dss-color-picker__presets-row"},R1=["title","onClick"],I1={key:1,class:"dss-color-picker__section"},F1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={class:"dss-color-picker__section"},O1={class:"dss-color-picker__section-header"},Z1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],q1=["onClick"],U1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},X1=["title","onClick"],Y1={class:"dss-color-picker__input-row"},j1=["value"],K1={__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(H,{emit:pe}){function D(Z){const q=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(Z);if(!q)return{h:0,s:0,l:50};const Y=parseInt(q[1],16)/255,ee=parseInt(q[2],16)/255,Ee=parseInt(q[3],16)/255,je=Math.max(Y,ee,Ee),Se=Math.min(Y,ee,Ee);let ze=0,ft=0;const Et=(je+Se)/2;if(je!==Se){const Ft=je-Se;switch(ft=Et>.5?Ft/(2-je-Se):Ft/(je+Se),je){case Y:ze=((ee-Ee)/Ft+(ee<Ee?6:0))/6;break;case ee:ze=((Ee-Y)/Ft+2)/6;break;case Ee:ze=((Y-ee)/Ft+4)/6;break}}return{h:ze*360,s:ft*100,l:Et*100}}function I(Z,q,Y){q/=100,Y/=100;const ee=q*Math.min(Y,1-Y),Ee=je=>{const Se=(je+Z/30)%12,ze=Y-ee*Math.max(Math.min(Se-3,9-Se,1),-1);return Math.round(255*ze).toString(16).padStart(2,"0")};return`#${Ee(0)}${Ee(8)}${Ee(4)}`}function we(Z){const q=Z.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!q)return null;let Y=q[1];return Y.length===3&&(Y=Y.split("").map(ee=>ee+ee).join("")),"#"+Y}function y(Z,q,Y){q/=100,Y/=100;const ee=Y+q*Math.min(Y,1-Y),Ee=ee===0?0:2-2*Y/ee;return{h:Z,s:Ee*100,v:ee*100}}function _e(Z,q,Y){q/=100,Y/=100;const ee=Y*(1-q/2),Ee=ee===0||ee===1?0:(Y-ee)/Math.min(ee,1-ee);return{h:Z,s:Ee*100,l:ee*100}}const ne=H,tt=pe,v=e.ref(!1),fe=e.ref(!1),Te=e.ref(!1),ge=e.ref(-1),Q=e.ref(-1),V=e.ref(null),ue=e.ref(null),Ke=e.ref(null),Me=e.ref(null),he=e.ref({top:0,left:0}),F=e.ref(D(ne.modelValue||"#b8a5de")),lt=e.computed(()=>Array.isArray(ne.presetGroups)&&ne.presetGroups.length>0),ut=e.computed(()=>lt.value?0:ne.initialPresetCount!=null?ne.initialPresetCount:Q.value<0?null:Q.value),ke=e.computed(()=>{const Z=ut.value;return Z==null?!0:Math.max(0,ne.presetColors.length-Z)<ne.max}),$t=e.computed(()=>!!(fe.value||ge.value>=0||!Nt.value&&ne.presetColors.length===0));e.computed(()=>{const Z=ut.value;return Z!=null&&ne.presetColors.length>Z});const Nt=e.computed(()=>lt.value||ut.value!=null),st=e.computed(()=>{const Z=ut.value;return Z==null?[]:ne.presetColors.slice(0,Z)}),He=e.computed(()=>{const Z=ut.value;return Z==null?[]:ne.presetColors.slice(Z)});function ve(Z){const q=ut.value;return q!=null?q+Z:-1}function Mt(Z){const q=ut.value;return q!=null&&Z>=q}function ht(Z){Mt(Z)&&(ge.value=Z,F.value=D(ne.presetColors[Z]),fe.value=!0,e.nextTick(()=>Me.value?.focus()))}function Ue(Z){if(!Mt(Z))return;const q=ne.presetColors.filter((Ee,je)=>je!==Z);tt("update:presetColors",q);const Y=we(ne.modelValue),ee=we(ne.presetColors[Z]);if(Y&&ee&&Y.toLowerCase()===ee.toLowerCase()){const Ee=q[Math.max(0,Z-1)]||q[0];Ee&&tt("update:modelValue",Ee)}}function Dt(){Te.value=!Te.value,Te.value||(ge.value=-1,fe.value=!1)}function Rt(){if(ge.value<0)return;const Z=Ze.value,q=we(Z);if(q){const Y=[...ne.presetColors];Y[ge.value]=q,tt("update:presetColors",Y),tt("update:modelValue",q),ge.value=-1,fe.value=!1}}function mn(){ne.disabled||(ge.value=-1,fe.value=!fe.value,fe.value&&(ae(),e.nextTick(()=>Me.value?.focus())))}function vt(Z){const q=we(Z),Y=we(ne.modelValue);return q&&Y&&q.toLowerCase()===Y.toLowerCase()}function Ge(){if(ne.disabled||!ke.value)return;const Z=Ze.value,q=we(Z);if(q){const Y=[...ne.presetColors,q];tt("update:presetColors",Y),tt("update:modelValue",q);const ee=ut.value??Q.value;ee>=0&&Y.length-ee>=ne.max&&(fe.value=!1)}}const Ze=e.computed(()=>{const{h:Z,s:q,l:Y}=F.value;return I(Z,q,Y)}),en=e.computed(()=>Ze.value.toLowerCase()),It=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${F.value.h}, 100%, 50%))`})),Bt=e.computed(()=>{const Z=y(F.value.h,F.value.s,F.value.l);return{left:`${Z.s}%`,bottom:`${Z.v}%`,transform:"translate(-50%, 50%)"}}),O=e.computed(()=>({left:`${F.value.h/360*100}%`,transform:"translateX(-50%)"})),Ae=e.computed(()=>({position:"fixed",left:`${he.value.left}px`,top:`${he.value.top}px`,zIndex:1002}));function xe(){if(!V.value||!v.value)return;const Z=V.value.getBoundingClientRect(),q=window.innerHeight||document.documentElement.clientHeight;let Y=Z.bottom+4;const ee=ue.value;ee&&Y+ee.offsetHeight>q-8&&(Y=Z.top-4-ee.offsetHeight),he.value={top:Y,left:Z.left}}function ae(){const Z=ne.modelValue||"#b8a5de";we(Z)&&(F.value=D(Z))}function et(){tt("update:modelValue",Ze.value)}function Ct(){ne.disabled||(v.value=!v.value,v.value&&(ae(),e.nextTick(()=>{xe(),Me.value?.focus()})))}function Fe(){const Z=Ze.value,q=we(Z);if(q){if(ge.value>=0){const Y=[...ne.presetColors];Y[ge.value]=q,tt("update:presetColors",Y),tt("update:modelValue",q)}else if((ne.presetColors.length>0||lt.value)&&fe.value&&ke.value&&!ne.presetColors.some(ee=>we(ee)?.toLowerCase()===q.toLowerCase())){const ee=[...ne.presetColors,q];tt("update:presetColors",ee),tt("update:modelValue",q)}}v.value=!1,fe.value=!1,Te.value=!1,ge.value=-1}function at(Z){if(!Ke.value)return;const q=Ke.value.getBoundingClientRect(),Y=ee=>{const Ee=Math.max(0,Math.min(1,(ee.clientX-q.left)/q.width)),je=Math.max(0,Math.min(1,1-(ee.clientY-q.top)/q.height)),Se={h:F.value.h,s:Ee*100,v:je*100};F.value=_e(Se.h,Se.s,Se.v)};Y(Z),document.addEventListener("mousemove",Y),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Y),et()},{once:!0})}function nt(Z){if(!Z.currentTarget)return;const Y=Z.currentTarget.getBoundingClientRect(),ee=Ee=>{const je=Math.max(0,Math.min(1,(Ee.clientX-Y.left)/Y.width));F.value={...F.value,h:je*360}};ee(Z),document.addEventListener("mousemove",ee),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ee),et()},{once:!0})}function xt(Z){const q=Z.target.value,Y=we(q);Y&&(F.value=D(Y),tt("update:modelValue",Y))}function Qe(Z){if(ne.disabled)return;const q=we(Z);q&&(F.value=D(q),tt("update:modelValue",q))}let mt=null,ye=null;function ot(){mt&&(document.removeEventListener("keydown",mt),mt=null),ye&&(window.removeEventListener("resize",ye),ye=null)}return e.watch(v,Z=>{if(ot(),Z){if(!lt.value&&ne.initialPresetCount==null){const q=ne.presetColors.length;q>0&&(Q.value<0||q<Q.value)&&(Q.value=q)}mt=q=>{q.key==="Escape"&&Fe()},ye=xe,document.addEventListener("keydown",mt),window.addEventListener("resize",ye)}}),e.watch(()=>ne.modelValue,()=>{v.value&&ae()},{immediate:!1}),e.watch(He,Z=>{Z.length===0&&(Te.value=!1,ge.value=-1,fe.value=!1)}),e.onBeforeUnmount(ot),(Z,q)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":H.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:V,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":v.value}]),onClick:Ct},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Ze.value})},[...q[0]||(q[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(Fe,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ue,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ae.value)},[Nt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(H.presetGroups,(Y,ee)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ee,class:"dss-color-picker__section"},[e.createElementVNode("span",A1,e.toDisplayString(Y.title),1),e.createElementVNode("div",D1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Y.colors,(Ee,je)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ee+"-"+je,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":vt(Ee)}]),style:e.normalizeStyle({backgroundColor:Ee}),title:Ee,onClick:e.withModifiers(Se=>Qe(Ee),["stop"])},null,14,R1))),128))])]))),128)):st.value.length?(e.openBlock(),e.createElementBlock("div",I1,[q[1]||(q[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",F1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(st.value,(Y,ee)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ee,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":vt(Y)}]),style:e.normalizeStyle({backgroundColor:Y}),title:Y,onClick:e.withModifiers(Ee=>Qe(Y),["stop"])},null,14,z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",P1,[e.createElementVNode("div",O1,[q[3]||(q[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),He.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":Te.value}]),title:"Manage custom colors",onClick:e.withModifiers(Dt,["stop"])},[...q[2]||(q[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",Z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(Y,ee)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ee,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":Te.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!Te.value&&vt(Y),"dss-color-picker__preset-bubble--editing":Te.value&&ge.value===ve(ee)}]),style:e.normalizeStyle({backgroundColor:ge.value===ve(ee)?Ze.value:Y}),title:ge.value===ve(ee)?Ze.value:Y,onClick:e.withModifiers(Ee=>Te.value?ht(ve(ee)):Qe(Y),["stop"])},null,14,W1),Te.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(Ee=>Ue(ve(ee)),["stop"])},[...q[4]||(q[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,q1)):e.createCommentVNode("",!0)],2))),128)),ke.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":fe.value}]),onClick:e.withModifiers(mn,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):H.presetColors.length?(e.openBlock(),e.createElementBlock("div",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.presetColors,(Y,ee)=>(e.openBlock(),e.createElementBlock("button",{key:ee,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":vt(Y)}]),style:e.normalizeStyle({backgroundColor:Y}),title:Y,onClick:e.withModifiers(Ee=>Qe(Y),["stop"])},null,14,X1))),128)),ke.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":fe.value}]),onClick:e.withModifiers(mn,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),$t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ke,onMousedown:at},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(It.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Bt.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:nt},[q[5]||(q[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(O.value)},null,4)],32),e.createElementVNode("div",Y1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Me,type:"text",class:"dss-color-picker__hex-input",value:en.value,onInput:xt},null,40,j1)]),Nt.value&&(H.presetColors.length||lt.value)&&ke.value&&ge.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ge}," Save color ")):e.createCommentVNode("",!0),Nt.value&&ge.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Rt}," Save color ")):e.createCommentVNode("",!0),Nt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:Fe}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},G1={key:0,class:"dss-loader"},Q1={key:0,class:"dss-loader-label"},J1={key:1,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:2,class:"dss-loader"},n2={key:0,class:"dss-loader-label"},o2={key:3,class:"dss-loader"},l2={key:0,class:"dss-loader-label"},a2={key:4,class:"dss-loader"},s2={key:0,class:"dss-loader-label"},r2={key:5,class:"dss-loader dss-loader--inline"},i2={class:"dss-loader-inline-text"},c2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(H){const pe=H,D=e.computed(()=>pe.size==="small"?"dss-loaders--size-small":pe.size==="large"?"dss-loaders--size-large":pe.size==="medium"||pe.size==null?"dss-loaders--size-medium":null),I=e.computed(()=>pe.size==="small"||pe.size==="medium"||pe.size==="large"||pe.size==null?{}:{"--dss-loader-size":typeof pe.size=="number"?`${pe.size}px`:String(pe.size)});return(we,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",D.value]),style:e.normalizeStyle(I.value)},[H.type==="spinner"?(e.openBlock(),e.createElementBlock("div",G1,[y[0]||(y[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="dots"?(e.openBlock(),e.createElementBlock("div",J1,[y[1]||(y[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)),H.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="battery"?(e.openBlock(),e.createElementBlock("div",t2,[y[2]||(y[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),H.label?(e.openBlock(),e.createElementBlock("span",n2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",o2,[y[3]||(y[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)),H.label?(e.openBlock(),e.createElementBlock("span",l2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="bars"?(e.openBlock(),e.createElementBlock("div",a2,[y[4]||(y[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)),H.label?(e.openBlock(),e.createElementBlock("span",s2,e.toDisplayString(H.label),1)):e.createCommentVNode("",!0)])):H.type==="inline"?(e.openBlock(),e.createElementBlock("div",r2,[y[5]||(y[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",i2,[e.renderSlot(we.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(H.label),1)])])])):e.createCommentVNode("",!0)],6))}},ql="dss-skeleton-item",d2={__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:H=>["single","multiple"].includes(H)},targetClass:{type:String,default:ql},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(H){const pe=H,D=e.computed(()=>{const y={"dss-skeleton--loading":pe.loading,"dss-skeleton--static":!pe.shimmer,"dss-skeleton--multiple":pe.mode==="multiple","dss-skeleton--dark":pe.darkMode};return pe.mode==="multiple"&&pe.targetClass!==ql&&(y[`dss-skeleton--target-${pe.targetClass}`]=!0),y}),I=e.computed(()=>{const y={};return pe.borderRadius&&(y.borderRadius=pe.borderRadius),y}),we=e.computed(()=>{const y={};return pe.borderRadius&&(y["--dss-skeleton-border-radius"]=pe.borderRadius),pe.darkMode?(y["--dss-skeleton-bg"]=pe.bgDark||"#322c3f",y["--dss-skeleton-shimmer"]=pe.shimmerDark||"#3e3f41",y):(pe.bgColor&&(y["--dss-skeleton-bg"]=pe.bgColor),pe.shimmerColor&&(y["--dss-skeleton-shimmer"]=pe.shimmerColor),y)});return(y,_e)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",D.value]),style:e.normalizeStyle(we.value)},[H.loading&&H.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(I.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":H.loading&&H.mode==="single"}])},[e.renderSlot(y.$slots,"default")],2)],6))}},u2={key:0,class:"dss-dnd-column-header"},m2={class:"dss-dnd-column-title"},p2={class:"dss-dnd-column-count"},v2=["data-column"],f2={key:0,class:"dss-dnd-indicator"},g2=["onPointerdown"],h2=["onPointerdown"],C2={class:"dss-dnd-item-content"},y2={class:"dss-dnd-item-default"},k2={key:0,class:"dss-dnd-empty"},b2={name:"DSSDnd"},w2=Object.assign(b2,{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"],setup(H,{emit:pe}){const D=H,I=pe,we={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1},y=e.computed(()=>({...we,...D.options})),_e=e.computed(()=>({"--dss-dnd-col-min-w":y.value.columnMinWidth,"--dss-dnd-col-max-w":y.value.columnMaxWidth,"--dss-dnd-col-gap":y.value.columnGap,"--dss-dnd-indicator-color":y.value.indicatorColor,"--dss-dnd-body-max-h":y.value.columnBodyMaxHeight})),ne=e.ref(null),tt=e.ref(null),v=e.ref(-1),fe=e.ref(null);let Te=null,ge=null,Q=null,V=null,ue=0,Ke=0,Me="",he=null;const F=5,lt=e.computed(()=>{const O={};for(const Ae of D.columns)O[Ae.value]=D.items.filter(xe=>xe[D.columnKey]===Ae.value).sort((xe,ae)=>(xe[D.positionKey]??0)-(ae[D.positionKey]??0));return O}),ut=e.computed(()=>{const O={},Ae=!!ne.value,xe=ne.value?.[D.itemKey],ae=tt.value,et=v.value;for(const Ct of D.columns){const Fe=lt.value[Ct.value]||[],at=[],nt=ae==Ct.value;let xt=0;for(let Qe=0;Qe<Fe.length;Qe++){const mt=Fe[Qe],ye=Ae&&mt[D.itemKey]===xe;!ye&&nt&&et===xt&&at.push({type:"indicator",key:`ind-${xt}`}),ye||xt++,at.push({type:"item",item:mt,isDragged:ye,key:`item-${mt[D.itemKey]}`})}nt&&et>=xt&&at.push({type:"indicator",key:"ind-end"}),O[Ct.value]=at}return O});function ke(O,Ae){const ae=(lt.value[O]||[]).filter(Fe=>Fe[D.itemKey]!==ne.value?.[D.itemKey]);if(ae.length===0)return 1;if(Ae<=0){const Fe=ae[0][D.positionKey];return Fe!=null&&Fe>0?Fe/2:.5}if(Ae>=ae.length){const Fe=ae[ae.length-1][D.positionKey];return(Fe??0)+1}const et=ae[Ae-1][D.positionKey]??0,Ct=ae[Ae][D.positionKey]??0;return(et+Ct)/2}function $t(O,Ae,xe){Q&&Q.remove();const ae=O.getBoundingClientRect(),et=O.cloneNode(!0);et.classList.add("dss-dnd-ghost"),et.style.cssText=`
|
|
100
|
+
</svg>`,f=e.ref(null),ue=e.ref(null),ve=e.ref(!1),de=e.ref(!1),te=e.ref(!1),S=e.ref(""),ae=e.ref({}),Ze=e.ref(!1),He=e.ref(!1),Ve=e.ref(""),O=e.ref(""),lt=e.ref(null),je=e.ref(null),Ne=e.ref(null),Ht=e.ref(null),Bt=e.ref(""),pt=e.ref(!1),Re=e.ref({}),ge=e.ref(!1),gt=e.ref({}),wt=e.ref(null),tt=e.ref(null),Mt=e.ref(!1),Ft=e.ref(""),on=e.ref(null),xt=e.ref(""),Ke=e.ref(""),Ge=e.ref(""),Zt=e.ref(null),At=e.ref(null),_t=e.ref(null),U=e.ref(null),Ie=e.ref(null),_e=e.ref(!1),fe=e.ref(""),ct=e.ref({}),Et=e.ref(!1),We=e.ref("upload"),ft=e.ref(""),dt=e.ref(null),$t=e.ref(null),ot=e.ref([]),bt=e.ref([]),Se=e.ref(null),ut=e.ref(!1),X=e.ref(""),j=e.ref(""),Q=e.ref(""),re=e.ref(""),x=e.ref(""),k=e.ref(""),V=e.ref(null),P=e.ref(null),Y=e.ref(null),xe=e.ref(!1),Ye=e.ref(null),Le=e.ref(!1),le=e.ref(!1),Qe=e.ref(null),qe=e.ref("p"),Vt=e.ref(!1),vt=e.ref([]),Ue=e.ref(null),Dt=e.ref(null),$n=e.ref(null),Tn=e.ref(!1),cn=e.ref(0),yn=100,an=e.ref(null),un=e.computed(()=>({"dss-text-editor-no-border":!C.border,"dss-text-editor-rounded":C.rounded,"dss-text-editor-full-height":C.fullHeight,"dss-comment-overlay-open":Kt.value!==null})),zn=e.computed(()=>({})),Ln=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+24+2}px`,resize:"none",overflowY:"auto"}),hl=e.computed(()=>!C.fixedHeight||C.fullHeight?{}:{height:`${1.6*14*C.rows+32}px`,overflowY:"auto"}),A=e.computed(()=>C.richText&&bt.value.length>0),q=e.computed(()=>{if(!C.modelValue)return"";if(C.richText){let o=C.modelValue.replace(/<script[^>]*>[\s\S]*?<\/script>/gi,"");return o=o.replace(/<style[^>]*>[\s\S]*?<\/style>/gi,""),o=o.replace(/<[^>]+>/g,""),o=o.replace(/ /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 C.modelValue}),I=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),ne=e.computed(()=>q.value.length),Be=e.computed(()=>U.value!==null&&We.value==="upload"&&xt.value&&xt.value.startsWith("data:")),Je=e.computed(()=>C.titlePlaceholder||R("textEditor.placeholders.title")),rt=e.computed(()=>C.descriptionPlaceholder||R("textEditor.placeholders.description")),Fe=e.computed(()=>C.placeholder||R("textEditor.placeholders.startTyping")),at=o=>ie&&ie[o]!==void 0,sn=o=>{for(let l=o+1;l<C.customToolbarSlots.length;l++)if(at(C.customToolbarSlots[l]))return!0;return!1},Nn=o=>{for(let l=o+1;l<C.customToolbarSlots.length;l++){const a=C.customToolbarSlots[l];if(at(a)&&nn(a))return!0}return!1},nn=o=>C.customToolbarFloatingMap.hasOwnProperty(o)?C.customToolbarFloatingMap[o]===!0:!0,Hn=e.computed(()=>C.customToolbarSlots.some(o=>at(o)&&nn(o))),Cn=e.computed(()=>at("title-slot")),dn=e.computed(()=>at("description-slot")),fn=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Pn=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},yl=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())},Xl=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""}},Cl=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=R("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"},kl=o=>{const l=o.target.value;Te("update:modelValue",l),Te("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=()=>{Le.value=!0,kn()},Al=()=>{Le.value=!1,ol()},ol=()=>{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")},An=o=>{const a=o.target.value;Le.value&&kn(),Te("update:title",a),Te("title-change",a),Y.value="title",C.richText&&(ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze()},500))},fl=()=>{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")},Vl=()=>{le.value=!0,fl()},Rt=()=>{le.value=!1,Ce()},Ce=()=>{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")},Nl=o=>{const a=o.target.value;le.value&&fl(),Te("update:description",a),Te("description-change",a),Y.value="description",C.richText&&(ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze()},500))},Xe=()=>{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(f.value),a.setEnd(l.startContainer,l.startOffset),{type:"text",start:a.toString().length,end:a.toString().length+l.toString().length}},jt=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),a=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){a.setStart(o.element,o.offset),a.collapse(!0),l.removeAllRanges(),l.addRange(a);return}else{f.value.focus();return}let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}l.removeAllRanges(),l.addRange(a)}catch{f.value.focus()}},Pe=()=>{if(!f.value)return;f.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(f.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)},ze=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,a=C.title||"",r=C.description||"";if(!o&&l===X.value&&a===Q.value&&r===re.value)return;const c={content:j.value||X.value,title:x.value!==void 0?x.value:Q.value,description:k.value!==void 0?k.value:re.value},d=ot.value.length>0?ot.value[ot.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&&(ot.value.push(c),ot.value.length>50&&ot.value.shift(),bt.value=[]),X.value=l,Q.value=a,re.value=r,j.value=l,x.value=a,k.value=r},Z=o=>{if(!f.value)return;Tt(),f.value&&yl(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Xe(),he()));const a=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");a&&Qe.value&&(Qe.value=null),de.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=fn(r);Te("update:modelValue",c),Te("change",c),Y.value="editor",ut.value||(j.value=X.value,x.value=Q.value,k.value=re.value),Se.value&&clearTimeout(Se.value),ut.value=!0,Se.value=setTimeout(()=>{ut.value=!1,ze(),Ot(),Ut()},500),e.nextTick(()=>{l&&jt(l),Tt();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&Qe.value?.command===h){Re.value[h]=Qe.value.state;return}if(h==="bold")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_;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{}Re.value[h]=N}else Re.value.hasOwnProperty(h)||(Re.value[h]=!1);else if(h==="italic")if(m){const _=m.commonAncestorContainer,$=_.nodeType===3?_.parentElement:_,N=$&&($.tagName==="EM"||$.tagName==="I"||$.closest&&$.closest("em, i"));Re.value[h]=!!N}else{const _=document.queryCommandState(h);Re.value[h]=_}else{const _=document.queryCommandState(h);Re.value[h]=_}}catch{}}),Sn(),Mn(),W(),qt(),En(),Rn("handleRichTextInput"),a&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>Ut(h),0),(h===" "||h===`
|
|
101
|
+
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{Ot()},100)}de.value=!1})},Tt=()=>{if(!f.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 v=document.createRange();v.setStartAfter(c),v.collapse(!0),o.removeAllRanges(),o.addRange(v)}}}},he=()=>{if(!f.value)return;const o=f.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)}})},Mn=()=>{if(f.value&&!xe.value){xe.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),_=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||_||_)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=nt,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{xe.value=!1}}},Dl=o=>{Ot(),Te("blur",o),Ml()},w=()=>{if(C.disabled||!C.richText||!f.value)return;It(),Se.value&&(clearTimeout(Se.value),Se.value=null),ut.value&&(ze(),ut.value=!1);const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(ot.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{Z()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};bt.value.push(r);const c=ot.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,Q.value=u,re.value=m,j.value=d,x.value=u,k.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),qt();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)Pe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else f.value&&Pe()},10)})})}},y=()=>{if(C.disabled||!C.richText||!f.value)return;It();const o=Y.value==="title",l=Y.value==="description",a=Y.value==="editor";if(bt.value.length===0){o&&V.value?V.value.focus():l&&P.value?P.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{Z()});return}const r={content:f.value.innerHTML,title:C.title||"",description:C.description||""};ot.value.push(r);const c=bt.value.pop();if(c!==void 0){de.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,Q.value=u,re.value=m,j.value=d,x.value=u,k.value=m,e.nextTick(()=>{Sn(),wn(),Zn(),qt();const v=fn(d);Te("update:modelValue",v),Te("update:title",u),Te("update:description",m),Te("change",v),Te("title-change",u),Te("description-change",m),de.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(V.value){V.value.focus();const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}}else if(l){if(P.value){P.value.focus();const h=m.length;P.value.setSelectionRange(h,h)}}else if(a)Pe();else if(V.value&&document.activeElement===V.value){const h=u.length;V.value.setSelectionRange&&V.value.setSelectionRange(h,h),kn()}else if(P.value&&document.activeElement===P.value){const h=m.length;P.value.setSelectionRange(h,h)}else f.value&&Pe()},10)})})}},B=()=>{if(!f.value)return;f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{const c=r.style.fontWeight;if(c==="normal"||c==="400"){const d=document.createDocumentFragment();for(;r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll('span[style*="font-weight"]').forEach(r=>{if(parseInt(r.style.fontWeight)>=600){const d=document.createElement("b");for(d.style.fontWeight="600";r.firstChild;)d.appendChild(r.firstChild);r.parentNode&&r.parentNode.replaceChild(d,r)}}),f.value.querySelectorAll("b, strong").forEach(r=>{r.style.fontWeight="600"})},W=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},se=()=>{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!==f.value;){if(c.tagName==="EM"||c.tagName==="I"){a=!0;break}if(c.style&&c.style.fontStyle==="italic"){a=!0;break}c=c.parentElement}}else{const r=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!==f.value;){if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){a=!0;break}if(u.style&&u.style.fontStyle==="italic"){a=!0;break}}if(a)break}}}if(a)return document.execCommand("italic",!1),e.nextTick(()=>{W()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{W()});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(()=>{W()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{W()})}return!0},mt=()=>{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!==f.value;){if(c.tagName==="STRONG"||c.tagName==="B"){a=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){a=!0;break}c=c.parentElement}}else{const r=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!==f.value;){if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){a=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){a=!0;break}}if(a)break}}}if(a)return document.execCommand("bold",!1),e.nextTick(()=>{B()}),!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!==f.value;){if(u.tagName==="SPAN"&&u.style.fontWeight){const m=u.style.fontWeight;if(m==="normal"||m==="400"){const v=document.createElement("b");v.style.fontWeight="600";const h=document.createDocumentFragment();for(;u.firstChild;)h.appendChild(u.firstChild);v.appendChild(h),u.parentNode&&u.parentNode.replaceChild(v,u),c.setStart(v,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c);break}}else if(u.tagName==="STRONG"||u.tagName==="B"){u.style.fontWeight="600";break}u=u.parentElement}if(!u||u===f.value){const m=document.createElement("b");m.style.fontWeight="600",m.innerHTML="<br>",c.insertNode(m),c.setStart(m,0),c.collapse(!0),r.removeAllRanges(),r.addRange(c)}}B()});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(()=>{B()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{B()})}return!0},et=(o,l=null)=>{if(C.disabled||!C.richText||!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus();const a=window.getSelection();let r=null;if(a&&a.rangeCount>0){const d=a.getRangeAt(0);!d.collapsed&&Wn(d)&&(r=Xe())}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 v=document.createTextNode(l);u.insertNode(v),u.selectNodeContents(v)}}}if(o==="bold"){const d=mt();Re.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Qe.value={command:"bold",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=ht("bold");Re.value.bold=m})),Z(),wn(),qt()});return}if(o==="italic"){const d=se();Re.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(Qe.value={command:"italic",state:d}),e.nextTick(()=>{r&&(jt(r),e.nextTick(()=>{const m=ht("italic");Re.value.italic=m})),Z(),W(),wn(),qt()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&jt(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=ht("bold");Re.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=ht("italic");Re.value.italic=u});else{const u=document.queryCommandState(o);Re.value[o]=u}else{const u=document.queryCommandState(o);Re.value[o]=u}}catch{Re.value.hasOwnProperty(o)?Re.value[o]=!Re.value[o]:Re.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),h=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");h&&(!h.getAttribute("href")||h.getAttribute("href")==="")&&h.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const h=v.getAttribute("href");(!h||h===""||h==="#")&&v.setAttribute("href",l)})}Z(),wn(),qt()})},ht=(o,l=null)=>{if(C.disabled||!f.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,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="STRONG"||v.tagName==="B"||v.closest&&v.closest("strong, b"))&&(u=!0),!u&&v.style&&parseInt(v.style.fontWeight)>=600&&(u=!0),!u))try{const h=window.getComputedStyle(v);parseInt(h.fontWeight)>=600&&(u=!0)}catch{}return Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==f.value;){if(N.tagName==="STRONG"||N.tagName==="B"){u=!0;break}if(N.style&&parseInt(N.style.fontWeight)>=600){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="STRONG"||$.tagName==="B"){u=!0;break}if($.style&&parseInt($.style.fontWeight)>=600){u=!0;break}}if(u)break}}return Re.value[o]=u&&v,u&&v}}if(o==="italic"){let u=!1;if(c.collapsed){const m=c.commonAncestorContainer,v=m.nodeType===3?m.parentElement:m;if(v&&((v.tagName==="EM"||v.tagName==="I"||v.closest&&v.closest("em, i"))&&(u=!0),!u&&v.style&&v.style.fontStyle==="italic"&&(u=!0),!u))try{window.getComputedStyle(v).fontStyle==="italic"&&(u=!0)}catch{}return Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let _;for(;_=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(_))){if(_.nodeType===3){if(!(_.textContent||"").trim())continue;v=!0;let N=_.parentElement;for(;N&&N!==f.value;){if(N.tagName==="EM"||N.tagName==="I"){u=!0;break}if(N.style&&N.style.fontStyle==="italic"){u=!0;break}N=N.parentElement}}else if(_.nodeType===1){const $=_;if($.tagName==="EM"||$.tagName==="I"){u=!0;break}if($.style&&$.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return Re.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&Re.value.hasOwnProperty(o)?Re.value[o]:(Re.value[o]=d,d)}return Re.value.hasOwnProperty(o)?Re.value[o]:!1}catch{return Re.value.hasOwnProperty(o)?Re.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},mn=o=>{C.disabled||!C.richText||(ue.value=ue.value===o?null:o,o==="askAi"&&(tt.value=null))},It=()=>{ue.value=null,dt.value=null},bn=o=>{et("formatBlock",o),It()},Yl=o=>{if(!o||!f.value)return o;const l=$e=>{let me=$e.nodeType===Node.TEXT_NODE?$e.parentElement:$e;for(;me&&me!==f.value;){const it=me.tagName;if(it==="P"){const ln=me.parentElement;if(ln===f.value||ln.tagName==="BLOCKQUOTE")return me}if(it==="BLOCKQUOTE")break;me=me.parentElement}return null},a=l(o.startContainer),r=l(o.endContainer);if(!a||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:$e=>{const me=$e.tagName;if(me==="P"){const it=$e.parentElement;if(it===f.value||it.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return me==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(a),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),_=Math.max(m,v),$=c.slice(h,_+1);if($.length===0)return o;const N=$[0],J=$[$.length-1],K=document.createRange();return K.setStartBefore(N),K.setEndAfter(J),K},so=()=>{if(C.disabled||!C.richText||!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Wn(l)&&(l=Yl(l),o.removeAllRanges(),o.addRange(l));let a=null;!l.collapsed&&Wn(l)&&(a=Xe());const r=l.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value.contains(c))){if(c){const u=c.parentNode;Array.from(c.childNodes).forEach(v=>{if(v.nodeType===Node.ELEMENT_NODE)if(v.tagName==="P"||v.tagName==="DIV")u.insertBefore(v,c);else{const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const h=document.createElement("p");h.appendChild(v.cloneNode(!0)),u.insertBefore(h,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],h=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:N=>N.parentNode===u&&N.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let _;for(;_=h.nextNode();)v.push(_);if(v.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&&jt(a),Zn(),Z(),qt()})},ro=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.tagName==="BLOCKQUOTE"?a:a.closest("blockquote"):a.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=_=>{if(!_)return!1;const $=_.textContent||"",J=(_.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 _=r.lastChild;if(_.nodeType===1&&_.tagName==="BR")_.remove();else if(_.nodeType===3)if((_.textContent||"").trim()==="")_.remove();else break;else break}if(r.children.length>0)for(let _=r.children.length-1;_>=0;_--){const $=r.children[_];if(($.tagName==="P"||$.tagName==="DIV")&&c($))$.remove();else break}let u=r.innerHTML;const m=u;u=u.replace(/(<br\s*\/?>)+$/gi,""),u!==m&&(r.innerHTML=u);const v=document.createElement("p");v.innerHTML="<br>",r.parentNode?r.nextSibling?r.parentNode.insertBefore(v,r.nextSibling):r.parentNode.appendChild(v):f.value&&f.value.appendChild(v);const h=document.createRange();h.selectNodeContents(v),h.collapse(!0),o.removeAllRanges(),o.addRange(h),e.nextTick(()=>{Zn(),Z()})},wn=()=>{if(!f.value){ve.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");ve.value=!!r}else ve.value=!1}catch{ve.value=!1}},jl=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ht.value=Xe();const l=window.getSelection();let a="";l.rangeCount>0&&(a=l.getRangeAt(0).toString()),Ve.value="",O.value=a,Bt.value="",Ne.value=null,He.value=!0,It(),e.nextTick(()=>{lt.value&<.value.focus()})},io=()=>{if(!f.value)return;ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze();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&&Ne.value&&(l=Ne.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)}Ne.value=null}else et("unlink");ve.value=!1,It(),e.nextTick(()=>{Z(),wn()})},al=()=>{C.disabled||!C.richText||f.value&&(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Sn(),Z(),qt()}))},co=()=>{C.disabled||!C.richText||f.value&&(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),It(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Sn(),Z(),qt()}))},uo=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},Sn=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const a=l.parentElement;if(a&&a.tagName==="LI"){const r=uo(a);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},Kl=()=>{if(C.disabled||!C.richText||!f.value)return;It(),f.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(()=>{Sn(),Z()});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=uo(c);u.appendChild(a),m!==null&&r.tagName==="OL"&&a.setAttribute("data-parent-num",String(m)),Sn();const v=document.createRange();v.selectNodeContents(a),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{Z(),qt()})}else document.execCommand("indent",!1),e.nextTick(()=>{Sn(),Z(),qt()})},No=()=>{if(C.disabled||!C.richText||!f.value)return;It(),f.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(()=>{Sn(),Z()});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(),Sn();const u=document.createRange();u.selectNodeContents(a),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{Z(),qt()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Sn(),Z(),qt()})},Kt=e.ref(null),Jn=e.ref(null),_n=e.ref({}),el=e.ref(""),tl=e.ref(null),sl=e.ref("");e.ref("");const rl=e.ref(null);e.ref("");const Bn=e.ref([]),Gl=e.ref(!1),Sl=e.ref(!1),mo=o=>{if(!o)return"";const l=o.cloneRange(),a=document.createElement("div");return a.appendChild(l.cloneContents()),a.innerHTML},Rl=()=>{if(C.disabled||!C.richText||!f.value)return;if(Kt.value!==null){Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0);return}It(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Wn(l))return;sl.value=mo(l)||"",rl.value=Xe();const a=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=a.bottom-c.top,m=Math.max(d+8,0);_n.value={top:`${m}px`,bottom:"auto"},Kt.value=Date.now(),e.nextTick(()=>{if(el.value="",tl.value){const h=tl.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const _=r.getBoundingClientRect(),$=v.getBoundingClientRect(),N=h.getBoundingClientRect(),J=$.bottom-_.top,K=N.top-_.top,$e=8;if(J>K-$e){const me=N.height;_n.value={bottom:`${me+$e}px`,top:"auto"}}else _n.value={top:`${m}px`,bottom:"auto"}}}})},Ql=()=>{if(!el.value.trim())return;const o=el.value.trim(),l=new Date,a={text:o,selectionText:sl.value,selectionRange:rl.value,commentId:Kt.value,user:C.commentUser||null,createdAt:l.toISOString()};Bn.value=[...Bn.value,a],Te("comment-submitted",a),Jl(a),rl.value&&!Bo(rl.value)&&Mo(Kt.value,rl.value),el.value="",e.nextTick(()=>{if(tl.value){const r=tl.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}Rn("sendComment")})},So=(o,l)=>{if(!(!C.commentUser||!o.user||o.user.id!==C.commentUser.id)){if(Bn.value=Bn.value.filter((a,r)=>r!==l),Kt.value!==null&&f.value){const a=String(Kt.value),r=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`);if(r&&Bn.value.length>0){const c=[],d=new Set;Bn.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(Bn.value.length))}else r&&Bn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(Te("comment-deleted",{comment:o,index:l,commentId:Kt.value}),C.comments&&Array.isArray(C.comments)){const a=C.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));Te("update:comments",a)}e.nextTick(()=>{Rn("deleteComment")})}},Bo=o=>{if(!o||!f.value)return!1;try{const l=Fl(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},Fl=o=>{if(!o||!f.value)return null;try{const l=document.createRange();if(o.type==="element"&&o.element)return f.value.contains(o.element)?(l.setStart(o.element,o.offset),l.collapse(!0),l):null;let a=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=a+c.length;!d&&o.start>=a&&o.start<=m&&(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}},Mo=(o,l)=>{if(!(!o||!l||!f.value))try{const a=Fl(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,v=a.endContainer,h=a.startOffset,_=a.endOffset,$=m.nodeType===3?m.parentNode:m,N=v.nodeType===3?v.parentNode:v;if($===N&&h===0&&_===(v.nodeType===3?v.length:N.childNodes.length)&&($.tagName==="P"||$.tagName==="DIV"||$.tagName==="H1"||$.tagName==="H2"||$.tagName==="H3"||$.tagName==="H4"||$.tagName==="H5"||$.tagName==="H6")){const K=a.extractContents();d.appendChild(K),a.insertNode(d)}else a.surroundContents(d)}catch{const v=a.extractContents();d.appendChild(v),a.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{Rn("wrapSelectionWithCommentMarker"),Z()})}catch{}},Jl=o=>{if(!o||!o.commentId)return;const l=Array.isArray(C.comments)?[...C.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(v=>v.article_id)?.article_id||null,m={conversation_id:a,article_id:u,selection_range:d?{start:d.start||0,end:d.end||0,type:d.type||"text"}:null,selection_text:o.selectionText||"",conversation:[c],created_by_user:o.user,created_at:o.createdAt,updated_at:o.createdAt,status:"active"};l.push(m)}Gl.value=!0,Te("update:comments",l)},xn=(o,l=[])=>{if(C.disabled||!C.richText||!f.value)return;const a=f.value;let r=null;try{r=a.querySelector(o)}catch{return}if(!r)return;It(),a.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),sl.value=r.innerHTML||"",rl.value=Xe();const u=c.getBoundingClientRect(),m=a.parentElement;if(m){const _=m.getBoundingClientRect(),$=u.bottom-_.top,J=Math.max($+8,0);_n.value={top:`${J}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&C.comments&&Array.isArray(C.comments)){const _=C.comments.find($=>String($.conversation_id)===String(v));if(_&&_.conversation&&Array.isArray(_.conversation)){const $=_.conversation.map(N=>({id:N.id||N.commentary_id,commentary_id:N.id||N.commentary_id,conversation_id:_.id||_.conversation_id,text:N.text,user:N.user,createdAt:N.created_at||N.createdAt,updated_at:N.updated_at||N.updatedAt}));h.push(...$)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((_,$)=>{const N=$e=>{if(!$e)return 0;const me=new Date($e).getTime();return isNaN(me)?0:me},J=N(_.createdAt),K=N($.createdAt);return J===K?0:J-K}),Bn.value=h,Yn(!0),Kt.value=v||null,r&&(Jn.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(el.value="",tl.value){const _=tl.value;_.style.height="auto",_.style.height=`${_.scrollHeight}px`,_.focus()}if(m){const _=m.querySelector(".dss-comment-overlay");if(_){const $=m.querySelector(".dss-text-editor-footer");if($){const N=m.getBoundingClientRect(),J=_.getBoundingClientRect(),K=$.getBoundingClientRect(),$e=J.bottom-N.top,me=K.top-N.top,it=8;if($e>me-it){const ln=K.height;_n.value={bottom:`${ln+it}px`,top:"auto"}}}}}Rn("openCommentOverlayForSelector")})},F=e.ref(null),rn=e.ref(0),Dn=o=>{if(!(C.disabled||!C.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&&f.value&&f.value.contains(c))){o.preventDefault();let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=document.createElement("p");m.innerHTML="<br>",u&&c.contains(u)&&u.nextSibling?c.insertBefore(m,u.nextSibling):c.appendChild(m),setTimeout(()=>{ro()},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,v=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const h=document.createRange();h.setStartAfter(d),h.collapse(!0),l.removeAllRanges(),l.addRange(h);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const a=l.getRangeAt(0);let r=null,c=null;if(a.collapsed)if(o.key==="Backspace"){const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===0?u=d.previousSibling||d.parentNode:u=d.parentNode);const m=u.previousSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.startContainer;let u=d;d.nodeType===3&&(a.startOffset===d.length?u=d.nextSibling||d.parentNode:u=d.parentNode);const m=u.nextSibling;m&&(m.classList&&m.classList.contains("dss-image-wrapper")?c=m:m.tagName==="IMG"&&(r=m,c=r.closest(".dss-image-wrapper"))),c||(c=u.closest(".dss-image-wrapper"),c&&(r=c.querySelector("img")))}else{const d=a.commonAncestorContainer,u=a.startContainer.nodeType===3?a.startContainer.parentElement:a.startContainer,m=a.endContainer.nodeType===3?a.endContainer.parentElement:a.endContainer;if(d.nodeType===1&&d.tagName==="IMG"?(r=d,c=r.closest(".dss-image-wrapper")):(r=d.querySelector("img"),r&&(c=r.closest(".dss-image-wrapper"))),c){const v=c.contains(u)||u===c,h=c.contains(m)||m===c,$=a.cloneContents().textContent?.trim()||"",N=c.textContent?.trim()||"";(!v||!h||$.length>N.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{Z()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?No():Kl();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=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const _=v.parentElement;return _&&_!==f.value?m(_):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let _=null;const $=a.startOffset;$<u.length&&(_=u.splitText($));const N=document.createElement("p");if(_?N.appendChild(_):N.innerHTML="<br>",u.length===0){const K=u.parentElement;K&&(K.removeChild(u),K.childNodes.length===0&&K.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(N,h.nextSibling):h.parentNode.appendChild(N);const J=document.createRange();_?J.setStart(_,0):J.setStart(N,0),J.collapse(!0),l.removeAllRanges(),l.addRange(J),e.nextTick(()=>{Z()});return}}}}const r=a.commonAncestorContainer,c=r.nodeType===1?r.tagName==="BLOCKQUOTE"?r:r.closest("blockquote"):r.parentElement?.closest("blockquote");if(!!(c&&f.value&&f.value.contains(c))){let u=null;r.nodeType===3?u=r.parentElement:r.tagName==="P"||r.tagName==="DIV"?u=r:u=r.closest("p, div");const m=K=>{if(!K)return!1;const $e=K.textContent||"",it=(K.innerHTML||"").trim(),ln=it.replace(/<br\s*\/?>/gi,"").trim();return $e.trim()===""||it===""||ln===""||it==="<br>"||it==="<br/>"||it==="<p></p>"||it==="<p><br></p>"||it==="<p><br/></p>"||it==="<p> </p>"||it==="<p><br> </p>"||it==="<div></div>"||it==="<div><br></div>"||it==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",_=a.startContainer,$=_.nodeType===3?_.parentElement:_,N=$===c||$&&$.parentElement===c;if(u&&m(u)||h&&N){o.preventDefault(),setTimeout(()=>{ro()},50);return}}}}if(o.key===" "){const l=Date.now(),a=l-rn.value;if(F.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(),Kl();return}}}}F.value=" ",rn.value=l}else F.value=o.key}},pn=o=>{if(C.disabled||!C.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,"")),ze();const r=window.getSelection();let c=null;if(r&&r.rangeCount>0){let m=r.getRangeAt(0).commonAncestorContainer;m.nodeType===3&&(m=m.parentNode),c=m.closest("p, h1, h2, h3, h4, h5, h6, li, blockquote")}const d=u=>{const v=new DOMParser().parseFromString(u,"text/html");let h=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach($=>{if(h>0){const N=v.createElement("p");N.innerHTML=$.innerHTML,$.parentNode.replaceChild(N,$)}else h++}),c){const $=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],N=Array.from(v.body.children).filter(J=>$.includes(J.tagName));if(N.length===1){const J=N[0].tagName,K=c.tagName,$e=c.textContent.trim()===""&&!c.querySelector("img");let me=!1;if(["H1","H2","H3","H4","H5","H6"].includes(K)?me=!0:$e||(J===K||J==="P")&&(me=!0),me)return N[0].innerHTML.trim()}}return v.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);Z()},On=o=>{if(ue.value){const a=o.target;!a.closest(".dss-toolbar-dropdown")&&!a.closest(".dss-toolbar-dropdown-toggle")&&It()}if(ge.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=f.value&&a.closest(".dss-text-editor-content");!r&&!c&&Ml()}if(tt.value){const a=o.target,r=a.closest(".dss-floating-toolbar"),c=a.closest(".dss-toolbar-dropdown");!r&&!c&&cl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(dt.value=null),!f.value||!l.closest(".dss-text-editor-content")){const a=window.getSelection();if(a&&a.rangeCount>0){const r=a.getRangeAt(0);Vt.value=!r.collapsed&&Wn(r)}else Vt.value=!1}if(Kt.value!==null){const a=document.querySelector(".dss-comment-overlay");let r=!1;if(a){const u=a.getBoundingClientRect(),m=o.clientX,v=o.clientY;r=m>=u.left&&m<=u.right&&v>=u.top&&v<=u.bottom}const c=l.closest(".dss-toolbar-button"),d=c&&c.getAttribute("title")==="Comment";!r&&!d&&(Kt.value=null,el.value="",sl.value="",rl.value=null,Bn.value=[],Yn(!0))}},Wt=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),$t.value&&(clearTimeout($t.value),$t.value=null),dt.value=l},Gt=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}$t.value&&clearTimeout($t.value),$t.value=setTimeout(()=>{dt.value=null,$t.value=null},150)},il=o=>{dt.value=null};let vl=0;const St=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(a=>{a.classList.contains("dss-toolbar-dropdown-submenu")||a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(a.tagName==="BUTTON"||a.tagName==="DIV")&&!a.classList.contains("dss-toolbar-dropdown-item")&&a.classList.add("dss-toolbar-dropdown-item")}),l.forEach((a,r)=>{if(a.classList.contains("dss-toolbar-dropdown-item-has-submenu")||a.classList.contains("dss-toolbar-dropdown-submenu")||!a.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(a.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(h=>h.tagName==="BUTTON"||h.tagName==="DIV").length>0:!1),d=a.nextElementSibling,u=d&&!d.classList.contains("dss-toolbar-dropdown-submenu")&&!d.classList.contains("dss-toolbar-dropdown-item-has-submenu")&&d.tagName==="DIV"&&!d.classList.contains("dss-toolbar-dropdown-item")&&Array.from(d.children).some(m=>m.tagName==="BUTTON"||m.tagName==="DIV");if(c||u){const m=`submenu-auto-${++vl}`;a.classList.add("dss-toolbar-dropdown-item-has-submenu"),a.setAttribute("data-submenu-id",m);let v=null;c?(a.tagName==="BUTTON"&&a.parentNode.insertBefore(c,a.nextSibling),c.classList.add("dss-toolbar-dropdown-submenu"),v=c):u&&(d.classList.add("dss-toolbar-dropdown-submenu"),v=d),v&&(v.setAttribute("data-submenu-id",m),v.setAttribute("data-processed","true"),c&&a.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(_=>{(_.tagName==="BUTTON"||_.tagName==="DIV")&&!_.classList.contains("dss-toolbar-dropdown-item")&&_.classList.add("dss-toolbar-dropdown-item")}))}})},Nt=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{St(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=v=>{const h=c.getAttribute("data-submenu-id");h&&Wt(v,h)},m=Gt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const _=c.getAttribute("data-submenu-id");_&&Wt(h,_)},m=Gt;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(h=>{h.addEventListener("click",il)})})})};let st=null;const Pt=()=>{if(dt.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${dt.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${dt.value}"]`);o&&l&&xo(o,l)}if(ge.value&&qt(),C.richText){if(st!==null)return;st=setTimeout(()=>{st=null,Rn("handleWindowResize")},150)}},Il=()=>{if(!C.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")})})},po=()=>{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(()=>{Le.value?kn():ol(),le.value?fl():Ce()})}),e.nextTick(()=>{po()}),C.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",On),window.addEventListener("resize",Pt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,Pt()},150))};window.addEventListener("scroll",l,!0),f.value._windowScrollHandler=l,f.value._windowScrollTimeout=o,f.value.closest(".editor-with-comments"),f.value.closest(".dss-text-editor-content-wrapper");const a=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,Pt()},150))};a&&(a.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:a,handler:c}),e.nextTick(()=>{Nt(),Il()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!C.disabled&&m.preventDefault();const _=v.closest(".dss-image-no-alt-icon"),$=v.closest(".dss-image-wrapper");if(_||$&&v===$){m.preventDefault(),m.stopPropagation();const N=window.getSelection(),J=document.createRange();J.setStartAfter($),J.collapse(!0),N.removeAllRanges(),N.addRange(J)}else $&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const N=window.getSelection();if(N.rangeCount>0){const K=N.getRangeAt(0).commonAncestorContainer,$e=K.nodeType===3?K.parentElement:K;if($.contains($e)&&$e!==$.querySelector("img")){const me=document.createRange();me.setStartAfter($),me.collapse(!0),N.removeAllRanges(),N.addRange(me)}}else{const J=document.createRange();J.setStartAfter($),J.collapse(!0),N.addRange(J)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),_=v.closest(".dss-image-wrapper");if(h||_&&v.tagName!=="IMG"){m.preventDefault();const $=window.getSelection(),N=document.createRange();_&&(N.setStartAfter(_),N.collapse(!0),$.removeAllRanges(),$.addRange(N))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(h=>{if(!h.closest(".dss-image-wrapper"))h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="";else{const $=h.getAttribute("alt")||h.alt||"";if($){const N=h.getAttribute("src")||h.src||"",J=N.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),K=$===N||$===J;($.startsWith("http://")||$.startsWith("https://")||$.startsWith("data:")||K||K)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Mn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),_=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&(Ye.value=_||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{Ye.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!Ye.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=Ye.value,h=v.classList?.contains("dss-image-wrapper"),_=h?v.querySelector("img"):v,$=h?v:_?.closest(".dss-image-wrapper");if(!_||!f.value.contains(_)){Ye.value=null;return}let N=null;const J=m.clientX,K=m.clientY;if(document.caretRangeFromPoint)N=document.caretRangeFromPoint(J,K);else{const zt=window.getSelection();zt.rangeCount>0?N=zt.getRangeAt(0).cloneRange():(N=document.createRange(),N.selectNodeContents(f.value),N.collapse(!1))}if(!N){Ye.value=null;return}const $e=N.commonAncestorContainer,me=$e.nodeType===3?$e.parentElement:$e;if(me?.closest(".dss-image-wrapper")===$||$&&$.contains(me)){Ye.value=null;return}if($&&(me===$||$.contains(me))){Ye.value=null;return}const ln=_.getAttribute("src");let Jt=null;$?Jt=$.cloneNode(!0):Jt=_.cloneNode(!0);try{let zt=N.startContainer;if(zt.nodeType===3&&(zt=zt.parentElement),$&&(zt===$||$.contains(zt))){const Xt=document.createRange();Xt.setStartAfter($),Xt.collapse(!0),N=Xt}N.insertNode(Jt);const en=document.createRange();en.setStartAfter(Jt),en.collapse(!0);const tn=window.getSelection();tn.removeAllRanges(),tn.addRange(en)}catch{if(f.value.childNodes.length===0){const en=document.createElement("p");en.appendChild(Jt),f.value.appendChild(en)}else{const en=f.value.lastChild;if(en&&en.nodeType===1)en.appendChild(Jt);else{const tn=document.createElement("p");tn.appendChild(Jt),f.value.appendChild(tn)}}}$?$.remove():_.remove(),Ye.value=null,e.nextTick(()=>{const zt=f.value.querySelectorAll("img");let en=!1;zt.forEach(tn=>{if(tn.getAttribute("src")===ln)if(!en)en=!0;else{const Xt=tn.closest(".dss-image-wrapper");Xt?Xt.remove():tn.remove()}}),Mn(),Z()})}),f.value.addEventListener("dragend",m=>{Ye.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const _=h.querySelectorAll&&h.querySelectorAll("img");_&&_.forEach($=>{$.removeAttribute("alt"),$.removeAttribute("data-alt"),$.setAttribute("alt",""),$.setAttribute("data-alt",""),$.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Mn(),Il(),d=null},100)});if(u.observe(f.value,{childList:!0,subtree:!0}),e.nextTick(()=>{const m=document.querySelector(".dss-text-editor-toolbar");if(m){const v=new MutationObserver(()=>{e.nextTick(()=>{Il()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),C.modelValue){const m=Pn(C.modelValue);f.value.innerHTML=m,he()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=C.title||"",h=C.description||"";X.value=m,Q.value=v,re.value=h,x.value=v,k.value=h,Sn(),Mn(),W(),En(),ml(),$l()}),wn(),Zn(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",On),window.removeEventListener("resize",Pt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),st!==null&&(clearTimeout(st),st=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Se.value&&clearTimeout(Se.value),$t.value&&clearTimeout($t.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ue.value&&Ue.value.disconnect(),Dt.value!==null&&(cancelAnimationFrame(Dt.value),Dt.value=null),$n.value!==null&&(clearTimeout($n.value),$n.value=null),an.value!==null&&(clearTimeout(an.value),an.value=null),Yn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:a,handler:r}=f.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 Bl=o=>{const l=o.target,a=l.closest("a");if(a&&!C.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c)}const r=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 v=document.createRange();v.setStartAfter(r),v.collapse(!0),c.removeAllRanges(),c.addRange(v)}}Mn(),wn(),Zn(),qt(),En()}):e.nextTick(()=>{Mn(),wn(),Zn(),qt(),En()})},zl=()=>{Tt();const o=window.getSelection();if(o&&o.rangeCount>0){const a=o.getRangeAt(0);Vt.value=!a.collapsed&&Wn(a),!a.collapsed&&Qe.value&&(Qe.value=null)}else Vt.value=!1;if(Mn(),wn(),Zn(),qt(),En(),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(),Vt.value=!1;return}}["bold","italic","underline"].forEach(a=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(a==="bold"){const d=c.commonAncestorContainer,u=d.nodeType===3?d.parentElement:d;let m=!1;if(u&&((u.tagName==="STRONG"||u.tagName==="B"||u.closest&&u.closest("strong, b"))&&(m=!0),!m&&u.style&&parseInt(u.style.fontWeight)>=600&&(m=!0),!m))try{const v=window.getComputedStyle(u);parseInt(v.fontWeight)>=600&&(m=!0)}catch{}Re.value[a]=m}else{const d=document.queryCommandState(a);Re.value[a]=d}}}catch{}})},En=()=>{if(!C.richText||C.disabled||!f.value){qe.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){qe.value="p";return}const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===3?a.parentElement:a;if(!r||!f.value.contains(r)){qe.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){qe.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?qe.value=d:qe.value="p"}catch{qe.value="p"}},Zn=()=>{if(!f.value){pt.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&&f.value.contains(c))}pt.value=l}catch{pt.value=!1}},Wn=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const a=l.nodeType===3?l.parentElement:l;return a?f.value.contains(a):!1},Ml=()=>{ge.value=!1},qt=()=>{if(!C.floatingToolbar||!C.richText||C.disabled){ge.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ge.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Wn(l)){ge.value=!1;return}const a=l.getBoundingClientRect();if(!a||a.width===0&&a.height===0){ge.value=!1;return}const r=f.value;if(!r){ge.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ge.value=!1;return}const d=40,u=8,m=a.top-d/2+15;let v=a.left+a.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let _=0;wt.value&&(_=wt.value.getBoundingClientRect().width);const $=(_||320)/2;let N=c.left+$,J=c.right-$;if(J<N){const K=c.left+c.width/2;N=K,J=K}if(h>0){const K=$+u,$e=h-$-u;if(N=Math.max(N,K),J=Math.min(J,$e),J<N){const me=h/2;N=me,J=me}}v<N?v=N:v>J&&(v=J),gt.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ge.value=!0},fo=o=>{C.disabled||!C.richText||(tt.value=tt.value===o?null:o,o==="askAi"&&(ue.value=null))},cl=()=>{tt.value=null,dt.value=null},ul=o=>{bn(o),cl()};let gn=null,bl=null,gl=null,qn=null;const _o=o=>{if(C.disabled||!C.richText){_l(),wl();return}const l=o.target,a=l.closest("a"),r=l.closest("img");if(gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),a&&a!==bl){wl(),bl=a;let c=a.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=a.textContent||""),Ne.value=a,S.value=c,te.value=!0,Ze.value=!0,eo(a)}else!a&&bl?(bl=null,gn=setTimeout(()=>{Ze.value||_l()},150)):a&&a===bl&&eo(a);if(r&&r!==qn){_l(),qn=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),U.value=r,fe.value=c.trim()||R("textEditor.image.noAlt"),_e.value=!0,Et.value=!0,go(r)}else!r&&qn?(qn=null,gl=setTimeout(()=>{Et.value||wl()},150)):r&&r===qn&&go(r)},vo=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(bl=null,qn=null,gn&&(clearTimeout(gn),gn=null),gl&&(clearTimeout(gl),gl=null),_l(),wl())},_l=()=>{Ze.value=!1,setTimeout(()=>{Ze.value||(te.value=!1,S.value="",He.value||(Ne.value=null))},100)},eo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ae.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},wl=()=>{Et.value=!1,setTimeout(()=>{Et.value||(_e.value=!1,fe.value="",Mt.value||(U.value=null))},100)},go=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;ct.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},$o=()=>{if(!S.value||!Ne.value)return;let l=Ne.value.getAttribute("href")||S.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},nl=()=>{if(Ne.value){const o=Ne.value.textContent||"",l=Ne.value.getAttribute("href")||"",a=Ne.value;Ve.value=l,O.value=o,Bt.value=o,Ze.value=!1,te.value=!1,S.value="",Ne.value=a,He.value=!0}else if(ve.value){const o=window.getSelection();if(o.rangeCount>0){const a=o.getRangeAt(0).commonAncestorContainer,r=a.nodeType===1?a.closest("a"):a.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";Ve.value=d,O.value=c,Bt.value=c,Ne.value=r,He.value=!0}}}else{Ht.value=Xe();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),Ve.value="",O.value=l,Bt.value="",Ne.value=null,He.value=!0}e.nextTick(()=>{lt.value&&(lt.value.focus(),lt.value.select())})},Un=()=>{He.value=!1,Ve.value="",O.value="",Bt.value="",Ne.value=null,Ht.value=null},Xn=()=>{if(!Ve.value.trim()){Un();return}if(ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze(),O.value.trim()||(O.value=Ve.value.trim()),Ne.value&&f.value&&f.value.contains(Ne.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Ne.value;if(l.setAttribute("href",Ve.value.trim()),O.value.trim()!==Bt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=O.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),Z()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ht.value&&jt(Ht.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const a=document.createElement("a");a.href=Ve.value.trim(),a.textContent=O.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(f.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=Ve.value.trim(),d.textContent=O.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=a.parentElement;for(;u&&u!==f.value&&!["P","DIV","H1","H2","H3","H4","H5","H6"].includes(u.tagName);)u=u.parentElement;if(u&&u!==f.value){let m=u.nextElementSibling;if(m&&(m.innerHTML==="<br>"||m.innerHTML==="<br/>"||m.textContent.trim()==="")){m.textContent="",m.appendChild(d);const v=document.createTextNode(" ");m.appendChild(v);const h=document.createRange();h.setStartAfter(d),h.collapse(!0),o.removeAllRanges(),o.addRange(h)}else{if(l.startOffset>0){const h=a.textContent.substring(0,l.startOffset),_=h[h.length-1];if(_&&_!==" "&&_!==" "&&_!==`
|
|
102
|
+
`){const $=document.createTextNode(" ");l.insertNode($),l.setStartAfter($)}}l.insertNode(d);const v=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(v),l.setStartAfter(v),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}}else{if(r&&l.startOffset>0){const m=a.textContent.substring(0,l.startOffset),v=m[m.length-1];if(v&&v!==" "&&v!==" "&&v!==`
|
|
103
|
+
`){const h=document.createTextNode(" ");l.insertNode(h),l.setStartAfter(h)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}Z()}e.nextTick(()=>{wn(),Un()})},Ot=()=>{if(!f.value||de.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Xe());const a=/(https?:\/\/[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|(www\.[^\s<>"{}|\\^`\[\]]+[^\s<>"{}|\\^`\[\].,;:!?])|([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.([a-zA-Z]{2,})(\/[^\s<>"{}|\\^`\[\]]*)?)/gi,r=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:m=>{const v=m.parentElement;return!v||v.closest("a")||v.closest(".dss-image-wrapper")||!m.textContent||m.textContent.trim()===""?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),c=[];let d;for(;d=r.nextNode();)c.push(d);let u=!1;for(let m=c.length-1;m>=0;m--){const v=c[m],h=v.textContent;a.lastIndex=0;const _=[...h.matchAll(a)];if(_.length===0)continue;const $=_.filter(K=>{const $e=K[0],me=K.index;if(me>0&&h[me-1]==="@"||me+$e.length<h.length&&h[me+$e.length]==="@")return!1;const it=v.parentElement;return!(it&&it.closest("a"))});if($.length===0)continue;if($.length===1&&$[0][0]===h.trim()){const K=$[0][0],$e=K.startsWith("http://")||K.startsWith("https://")?K:`https://${K}`,me=document.createElement("a");me.href=$e,me.textContent=K,me.style.color="#60afdf",me.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(me,v),u=!0);continue}let N=0;const J=document.createDocumentFragment();if($.forEach(K=>{const $e=K.index,me=K[0];if($e>N){const Jt=h.substring(N,$e);Jt&&J.appendChild(document.createTextNode(Jt))}const it=me.startsWith("http://")||me.startsWith("https://")?me:`https://${me}`,ln=document.createElement("a");ln.href=it,ln.textContent=me,ln.style.color="#60afdf",ln.style.textDecoration="underline",J.appendChild(ln),N=$e+me.length}),N<h.length){const K=h.substring(N);K&&J.appendChild(document.createTextNode(K))}v.parentNode&&J.childNodes.length>0&&(v.parentNode.replaceChild(J,v),u=!0)}u&&l&&e.nextTick(()=>{jt(l),wn()})},To=()=>{if(!f.value)return;const o=/<u>([\s\S]*?)<\/u>|<ins>([\s\S]*?)<\/ins>/gi,l=document.createTreeWalker(f.value,NodeFilter.SHOW_TEXT,{acceptNode:c=>{const d=c.parentElement;return!d||d.closest("a, code, pre, u, ins")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}}),a=[];let r;for(;r=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 v=0;const h=document.createDocumentFragment();m.forEach(_=>{const $=_.index,N=_[0].startsWith("<u>")?"u":"ins",J=_[1]||_[2]||"";$>v&&h.appendChild(document.createTextNode(u.substring(v,$)));const K=document.createElement(N);K.textContent=J,h.appendChild(K),v=$+_[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},Ut=o=>{if(!f.value||de.value)return;if(!o){To();return}if(!["*","_",">"].includes(o))return;const a=window.getSelection();if(!a||a.rangeCount===0)return;const r=a.getRangeAt(0);if(!r.collapsed)return;const c=r.startContainer.nodeType===Node.TEXT_NODE?r.startContainer.parentElement?.closest("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div"):r.startContainer.closest?.("p, h1, h2, h3, h4, h5, h6, li, td, th, blockquote, div");if(!c||c===f.value||!f.value.contains(c))return;const d=()=>{let Jt="",zt=0,en=!1;const tn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:jn=>jn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let Xt=0;for(;tn.nextNode();){const jn=tn.currentNode,hn=jn.textContent||"",Kn=Xt;if(Xt+=hn.length,jn===r.startContainer){Jt+=hn.substring(0,r.startOffset),zt=Kn+r.startOffset,en=!0;break}Jt+=hn}return en||(zt=Jt.length),{textBeforeCursor:Jt,cursorCharOffset:zt}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],_=m[1],$=u.length-h.length,J=(Jt=>{let zt=0;const en=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:Xt=>Xt.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let tn;for(;tn=en.nextNode();){const Xt=(tn.textContent||"").length;if(zt+Xt>=Jt)return{node:tn,offset:Jt-zt};zt+=Xt}return null})($);if(!J)return;const K=document.createRange();K.setStart(J.node,J.offset),K.setEnd(r.endContainer,r.endOffset);const $e=document.createElement(v);$e.textContent=_,K.deleteContents(),K.insertNode($e);const me=window.getSelection(),it=document.createRange();it.setStartAfter($e),it.collapse(!0),me.removeAllRanges(),me.addRange(it);const ln=Xe();e.nextTick(()=>{Z(),ln&&jt(ln)})},Qt=()=>{f.value&&(Ie.value=Xe(),Ft.value="",xt.value="",ft.value="",Ke.value="",Ge.value="",on.value=null,U.value=null,We.value="upload",Mt.value=!0,It(),e.nextTick(()=>{Zt.value&&Zt.value.focus(),At.value&&(At.value.value="")}))},ho=o=>{const l=o.target?.files?.[0];if(!l){on.value=null,xt.value="";return}on.value=l;const a=new FileReader;a.onload=r=>{xt.value=r.target?.result||""},a.readAsDataURL(l)},Lo=()=>{At.value&&At.value.click()},Pl=()=>{Ke.value&&(Ge.value="")},yo=()=>{Ge.value&&(Ke.value="")},Co=()=>{let o=U.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")||"";U.value=o,Ft.value=l.trim()===""||l.trim()==="Image"?"":l;const a=o.getAttribute("src")||o.src||"";a.startsWith("http://")||a.startsWith("https://")?(ft.value=a,xt.value="",We.value="url"):(xt.value=a,ft.value="",We.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";Ke.value=c.endsWith("px")?c.replace("px",""):c,Ge.value=d.endsWith("px")?d.replace("px",""):d,Ie.value=null}else{Qt();return}Mt.value=!0,Et.value=!1,_e.value=!1,e.nextTick(()=>{We.value==="url"&&_t.value?(_t.value.focus(),_t.value.select()):Zt.value&&(Zt.value.focus(),Zt.value.select()),At.value&&(At.value.value="")})},Lt=()=>{Mt.value=!1,Ft.value="",xt.value="",ft.value="",Ke.value="",Ge.value="",on.value=null,U.value=null,Ie.value=null,We.value="upload"},dl=()=>{const o=(Ft.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),ut.value?(Se.value&&(clearTimeout(Se.value),Se.value=null),ze(),ut.value=!1):ze();const a=We.value==="url"?ft.value.trim():xt.value;if(U.value&&f.value&&f.value.contains(U.value)){a&&(U.value.src=a),U.value.setAttribute("alt",o),U.value.setAttribute("data-alt",o),Ke.value?(U.value.style.width=`${Ke.value}px`,U.value.setAttribute("width",Ke.value)):(U.value.style.removeProperty("width"),U.value.removeAttribute("width")),Ge.value?(U.value.style.height=`${Ge.value}px`,U.value.setAttribute("height",Ge.value)):(U.value.style.removeProperty("height"),U.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(U.value),c.collapse(!0),r.addRange(c)}Z()}else{if(!a){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Lt();return}if(f.value){f.value.focus();const r=window.getSelection();r&&r.rangeCount>0&&r.removeAllRanges();const c=window.getSelection();let d=null;if(Ie.value&&(jt(Ie.value),c&&c.rangeCount>0&&(d=c.getRangeAt(0))),!d&&c&&c.rangeCount>0&&(d=c.getRangeAt(0)),!d&&f.value){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){Lt();return}const u=d.commonAncestorContainer,m=u.nodeType===3?u.parentElement:u;if(!f.value.contains(m)){if(d=document.createRange(),f.value.childNodes.length===0){const h=document.createElement("p");h.innerHTML="<br>",f.value.appendChild(h),d.setStart(h,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}const v=document.createElement("img");v.src=a,v.setAttribute("alt",o),v.setAttribute("data-alt",o),Ke.value&&(v.style.width=`${Ke.value}px`,v.setAttribute("width",Ke.value)),Ge.value&&(v.style.height=`${Ge.value}px`,v.setAttribute("height",Ge.value));try{d.insertNode(v),d.setStartAfter(v),d.collapse(!0),c&&(c.removeAllRanges(),c.addRange(d))}catch{if(f.value){if(f.value.childNodes.length===0){const $=document.createElement("p");f.value.appendChild($),$.appendChild(v)}else{const $=f.value.lastChild;if($&&$.nodeType===1)$.appendChild(v);else{const N=document.createElement("p");f.value.appendChild(N),N.appendChild(v)}}const _=document.createRange();_.setStartAfter(v),_.collapse(!0),c&&(c.removeAllRanges(),c.addRange(_))}}U.value=v,Z()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),wn(),qt(),Lt()})};e.watch(()=>C.modelValue,o=>{if(C.richText&&f.value&&!de.value){const l=Pn(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=Xe();f.value.innerHTML=l,e.nextTick(()=>{he();const u=f.value.innerHTML||"",m=C.title||"",v=C.description||"";X.value=u,Q.value=m,re.value=v,j.value=u,x.value=m,k.value=v,ot.value=[],bt.value=[],Se.value&&(clearTimeout(Se.value),Se.value=null),ut.value=!1,d&&jt(d),Sn(),Mn(),W(),wn(),qt(),En(),Rn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>C.richText,o=>{o?(qt(),e.nextTick(()=>{ml()})):(Ml(),vt.value=[],Ue.value&&(Ue.value.disconnect(),Ue.value=null)),En()}),e.watch(()=>C.floatingToolbar,o=>{o?qt():Ml()}),e.watch(()=>C.disabled,o=>{o&&Ml(),En()}),e.watch(()=>C.description,()=>{e.nextTick(()=>{le.value?fl():Ce()})}),e.watch(()=>C.title,()=>{e.nextTick(()=>{Le.value?kn():ol()})}),e.watch(()=>C.customToolbarSlots,()=>{e.nextTick(()=>{Il()})},{deep:!0}),e.watch(()=>C.comments,(o,l)=>{if(Gl.value){Gl.value=!1;return}Sl.value||C.richText&&f.value&&e.nextTick(()=>{$l()})},{deep:!0,immediate:!1});const $l=()=>{if(!Sl.value&&!(!C.comments||!Array.isArray(C.comments)||C.comments.length===0)&&!(!C.richText||!f.value)){Sl.value=!0;try{const o=new Set,l=C.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),a=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=a.length;a.forEach(u=>{const m=u.parentNode;if(m){for(;u.firstChild;)m.insertBefore(u.firstChild,u);m.removeChild(u)}});let c=0;const d=new Set;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 v=String(m);if(d.has(v))return;const h=f.value.querySelector(`[data-comment="${v}"]`);if(h){Zl(h,u),d.add(v);return}try{const _=bo(u.selection_range,u.selection_text);if(_&&!_.collapsed){const $=_.commonAncestorContainer,N=$.nodeType===3?$.parentElement:$;if(N){const $e=N.closest("[data-comment], [data-fake-comment]");if($e){const me=$e.getAttribute("data-comment")||$e.getAttribute("data-fake-comment");if(String(me)===String(m)){$e.setAttribute("data-comment",v),$e.removeAttribute("data-fake-comment"),Zl($e,u),d.add(v);return}else return}}const J=f.value.querySelector(`[data-comment="${v}"]`);if(J){Zl(J,u),d.add(v);return}const K=document.createElement("span");K.setAttribute("data-comment",v),Zl(K,u);try{_.surroundContents(K),c++,d.add(v)}catch{try{const me=document.createRange();me.setStart(_.startContainer,_.startOffset),me.setEnd(_.endContainer,_.endOffset),Ol(me),me.surroundContents(K),c++,d.add(v)}catch{try{const it=_.extractContents();K.appendChild(it),_.insertNode(K),c++,d.add(v)}catch(it){console.warn("Failed to create comment marker:",it)}}}}}catch{}}),e.nextTick(()=>{Rn("restoreCommentsFromModel"),Z(),Sl.value=!1})}catch{Sl.value=!1}}},Ol=o=>{if(!o||!f.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&&!ko(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},ko=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},bo=(o,l)=>{if(!o||!f.value)return null;try{const a=document.createRange();if(o.type==="text"&&typeof o.start=="number"&&typeof o.end=="number"){let r=0;const c=[f.value];let d=null,u=!1,m=!1;for(;!m&&(d=c.pop());)if(d.nodeType===3){const v=r+d.length;!u&&o.start>=r&&o.start<=v&&(a.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(a.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?Ol(a):null}}catch{return null}return null},Zl=(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")},Rn=(o="unknown")=>{if(!C.richText||!f.value){vt.value=[];return}Date.now()-cn.value<yn&&Dt.value!==null||Dt.value===null&&(Dt.value=requestAnimationFrame(()=>{if(Dt.value=null,cn.value=Date.now(),Tn.value)return;Tn.value=!0;const a={},r=f.value;if(!r){Tn.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Tn.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 v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((N,J)=>{let K=N.getAttribute("data-comment")||N.getAttribute("data-fake-comment");if(!K)return;if(typeof K=="string"&&K.startsWith("comment-")){const Qn=N.textContent?.trim(),ll=C.comments?.find(In=>(typeof In.conversation_id=="string"&&In.conversation_id.startsWith("comment-")?null:In.conversation_id)&&In.selection_text?.trim()===Qn);ll?(K=String(ll.conversation_id),N.setAttribute("data-comment",K),N.removeAttribute("data-fake-comment")):(K=String(Date.now()),N.setAttribute("data-comment",K),N.removeAttribute("data-fake-comment"))}const $e=N.getBoundingClientRect(),me=window.getComputedStyle(N),it=parseFloat(me.lineHeight)||parseFloat(me.fontSize)*1.2,zt=$e.top-h.top+it/2-15,tn=h.top-v.top+zt;let Xt=null,jn=null,hn=0;const Kn=[],Ll=new Set;if(K&&C.comments){const Qn=C.comments.find(ll=>String(ll.conversation_id||ll.id)===String(K));if(Qn){const ll=Qn.conversation||[];ll.length>0?(ll.forEach(In=>{In.user&&In.user.id&&!Ll.has(In.user.id)&&(Ll.add(In.user.id),Kn.push(In.user))}),hn=ll.length):(hn=0,Xt=null,jn=null),Kn.length>0?Xt=Kn[0]:Xt=null,Kn.length>1?jn=Kn[1]:jn=null}}const Fn=$e.top+it/2-15,Hl=Fn+30,xl=5,yt=Hl>h.top+xl&&Fn<h.bottom-xl?1:0;vt.value.find(Qn=>Qn.id===K);let El=N;if(!El&&K&&f.value){const Qn=String(K);El=f.value.querySelector(`[data-comment="${Qn}"], [data-fake-comment="${Qn}"]`)}const Gn=Kn.length;a[K]?(a[K].top=tn,a[K].opacity=yt,a[K].element=El,a[K].firstUser=Xt,a[K].secondUser=jn,a[K].totalCount=hn,a[K].uniqueUserCount=Gn):a[K]={id:K,top:tn,opacity:yt,element:El,firstUser:Xt,secondUser:jn,totalCount:hn,uniqueUserCount:Gn}});const _=Object.values(a).map(N=>{const J=Math.max(0,(N.uniqueUserCount??0)-2);if(!N.element&&N.id&&f.value){const $e=String(N.id);N.element=f.value.querySelector(`[data-comment="${$e}"], [data-fake-comment="${$e}"]`)}return{...N,firstUser:N.firstUser||null,secondUser:N.secondUser||null,totalCount:N.totalCount,additionalCount:J}});(vt.value.length!==_.length||_.some((N,J)=>{const K=vt.value[J];if(!K)return!0;const $e=(K.firstUser?.id||null)!==(N.firstUser?.id||null),me=(K.secondUser?.id||null)!==(N.secondUser?.id||null);return K.id!==N.id||Math.abs(K.top-N.top)>1||K.opacity!==N.opacity||K.totalCount!==N.totalCount||K.additionalCount!==N.additionalCount||$e||me||K.element!==N.element}))&&(vt.value=_),Tn.value=!1}))},Ho=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const a=String(o.id);l=f.value.querySelector(`[data-comment="${a}"], [data-fake-comment="${a}"]`)}l&&(Yn(),Jn.value=l,l.classList.add("editor-comment-highlighted"))},Yn=(o=!1)=>{!o&&Kt.value!==null&&Jn.value&&(Jn.value.getAttribute("data-comment")||Jn.value.getAttribute("data-fake-comment"))===Kt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(a=>{a.classList.remove("editor-comment-highlighted")}),Jn.value&&(Jn.value.classList.remove("editor-comment-highlighted"),Jn.value=null))},Tl=o=>{if(!o||!o.element)return;Yn(!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}"]`;Te("comment-marker-clicked",{commentId:l,selector:a,element:o.element})},wo=()=>{Yn()},ml=()=>{!C.richText||!f.value||(Ue.value&&Ue.value.disconnect(),an.value!==null&&(clearTimeout(an.value),an.value=null),Ue.value=new MutationObserver(()=>{an.value===null&&(an.value=setTimeout(()=>{an.value=null,e.nextTick(()=>{Rn("MutationObserver")})},200))}),Ue.value.observe(f.value,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-comment","data-fake-comment","data-comment-user","data-comment-user-2","data-comment-count"]}),Rn("setupCommentMarkersObserver-initial"))},xo=(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 v=a.left-d.width-4;o.style.left=`${v}px`}if(d.bottom>m){const v=Math.max(8,m-d.height-8);o.style.top=`${v}px`}d.top<0&&(o.style.top="8px")};return e.watch(()=>dt.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(()=>{xo(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,tt.value],()=>{ue.value==="askAi"||tt.value==="askAi"?e.nextTick(()=>{Nt()}):(dt.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(()=>C.locale,o=>{o&&o!==Me.value&&(Me.value=o)},{immediate:!0}),ke({openCommentOverlayForSelector:xn,updateCommentMarkers:Rn,restoreCommentsFromModel:$l}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",un.value]),style:e.normalizeStyle(zn.value)},[D.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Wc,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:w,title:e.unref(R)("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,qc),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:y,title:e.unref(R)("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,Uc),l[73]||(l[73]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Xc,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=a=>mn("paragraph")),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[qe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",jc,[...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)])])):qe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",Kc,[...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)])])):qe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",Gc,[...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)])])):qe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",Qc,[...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)])])):qe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",Jc,[...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)])])):qe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",eu,[...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",tu,[...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,Yc),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=>bn("<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(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=a=>bn("<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(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=a=>bn("<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(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=a=>bn("<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(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=a=>bn("<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(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=a=>bn("<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(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=a=>bn("<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(R)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("bold")}]),onClick:l[9]||(l[9]=a=>et("bold")),title:e.unref(R)("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,nu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("italic")}]),onClick:l[10]||(l[10]=a=>et("italic")),title:e.unref(R)("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,lu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("underline")}]),onClick:l[11]||(l[11]=a=>et("underline")),title:e.unref(R)("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,ou),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt.value}]),onClick:so,title:e.unref(R)("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,au),l[74]||(l[74]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:io,title:e.unref(R)("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,ru)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:jl,title:e.unref(R)("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,su)),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":ht("insertUnorderedList")}]),onClick:al,title:e.unref(R)("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,iu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertOrderedList")}]),onClick:co,title:e.unref(R)("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,cu),l[76]||(l[76]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Qt,title:e.unref(R)("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,uu),Vt.value?(e.openBlock(),e.createElementBlock("div",du)):e.createCommentVNode("",!0),Vt.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:Rl},[...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,mu)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",pu)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",fu,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=a=>mn("askAi")),title:e.unref(R)("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",gu,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,vu),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",hu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[at(a)?(e.openBlock(),e.createElementBlock("div",yu,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),at(a)&&r<D.customToolbarSlots.length-1&&sn(r)?(e.openBlock(),e.createElementBlock("div",Cu)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(ue.value==="paragraph"||ue.value==="askAi")&&D.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:It})):e.createCommentVNode("",!0),e.createVNode(Ao,{showModal:He.value,width:"500px",height:"55vh",onCloseModal:Un},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(R)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",ku,[e.createElementVNode("div",bu,[e.createElementVNode("label",wu,e.toDisplayString(e.unref(R)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:je,type:"text","onUpdate:modelValue":l[15]||(l[15]=a=>O.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterAltText"),onKeyup:e.withKeys(Xn,["enter"])},null,40,xu),[[e.vModelText,O.value]])]),e.createElementVNode("div",Eu,[e.createElementVNode("label",Vu,e.toDisplayString(e.unref(R)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:lt,type:"text","onUpdate:modelValue":l[16]||(l[16]=a=>Ve.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.link.enterUrl"),onKeyup:e.withKeys(Xn,["enter"])},null,40,Nu),[[e.vModelText,Ve.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Un},e.toDisplayString(e.unref(R)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:Xn},e.toDisplayString(e.unref(R)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Ao,{showModal:Mt.value,width:"500px",height:"80vh",onCloseModal:Lt},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(U.value?e.unref(R)("textEditor.image.editImage"):e.unref(R)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",Su,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":We.value==="upload"}]),onClick:l[17]||(l[17]=a=>We.value="upload")},e.toDisplayString(e.unref(R)("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":We.value==="url"}]),onClick:l[18]||(l[18]=a=>We.value="url")},e.toDisplayString(e.unref(R)("textEditor.image.imageLink")),3)]),We.value==="upload"?(e.openBlock(),e.createElementBlock("div",Bu,[e.createElementVNode("div",Mu,[e.createElementVNode("div",_u,[Be.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",$u,e.toDisplayString(e.unref(R)("textEditor.image.uploadImage")),1)),Be.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Lo},[e.createElementVNode("img",{src:xt.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Tu),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:At,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:ho},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:At,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:ho},null,544))]),e.createElementVNode("div",Lu,[e.createElementVNode("label",Hu,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:Zt,type:"text","onUpdate:modelValue":l[19]||(l[19]=a=>Ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,Au),[[e.vModelText,Ft.value]])]),e.createElementVNode("div",Du,[e.createElementVNode("label",Ru,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Fu),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Iu,[e.createElementVNode("label",zu,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,Pu),[[e.vModelText,Ge.value]])])])])):e.createCommentVNode("",!0),We.value==="url"?(e.openBlock(),e.createElementBlock("div",Ou,[e.createElementVNode("div",Zu,[e.createElementVNode("div",Wu,[e.createElementVNode("label",qu,e.toDisplayString(e.unref(R)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:_t,type:"text","onUpdate:modelValue":l[22]||(l[22]=a=>ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(dl,["enter"])},null,40,Uu),[[e.vModelText,ft.value]])]),e.createElementVNode("div",Xu,[e.createElementVNode("label",Yu,e.toDisplayString(e.unref(R)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=a=>Ft.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.enterAltText"),onKeyup:e.withKeys(dl,["enter"])},null,40,ju),[[e.vModelText,Ft.value]])]),e.createElementVNode("div",Ku,[e.createElementVNode("label",Gu,e.toDisplayString(e.unref(R)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=a=>Ke.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:Pl},null,40,Qu),[[e.vModelText,Ke.value]])]),e.createElementVNode("div",Ju,[e.createElementVNode("label",ed,e.toDisplayString(e.unref(R)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=a=>Ge.value=a),class:"dss-link-modal-input",placeholder:e.unref(R)("textEditor.image.auto"),onKeyup:e.withKeys(dl,["enter"]),onInput:yo},null,40,td),[[e.vModelText,Ge.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Lt},e.toDisplayString(e.unref(R)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:dl},e.toDisplayString(e.unref(R)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Cn.value&&Le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.title")),1),e.createElementVNode("div",nd,[Le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ld,[D.title?(e.openBlock(),e.createElementBlock("span",od,e.toDisplayString(D.title),1)):(e.openBlock(),e.createElementBlock("span",ad,e.toDisplayString(Je.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:V,value:D.title,onInput:An,onFocus:vn,onBlur:Al,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Le.value}]),placeholder:Je.value,disabled:D.disabled,rows:"1"},null,42,sd)])],2),Cn.value&&Le.value?(e.openBlock(),e.createElementBlock("div",rd,[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":dn.value&&le.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("textEditor.labels.description")),1),e.createElementVNode("div",id,[le.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",cd,[D.description?(e.openBlock(),e.createElementBlock("span",ud,e.toDisplayString(D.description),1)):(e.openBlock(),e.createElementBlock("span",dd,e.toDisplayString(rt.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:P,value:D.description,onInput:Nl,onFocus:Vl,onBlur:Rt,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!le.value}]),placeholder:rt.value,disabled:D.disabled,rows:"1"},null,42,md)])],2),dn.value&&le.value?(e.openBlock(),e.createElementBlock("div",pd,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,a=>(e.openBlock(),e.createElementBlock("div",{key:a.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":Kt.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=>Ho(a),onMouseleave:wo},[a.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.firstUser.avatar,alt:a.firstUser.name||"avatar"},null,8,gd)):(e.openBlock(),e.createElementBlock("span",hd,e.toDisplayString(a.firstUser.initials||(a.firstUser.name?a.firstUser.name.charAt(0):"")),1))],8,vd)):e.createCommentVNode("",!0),a.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>Tl(a),["stop"])},[a.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.secondUser.avatar,alt:a.secondUser.name||"avatar"},null,8,Cd)):(e.openBlock(),e.createElementBlock("span",kd,e.toDisplayString(a.secondUser.initials||(a.secondUser.name?a.secondUser.name.charAt(0):"")),1))],8,yd)):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=>Tl(a),["stop"])},[e.createElementVNode("span",wd,"+"+e.toDisplayString(a.additionalCount),1)],12,bd)):e.createCommentVNode("",!0)],46,fd))),128)),D.richText?(e.openBlock(),e.createElementBlock("div",Md,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":D.disabled,"dss-text-editor-fixed-height":D.fixedHeight}]),style:e.normalizeStyle(hl.value),onInput:Z,onBlur:Dl,onClick:Bl,onMouseup:zl,onKeyup:zl,onKeydown:Dn,onPaste:pn,onMousemove:_o,onMouseleave:vo},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[Kt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(_n.value)},[sl.value||Bn.value.length>0?(e.openBlock(),e.createElementBlock("div",_d,[e.createElementVNode("div",$d,[sl.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:sl.value},null,8,Td)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ld,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bn.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",Hd,[e.createElementVNode("div",Ad,[a.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.user.avatar,alt:a.user.name||"avatar"},null,8,Dd)):(e.openBlock(),e.createElementBlock("span",Rd,e.toDisplayString(a.user.initials||(a.user.name?a.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Fd,[e.createElementVNode("div",Id,[e.createElementVNode("div",zd,e.toDisplayString(a.user&&a.user.name||"Comment"),1),a.createdAt?(e.openBlock(),e.createElementBlock("div",Pd,e.toDisplayString(Xl(new Date(a.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Cl(a.text)||a.class==="comment-started"}])},e.toDisplayString(a.text||""),3)]),C.commentUser&&a.user&&a.user.id===C.commentUser.id&&!Cl(a.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>So(a,r),["stop"]),title:e.unref(R)("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,Od)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Zd,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:tl,"onUpdate:modelValue":l[26]||(l[26]=a=>el.value=a),class:"dss-comment-input",rows:"1",placeholder:e.unref(R)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(Ql,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(tl.value){const a=tl.value;a.style.height="auto",a.style.height=`${a.scrollHeight}px`}})},null,40,Wd),[[e.vModelText,el.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(Ql,["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",qd,[e.createElementVNode("div",Ud,[e.createElementVNode("span",Xd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),l[82]||(l[82]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Yd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",xd,[e.createElementVNode("textarea",{value:D.modelValue,onInput:kl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":D.fixedHeight}]),placeholder:Fe.value,rows:D.rows,disabled:D.disabled,style:e.normalizeStyle(Ln.value)},null,46,Ed),e.createElementVNode("div",Vd,[e.createElementVNode("div",Nd,[e.createElementVNode("span",Sd,e.toDisplayString(I.value)+" "+e.toDisplayString(I.value===1?e.unref(R)("textEditor.footer.word"):e.unref(R)("textEditor.footer.words")),1),l[79]||(l[79]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",Bd,e.toDisplayString(ne.value)+" "+e.toDisplayString(ne.value===1?e.unref(R)("textEditor.footer.character"):e.unref(R)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[te.value&&S.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ae.value),onMouseenter:l[28]||(l[28]=a=>Ze.value=!0),onMouseleave:_l},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers($o,["stop"]),title:S.value},e.toDisplayString(S.value),9,jd),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(nl,["stop"]),title:e.unref(R)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Gd,[...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,Kd)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[_e.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(ct.value),onMouseenter:l[29]||(l[29]=a=>Et.value=!0),onMouseleave:wl},[e.createElementVNode("div",Qd,[fe.value===e.unref(R)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",Jd,[...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:fe.value},e.toDisplayString(fe.value),9,e1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Co,["stop"]),title:e.unref(R)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",n1,[...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,t1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[D.floatingToolbar&&D.richText&&ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:wt,class:"dss-floating-toolbar",style:e.normalizeStyle(gt.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",l1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(w,["stop"]),title:e.unref(R)("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,o1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!A.value}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(R)("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,a1),l[107]||(l[107]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",s1,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(a=>fo("paragraph"),["stop"])),title:e.unref(R)("textEditor.toolbar.paragraphFormat")},[qe.value==="h1"?(e.openBlock(),e.createElementBlock("svg",i1,[...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)])])):qe.value==="h2"?(e.openBlock(),e.createElementBlock("svg",c1,[...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)])])):qe.value==="h3"?(e.openBlock(),e.createElementBlock("svg",u1,[...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)])])):qe.value==="h4"?(e.openBlock(),e.createElementBlock("svg",d1,[...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)])])):qe.value==="h5"?(e.openBlock(),e.createElementBlock("svg",m1,[...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)])])):qe.value==="h6"?(e.openBlock(),e.createElementBlock("svg",p1,[...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",f1,[...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,r1),tt.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=>ul("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=a=>ul("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=a=>ul("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=a=>ul("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=a=>ul("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=a=>ul("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(R)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=a=>ul("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(R)("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":ht("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(a=>et("bold"),["stop"])),title:e.unref(R)("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,v1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(a=>et("italic"),["stop"])),title:e.unref(R)("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,g1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(a=>et("underline"),["stop"])),title:e.unref(R)("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,h1),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":pt.value}]),onClick:e.withModifiers(so,["stop"]),title:e.unref(R)("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,y1),l[110]||(l[110]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(io,["stop"]),title:e.unref(R)("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,k1)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(jl,["stop"]),title:e.unref(R)("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,C1)),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":ht("insertUnorderedList")}]),onClick:e.withModifiers(al,["stop"]),title:e.unref(R)("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,b1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":ht("insertOrderedList")}]),onClick:e.withModifiers(co,["stop"]),title:e.unref(R)("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,w1),l[112]||(l[112]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Qt,["stop"]),title:e.unref(R)("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,x1),l[113]||(l[113]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(R)("textEditor.toolbar.comment"),onClick:e.withModifiers(Rl,["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,E1),D.askAi?(e.openBlock(),e.createElementBlock("div",V1)):e.createCommentVNode("",!0),D.askAi?(e.openBlock(),e.createElementBlock("div",N1,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(a=>fo("askAi"),["stop"])),title:e.unref(R)("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",B1,e.toDisplayString(e.unref(R)("textEditor.toolbar.askAi")),1)],8,S1),tt.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)]),Hn.value?(e.openBlock(),e.createElementBlock("div",M1,[D.askAi&&Hn.value?(e.openBlock(),e.createElementBlock("div",_1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.customToolbarSlots,(a,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[at(a)&&nn(a)?(e.openBlock(),e.createElementBlock("div",$1,[e.renderSlot(o.$slots,a)])):e.createCommentVNode("",!0),at(a)&&nn(a)&&r<D.customToolbarSlots.length-1&&Nn(r)?(e.openBlock(),e.createElementBlock("div",T1)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),A1={class:"dss-color-picker__section-title"},D1={class:"dss-color-picker__presets-row"},R1=["title","onClick"],F1={key:1,class:"dss-color-picker__section"},I1={class:"dss-color-picker__presets-row"},z1=["title","onClick"],P1={class:"dss-color-picker__section"},O1={class:"dss-color-picker__section-header"},Z1={class:"dss-color-picker__presets-row"},W1=["title","onClick"],q1=["onClick"],U1={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},X1=["title","onClick"],Y1={class:"dss-color-picker__input-row"},j1=["value"],K1={__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(D,{emit:ke}){function z(X){const j=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(X);if(!j)return{h:0,s:0,l:50};const Q=parseInt(j[1],16)/255,re=parseInt(j[2],16)/255,x=parseInt(j[3],16)/255,k=Math.max(Q,re,x),V=Math.min(Q,re,x);let P=0,Y=0;const xe=(k+V)/2;if(k!==V){const Ye=k-V;switch(Y=xe>.5?Ye/(2-k-V):Ye/(k+V),k){case Q:P=((re-x)/Ye+(re<x?6:0))/6;break;case re:P=((x-Q)/Ye+2)/6;break;case x:P=((Q-re)/Ye+4)/6;break}}return{h:P*360,s:Y*100,l:xe*100}}function R(X,j,Q){j/=100,Q/=100;const re=j*Math.min(Q,1-Q),x=k=>{const V=(k+X/30)%12,P=Q-re*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 Me(X){const j=X.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!j)return null;let Q=j[1];return Q.length===3&&(Q=Q.split("").map(re=>re+re).join("")),"#"+Q}function C(X,j,Q){j/=100,Q/=100;const re=Q+j*Math.min(Q,1-Q),x=re===0?0:2-2*Q/re;return{h:X,s:x*100,v:re*100}}function Te(X,j,Q){j/=100,Q/=100;const re=Q*(1-j/2),x=re===0||re===1?0:(Q-re)/Math.min(re,1-re);return{h:X,s:x*100,l:re*100}}const ie=D,nt=ke,f=e.ref(!1),ue=e.ref(!1),ve=e.ref(!1),de=e.ref(-1),te=e.ref(-1),S=e.ref(null),ae=e.ref(null),Ze=e.ref(null),He=e.ref(null),Ve=e.ref({top:0,left:0}),O=e.ref(z(ie.modelValue||"#b8a5de")),lt=e.computed(()=>Array.isArray(ie.presetGroups)&&ie.presetGroups.length>0),je=e.computed(()=>lt.value?0:ie.initialPresetCount!=null?ie.initialPresetCount:te.value<0?null:te.value),Ne=e.computed(()=>{const X=je.value;return X==null?!0:Math.max(0,ie.presetColors.length-X)<ie.max}),Ht=e.computed(()=>!!(ue.value||de.value>=0||!Bt.value&&ie.presetColors.length===0));e.computed(()=>{const X=je.value;return X!=null&&ie.presetColors.length>X});const Bt=e.computed(()=>lt.value||je.value!=null),pt=e.computed(()=>{const X=je.value;return X==null?[]:ie.presetColors.slice(0,X)}),Re=e.computed(()=>{const X=je.value;return X==null?[]:ie.presetColors.slice(X)});function ge(X){const j=je.value;return j!=null?j+X:-1}function gt(X){const j=je.value;return j!=null&&X>=j}function wt(X){gt(X)&&(de.value=X,O.value=z(ie.presetColors[X]),ue.value=!0,e.nextTick(()=>He.value?.focus()))}function tt(X){if(!gt(X))return;const j=ie.presetColors.filter((x,k)=>k!==X);nt("update:presetColors",j);const Q=Me(ie.modelValue),re=Me(ie.presetColors[X]);if(Q&&re&&Q.toLowerCase()===re.toLowerCase()){const x=j[Math.max(0,X-1)]||j[0];x&&nt("update:modelValue",x)}}function Mt(){ve.value=!ve.value,ve.value||(de.value=-1,ue.value=!1)}function Ft(){if(de.value<0)return;const X=Ge.value,j=Me(X);if(j){const Q=[...ie.presetColors];Q[de.value]=j,nt("update:presetColors",Q),nt("update:modelValue",j),de.value=-1,ue.value=!1}}function on(){ie.disabled||(de.value=-1,ue.value=!ue.value,ue.value&&(fe(),e.nextTick(()=>He.value?.focus())))}function xt(X){const j=Me(X),Q=Me(ie.modelValue);return j&&Q&&j.toLowerCase()===Q.toLowerCase()}function Ke(){if(ie.disabled||!Ne.value)return;const X=Ge.value,j=Me(X);if(j){const Q=[...ie.presetColors,j];nt("update:presetColors",Q),nt("update:modelValue",j);const re=je.value??te.value;re>=0&&Q.length-re>=ie.max&&(ue.value=!1)}}const Ge=e.computed(()=>{const{h:X,s:j,l:Q}=O.value;return R(X,j,Q)}),Zt=e.computed(()=>Ge.value.toLowerCase()),At=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${O.value.h}, 100%, 50%))`})),_t=e.computed(()=>{const X=C(O.value.h,O.value.s,O.value.l);return{left:`${X.s}%`,bottom:`${X.v}%`,transform:"translate(-50%, 50%)"}}),U=e.computed(()=>({left:`${O.value.h/360*100}%`,transform:"translateX(-50%)"})),Ie=e.computed(()=>({position:"fixed",left:`${Ve.value.left}px`,top:`${Ve.value.top}px`,zIndex:1002}));function _e(){if(!S.value||!f.value)return;const X=S.value.getBoundingClientRect(),j=window.innerHeight||document.documentElement.clientHeight;let Q=X.bottom+4;const re=ae.value;re&&Q+re.offsetHeight>j-8&&(Q=X.top-4-re.offsetHeight),Ve.value={top:Q,left:X.left}}function fe(){const X=ie.modelValue||"#b8a5de";Me(X)&&(O.value=z(X))}function ct(){nt("update:modelValue",Ge.value)}function Et(){ie.disabled||(f.value=!f.value,f.value&&(fe(),e.nextTick(()=>{_e(),He.value?.focus()})))}function We(){const X=Ge.value,j=Me(X);if(j){if(de.value>=0){const Q=[...ie.presetColors];Q[de.value]=j,nt("update:presetColors",Q),nt("update:modelValue",j)}else if((ie.presetColors.length>0||lt.value)&&ue.value&&Ne.value&&!ie.presetColors.some(re=>Me(re)?.toLowerCase()===j.toLowerCase())){const re=[...ie.presetColors,j];nt("update:presetColors",re),nt("update:modelValue",j)}}f.value=!1,ue.value=!1,ve.value=!1,de.value=-1}function ft(X){if(!Ze.value)return;const j=Ze.value.getBoundingClientRect(),Q=re=>{const x=Math.max(0,Math.min(1,(re.clientX-j.left)/j.width)),k=Math.max(0,Math.min(1,1-(re.clientY-j.top)/j.height)),V={h:O.value.h,s:x*100,v:k*100};O.value=Te(V.h,V.s,V.v)};Q(X),document.addEventListener("mousemove",Q),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",Q),ct()},{once:!0})}function dt(X){if(!X.currentTarget)return;const Q=X.currentTarget.getBoundingClientRect(),re=x=>{const k=Math.max(0,Math.min(1,(x.clientX-Q.left)/Q.width));O.value={...O.value,h:k*360}};re(X),document.addEventListener("mousemove",re),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",re),ct()},{once:!0})}function $t(X){const j=X.target.value,Q=Me(j);Q&&(O.value=z(Q),nt("update:modelValue",Q))}function ot(X){if(ie.disabled)return;const j=Me(X);j&&(O.value=z(j),nt("update:modelValue",j))}let bt=null,Se=null;function ut(){bt&&(document.removeEventListener("keydown",bt),bt=null),Se&&(window.removeEventListener("resize",Se),Se=null)}return e.watch(f,X=>{if(ut(),X){if(!lt.value&&ie.initialPresetCount==null){const j=ie.presetColors.length;j>0&&(te.value<0||j<te.value)&&(te.value=j)}bt=j=>{j.key==="Escape"&&We()},Se=_e,document.addEventListener("keydown",bt),window.addEventListener("resize",Se)}}),e.watch(()=>ie.modelValue,()=>{f.value&&fe()},{immediate:!1}),e.watch(Re,X=>{X.length===0&&(ve.value=!1,de.value=-1,ue.value=!1)}),e.onBeforeUnmount(ut),(X,j)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":D.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:S,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":f.value}]),onClick:Et},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:Ge.value})},[...j[0]||(j[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(We,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ae,class:"dss-color-picker__dropdown",style:e.normalizeStyle(Ie.value)},[Bt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[lt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(D.presetGroups,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+re,class:"dss-color-picker__section"},[e.createElementVNode("span",A1,e.toDisplayString(Q.title),1),e.createElementVNode("div",D1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.colors,(x,k)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+re+"-"+k,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(x)}]),style:e.normalizeStyle({backgroundColor:x}),title:x,onClick:e.withModifiers(V=>ot(x),["stop"])},null,14,R1))),128))])]))),128)):pt.value.length?(e.openBlock(),e.createElementBlock("div",F1,[j[1]||(j[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",I1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(x=>ot(Q),["stop"])},null,14,z1))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",P1,[e.createElementVNode("div",O1,[j[3]||(j[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),Re.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":ve.value}]),title:"Manage custom colors",onClick:e.withModifiers(Mt,["stop"])},[...j[2]||(j[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Z1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(Q,re)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+re,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":ve.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!ve.value&&xt(Q),"dss-color-picker__preset-bubble--editing":ve.value&&de.value===ge(re)}]),style:e.normalizeStyle({backgroundColor:de.value===ge(re)?Ge.value:Q}),title:de.value===ge(re)?Ge.value:Q,onClick:e.withModifiers(x=>ve.value?wt(ge(re)):ot(Q),["stop"])},null,14,W1),ve.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(x=>tt(ge(re)),["stop"])},[...j[4]||(j[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,q1)):e.createCommentVNode("",!0)],2))),128)),Ne.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(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):D.presetColors.length?(e.openBlock(),e.createElementBlock("div",U1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.presetColors,(Q,re)=>(e.openBlock(),e.createElementBlock("button",{key:re,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":xt(Q)}]),style:e.normalizeStyle({backgroundColor:Q}),title:Q,onClick:e.withModifiers(x=>ot(Q),["stop"])},null,14,X1))),128)),Ne.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(on,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ht.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:Ze,onMousedown:ft},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(At.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(_t.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:dt},[j[5]||(j[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(U.value)},null,4)],32),e.createElementVNode("div",Y1,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:He,type:"text",class:"dss-color-picker__hex-input",value:Zt.value,onInput:$t},null,40,j1)]),Bt.value&&(D.presetColors.length||lt.value)&&Ne.value&&de.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ke}," Save color ")):e.createCommentVNode("",!0),Bt.value&&de.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),Bt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:We}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},G1={key:0,class:"dss-loader"},Q1={key:0,class:"dss-loader-label"},J1={key:1,class:"dss-loader"},em={key:0,class:"dss-loader-label"},tm={key:2,class:"dss-loader"},nm={key:0,class:"dss-loader-label"},lm={key:3,class:"dss-loader"},om={key:0,class:"dss-loader-label"},am={key:4,class:"dss-loader"},sm={key:0,class:"dss-loader-label"},rm={key:5,class:"dss-loader dss-loader--inline"},im={class:"dss-loader-inline-text"},cm={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"}},setup(D){const ke=D,z=e.computed(()=>ke.size==="small"?"dss-loaders--size-small":ke.size==="large"?"dss-loaders--size-large":ke.size==="medium"||ke.size==null?"dss-loaders--size-medium":null),R=e.computed(()=>ke.size==="small"||ke.size==="medium"||ke.size==="large"||ke.size==null?{}:{"--dss-loader-size":typeof ke.size=="number"?`${ke.size}px`:String(ke.size)});return(Me,C)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",z.value]),style:e.normalizeStyle(R.value)},[D.type==="spinner"?(e.openBlock(),e.createElementBlock("div",G1,[C[0]||(C[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",Q1,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="dots"?(e.openBlock(),e.createElementBlock("div",J1,[C[1]||(C[1]=e.createElementVNode("span",{class:"dss-loader-dots","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"}),e.createElementVNode("span",{class:"dss-loader-dot"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",em,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="battery"?(e.openBlock(),e.createElementBlock("div",tm,[C[2]||(C[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),D.label?(e.openBlock(),e.createElementBlock("span",nm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",lm,[C[3]||(C[3]=e.createElementVNode("span",{class:"dss-loader-double-circle","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-double-circle-outer"}),e.createElementVNode("span",{class:"dss-loader-double-circle-inner"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",om,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="bars"?(e.openBlock(),e.createElementBlock("div",am,[C[4]||(C[4]=e.createElementVNode("span",{class:"dss-loader-bars","aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"}),e.createElementVNode("span",{class:"dss-loader-bar"})],-1)),D.label?(e.openBlock(),e.createElementBlock("span",sm,e.toDisplayString(D.label),1)):e.createCommentVNode("",!0)])):D.type==="inline"?(e.openBlock(),e.createElementBlock("div",rm,[C[5]||(C[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",im,[e.renderSlot(Me.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(D.label),1)])])])):e.createCommentVNode("",!0)],6))}},Uo="dss-skeleton-item",um={__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:D=>["single","multiple"].includes(D)},targetClass:{type:String,default:Uo},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(D){const ke=D,z=e.computed(()=>{const C={"dss-skeleton--loading":ke.loading,"dss-skeleton--static":!ke.shimmer,"dss-skeleton--multiple":ke.mode==="multiple","dss-skeleton--dark":ke.darkMode};return ke.mode==="multiple"&&ke.targetClass!==Uo&&(C[`dss-skeleton--target-${ke.targetClass}`]=!0),C}),R=e.computed(()=>{const C={};return ke.borderRadius&&(C.borderRadius=ke.borderRadius),C}),Me=e.computed(()=>{const C={};return ke.borderRadius&&(C["--dss-skeleton-border-radius"]=ke.borderRadius),ke.darkMode?(C["--dss-skeleton-bg"]=ke.bgDark||"#322c3f",C["--dss-skeleton-shimmer"]=ke.shimmerDark||"#3e3f41",C):(ke.bgColor&&(C["--dss-skeleton-bg"]=ke.bgColor),ke.shimmerColor&&(C["--dss-skeleton-shimmer"]=ke.shimmerColor),C)});return(C,Te)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",z.value]),style:e.normalizeStyle(Me.value)},[D.loading&&D.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(R.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":D.loading&&D.mode==="single"}])},[e.renderSlot(C.$slots,"default")],2)],6))}},dm={key:0,class:"dss-dnd-column-header"},mm={class:"dss-dnd-column-title"},pm={class:"dss-dnd-column-count"},fm=["data-column"],vm={key:0,class:"dss-dnd-indicator"},gm=["onPointerdown"],hm=["onPointerdown"],ym={class:"dss-dnd-item-content"},Cm={class:"dss-dnd-item-default"},km={key:0,class:"dss-dnd-empty"},bm={name:"DSSDnd"},wm=Object.assign(bm,{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"],setup(D,{emit:ke}){const z=D,R=ke,Me={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1},C=e.computed(()=>({...Me,...z.options})),Te=e.computed(()=>({"--dss-dnd-col-min-w":C.value.columnMinWidth,"--dss-dnd-col-max-w":C.value.columnMaxWidth,"--dss-dnd-col-gap":C.value.columnGap,"--dss-dnd-indicator-color":C.value.indicatorColor,"--dss-dnd-body-max-h":C.value.columnBodyMaxHeight})),ie=e.ref(null),nt=e.ref(null),f=e.ref(-1),ue=e.ref(null);let ve=null,de=null,te=null,S=null,ae=0,Ze=0,He="",Ve=null;const O=5,lt=e.computed(()=>{const U={};for(const Ie of z.columns)U[Ie.value]=z.items.filter(_e=>_e[z.columnKey]===Ie.value).sort((_e,fe)=>(_e[z.positionKey]??0)-(fe[z.positionKey]??0));return U}),je=e.computed(()=>{const U={},Ie=!!ie.value,_e=ie.value?.[z.itemKey],fe=nt.value,ct=f.value;for(const Et of z.columns){const We=lt.value[Et.value]||[],ft=[],dt=fe==Et.value;let $t=0;for(let ot=0;ot<We.length;ot++){const bt=We[ot],Se=Ie&&bt[z.itemKey]===_e;!Se&&dt&&ct===$t&&ft.push({type:"indicator",key:`ind-${$t}`}),Se||$t++,ft.push({type:"item",item:bt,isDragged:Se,key:`item-${bt[z.itemKey]}`})}dt&&ct>=$t&&ft.push({type:"indicator",key:"ind-end"}),U[Et.value]=ft}return U});function Ne(U,Ie){const fe=(lt.value[U]||[]).filter(We=>We[z.itemKey]!==ie.value?.[z.itemKey]);if(fe.length===0)return 1;if(Ie<=0){const We=fe[0][z.positionKey];return We!=null&&We>0?We/2:.5}if(Ie>=fe.length){const We=fe[fe.length-1][z.positionKey];return(We??0)+1}const ct=fe[Ie-1][z.positionKey]??0,Et=fe[Ie][z.positionKey]??0;return(ct+Et)/2}function Ht(U,Ie,_e){te&&te.remove();const fe=U.getBoundingClientRect(),ct=U.cloneNode(!0);ct.classList.add("dss-dnd-ghost"),ct.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
|
-
left: ${
|
|
106
|
-
top: ${
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
105
|
+
left: ${Ie-ae}px;
|
|
106
|
+
top: ${_e-Ze}px;
|
|
107
|
+
width: ${fe.width}px;
|
|
108
|
+
height: ${fe.height}px;
|
|
109
109
|
z-index: 9999;
|
|
110
110
|
pointer-events: none;
|
|
111
|
-
opacity: ${
|
|
111
|
+
opacity: ${C.value.dragGhostOpacity};
|
|
112
112
|
box-sizing: border-box;
|
|
113
113
|
box-shadow: 0 8px 24px rgba(0,0,0,0.15);
|
|
114
|
-
background-color: ${
|
|
114
|
+
background-color: ${C.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(et),Q=et}function Nt(O,Ae){Q&&(Q.style.left=`${O-ue}px`,Q.style.top=`${Ae-Ke}px`)}function st(O){O.classList.add("dss-dnd-item--dragging"),O.style.background=y.value.dragSourceBackground,O.style.borderColor=y.value.dragSourceBorder,O.style.transform="scale(0.97)"}function He(O){O.classList.remove("dss-dnd-item--dragging"),O.style.background="",O.style.borderColor="",O.style.transform=""}function ve(O,Ae){return document.elementFromPoint(O,Ae)?.closest(".dss-dnd-column-body")??null}function Mt(O,Ae){const xe=ve(O,Ae),ae=xe?.getAttribute("data-column")??null;if(!ae){tt.value=null,v.value=-1;return}tt.value=ae;const et=xe.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Ct=et.length;for(let Fe=0;Fe<et.length;Fe++){const at=et[Fe].getBoundingClientRect();if(Ae<at.top+at.height/2){Ct=Fe;break}}v.value=Ct}function ht(O){O.preventDefault(),Nt(O.clientX,O.clientY),!Te&&(Te=requestAnimationFrame(()=>{Te=null,Mt(O.clientX,O.clientY)}))}function Ue(O){window.removeEventListener("pointermove",ht),window.removeEventListener("pointerup",Ue),window.removeEventListener("pointercancel",Ue),V?.releasePointerCapture?.(O.pointerId),He(V),V=null;const xe=ve(O.clientX,O.clientY)?.getAttribute("data-column")??null;if(ne.value&&xe){const ae=ne.value[D.columnKey],et=xe,Fe=(lt.value[et]||[]).filter(Qe=>Qe[D.itemKey]!==ne.value[D.itemKey]),at=Math.max(0,Math.min(v.value,Fe.length)),nt=ke(et,at),xt=ne.value[D.itemKey];I("move",{item:ne.value,from:ae,to:et,position:nt,index:at}),ge&&clearTimeout(ge),fe.value={id:xt,from:ae,to:et},ge=setTimeout(()=>{fe.value=null},3500)}Q&&(Q.remove(),Q=null),Me!==null&&(document.body.style.cursor=Me,Me=""),Bt()}function Dt(O,Ae){O.preventDefault();const xe=O.target.closest(".dss-dnd-item");if(!xe)return;const ae=xe.getBoundingClientRect();ue=O.clientX-ae.left,Ke=O.clientY-ae.top,Me=document.body.style.cursor,document.body.style.cursor="grabbing",ne.value=Ae,V=xe,$t(xe,O.clientX,O.clientY),requestAnimationFrame(()=>st(xe)),xe.setPointerCapture?.(O.pointerId),window.addEventListener("pointermove",ht),window.addEventListener("pointerup",Ue,{once:!0}),window.addEventListener("pointercancel",Ue,{once:!0})}function Rt(){he&&(window.removeEventListener("pointermove",mn),window.removeEventListener("pointerup",vt),window.removeEventListener("pointercancel",vt),he=null)}function mn(O){if(!he||O.pointerId!==he.pointerId)return;const Ae=O.clientX-he.startX,xe=O.clientY-he.startY;if(Math.abs(Ae)>=F||Math.abs(xe)>=F){const ae=he.item;Rt(),Dt(O,ae)}}function vt(O){!he||O.pointerId!==he.pointerId||Rt()}function Ge(O,Ae){Rt(),he={item:Ae,startX:O.clientX,startY:O.clientY,pointerId:O.pointerId},window.addEventListener("pointermove",mn),window.addEventListener("pointerup",vt),window.addEventListener("pointercancel",vt)}function Ze(O,Ae){y.value.useHandle||Ge(O,Ae)}function en(O,Ae){Ge(O,Ae)}function It(){Te&&(cancelAnimationFrame(Te),Te=null)}function Bt(){It(),ne.value=null,tt.value=null,v.value=-1}return e.onBeforeUnmount(()=>{It(),Rt(),ge&&clearTimeout(ge),Q&&(Q.remove(),Q=null)}),(O,Ae)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":y.value.unstyled}]),style:e.normalizeStyle(_e.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.columns,xe=>(e.openBlock(),e.createElementBlock("div",{key:xe.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":tt.value==xe.value},xe.class||""]])},[y.value.showHeader?(e.openBlock(),e.createElementBlock("div",u2,[e.renderSlot(O.$slots,"column-header",{column:xe,items:lt.value[xe.value]||[]},()=>[e.createElementVNode("span",m2,e.toDisplayString(xe.title||xe.value),1),e.createElementVNode("span",p2,e.toDisplayString((lt.value[xe.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":xe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value[xe.value],ae=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:ae.key},[ae.type==="indicator"?(e.openBlock(),e.createElementBlock("div",f2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":ae.isDragged,"dss-dnd-item--no-handle":!y.value.useHandle}]),onPointerdown:et=>Ze(et,ae.item)},[y.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(et=>en(et,ae.item),["stop"])},[e.renderSlot(O.$slots,"handle",{},()=>[Ae[0]||(Ae[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,h2)):e.createCommentVNode("",!0),e.createElementVNode("div",C2,[e.renderSlot(O.$slots,"item",{item:ae.item,column:xe,justDropped:fe.value?.id===ae.item[H.itemKey],droppedFrom:fe.value?.id===ae.item[H.itemKey]?fe.value.from:null,droppedTo:fe.value?.id===ae.item[H.itemKey]?fe.value.to:null},()=>[e.createElementVNode("div",y2,e.toDisplayString(ae.item[H.itemKey]),1)])])],42,g2))],64))),128)),(lt.value[xe.value]||[]).length===0&&tt.value!=xe.value?(e.openBlock(),e.createElementBlock("div",k2,[e.renderSlot(O.$slots,"empty",{column:xe},()=>[Ae[1]||(Ae[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,v2)],2))),128))],6))}}),x2={name:"DSSConfetti"},E2=Object.assign(x2,{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(H){const pe=H,D=e.ref(null),I=e.ref(!1);let we=[],y=null,_e=null;function ne(Q,V){const ue=[];for(let Ke=0;Ke<pe.count;Ke++)ue.push(tt(Q));return ue}function tt(Q,V){return{x:Math.random()*Q,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:pe.colors[Math.floor(Math.random()*pe.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(Q,V,ue,Ke){Q.clearRect(0,0,V,ue);for(const Me of we)Q.save(),Q.globalAlpha=Me.opacity*Ke,Q.beginPath(),Q.lineWidth=Me.r,Q.strokeStyle=Me.color,Q.moveTo(Me.x+Me.tilt+Me.r/2,Me.y),Q.lineTo(Me.x+Me.tilt,Me.y+Me.tilt+Me.r/2),Q.stroke(),Q.restore()}function fe(Q,V,ue){const Ke=.3+ue*.7;for(let Me=0;Me<we.length;Me++){const he=we[Me];he.tiltAngle+=he.tiltInc,he.y+=he.speed*Ke,he.x+=Math.sin(he.d)*.5*Ke,he.tilt=Math.sin(he.tiltAngle)*15,ue>=.99&&he.y>V+20&&(we[Me]=tt(Q))}}function Te(){I.value=!0,e.nextTick(()=>{const Q=D.value;if(!Q)return;const V=Q.getContext("2d"),ue=Q.parentElement;if(!ue)return;const Ke=ue.getBoundingClientRect();Q.width=Ke.width,Q.height=Ke.height,we=ne(Q.width,Q.height);const Me=Date.now(),he=Me+pe.duration,F=()=>{const lt=Date.now(),ut=lt-Me;if(lt<he){let ke=1;ut>pe.fadeStart&&(ke=1-(ut-pe.fadeStart)/(pe.duration-pe.fadeStart)),v(V,Q.width,Q.height,ke),fe(Q.width,Q.height,ke),y=requestAnimationFrame(F)}else ge()};F()})}function ge(){y&&(cancelAnimationFrame(y),y=null),we=[],I.value=!1}return e.watch(()=>pe.trigger,Q=>{Q&&(_e&&clearTimeout(_e),_e=setTimeout(Te,pe.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ge(),_e&&clearTimeout(_e)}),(Q,V)=>I.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:D,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),V2={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"}},S2={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"}},M2={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"}},ll={chart:V2,table:S2,datepicker:N2,textEditor:M2},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"}},_2={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"},T2={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"}},al={chart:B2,table:_2,datepicker:T2,textEditor:$2},L2={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"}},H2={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"},A2={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"}},D2={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"}},sl={chart:L2,table:H2,datepicker:A2,textEditor:D2},Dl={en:ll,fr:al,nl:sl};function R2(H){if(!H||!H.global)return;const pe=H.global.availableLocales||[];Object.keys(Dl).forEach(D=>{pe.includes(D)&&H.global.mergeLocaleMessage(D,Dl[D])})}const Rl={en:{textEditor:ll.textEditor},fr:{textEditor:al.textEditor},nl:{textEditor:sl.textEditor}};function I2(H){if(!H||!H.global)return;const pe=H.global.availableLocales||[];Object.keys(Rl).forEach(D=>{pe.includes(D)&&H.global.mergeLocaleMessage(D,Rl[D])})}const Il={en:{table:ll.table},fr:{table:al.table},nl:{table:sl.table}};function F2(H){if(!H||!H.global)return;const pe=H.global.availableLocales||[];Object.keys(Il).forEach(D=>{pe.includes(D)&&H.global.mergeLocaleMessage(D,Il[D])})}const Fl={en:{datepicker:ll.datepicker},fr:{datepicker:al.datepicker},nl:{datepicker:sl.datepicker}};function z2(H){if(!H||!H.global)return;const pe=H.global.availableLocales||[];Object.keys(Fl).forEach(D=>{pe.includes(D)&&H.global.mergeLocaleMessage(D,Fl[D])})}const P2={en:{...ll},fr:{...al},nl:{...sl}};ol.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:P2});exports.DSSChart=Si;exports.DSSChartMessages=Dl;exports.DSSColorPicker=K1;exports.DSSConfetti=E2;exports.DSSDatepicker=Ul;exports.DSSDatepickerMessages=Fl;exports.DSSDnd=w2;exports.DSSLoader=c2;exports.DSSModal=Al;exports.DSSSkeleton=d2;exports.DSSTable=Zc;exports.DSSTableMessages=Il;exports.DSSTextEditor=H1;exports.DSSTextEditorMessages=Rl;exports.addDSSChartTranslations=R2;exports.addDSSDatepickerTranslations=z2;exports.addDSSTableTranslations=F2;exports.addDSSTextEditorTranslations=I2;
|
|
117
|
+
`,document.body.appendChild(ct),te=ct}function Bt(U,Ie){te&&(te.style.left=`${U-ae}px`,te.style.top=`${Ie-Ze}px`)}function pt(U){U.classList.add("dss-dnd-item--dragging"),U.style.background=C.value.dragSourceBackground,U.style.borderColor=C.value.dragSourceBorder,U.style.transform="scale(0.97)"}function Re(U){U.classList.remove("dss-dnd-item--dragging"),U.style.background="",U.style.borderColor="",U.style.transform=""}function ge(U,Ie){return document.elementFromPoint(U,Ie)?.closest(".dss-dnd-column-body")??null}function gt(U,Ie){const _e=ge(U,Ie),fe=_e?.getAttribute("data-column")??null;if(!fe){nt.value=null,f.value=-1;return}nt.value=fe;const ct=_e.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let Et=ct.length;for(let We=0;We<ct.length;We++){const ft=ct[We].getBoundingClientRect();if(Ie<ft.top+ft.height/2){Et=We;break}}f.value=Et}function wt(U){U.preventDefault(),Bt(U.clientX,U.clientY),!ve&&(ve=requestAnimationFrame(()=>{ve=null,gt(U.clientX,U.clientY)}))}function tt(U){window.removeEventListener("pointermove",wt),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),S?.releasePointerCapture?.(U.pointerId),Re(S),S=null;const _e=ge(U.clientX,U.clientY)?.getAttribute("data-column")??null;if(ie.value&&_e){const fe=ie.value[z.columnKey],ct=_e,We=(lt.value[ct]||[]).filter(ot=>ot[z.itemKey]!==ie.value[z.itemKey]),ft=Math.max(0,Math.min(f.value,We.length)),dt=Ne(ct,ft),$t=ie.value[z.itemKey];R("move",{item:ie.value,from:fe,to:ct,position:dt,index:ft}),de&&clearTimeout(de),ue.value={id:$t,from:fe,to:ct},de=setTimeout(()=>{ue.value=null},3500)}te&&(te.remove(),te=null),He!==null&&(document.body.style.cursor=He,He=""),_t()}function Mt(U,Ie){U.preventDefault();const _e=U.target.closest(".dss-dnd-item");if(!_e)return;const fe=_e.getBoundingClientRect();ae=U.clientX-fe.left,Ze=U.clientY-fe.top,He=document.body.style.cursor,document.body.style.cursor="grabbing",ie.value=Ie,S=_e,Ht(_e,U.clientX,U.clientY),requestAnimationFrame(()=>pt(_e)),_e.setPointerCapture?.(U.pointerId),window.addEventListener("pointermove",wt),window.addEventListener("pointerup",tt,{once:!0}),window.addEventListener("pointercancel",tt,{once:!0})}function Ft(){Ve&&(window.removeEventListener("pointermove",on),window.removeEventListener("pointerup",xt),window.removeEventListener("pointercancel",xt),Ve=null)}function on(U){if(!Ve||U.pointerId!==Ve.pointerId)return;const Ie=U.clientX-Ve.startX,_e=U.clientY-Ve.startY;if(Math.abs(Ie)>=O||Math.abs(_e)>=O){const fe=Ve.item;Ft(),Mt(U,fe)}}function xt(U){!Ve||U.pointerId!==Ve.pointerId||Ft()}function Ke(U,Ie){Ft(),Ve={item:Ie,startX:U.clientX,startY:U.clientY,pointerId:U.pointerId},window.addEventListener("pointermove",on),window.addEventListener("pointerup",xt),window.addEventListener("pointercancel",xt)}function Ge(U,Ie){C.value.useHandle||Ke(U,Ie)}function Zt(U,Ie){Ke(U,Ie)}function At(){ve&&(cancelAnimationFrame(ve),ve=null)}function _t(){At(),ie.value=null,nt.value=null,f.value=-1}return e.onBeforeUnmount(()=>{At(),Ft(),de&&clearTimeout(de),te&&(te.remove(),te=null)}),(U,Ie)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":C.value.unstyled}]),style:e.normalizeStyle(Te.value)},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.columns,_e=>(e.openBlock(),e.createElementBlock("div",{key:_e.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":nt.value==_e.value},_e.class||""]])},[C.value.showHeader?(e.openBlock(),e.createElementBlock("div",dm,[e.renderSlot(U.$slots,"column-header",{column:_e,items:lt.value[_e.value]||[]},()=>[e.createElementVNode("span",mm,e.toDisplayString(_e.title||_e.value),1),e.createElementVNode("span",pm,e.toDisplayString((lt.value[_e.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":_e.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(je.value[_e.value],fe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:fe.key},[fe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",vm)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":fe.isDragged,"dss-dnd-item--no-handle":!C.value.useHandle}]),onPointerdown:ct=>Ge(ct,fe.item)},[C.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(ct=>Zt(ct,fe.item),["stop"])},[e.renderSlot(U.$slots,"handle",{},()=>[Ie[0]||(Ie[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,hm)):e.createCommentVNode("",!0),e.createElementVNode("div",ym,[e.renderSlot(U.$slots,"item",{item:fe.item,column:_e,justDropped:ue.value?.id===fe.item[D.itemKey],droppedFrom:ue.value?.id===fe.item[D.itemKey]?ue.value.from:null,droppedTo:ue.value?.id===fe.item[D.itemKey]?ue.value.to:null},()=>[e.createElementVNode("div",Cm,e.toDisplayString(fe.item[D.itemKey]),1)])])],42,gm))],64))),128)),(lt.value[_e.value]||[]).length===0&&nt.value!=_e.value?(e.openBlock(),e.createElementBlock("div",km,[e.renderSlot(U.$slots,"empty",{column:_e},()=>[Ie[1]||(Ie[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,fm)],2))),128))],6))}}),xm={name:"DSSConfetti"},Em=Object.assign(xm,{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(D){const ke=D,z=e.ref(null),R=e.ref(!1);let Me=[],C=null,Te=null;function ie(te,S){const ae=[];for(let Ze=0;Ze<ke.count;Ze++)ae.push(nt(te));return ae}function nt(te,S){return{x:Math.random()*te,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:ke.colors[Math.floor(Math.random()*ke.colors.length)],tilt:Math.floor(Math.random()*10)-10,tiltInc:Math.random()*.08+.04,tiltAngle:0,opacity:Math.random()*.7+.3,speed:Math.random()*4+1.5}}function f(te,S,ae,Ze){te.clearRect(0,0,S,ae);for(const He of Me)te.save(),te.globalAlpha=He.opacity*Ze,te.beginPath(),te.lineWidth=He.r,te.strokeStyle=He.color,te.moveTo(He.x+He.tilt+He.r/2,He.y),te.lineTo(He.x+He.tilt,He.y+He.tilt+He.r/2),te.stroke(),te.restore()}function ue(te,S,ae){const Ze=.3+ae*.7;for(let He=0;He<Me.length;He++){const Ve=Me[He];Ve.tiltAngle+=Ve.tiltInc,Ve.y+=Ve.speed*Ze,Ve.x+=Math.sin(Ve.d)*.5*Ze,Ve.tilt=Math.sin(Ve.tiltAngle)*15,ae>=.99&&Ve.y>S+20&&(Me[He]=nt(te))}}function ve(){R.value=!0,e.nextTick(()=>{const te=z.value;if(!te)return;const S=te.getContext("2d"),ae=te.parentElement;if(!ae)return;const Ze=ae.getBoundingClientRect();te.width=Ze.width,te.height=Ze.height,Me=ie(te.width,te.height);const He=Date.now(),Ve=He+ke.duration,O=()=>{const lt=Date.now(),je=lt-He;if(lt<Ve){let Ne=1;je>ke.fadeStart&&(Ne=1-(je-ke.fadeStart)/(ke.duration-ke.fadeStart)),f(S,te.width,te.height,Ne),ue(te.width,te.height,Ne),C=requestAnimationFrame(O)}else de()};O()})}function de(){C&&(cancelAnimationFrame(C),C=null),Me=[],R.value=!1}return e.watch(()=>ke.trigger,te=>{te&&(Te&&clearTimeout(Te),Te=setTimeout(ve,ke.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{de(),Te&&clearTimeout(Te)}),(te,S)=>R.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:z,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),Vm={class:"dss-filter-global-inner"},Nm=["value"],Sm=["title"],Bm={key:0,class:"dss-filter-funnel-badge"},Mm={class:"dss-filter-panel"},_m={key:0,class:"dss-filter-empty"},$m={class:"dss-filter-row-prefix"},Tm={class:"dss-filter-cell"},Lm=["onClick"],Hm={class:"dss-filter-trigger-text"},Am={class:"dss-filter-popup-list"},Dm=["onClick"],Rm={key:0,class:"dss-filter-popup-empty"},Fm={key:0,class:"dss-filter-cell"},Im=["onClick"],zm={class:"dss-filter-trigger-text"},Pm={class:"dss-filter-popup-list"},Om=["onClick"],Zm={key:1,class:"dss-filter-cell dss-filter-cell--value"},Wm=["onUpdate:modelValue"],qm={key:1,class:"dss-filter-date-wrap"},Um=["onUpdate:modelValue"],Xm=["value","onInput","step"],Ym={key:4,class:"dss-filter-between"},jm=["value","onInput","step"],Km=["value","onInput","step"],Gm={key:5,class:"dss-filter-multiselect"},Qm=["onClick"],Jm={class:"dss-filter-trigger-text"},e2={class:"dss-filter-popup-list dss-filter-popup-list--check"},t2=["onClick"],n2=["checked"],l2={key:0,class:"dss-filter-popup-empty"},o2=["onClick"],a2={class:"dss-filter-foot"},s2={class:"dss-filter-cell"},r2={class:"dss-filter-popup-list"},i2=["onClick"],c2={key:0,class:"dss-filter-popup-divider"},u2=["onClick"],d2={class:"dss-filter-popup-list"},m2=["onClick"],p2={key:0,class:"dss-filter-popup-empty"},f2={class:"dss-filter-popup-list"},v2=["onClick"],g2={key:0,class:"dss-filter-popup-empty"},h2={name:"DSSFilter"},y2=Object.assign(h2,{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(D,{expose:ke,emit:z}){const R=D,Me=z,C={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},Te=e.computed(()=>({...C,...R.options})),ie={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"}]},nt=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],ue=e.ref(""),ve=e.ref([]),de=e.ref(null),te=e.ref(!1),S=e.ref(null),ae=e.ref(""),Ze=e.ref(null);let He=1;function Ve(x){const k=x.find(V=>V&&typeof V=="object");if(!k)return null;for(const V of f)if(V in k&&typeof k[V]=="string")return V;return Object.keys(k).find(V=>typeof k[V]=="string")||null}function O(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(xe=>xe).filter(xe=>xe!=null);return P.length===0?null:typeof P.find(xe=>xe!=null)=="object"?"arraySelect":"arrayText"}return V.every(P=>typeof P=="boolean")?"boolean":V.every(P=>typeof P=="number")?new Set(V).size<=Te.value.maxUniqueForEnum?"select":"range":V.every(P=>typeof P=="string")?new Set(V).size<=Te.value.maxUniqueForSelect?"select":"text":V.some(P=>typeof P=="object"&&!Array.isArray(P))?null:"text"}const lt=e.computed(()=>{if(!R.data?.length)return[];const x=new Set;for(const Y of R.data)if(Y&&typeof Y=="object")for(const xe of Object.keys(Y))x.add(xe);const k=new Set(R.exclude),V=[];for(const Y of x){if(k.has(Y))continue;const xe=R.config[Y]||{},Ye=R.data.map(Vt=>Vt?.[Y]),Le=xe.type||O(Y,Ye);if(!Le)continue;const le=xe.filterMode||"contain",Qe=le==="date"?"date":le==="string"?"text":Le,qe={key:Y,label:xe.label||Q(Y),type:Qe,filterMode:le};if(Le==="select"){const Vt=Ye.filter(vt=>vt!=null&&vt!=="NULL");qe.uniqueValues=[...new Set(Vt)].sort((vt,Ue)=>typeof vt=="number"&&typeof Ue=="number"?vt-Ue:String(vt).localeCompare(String(Ue)))}else if(Le==="range"||Le==="int"){const Vt=Ye.filter(vt=>typeof vt=="number");qe.min=Math.min(...Vt),qe.max=Math.max(...Vt)}else if(Le==="arraySelect"){const Vt=xe.displayKey||Ve(Ye.flatMap(Ue=>Array.isArray(Ue)?Ue:[]));qe.displayKey=Vt;const vt=Ye.flatMap(Ue=>Array.isArray(Ue)?Ue:[]).filter(Ue=>Ue!=null).map(Ue=>Vt&&typeof Ue=="object"?Ue[Vt]:String(Ue)).filter(Ue=>Ue!=null&&Ue!=="");qe.uniqueValues=[...new Set(vt)].sort((Ue,Dt)=>String(Ue).localeCompare(String(Dt)))}V.push(qe)}const P=R.config._order;return P&&V.sort((Y,xe)=>{const Ye=P.indexOf(Y.key),Le=P.indexOf(xe.key);return Ye===-1&&Le===-1?0:Ye===-1?1:Le===-1?-1:Ye-Le}),V}),je=e.computed(()=>{const x={};for(const k of lt.value)x[k.key]=k;return x}),Ne=e.computed(()=>Array.isArray(R.config.groups)&&R.config.groups.length>0),Ht=e.computed(()=>{if(!Ne.value)return[];const x=new Set(lt.value.map(k=>k.key));return R.config.groups.map(k=>({...k,keys:k.keys.filter(V=>x.has(V))})).filter(k=>k.keys.length>0)}),Bt=e.computed(()=>{if(!Ne.value)return[];const x=new Set(R.config.groups.flatMap(k=>k.keys));return lt.value.filter(k=>!x.has(k.key))}),pt=e.computed(()=>{if(!Ze.value)return[];const x=new Set(Ze.value.keys),k=lt.value.filter(P=>x.has(P.key));if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>P.label.toLowerCase().includes(V))}),Re=e.computed(()=>{if(!ae.value)return lt.value;const x=ae.value.toLowerCase();return lt.value.filter(k=>k.label.toLowerCase().includes(x))});function ge(x){de.value===x?gt():(de.value=x,ae.value="",Ze.value=null)}function gt(){de.value=null,ae.value="",Ze.value=null}function wt(x){const k=x.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");de.value&&!k&&!x.target.closest(".dss-filter-popup")&&!x.target.closest(".dss-filter-trigger")&&!x.target.closest(".dss-filter-add-btn")&>(),te.value&&S.value&&!S.value.contains(x.target)&&(k||(te.value=!1))}e.onMounted(()=>document.addEventListener("click",wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",wt));function tt(x){return je.value[x]?.label||Q(x)}function Mt(x){return je.value[x.key]?.filterMode||"contain"}function Ft(x){for(const k of Object.values(ie)){const V=k.find(P=>P.value===x);if(V)return V.label}return x}function on(x){const k=je.value[x.key];return ie[k?.type]||ie.text}function xt(x){return nt.has(x)}function Ke(x){const k=je.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 Ge(x){return ie[x]?.[0]?.value||"contains"}function Zt(x,k){return nt.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 At(x){return je.value[x.key]?.uniqueValues||[]}function _t(x){const k=At(x);if(!ae.value)return k;const V=ae.value.toLowerCase();return k.filter(P=>String(P).toLowerCase().includes(V))}function U(x){const k=x.value;return!k||k.length===0?"Select...":k.length<=2?k.join(", "):`${k.length} selected`}function Ie(x){const k=je.value[x],V=k?.filterMode||"contain",P=k?.type||"text",Y=V==="string"?"contains":Ge(P);ve.value.push(e.reactive({id:He++,key:x,operator:Y,value:Zt(P,Y)})),gt()}function _e(x){ve.value=ve.value.filter(k=>k.id!==x)}function fe(x,k){const P=je.value[k]?.type||"text";x.key=k,x.operator=Ge(P),x.value=Zt(P,x.operator),gt()}function ct(x,k){const V=Ke(x);x.operator=k;const P=Ke(x);if(V!==P||nt.has(k)){const Y=je.value[x.key];x.value=Zt(Y?.type||"text",k)}gt()}function Et(x,k){const V=k.target.value;x.value=V===""?null:Number(V)}function We(x,k,V){const P=V.target.value,Y=P===""?null:Number(P);(!x.value||typeof x.value!="object")&&(x.value={min:null,max:null}),x.value={...x.value,[k]:isNaN(Y)?null:Y}}function ft(x,k){const V=x.value||[],P=V.indexOf(k);x.value=P>=0?V.filter(Y=>Y!==k):[...V,k]}function dt(){ve.value=[],ue.value="",gt()}function $t(x){ue.value=x.target.value}const ot=e.computed(()=>{if(!R.data)return[];let x=R.data;if(ue.value){const k=ue.value.toLowerCase();x=x.filter(V=>{for(const P of Object.keys(V)){const Y=V[P];if(typeof Y=="string"&&Y.toLowerCase().includes(k)||typeof Y=="number"&&String(Y).includes(k)||Array.isArray(Y)&&Y.some(xe=>xe!=null&&(typeof xe=="string"?xe.toLowerCase().includes(k):typeof xe=="object"?Object.values(xe).some(Ye=>typeof Ye=="string"&&Ye.toLowerCase().includes(k)):!1)))return!0}return!1})}for(const k of ve.value){if(!bt(k))continue;const V=je.value[k.key];V&&(x=x.filter(P=>Se(P,k,V)))}return x});function bt(x){return nt.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 Se(x,k,V){const P=x?.[k.key],Y=k.value,xe=k.operator;if(xe==="is_empty")return j(P);if(xe==="is_not_empty")return!j(P);const Ye=V.type;if(Ye==="text"||Ye==="arrayText"){const Le=Ye==="arrayText"&&Array.isArray(P)?P.filter(qe=>qe!=null).map(String).join(" "):P!=null?String(P):"",le=String(Y).toLowerCase(),Qe=Le.toLowerCase();switch(xe){case"contains":return Qe.includes(le);case"not_contains":return!Qe.includes(le);case"equals":return Qe===le;case"not_equals":return Qe!==le;case"starts_with":return Qe.startsWith(le);case"ends_with":return Qe.endsWith(le);default:return!0}}if(Ye==="select")switch(xe){case"is_any_of":return Y.includes(P);case"is_none_of":return!Y.includes(P);default:return!0}if(Ye==="range"||Ye==="int"){const Le=typeof P=="number"?P:Number(P);if(typeof Le!="number"||isNaN(Le))return!1;if(xe==="between"){const Qe=Y?.min!=null?Number(Y.min):null,qe=Y?.max!=null?Number(Y.max):null,Vt=Qe!=null&&!isNaN(Qe)?Qe:null,vt=qe!=null&&!isNaN(qe)?qe:null;return(Vt==null||Le>=Vt)&&(vt==null||Le<=vt)}const le=typeof Y=="number"&&!isNaN(Y)?Y:Number(Y);if(xe==="contains"||xe==="not_contains"){const Qe=String(Le),qe=String(Y??"").toLowerCase(),Vt=Qe.toLowerCase().includes(qe);return xe==="contains"?Vt:!Vt}if(typeof le!="number"||isNaN(le))return!1;switch(xe){case"eq":return Le===le;case"neq":return Le!==le;case"gt":return Le>le;case"gte":return Le>=le;case"lt":return Le<le;case"lte":return Le<=le;default:return!0}}if(Ye==="arraySelect"){if(!Array.isArray(P))return!1;const Le=P.filter(le=>le!=null).map(le=>V.displayKey&&typeof le=="object"?le[V.displayKey]:String(le));switch(xe){case"contains_any":return Le.some(le=>Y.includes(le));case"contains_all":return Y.every(le=>Le.includes(le));case"not_contains_any":return!Le.some(le=>Y.includes(le));default:return!0}}if(Ye==="date"){const Le=ut(Y);if(!Le||isNaN(Le.getTime()))return!1;const le=ut(P);if(!le||isNaN(le.getTime()))return!1;const Qe=X(le),qe=X(Le);switch(xe){case"eq":return Qe===qe;case"before":return Qe<qe;case"after":return Qe>qe;default:return!0}}if(Ye==="boolean"){const Le=P===!0||P==="true"||P===1,le=P===!1||P==="false"||P===0;switch(xe){case"is_true":return Le;case"is_false":return le;default:return!0}}return!0}function ut(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 X(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 j(x){return!!(x==null||x===""||x==="NULL"||Array.isArray(x)&&x.length===0||Array.isArray(x)&&x.every(k=>k==null))}e.watch(ot,x=>Me("update:modelValue",x),{immediate:!0}),e.watch(()=>R.data,()=>{ve.value=[],ue.value="",te.value=!1,gt()});function Q(x){return x.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,k=>k.toUpperCase())}function re(){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:ve.value.map(k=>({key:k.key,operator:k.operator,value:x(k.value),defType:je.value[k.key]?.type,defFilterMode:je.value[k.key]?.filterMode})),filteredCount:ot.value?.length??0}}return ke({getDebugState:re}),(x,k)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":Te.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:S},[e.createElementVNode("div",Vm,[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:$t},null,40,Nm),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:te.value||ve.value.length>0}]),onClick:k[1]||(k[1]=V=>te.value=!te.value),type:"button",title:te.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)),ve.value.length>0?(e.openBlock(),e.createElementBlock("span",Bm,e.toDisplayString(ve.value.length),1)):e.createCommentVNode("",!0)],10,Sm)]),te.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:k[13]||(k[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Mm,[ve.value.length===0?(e.openBlock(),e.createElementBlock("div",_m," No filter conditions are applied to this view ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ve.value,(V,P)=>(e.openBlock(),e.createElementBlock("div",{key:V.id,class:"dss-filter-row"},[e.createElementVNode("span",$m,e.toDisplayString(P===0?"Where":"And"),1),e.createElementVNode("div",Tm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:field`),["stop"])},[e.createElementVNode("span",Hm,e.toDisplayString(tt(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,Lm),de.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]=Y=>ae.value=Y),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",Am,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.key,class:"dss-filter-popup-item",onClick:xe=>fe(V,Y.key)},e.toDisplayString(Y.label),9,Dm))),128)),Re.value.length===0?(e.openBlock(),e.createElementBlock("li",Rm,"No match")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),Mt(V)==="contain"||Mt(V)==="date"?(e.openBlock(),e.createElementBlock("div",Fm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:op`),["stop"])},[e.createElementVNode("span",zm,e.toDisplayString(Ft(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,Im),de.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",Pm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(on(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:V.operator===Y.value}]),onClick:xe=>ct(V,Y.value)},e.toDisplayString(Y.label),11,Om))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),xt(V.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Zm,[Mt(V)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Wm)),[[e.vModelText,V.value]]):Mt(V)==="date"?(e.openBlock(),e.createElementBlock("div",qm,[e.createVNode(zo,{mode:"single",modelValue:V.value,"onUpdate:modelValue":Y=>V.value=Y},null,8,["modelValue","onUpdate:modelValue"])])):Ke(V)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:"Enter value...","onUpdate:modelValue":Y=>V.value=Y},null,8,Um)),[[e.vModelText,V.value]]):Ke(V)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:"Enter value...",value:V.value,onInput:Y=>Et(V,Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,Xm)):Ke(V)==="between"?(e.openBlock(),e.createElementBlock("div",Ym,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:"Min",value:V.value?.min,onInput:Y=>We(V,"min",Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,jm),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:Y=>We(V,"max",Y),step:je.value[V.key]?.type==="int"?1:void 0},null,40,Km)])):Ke(V)==="multiselect"?(e.openBlock(),e.createElementBlock("div",Gm,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(Y=>ge(`${V.id}:val`),["stop"])},[e.createElementVNode("span",Jm,e.toDisplayString(U(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,Qm),de.value===`${V.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:k[6]||(k[6]=e.withModifiers(()=>{},["stop"]))},[At(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]=Y=>ae.value=Y),placeholder:"Search..."},null,512)),[[e.vModelText,ae.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",e2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_t(V),Y=>(e.openBlock(),e.createElementBlock("li",{key:Y,class:"dss-filter-popup-item",onClick:xe=>ft(V,Y)},[e.createElementVNode("input",{type:"checkbox",checked:(V.value||[]).includes(Y),tabindex:"-1"},null,8,n2),e.createElementVNode("span",null,e.toDisplayString(Y),1)],8,t2))),128)),_t(V).length===0?(e.openBlock(),e.createElementBlock("li",l2," No match ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:Y=>_e(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,o2)]))),128)),e.createElementVNode("div",a2,[e.createElementVNode("div",s2,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:k[7]||(k[7]=e.withModifiers(V=>ge("add"),["stop"]))}," Add filter "),de.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"]))},[Ne.value&&!Ze.value&&!ae.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[8]||(k[8]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",r2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ht.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:P=>Ze.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,i2))),128)),Bt.value.length>0?(e.openBlock(),e.createElementBlock("li",c2)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,u2))),128))])],64)):Ze.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:k[9]||(k[9]=V=>Ze.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(Ze.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[10]||(k[10]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",d2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,m2))),128)),pt.value.length===0?(e.openBlock(),e.createElementBlock("li",p2,"No match")):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":k[11]||(k[11]=V=>ae.value=V),placeholder:"Search attributes..."},null,512),[[e.vModelText,ae.value]]),e.createElementVNode("ul",f2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,V=>(e.openBlock(),e.createElementBlock("li",{key:V.key,class:"dss-filter-popup-item",onClick:P=>Ie(V.key)},e.toDisplayString(V.label),9,v2))),128)),Re.value.length===0?(e.openBlock(),e.createElementBlock("li",g2,"No match ")):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ve.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:dt}," Clear all filters ")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),C2={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"}},k2={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"},b2={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"}},w2={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"}},lo={chart:C2,table:k2,datepicker:b2,textEditor:w2},x2={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"}},E2={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"},V2={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"}},N2={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"}},oo={chart:x2,table:E2,datepicker:V2,textEditor:N2},S2={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"}},B2={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"},M2={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"}},_2={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"}},ao={chart:S2,table:B2,datepicker:M2,textEditor:_2},Do={en:lo,fr:oo,nl:ao};function $2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Do).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Do[z])})}const Ro={en:{textEditor:lo.textEditor},fr:{textEditor:oo.textEditor},nl:{textEditor:ao.textEditor}};function T2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Ro).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Ro[z])})}const Fo={en:{table:lo.table},fr:{table:oo.table},nl:{table:ao.table}};function L2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Fo).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Fo[z])})}const Io={en:{datepicker:lo.datepicker},fr:{datepicker:oo.datepicker},nl:{datepicker:ao.datepicker}};function H2(D){if(!D||!D.global)return;const ke=D.global.availableLocales||[];Object.keys(Io).forEach(z=>{ke.includes(z)&&D.global.mergeLocaleMessage(z,Io[z])})}const A2={en:{...lo},fr:{...oo},nl:{...ao}};no.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:A2});exports.DSSChart=Ni;exports.DSSChartMessages=Do;exports.DSSColorPicker=K1;exports.DSSConfetti=Em;exports.DSSDatepicker=zo;exports.DSSDatepickerMessages=Io;exports.DSSDnd=wm;exports.DSSFilter=y2;exports.DSSLoader=cm;exports.DSSModal=Ao;exports.DSSSkeleton=um;exports.DSSTable=Zc;exports.DSSTableMessages=Fo;exports.DSSTextEditor=H1;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=$2;exports.addDSSDatepickerTranslations=H2;exports.addDSSTableTranslations=L2;exports.addDSSTextEditorTranslations=T2;
|