dsp-semactic 0.6.50 → 0.6.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dsp-semactic.css +1 -1
- package/dist/index.cjs.js +23 -23
- package/dist/index.es.js +4178 -4164
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gl=require("vue-i18n"),Sa={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Va=["value"],Na=["placeholder","value","disabled"],Ba=["placeholder","value"],Ma={key:0,class:"dss-datepicker__double-wrap"},_a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},$a=["onClick"],La={class:"dss-datepicker__double-calendars"},Ta={class:"dss-datepicker__double-calendar"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__double-calendar"},qa={class:"dss-datepicker__calendar-header"},Wa=["aria-label"],Za={class:"dss-datepicker__month-year-row"},Ua=["aria-label"],Xa={class:"dss-datepicker__weekdays"},Ya={class:"dss-datepicker__grid"},ja=["disabled","onClick","onMouseenter"],Ka={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ga={class:"dss-datepicker__calendar-header"},Qa=["aria-label"],Ja={class:"dss-datepicker__month-year-row"},es=["aria-label"],ts={class:"dss-datepicker__weekdays"},ns={class:"dss-datepicker__grid"},ls=["disabled","onClick","onMouseenter"],os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},as={class:"dss-datepicker__calendar-header"},ss={class:"dss-datepicker__month-year-row"},rs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},is={class:"dss-datepicker__months-grid"},cs=["onClick"],us={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ds={class:"dss-datepicker__month-year"},ms={class:"dss-datepicker__years-grid"},ps=["data-year","onClick"],ra=27,ea={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:T=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(T)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(T,{emit:te}){const _=T,L=te,{t:ce,locale:z}=Gl.useI18n(),A=e.ref(!1),U=e.ref("days"),Ke=new Date,he=e.computed(()=>_.minDate instanceof Date?_.minDate:Ke),f=e.ref(he.value.getMonth()),we=e.ref(he.value.getFullYear()),ge=e.ref(he.value.getMonth()),ne=e.ref(he.value.getFullYear()),oe=e.ref(he.value.getMonth()),ve=e.ref(he.value.getFullYear()),H=e.ref("start"),Ce=e.ref(null),Te=e.ref(null);function qe(){const O=he.value,W=O.getMonth(),q=O.getFullYear(),se=W===11?0:W+1,Ie=W===11?q+1:q;return{left:{month:W,year:q},right:{month:se,year:Ie}}}const ct=e.ref(null),R=e.ref(null),xe=e.ref(null),Be=e.ref(null),ke=e.ref(null),mt=e.ref(null),vt=new Date().getFullYear(),de=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),gt=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),We=e.computed(()=>{if(_.mode!=="single"&&_.mode!=="singleFromAvailable")return null;const O=_.modelValue;return O instanceof Date?O:null}),Pt=e.computed(()=>{if(!gt.value)return{start:null,end:null};const O=_.modelValue;return!O||typeof O!="object"?{start:null,end:null}:{start:O.start instanceof Date?O.start:null,end:O.end instanceof Date?O.end:null}});function it(O){if(!O||!(O instanceof Date))return"";const W=O.getDate(),q=O.getMonth()+1,se=O.getFullYear(),Ie=ut=>String(ut).padStart(2,"0");return`${Ie(W)}/${Ie(q)}/${se}`}const Et=e.computed(()=>it(We.value)),Tt=e.computed(()=>{const{start:O,end:W}=Pt.value;if(!O&&!W)return"";const q=!W||O&&O<=W?O:W,se=!O||W&&W>=O?W:O;return P(q,se)?it(q):`${it(q)} - ${it(se)}`}),Wt=e.computed(()=>{if(_.mode!=="readonly")return"—";const O=_.modelValue;if(O instanceof Date)return it(O)||"—";if(O&&typeof O=="object"&&("start"in O||"end"in O)){const W=O.start instanceof Date?O.start:null,q=O.end instanceof Date?O.end:null;if(!W&&!q)return"—";const se=!q||W&&W<=q?W:q,Ie=!W||q&&q>=W?q:W;return P(se,Ie)?it(se):`${it(se)} - ${it(Ie)}`}return"—"});e.computed(()=>{const O=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)});const Ft=e.computed(()=>Te.value==="left"?ge.value:Te.value==="right"?oe.value:f.value),G=e.computed(()=>Te.value==="left"?ne.value:Te.value==="right"?ve.value:we.value),ue=e.computed(()=>{const O=new Date(we.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),De=e.computed(()=>{const O=new Date(G.value,Ft.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),Xe=e.computed(()=>{const O=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(W,q)=>O.format(new Date(2024,q,1)))}),Zt=e.computed(()=>{const W=(Te.value?G.value:we.value)-Math.floor(ra/2);return Array.from({length:ra},(q,se)=>W+se)}),kt=e.computed(()=>{const O=Zt.value;return O.length?`${O[0]} – ${O[O.length-1]}`:""}),xt=e.computed(()=>{const O=new Intl.DateTimeFormat(z.value,{weekday:"short"}),W=new Date(2024,0,1),q=[];for(let se=0;se<7;se++){const Ie=new Date(W);Ie.setDate(W.getDate()+se),q.push(O.format(Ie).slice(0,2))}return q});function Mt(O,W){const q=new Date(O,W,1),se=new Date(O,W+1,0),Ie=q.getDay(),ut=se.getDate(),ft=[];for(let Qe=0;Qe<Ie;Qe++)ft.push(null);for(let Qe=1;Qe<=ut;Qe++)ft.push(new Date(O,W,Qe));return ft}const Ut=e.computed(()=>Mt(we.value,f.value)),Q=e.computed(()=>Mt(ne.value,ge.value)),be=e.computed(()=>Mt(ve.value,oe.value));e.computed(()=>{const O=new Date(ne.value,ge.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)}),e.computed(()=>{const O=new Date(ve.value,oe.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)});const Me=e.computed(()=>{const O=new Date(ne.value,ge.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),Ze=e.computed(()=>{const O=new Date(ve.value,oe.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),et=e.computed(()=>_.availableDates&&_.availableDates.length>0),pt=e.computed(()=>et.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"}]),je=e.ref({top:0,left:0});function _t(){if(!Be.value||!A.value)return;const O=Be.value.getBoundingClientRect(),W=window.innerWidth||document.documentElement.clientWidth,q=window.innerHeight||document.documentElement.clientHeight;let se=O.left,Ie=O.bottom+4;const ut=ke.value;if(ut){const ft=ut.offsetWidth,Qe=ut.offsetHeight;if(se+ft>W-8&&(se=O.right-ft,se<8&&(se=8)),Ie+Qe>q-8){const Ct=O.top-4-Qe;Ct>=8?Ie=Ct:Ie=Math.max(8,q-Qe-8)}}je.value={top:Ie,left:se}}const Re=e.computed(()=>!Be.value||!A.value?{}:{position:"fixed",left:`${je.value.left}px`,top:`${je.value.top}px`,zIndex:1002});function P(O,W){return!O||!W?!1:O.getFullYear()===W.getFullYear()&&O.getMonth()===W.getMonth()&&O.getDate()===W.getDate()}function X(O){return new Date(O.getFullYear(),O.getMonth(),O.getDate()).getTime()}function K(O){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(W=>W instanceof Date&&P(W,O))}function me(O){const W=X(O);return!(_.minDate instanceof Date&&W<X(_.minDate)||_.maxDate instanceof Date&&W>X(_.maxDate))}function ze(O){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(W=>W instanceof Date&&P(W,O))}function nt(O){return ze(O)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?K(O):me(O)}function St(O){const W=We.value,q=Pt.value,se=X(O),Ie=gt.value&&q.start&&q.end&&se>X(q.start)&&se<X(q.end),ut=gt.value&&q.start&&P(O,q.start),ft=gt.value&&q.end&&P(O,q.end),Qe=ut&&ft,Ct=de.value&&W&&P(O,W)||ut||ft;let Xt=!1;if(gt.value&&q.start&&!q.end&&Ce.value){const Tn=X(q.start),An=X(Ce.value),Dn=Math.min(Tn,An),sl=Math.max(Tn,An);Xt=se>Dn&&se<sl}return{"dss-datepicker__day--selected":Ct&&!Qe,"dss-datepicker__day--range-start":ut&&!Qe,"dss-datepicker__day--range-end":ft&&!Qe,"dss-datepicker__day--range-single":Qe,"dss-datepicker__day--in-range":Ie&&!ut&&!ft,"dss-datepicker__day--in-range-preview":Xt&&!ut&&!ft&&!Ie,"dss-datepicker__day--disabled":!nt(O)}}function Pe(O){if(!gt.value)return;const W=Pt.value;if(!W.start||W.end){Ce.value=null;return}if(!nt(O)){Ce.value=null;return}Ce.value=new Date(O.getFullYear(),O.getMonth(),O.getDate())}function ht(){Ce.value=null}function Ot(){if(!_.doubleCalendar||!gt.value)return;const O=Pt.value,{start:W,end:q}=O;if(W&&q){const ut=W<=q?W:q,ft=W<=q?q:W,Qe=ut.getMonth(),Ct=ut.getFullYear(),Xt=ft.getMonth(),Tn=ft.getFullYear();if(Qe!==Xt||Ct!==Tn){const An=ge.value===Qe&&ne.value===Ct,Dn=oe.value===Xt&&ve.value===Tn;if(An&&Dn)return;ge.value=Qe,ne.value=Ct,oe.value=Xt,ve.value=Tn}else{const An=Qe===0?11:Qe-1,Dn=Qe===0?Ct-1:Ct;ge.value===An&&ne.value===Dn&&oe.value===Qe&&ve.value===Ct||(ge.value=Qe,ne.value=Ct,Qe===11?(oe.value=0,ve.value=Ct+1):(oe.value=Qe+1,ve.value=Ct))}return}const se=W||q;if(se){const ut=se.getMonth(),ft=se.getFullYear(),Qe=ge.value===ut&&ne.value===ft,Ct=oe.value===ut&&ve.value===ft;if(Qe||Ct)return;ge.value=ut,ne.value=ft,ut===11?(oe.value=0,ve.value=ft+1):(oe.value=ut+1,ve.value=ft);return}const Ie=qe();ge.value=Ie.left.month,ne.value=Ie.left.year,oe.value=Ie.right.month,ve.value=Ie.right.year}function on(O="start"){if(_.mode==="readonly")return;H.value=O;const W=We.value,q=Pt.value;if(de.value&&W)f.value=W.getMonth(),we.value=W.getFullYear();else if(gt.value)if(_.doubleCalendar)Ot();else{const se=O==="start"&&q.start?q.start:q.end||q.start;se&&(f.value=se.getMonth(),we.value=se.getFullYear())}Be.value=de.value?ct.value?.closest(".dss-datepicker__input-wrap"):R.value,U.value="days",Te.value=null,A.value=!0,e.nextTick(()=>{_t()})}function $t(){U.value="days",Te.value=null,Ce.value=null,A.value=!1}function an(O,W){Te.value=O,U.value=W}function V(){U.value="days",Te.value=null}function w(O){const W=new Date,q=W.getFullYear(),se=W.getMonth(),Ie=W.getDate();let ut,ft;if(et.value){const Qe=[..._.availableDates].filter(Ct=>Ct instanceof Date).map(Ct=>new Date(Ct.getFullYear(),Ct.getMonth(),Ct.getDate()));if(Qe.sort((Ct,Xt)=>Ct.getTime()-Xt.getTime()),Qe.length===0)return;if(O==="all")ut=Qe[0],ft=Qe[Qe.length-1];else{const Ct=parseInt(O.replace("last",""),10);if(Ct<2||Ct>5)return;const Xt=Qe.slice(-Ct);ut=Xt[0],ft=Xt[Xt.length-1]}}else{const Qe=new Date(q,se,Ie);switch(O){case"today":ut=Qe,ft=Qe;break;case"lastWeek":ut=new Date(q,se,Ie-6),ft=Qe;break;case"last15Days":ut=new Date(q,se,Ie-14),ft=Qe;break;case"last30Days":ut=new Date(q,se,Ie-29),ft=Qe;break;case"thisMonth":ut=new Date(q,se,1),ft=Qe;break;case"last3Months":ut=new Date(q,se-3,1),ft=new Date(q,se,0);break;case"last6Months":ut=new Date(q,se-6,1),ft=new Date(q,se,0);break;case"last12Months":ut=new Date(q,se-12,1),ft=new Date(q,se,0);break;case"lastYear":ut=new Date(q-1,0,1),ft=new Date(q-1,11,31);break;default:return}}L("update:modelValue",{start:ut,end:ft}),Ot()}function E(O){Te.value==="left"?ge.value=O:Te.value==="right"?oe.value=O:f.value=O,V()}function Y(O){Te.value==="left"?ne.value=O:Te.value==="right"?ve.value=O:we.value=O,V()}function le(){f.value===0?(f.value=11,we.value--):f.value--}function Ye(){f.value===11?(f.value=0,we.value++):f.value++}function at(){ge.value===0?(ge.value=11,ne.value--):ge.value--}function Ve(){ge.value===11?(ge.value=0,ne.value++):ge.value++}function Fe(){oe.value===0?(oe.value=11,ve.value--):oe.value--}function It(){oe.value===11?(oe.value=0,ve.value++):oe.value++}function Ht(O){if(!nt(O))return;const W=new Date(O.getFullYear(),O.getMonth(),O.getDate());if(de.value){L("update:modelValue",W),$t();return}const q=Pt.value;if(!q.start&&!q.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(q.start&&q.end){L("update:modelValue",{start:W,end:null}),H.value="end";return}if(H.value==="start"){let se=W,Ie=q.end;se&&Ie&&se>Ie&&([se,Ie]=[Ie,se]),L("update:modelValue",{start:se||Ie,end:Ie||se}),H.value="end"}else{let se=q.start,Ie=W;se&&Ie&&Ie<se&&([se,Ie]=[Ie,se]),L("update:modelValue",{start:se||Ie,end:Ie||se}),H.value="start"}}e.watch(Pt,()=>{_.doubleCalendar&>.value&&A.value&&Ot()},{deep:!0});let st=null,Ge=null,Lt=null;function Fn(){st&&(document.removeEventListener("keydown",st),st=null),Ge&&(window.removeEventListener("resize",Ge),Ge=null),Lt&&(window.removeEventListener("scroll",Lt,!0),Lt=null)}return e.watch(U,O=>{O==="years"&&e.nextTick(()=>{mt.value?.querySelector(`[data-year="${G.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,O=>{Fn(),O&&(st=W=>{W.key==="Escape"&&(U.value==="years"||U.value==="months"?V():$t())},Ge=()=>{_t()},Lt=()=>{_t()},document.addEventListener("keydown",st),window.addEventListener("resize",Ge),window.addEventListener("scroll",Lt,!0))}),e.onBeforeUnmount(()=>{Fn()}),(O,W)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":T.mode==="readonly"}])},[T.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Sa,[W[10]||(W[10]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{type:"text",class:"dss-datepicker__input",value:Wt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):de.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:W[0]||(W[0]=q=>on("start"))},[W[11]||(W[11]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputSingleRef",ref:ct,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):gt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:W[1]||(W[1]=q=>on("start"))},[W[12]||(W[12]=e.createElementVNode("span",{class:"dss-datepicker__icon","aria-hidden":"true"},[e.createElementVNode("svg",{class:"dss-datepicker__icon-svg",width:"24",height:"24",viewBox:"0 0 256 256",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,48H48V48H72v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24Z"})])],-1)),e.createElementVNode("input",{ref_key:"inputRangeRef",ref:xe,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectRange"),value:Tt.value,readonly:""},null,8,Ba)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers($t,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ke,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&>.value&&U.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&>.value&&U.value==="days"&&T.quickSelect}]),onClick:W[9]||(W[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Re.value)},[U.value==="days"&&T.doubleCalendar&>.value?(e.openBlock(),e.createElementBlock("div",Ma,[T.quickSelect?(e.openBlock(),e.createElementBlock("nav",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,q=>(e.openBlock(),e.createElementBlock("button",{key:q.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:se=>w(q.id)},e.toDisplayString(e.unref(ce)(q.labelKey)),9,$a))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",La,[e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:at}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[2]||(W[2]=q=>an("left","months"))},e.toDisplayString(Me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[3]||(W[3]=q=>an("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Ve}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,q=>(e.openBlock(),e.createElementBlock("span",{key:q,class:"dss-datepicker__weekday"},e.toDisplayString(q),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(q,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[q?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",St(q)]),disabled:!nt(q),onClick:Ie=>Ht(q),onMouseenter:Ie=>Pe(q),onMouseleave:ht},e.toDisplayString(q.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])]),e.createElementVNode("div",Oa,[e.createElementVNode("div",qa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:Fe}," ‹ ",8,Wa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[4]||(W[4]=q=>an("right","months"))},e.toDisplayString(Ze.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[5]||(W[5]=q=>an("right","years"))},e.toDisplayString(ve.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:It}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,q=>(e.openBlock(),e.createElementBlock("span",{key:q,class:"dss-datepicker__weekday"},e.toDisplayString(q),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(be.value,(q,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[q?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",St(q)]),disabled:!nt(q),onClick:Ie=>Ht(q),onMouseenter:Ie=>Pe(q),onMouseleave:ht},e.toDisplayString(q.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):U.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:le}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[6]||(W[6]=q=>U.value="months")},e.toDisplayString(ue.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[7]||(W[7]=q=>U.value="years")},e.toDisplayString(we.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Ye}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(xt.value,q=>(e.openBlock(),e.createElementBlock("span",{key:q,class:"dss-datepicker__weekday"},e.toDisplayString(q),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,(q,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[q?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",St(q)]),disabled:!nt(q),onClick:Ie=>Ht(q),onMouseenter:Ie=>Pe(q),onMouseleave:ht},e.toDisplayString(q.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):U.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(De.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:W[8]||(W[8]=q=>U.value="years")},e.toDisplayString(G.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Xe.value,(q,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===Ft.value}]),onClick:Ie=>E(se)},e.toDisplayString(q),11,cs))),128))])],64)):U.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",us,[e.createElementVNode("span",ds,e.toDisplayString(kt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:mt},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Zt.value,q=>(e.openBlock(),e.createElementBlock("button",{key:q,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":q===G.value,"dss-datepicker__year-cell--current":q===e.unref(vt)}]),"data-year":q,onClick:se=>Y(q)},e.toDisplayString(q),11,ps))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},fs=["data-chart-type"],vs={class:"dss-chart-header-titles"},gs={key:0,class:"dss-chart-title"},hs={key:1,class:"dss-chart-subtitle"},ys=["onClick","onMouseenter"],ks={class:"dss-legend-text"},Cs=["onClick","onMouseenter"],bs={class:"dss-legend-text"},ws=["title"],xs=["src"],Es={class:"dss-chart-area-wrapper"},Ss={key:0,class:"dss-chart-z-axis-label"},Vs=["width","height","data-smooth","data-animated"],Ns=["id"],Bs=["y","width","height"],Ms=["id"],_s=["d"],$s=["id"],Ls=["d"],Ts={key:0},As=["clip-path"],Ds=["x1","x2","y1","y2"],Hs={class:"dss-axes"},Rs=["x1","x2","y1","y2"],Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs={class:"dss-axis-labels"},Ps=["x","y"],Os=["x","y"],qs=["x","y"],Ws=["x","y"],Zs=["y","transform"],Us=["x","y","transform"],Xs={key:1,class:"dss-flag-markers"},Ys=["clip-path"],js=["x1","x2","y1","y2","onMouseover"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["cx","cy","onMouseover"],Js=["cx","cy","fill","onMouseover"],er=["x","y"],tr=["clip-path"],nr={key:0},lr=["d","onMouseover"],or=["x","y","width","height","fill","onMouseover"],ar={class:"dss-line-chart"},sr=["d","stroke","stroke-width","stroke-dasharray"],rr=["d","stroke","stroke-width","opacity"],ir=["cx","cy","r","fill","onMouseover"],cr={key:1},ur=["d","stroke","stroke-width","stroke-dasharray"],dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","opacity"],pr=["cx","cy","r","fill","onMouseover"],fr={key:2},vr=["id"],gr=["x","y","width","height"],hr=["d","fill","fill-opacity","mask"],yr=["d","stroke","stroke-width"],kr=["d","fill","onMouseover"],Cr=["x","y","width","height","onMouseover"],br=["clip-path"],wr=["x1","x2","y1","y2","stroke"],xr=["cx","cy","r","fill"],Er={key:1,class:"dss-bubble-chart"},Sr={key:0,class:"dss-bubble-group"},Vr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Nr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Br=["transform"],Mr=["cx","cy","r"],_r=["data-chart-type","clip-path"],$r=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Lr={key:1,class:"dss-radial-segment-data-labels"},Tr=["x","y"],Ar=["x","y","font-size","fill"],Dr=["x1","y1","x2","y2","stroke"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x","y","text-anchor","font-size"],Fr=["transform"],Ir={key:0,class:"dss-spider-grid"},zr=["cx","cy","r"],Pr={class:"dss-spider-grid-labels"},Or=["x","y"],qr=["x","y"],Wr=["x1","x2","y1","y2"],Zr={class:"dss-spider-labels"},Ur=["x","y","text-anchor","dominant-baseline"],Xr=["points","fill","fill-opacity","stroke","stroke-width"],Yr=["cx","cy","r","fill","onMouseover"],jr={class:"dss-chart-logos"},Kr=["cx","cy","r","fill"],Gr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Qr=["onClick","onMouseenter"],Jr=["src"],ei={class:"dss-marker-tooltip-category"},ti={key:0,class:"dss-marker-tooltip-description"},ni={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},li={class:"dss-tooltip-title dss-spider-tooltip-area-title"},oi={class:"dss-tooltip-series-name"},ai={class:"dss-tooltip-series-value"},si={key:1,class:"dss-tooltip-section"},ri={key:0,class:"dss-tooltip-title"},ii={class:"dss-bubble-tooltip-data"},ci={key:2,class:"dss-tooltip-section"},ui={class:"dss-tooltip-title"},di={class:"dss-tooltip-value"},mi={key:0,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-group-header"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-text"},hi={key:1,class:"dss-tooltip-section"},yi={class:"dss-tooltip-section-title"},ki={class:"dss-tooltip-item-content"},Ci={class:"dss-tooltip-item-title"},bi={key:0,class:"dss-tooltip-item-description"},wi={class:"dss-tooltip-section"},xi={class:"dss-tooltip-title"},Ei={key:0,class:"dss-bubble-tooltip-data"},Si={class:"dss-tooltip-series-name"},Vi={class:"dss-tooltip-series-value"},Ni={key:0,class:"dss-tooltip-section"},Bi={class:"dss-tooltip-section-title"},Mi={class:"dss-tooltip-group-header"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-text"},Li={key:1,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Ai={class:"dss-tooltip-item-content"},Di={class:"dss-tooltip-item-title"},Hi={key:0,class:"dss-tooltip-item-description"},Ri=["onClick","onMouseenter"],Fi={class:"dss-legend-text"},Ii={key:1,class:"dss-context-menu-separator"},zi={key:0,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi=["onClick"],qi=["innerHTML"],Wi={key:0,class:"dss-context-menu-icon"},Zi={class:"dss-marker-modal-header"},Ui={class:"dss-marker-modal-body"},Xi={class:"dss-form-group"},Yi={class:"dss-form-group"},ji={for:"dss-marker-description"},Ki={key:0,class:"dss-form-text-display"},Gi=["placeholder"],Qi={class:"dss-marker-modal-footer"},Ji={class:"modal-footer-left"},ec={class:"dss-modal-footer-right"},tc=["disabled"],nc={name:"DSSChart"},lc=Object.assign(nc,{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:T=>typeof T=="object"&&T!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:te}){const{t:_,locale:L}=Gl.useI18n(),ce=te,z=e.ref(null),A=e.ref(null),U=e.ref(null),Ke=e.ref(0),he=e.ref(0);let f=null,we=null;const ge=20,ne=e.computed(()=>{if(he.value,Ke.value,!z.value||!A.value)return 0;try{const t=z.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),oe=e.computed(()=>`chart-clip-${H.chartId}`),ve=e.computed(()=>`url(#${oe.value})`),H=T,Ce={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Te(t,a){const n=Object.assign({},t);return ct(t)&&ct(a)&&Object.keys(a).forEach(i=>{ct(a[i])?i in t?n[i]=Te(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const qe=()=>{let t=20,a=0,n=0;if(it.value&&(t+=30),Et.value&&(t+=25),Q.value&&H.series.length>0){const i=H.series.filter((p,g)=>!tt.value.has(g)).length;if(be.value==="top"||be.value==="bottom"){if(Me.value==="horizontal"){const g=Math.floor(ke.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function ct(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Te(Ce,H.options)),xe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),Be=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),ke=e.computed(()=>{const t=R.value;return xe.value?Ke.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),mt=e.ref(ge),vt=e.computed(()=>{if(Be.value){const t=vt.value;return t??Math.max(0,(he.value||400)-mt.value*5)}}),de=e.computed(()=>{const t=R.value;if(We.value==="mini-radial")return ke.value;if(Be.value){const a=vt.value;return a??Math.max(0,(he.value||400)-mt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),gt=e.computed(()=>{if(Be.value&&We.value==="semi-radial"&&vt.value!=null)return mt.value+de.value+"px";if(Be.value)return"100%";if(fn.value)return mt.value+de.value+"px";if(Q.value&&be.value==="bottom"){const t=qe();return de.value+(t.legendHeight||35)+"px"}return de.value+(Q.value?20:0)+"px"}),We=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Pt=e.computed(()=>{const t=H.series.map(a=>a.type||We.value);return new Set(t).size>1}),it=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Tt=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),Wt=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ft=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),G=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),ue=e.computed(()=>{const t=G.value;return t&&t.title&&t.title.text?t.title.text:""}),De=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return bn;const a=t.yAxis.min;return typeof a=="number"||a===bn?a:bn}),Xe=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return bn;const a=t.yAxis.max;return typeof a=="number"||a===bn?a:bn}),Zt=e.computed(()=>{const t=G.value;if(!t)return bn;const a=t.min;return typeof a=="number"||a===bn?a:bn}),kt=e.computed(()=>{const t=G.value;if(!t)return bn;const a=t.max;return typeof a=="number"||a===bn?a:bn}),xt=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),Mt=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),Ut=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Q=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),be=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Me=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),Ze=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),et=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),pt=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),je=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),_t=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Re=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),P=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),X=e.computed(()=>{if(!fn.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),K=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),me=e.computed(()=>{const{maxX:t}=qt.value;return t===0}),ze=(t,a)=>me.value&&a===0?5:a,nt=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},St=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Pe=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),ht=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Ot=e.computed(()=>{const t=R.value;return Pe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),on=e.computed(()=>{const t=R.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),$t=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),an=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),w=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),E=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),le=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Ye=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),at=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),Ve=e.computed(()=>R.value?.spider?.gridSteps||5),Fe=e.computed(()=>{const t=[],a=Ve.value;for(let n=1;n<=a;n++)t.push(dt.value/a*n);return t}),It=t=>{const a=Ht.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=Fe.value[t];return Math.round(n/dt.value*100)+"%"},Ht=e.computed(()=>R.value?.spider?.gridLabels||null),st=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),Ge=e.computed(()=>{const t=R.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),Lt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Fn=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:yl.value}),O=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),W=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),q=e.computed(()=>{const a=R.value?.valueFormat?.extension;return typeof a=="string"?a:""}),se=t=>{const a=q.value;if(t==null)return"";const n=String(t);return a?n+a:n},Ie=e.computed(()=>!J.value.isZooming);e.computed(()=>Gt.value.map(t=>{if(t.categoryIndex!==void 0&&(Cn.value||jt.value)){const a=Kt(t.categoryIndex),n=ne.value+F.value.bottom-W.value/2;return{...t,x:a,y:n}}return t}));function ut(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,b]=t.split("-"),I=Number(b?.length===2?`20${b}`:b);n=new Date(I,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[b,I,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(I)-1,Number(b)),ee=Math.abs(B-n);ee<p&&(p=ee,i=C)}),i}const ft=e.computed(()=>{const t=H.markers.map(n=>{const i=ut(n.marker_date,H.categories),p=Kt(i),g=ne.value+F.value.bottom-W.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=Gt.value.map(n=>{if(n.categoryIndex!==void 0&&(Cn.value||jt.value)){const i=Kt(n.categoryIndex),p=ne.value+F.value.bottom-W.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),Qe=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),Ct=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),Xt=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Tn=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),An=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let a,n;const i=String(Xt.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Dn=e.computed(()=>{const{width:t,height:a}=An.value,n=Tn.value;let i,p;const g=F.value.left,C=F.value.right,b=F.value.top,I=F.value.bottom,N=F.value.width,$=F.value.height;switch(n){case"center":i=g+(N-t)/2,p=b+($-a)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=C-t-15,p=b+5;break;case"bottom-left":i=g+15,p=I-a-5;break;case"bottom-right":default:i=C-t-15,p=I-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),sl=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),Hn=t=>{const a=sl(t),n=S(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},yl=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Gl=require("vue-i18n"),Sa={key:0,class:"dss-datepicker__input-wrap dss-datepicker__input-wrap--readonly"},Va=["value"],Na=["placeholder","value","disabled"],Ba=["placeholder","value"],Ma={key:0,class:"dss-datepicker__double-wrap"},_a={key:0,class:"dss-datepicker__quick-select","aria-label":"Quick range"},$a=["onClick"],La={class:"dss-datepicker__double-calendars"},Ta={class:"dss-datepicker__double-calendar"},Aa={class:"dss-datepicker__calendar-header"},Da=["aria-label"],Ha={class:"dss-datepicker__month-year-row"},Ra=["aria-label"],Fa={class:"dss-datepicker__weekdays"},Ia={class:"dss-datepicker__grid"},za=["disabled","onClick","onMouseenter"],Pa={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Oa={class:"dss-datepicker__double-calendar"},qa={class:"dss-datepicker__calendar-header"},Wa=["aria-label"],Za={class:"dss-datepicker__month-year-row"},Ua=["aria-label"],Xa={class:"dss-datepicker__weekdays"},Ya={class:"dss-datepicker__grid"},ja=["disabled","onClick","onMouseenter"],Ka={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},Ga={class:"dss-datepicker__calendar-header"},Qa=["aria-label"],Ja={class:"dss-datepicker__month-year-row"},es=["aria-label"],ts={class:"dss-datepicker__weekdays"},ns={class:"dss-datepicker__grid"},ls=["disabled","onClick","onMouseenter"],os={key:1,class:"dss-datepicker__day dss-datepicker__day--empty"},as={class:"dss-datepicker__calendar-header"},ss={class:"dss-datepicker__month-year-row"},rs={class:"dss-datepicker__month-year dss-datepicker__month-year--static"},is={class:"dss-datepicker__months-grid"},cs=["onClick"],us={class:"dss-datepicker__calendar-header dss-datepicker__calendar-header--center"},ds={class:"dss-datepicker__month-year"},ms={class:"dss-datepicker__years-grid"},ps=["data-year","onClick"],ra=27,ea={__name:"DSSDatepicker",props:{mode:{type:String,default:"single",validator:T=>["single","range","singleFromAvailable","rangeFromAvailable","readonly"].includes(T)},modelValue:{type:[Date,Object],default:null},availableDates:{type:Array,default:()=>[]},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},exceptDates:{type:Array,default:()=>[]},doubleCalendar:{type:Boolean,default:!1},quickSelect:{type:Boolean,default:!0},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(T,{emit:te}){const _=T,L=te,{t:ce,locale:z}=Gl.useI18n(),A=e.ref(!1),X=e.ref("days"),je=new Date,ge=e.computed(()=>_.minDate instanceof Date?_.minDate:je),f=e.ref(ge.value.getMonth()),xe=e.ref(ge.value.getFullYear()),he=e.ref(ge.value.getMonth()),ne=e.ref(ge.value.getFullYear()),le=e.ref(ge.value.getMonth()),fe=e.ref(ge.value.getFullYear()),H=e.ref("start"),be=e.ref(null),Te=e.ref(null);function ze(){const O=ge.value,U=O.getMonth(),P=O.getFullYear(),se=U===11?0:U+1,Fe=U===11?P+1:P;return{left:{month:U,year:P},right:{month:se,year:Fe}}}const rt=e.ref(null),R=e.ref(null),Ee=e.ref(null),Be=e.ref(null),Ce=e.ref(null),gt=e.ref(null),pt=new Date().getFullYear(),de=e.computed(()=>["single","singleFromAvailable"].includes(_.mode)),ut=e.computed(()=>["range","rangeFromAvailable"].includes(_.mode)),Oe=e.computed(()=>{if(_.mode!=="single"&&_.mode!=="singleFromAvailable")return null;const O=_.modelValue;return O instanceof Date?O:null}),Ut=e.computed(()=>{if(!ut.value)return{start:null,end:null};const O=_.modelValue;return!O||typeof O!="object"?{start:null,end:null}:{start:O.start instanceof Date?O.start:null,end:O.end instanceof Date?O.end:null}});function st(O){if(!O||!(O instanceof Date))return"";const U=O.getDate(),P=O.getMonth()+1,se=O.getFullYear(),Fe=ct=>String(ct).padStart(2,"0");return`${Fe(U)}/${Fe(P)}/${se}`}const Et=e.computed(()=>st(Oe.value)),Tt=e.computed(()=>{const{start:O,end:U}=Ut.value;if(!O&&!U)return"";const P=!U||O&&O<=U?O:U,se=!O||U&&U>=O?U:O;return W(P,se)?st(P):`${st(P)} - ${st(se)}`}),qt=e.computed(()=>{if(_.mode!=="readonly")return"—";const O=_.modelValue;if(O instanceof Date)return st(O)||"—";if(O&&typeof O=="object"&&("start"in O||"end"in O)){const U=O.start instanceof Date?O.start:null,P=O.end instanceof Date?O.end:null;if(!U&&!P)return"—";const se=!P||U&&U<=P?U:P,Fe=!U||P&&P>=U?P:U;return W(se,Fe)?st(se):`${st(se)} - ${st(Fe)}`}return"—"});e.computed(()=>{const O=new Date(xe.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)});const Ft=e.computed(()=>Te.value==="left"?he.value:Te.value==="right"?le.value:f.value),G=e.computed(()=>Te.value==="left"?ne.value:Te.value==="right"?fe.value:xe.value),me=e.computed(()=>{const O=new Date(xe.value,f.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),He=e.computed(()=>{const O=new Date(G.value,Ft.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),Ue=e.computed(()=>{const O=new Intl.DateTimeFormat(z.value,{month:"short"});return Array.from({length:12},(U,P)=>O.format(new Date(2024,P,1)))}),Wt=e.computed(()=>{const U=(Te.value?G.value:xe.value)-Math.floor(ra/2);return Array.from({length:ra},(P,se)=>U+se)}),yt=e.computed(()=>{const O=Wt.value;return O.length?`${O[0]} – ${O[O.length-1]}`:""}),Pt=e.computed(()=>{const O=new Intl.DateTimeFormat(z.value,{weekday:"short"}),U=new Date(2024,0,1),P=[];for(let se=0;se<7;se++){const Fe=new Date(U);Fe.setDate(U.getDate()+se),P.push(O.format(Fe).slice(0,2))}return P});function wt(O,U){const P=new Date(O,U,1),se=new Date(O,U+1,0),Fe=P.getDay(),ct=se.getDate(),mt=[];for(let Je=0;Je<Fe;Je++)mt.push(null);for(let Je=1;Je<=ct;Je++)mt.push(new Date(O,U,Je));return mt}const It=e.computed(()=>wt(xe.value,f.value)),Q=e.computed(()=>wt(ne.value,he.value)),ye=e.computed(()=>wt(fe.value,le.value));e.computed(()=>{const O=new Date(ne.value,he.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)}),e.computed(()=>{const O=new Date(fe.value,le.value,1);return new Intl.DateTimeFormat(z.value,{month:"long",year:"numeric"}).format(O)});const Me=e.computed(()=>{const O=new Date(ne.value,he.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),qe=e.computed(()=>{const O=new Date(fe.value,le.value,1);return new Intl.DateTimeFormat(z.value,{month:"long"}).format(O)}),et=e.computed(()=>_.availableDates&&_.availableDates.length>0),St=e.computed(()=>et.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"}]),Xe=e.ref({top:0,left:0});function Vt(){if(!Be.value||!A.value)return;const O=Be.value.getBoundingClientRect(),U=window.innerWidth||document.documentElement.clientWidth,P=window.innerHeight||document.documentElement.clientHeight;let se=O.left,Fe=O.bottom+4;const ct=Ce.value;if(ct){const mt=ct.offsetWidth,Je=ct.offsetHeight;if(se+mt>U-8&&(se=O.right-mt,se<8&&(se=8)),Fe+Je>P-8){const xt=O.top-4-Je;xt>=8?Fe=xt:Fe=Math.max(8,P-Je-8)}}Xe.value={top:Fe,left:se}}const Ye=e.computed(()=>!Be.value||!A.value?{}:{position:"fixed",left:`${Xe.value.left}px`,top:`${Xe.value.top}px`,zIndex:1002});function W(O,U){return!O||!U?!1:O.getFullYear()===U.getFullYear()&&O.getMonth()===U.getMonth()&&O.getDate()===U.getDate()}function Z(O){return new Date(O.getFullYear(),O.getMonth(),O.getDate()).getTime()}function K(O){return!_.availableDates||!_.availableDates.length?!0:_.availableDates.some(U=>U instanceof Date&&W(U,O))}function ve(O){const U=Z(O);return!(_.minDate instanceof Date&&U<Z(_.minDate)||_.maxDate instanceof Date&&U>Z(_.maxDate))}function We(O){return!_.exceptDates||!_.exceptDates.length?!1:_.exceptDates.some(U=>U instanceof Date&&W(U,O))}function Ke(O){return We(O)?!1:["singleFromAvailable","rangeFromAvailable"].includes(_.mode)?K(O):ve(O)}function Nt(O){const U=Oe.value,P=Ut.value,se=Z(O),Fe=ut.value&&P.start&&P.end&&se>Z(P.start)&&se<Z(P.end),ct=ut.value&&P.start&&W(O,P.start),mt=ut.value&&P.end&&W(O,P.end),Je=ct&&mt,xt=de.value&&U&&W(O,U)||ct||mt;let zt=!1;if(ut.value&&P.start&&!P.end&&be.value){const Tn=Z(P.start),An=Z(be.value),Dn=Math.min(Tn,An),cl=Math.max(Tn,An);zt=se>Dn&&se<cl}return{"dss-datepicker__day--selected":xt&&!Je,"dss-datepicker__day--range-start":ct&&!Je,"dss-datepicker__day--range-end":mt&&!Je,"dss-datepicker__day--range-single":Je,"dss-datepicker__day--in-range":Fe&&!ct&&!mt,"dss-datepicker__day--in-range-preview":zt&&!ct&&!mt&&!Fe,"dss-datepicker__day--disabled":!Ke(O)}}function Qe(O){if(!ut.value)return;const U=Ut.value;if(!U.start||U.end){be.value=null;return}if(!Ke(O)){be.value=null;return}be.value=new Date(O.getFullYear(),O.getMonth(),O.getDate())}function lt(){be.value=null}function Xt(){if(!_.doubleCalendar||!ut.value)return;const O=Ut.value,{start:U,end:P}=O;if(U&&P){const ct=U<=P?U:P,mt=U<=P?P:U,Je=ct.getMonth(),xt=ct.getFullYear(),zt=mt.getMonth(),Tn=mt.getFullYear();if(Je!==zt||xt!==Tn){const An=he.value===Je&&ne.value===xt,Dn=le.value===zt&&fe.value===Tn;if(An&&Dn)return;he.value=Je,ne.value=xt,le.value=zt,fe.value=Tn}else{const An=Je===0?11:Je-1,Dn=Je===0?xt-1:xt;he.value===An&&ne.value===Dn&&le.value===Je&&fe.value===xt||(he.value=Je,ne.value=xt,Je===11?(le.value=0,fe.value=xt+1):(le.value=Je+1,fe.value=xt))}return}const se=U||P;if(se){const ct=se.getMonth(),mt=se.getFullYear(),Je=he.value===ct&&ne.value===mt,xt=le.value===ct&&fe.value===mt;if(Je||xt)return;he.value=ct,ne.value=mt,ct===11?(le.value=0,fe.value=mt+1):(le.value=ct+1,fe.value=mt);return}const Fe=ze();he.value=Fe.left.month,ne.value=Fe.left.year,le.value=Fe.right.month,fe.value=Fe.right.year}function ln(O="start"){if(_.mode==="readonly")return;H.value=O;const U=Oe.value,P=Ut.value;if(de.value&&U)f.value=U.getMonth(),xe.value=U.getFullYear();else if(ut.value)if(_.doubleCalendar)Xt();else{const se=O==="start"&&P.start?P.start:P.end||P.start;se&&(f.value=se.getMonth(),xe.value=se.getFullYear())}Be.value=de.value?rt.value?.closest(".dss-datepicker__input-wrap"):R.value,X.value="days",Te.value=null,A.value=!0,e.nextTick(()=>{Vt()})}function $t(){X.value="days",Te.value=null,be.value=null,A.value=!1}function Qt(O,U){Te.value=O,X.value=U}function V(){X.value="days",Te.value=null}function w(O){const U=new Date,P=U.getFullYear(),se=U.getMonth(),Fe=U.getDate();let ct,mt;if(et.value){const Je=[..._.availableDates].filter(xt=>xt instanceof Date).map(xt=>new Date(xt.getFullYear(),xt.getMonth(),xt.getDate()));if(Je.sort((xt,zt)=>xt.getTime()-zt.getTime()),Je.length===0)return;if(O==="all")ct=Je[0],mt=Je[Je.length-1];else{const xt=parseInt(O.replace("last",""),10);if(xt<2||xt>5)return;const zt=Je.slice(-xt);ct=zt[0],mt=zt[zt.length-1]}}else{const Je=new Date(P,se,Fe);switch(O){case"today":ct=Je,mt=Je;break;case"lastWeek":ct=new Date(P,se,Fe-6),mt=Je;break;case"last15Days":ct=new Date(P,se,Fe-14),mt=Je;break;case"last30Days":ct=new Date(P,se,Fe-29),mt=Je;break;case"thisMonth":ct=new Date(P,se,1),mt=Je;break;case"last3Months":ct=new Date(P,se-3,1),mt=new Date(P,se,0);break;case"last6Months":ct=new Date(P,se-6,1),mt=new Date(P,se,0);break;case"last12Months":ct=new Date(P,se-12,1),mt=new Date(P,se,0);break;case"lastYear":ct=new Date(P-1,0,1),mt=new Date(P-1,11,31);break;default:return}}L("update:modelValue",{start:ct,end:mt}),Xt()}function S(O){Te.value==="left"?he.value=O:Te.value==="right"?le.value=O:f.value=O,V()}function Y(O){Te.value==="left"?ne.value=O:Te.value==="right"?fe.value=O:xe.value=O,V()}function J(){f.value===0?(f.value=11,xe.value--):f.value--}function Pe(){f.value===11?(f.value=0,xe.value++):f.value++}function ft(){he.value===0?(he.value=11,ne.value--):he.value--}function tt(){he.value===11?(he.value=0,ne.value++):he.value++}function we(){le.value===0?(le.value=11,fe.value--):le.value--}function Bt(){le.value===11?(le.value=0,fe.value++):le.value++}function At(O){if(!Ke(O))return;const U=new Date(O.getFullYear(),O.getMonth(),O.getDate());if(de.value){L("update:modelValue",U),$t();return}const P=Ut.value;if(!P.start&&!P.end){L("update:modelValue",{start:U,end:null}),H.value="end";return}if(P.start&&P.end){L("update:modelValue",{start:U,end:null}),H.value="end";return}if(H.value==="start"){let se=U,Fe=P.end;se&&Fe&&se>Fe&&([se,Fe]=[Fe,se]),L("update:modelValue",{start:se||Fe,end:Fe||se}),H.value="end"}else{let se=P.start,Fe=U;se&&Fe&&Fe<se&&([se,Fe]=[Fe,se]),L("update:modelValue",{start:se||Fe,end:Fe||se}),H.value="start"}}e.watch(Ut,()=>{_.doubleCalendar&&ut.value&&A.value&&Xt()},{deep:!0});let kt=null,nt=null,dt=null;function Wn(){kt&&(document.removeEventListener("keydown",kt),kt=null),nt&&(window.removeEventListener("resize",nt),nt=null),dt&&(window.removeEventListener("scroll",dt,!0),dt=null)}return e.watch(X,O=>{O==="years"&&e.nextTick(()=>{gt.value?.querySelector(`[data-year="${G.value}"]`)?.scrollIntoView({block:"center",behavior:"auto"})})}),e.watch(A,O=>{Wn(),O&&(kt=U=>{U.key==="Escape"&&(X.value==="years"||X.value==="months"?V():$t())},nt=()=>{Vt()},dt=()=>{Vt()},document.addEventListener("keydown",kt),window.addEventListener("resize",nt),window.addEventListener("scroll",dt,!0))}),e.onBeforeUnmount(()=>{Wn()}),(O,U)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-datepicker",{"dss-datepicker--readonly":T.mode==="readonly"}])},[T.mode==="readonly"?(e.openBlock(),e.createElementBlock("div",Sa,[U[10]||(U[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:qt.value,readonly:"",disabled:"",tabindex:"-1"},null,8,Va)])):de.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-datepicker__input-wrap",onClick:U[0]||(U[0]=P=>ln("start"))},[U[11]||(U[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:rt,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectDate"),value:Et.value,readonly:"",disabled:T.mode==="readonly"},null,8,Na)])):ut.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-datepicker__input-wrap",ref_key:"inputRangeWrapRef",ref:R,onClick:U[1]||(U[1]=P=>ln("start"))},[U[12]||(U[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:Ee,type:"text",class:"dss-datepicker__input",placeholder:_.placeholder||e.unref(ce)("datepicker.selectRange"),value:Tt.value,readonly:""},null,8,Ba)],512)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[A.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-datepicker__overlay",onClick:e.withModifiers($t,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:Ce,class:e.normalizeClass(["dss-datepicker__dropdown",{"dss-datepicker__dropdown--double":T.doubleCalendar&&ut.value&&X.value==="days","dss-datepicker__dropdown--quick-select":T.doubleCalendar&&ut.value&&X.value==="days"&&T.quickSelect}]),onClick:U[9]||(U[9]=e.withModifiers(()=>{},["stop"])),style:e.normalizeStyle(Ye.value)},[X.value==="days"&&T.doubleCalendar&&ut.value?(e.openBlock(),e.createElementBlock("div",Ma,[T.quickSelect?(e.openBlock(),e.createElementBlock("nav",_a,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(St.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P.id,type:"button",class:"dss-datepicker__quick-select-btn",onClick:se=>w(P.id)},e.toDisplayString(e.unref(ce)(P.labelKey)),9,$a))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",La,[e.createElementVNode("div",Ta,[e.createElementVNode("div",Aa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:ft}," ‹ ",8,Da),e.createElementVNode("div",Ha,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[2]||(U[2]=P=>Qt("left","months"))},e.toDisplayString(Me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[3]||(U[3]=P=>Qt("left","years"))},e.toDisplayString(ne.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:tt}," › ",8,Ra)]),e.createElementVNode("div",Fa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",Ia,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Q.value,(P,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"L-"+se},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(P)]),disabled:!Ke(P),onClick:Fe=>At(P),onMouseenter:Fe=>Qe(P),onMouseleave:lt},e.toDisplayString(P.getDate()),43,za)):(e.openBlock(),e.createElementBlock("span",Pa))],64))),128))])]),e.createElementVNode("div",Oa,[e.createElementVNode("div",qa,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:we}," ‹ ",8,Wa),e.createElementVNode("div",Za,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[4]||(U[4]=P=>Qt("right","months"))},e.toDisplayString(qe.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[5]||(U[5]=P=>Qt("right","years"))},e.toDisplayString(fe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Bt}," › ",8,Ua)]),e.createElementVNode("div",Xa,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",Ya,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ye.value,(P,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"R-"+se},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(P)]),disabled:!Ke(P),onClick:Fe=>At(P),onMouseenter:Fe=>Qe(P),onMouseleave:lt},e.toDisplayString(P.getDate()),43,ja)):(e.openBlock(),e.createElementBlock("span",Ka))],64))),128))])])])])):X.value==="days"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",Ga,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.prevMonth"),onClick:J}," ‹ ",8,Qa),e.createElementVNode("div",Ja,[e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[6]||(U[6]=P=>X.value="months")},e.toDisplayString(me.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[7]||(U[7]=P=>X.value="years")},e.toDisplayString(xe.value),1)]),e.createElementVNode("button",{type:"button",class:"dss-datepicker__nav","aria-label":e.unref(ce)("datepicker.nextMonth"),onClick:Pe}," › ",8,es)]),e.createElementVNode("div",ts,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,P=>(e.openBlock(),e.createElementBlock("span",{key:P,class:"dss-datepicker__weekday"},e.toDisplayString(P),1))),128))]),e.createElementVNode("div",ns,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(It.value,(P,se)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:se},[P?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-datepicker__day",Nt(P)]),disabled:!Ke(P),onClick:Fe=>At(P),onMouseenter:Fe=>Qe(P),onMouseleave:lt},e.toDisplayString(P.getDate()),43,ls)):(e.openBlock(),e.createElementBlock("span",os))],64))),128))])],64)):X.value==="months"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",as,[e.createElementVNode("div",ss,[e.createElementVNode("span",rs,e.toDisplayString(He.value),1),e.createElementVNode("button",{type:"button",class:"dss-datepicker__month-year-btn",onClick:U[8]||(U[8]=P=>X.value="years")},e.toDisplayString(G.value),1)])]),e.createElementVNode("div",is,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ue.value,(P,se)=>(e.openBlock(),e.createElementBlock("button",{key:se,type:"button",class:e.normalizeClass(["dss-datepicker__month-cell",{"dss-datepicker__month-cell--selected":se===Ft.value}]),onClick:Fe=>S(se)},e.toDisplayString(P),11,cs))),128))])],64)):X.value==="years"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("div",us,[e.createElementVNode("span",ds,e.toDisplayString(yt.value),1)]),e.createElementVNode("div",{class:"dss-datepicker__years-wrap",ref_key:"yearsWrapRef",ref:gt},[e.createElementVNode("div",ms,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Wt.value,P=>(e.openBlock(),e.createElementBlock("button",{key:P,type:"button",class:e.normalizeClass(["dss-datepicker__year-cell",{"dss-datepicker__year-cell--selected":P===G.value,"dss-datepicker__year-cell--current":P===e.unref(pt)}]),"data-year":P,onClick:se=>Y(P)},e.toDisplayString(P),11,ps))),128))])],512)],64)):e.createCommentVNode("",!0)],6)])):e.createCommentVNode("",!0)]))],2))}},fs=["data-chart-type"],vs={class:"dss-chart-header-titles"},gs={key:0,class:"dss-chart-title"},hs={key:1,class:"dss-chart-subtitle"},ys=["onClick","onMouseenter"],ks={class:"dss-legend-text"},Cs=["onClick","onMouseenter"],bs={class:"dss-legend-text"},ws=["title"],xs=["src"],Es={class:"dss-chart-area-wrapper"},Ss={key:0,class:"dss-chart-z-axis-label"},Vs=["width","height","data-smooth","data-animated"],Ns=["id"],Bs=["y","width","height"],Ms=["id"],_s=["d"],$s=["id"],Ls=["d"],Ts={key:0},As=["clip-path"],Ds=["x1","x2","y1","y2"],Hs={class:"dss-axes"},Rs=["x1","x2","y1","y2"],Fs=["x1","x2","y1","y2"],Is=["x1","x2","y1","y2"],zs={class:"dss-axis-labels"},Ps=["x","y"],Os=["x","y"],qs=["x","y"],Ws=["x","y"],Zs=["y","transform"],Us=["x","y","transform"],Xs={key:1,class:"dss-flag-markers"},Ys=["clip-path"],js=["x1","x2","y1","y2","onMouseover"],Ks=["x1","x2","y1","y2","onMouseover"],Gs=["x1","x2","y1","y2","onMouseover"],Qs=["cx","cy","onMouseover"],Js=["cx","cy","fill","onMouseover"],er=["x","y"],tr=["clip-path"],nr={key:0},lr=["d","onMouseover"],or=["x","y","width","height","fill","onMouseover"],ar={class:"dss-line-chart"},sr=["d","stroke","stroke-width","stroke-dasharray"],rr=["d","stroke","stroke-width","opacity"],ir=["cx","cy","r","fill","onMouseover"],cr={key:1},ur=["d","stroke","stroke-width","stroke-dasharray"],dr=["d","stroke","stroke-width","stroke-dasharray"],mr=["d","stroke","stroke-width","opacity"],pr=["cx","cy","r","fill","onMouseover"],fr={key:2},vr=["id"],gr=["x","y","width","height"],hr=["d","fill","fill-opacity","mask"],yr=["d","stroke","stroke-width"],kr=["d","fill","onMouseover"],Cr=["x","y","width","height","onMouseover"],br=["clip-path"],wr=["x1","x2","y1","y2","stroke"],xr=["cx","cy","r","fill"],Er={key:1,class:"dss-bubble-chart"},Sr={key:0,class:"dss-bubble-group"},Vr=["cx","cy","r","fill","fill-opacity","stroke","onMouseenter","onMouseleave","onClick"],Nr=["x","y","width","height","xlink:href","clip-path","onLoad","onError","onMouseenter","onMouseleave","onClick"],Br=["transform"],Mr=["cx","cy","r"],_r=["data-chart-type","clip-path"],$r=["d","fill","fill-opacity","stroke","stroke-width","clip-path","onMouseover"],Lr={key:1,class:"dss-radial-segment-data-labels"},Tr=["x","y"],Ar=["x","y","font-size","fill"],Dr=["x1","y1","x2","y2","stroke"],Hr=["x1","y1","x2","y2","stroke"],Rr=["x","y","text-anchor","font-size"],Fr=["transform"],Ir={key:0,class:"dss-spider-grid"},zr=["cx","cy","r"],Pr={class:"dss-spider-grid-labels"},Or=["x","y"],qr=["x","y"],Wr=["x1","x2","y1","y2"],Zr={class:"dss-spider-labels"},Ur=["x","y","text-anchor","dominant-baseline"],Xr=["points","fill","fill-opacity","stroke","stroke-width"],Yr=["cx","cy","r","fill","onMouseover"],jr={class:"dss-chart-logos"},Kr=["cx","cy","r","fill"],Gr=["x","y","width","height","xlink:href","onLoad","onError","clip-path"],Qr=["onClick","onMouseenter"],Jr=["src"],ei={class:"dss-marker-tooltip-category"},ti={key:0,class:"dss-marker-tooltip-description"},ni={key:0,class:"dss-tooltip-section dss-spider-tooltip-section"},li={class:"dss-tooltip-title dss-spider-tooltip-area-title"},oi={class:"dss-tooltip-series-name"},ai={class:"dss-tooltip-series-value"},si={key:1,class:"dss-tooltip-section"},ri={key:0,class:"dss-tooltip-title"},ii={class:"dss-bubble-tooltip-data"},ci={key:2,class:"dss-tooltip-section"},ui={class:"dss-tooltip-title"},di={class:"dss-tooltip-value"},mi={key:0,class:"dss-tooltip-section"},pi={class:"dss-tooltip-section-title"},fi={class:"dss-tooltip-group-header"},vi={class:"dss-tooltip-item-content"},gi={class:"dss-tooltip-item-text"},hi={key:1,class:"dss-tooltip-section"},yi={class:"dss-tooltip-section-title"},ki={class:"dss-tooltip-item-content"},Ci={class:"dss-tooltip-item-title"},bi={key:0,class:"dss-tooltip-item-description"},wi={class:"dss-tooltip-section"},xi={class:"dss-tooltip-title"},Ei={key:0,class:"dss-bubble-tooltip-data"},Si={class:"dss-tooltip-series-name"},Vi={class:"dss-tooltip-series-value"},Ni={key:0,class:"dss-tooltip-section"},Bi={class:"dss-tooltip-section-title"},Mi={class:"dss-tooltip-group-header"},_i={class:"dss-tooltip-item-content"},$i={class:"dss-tooltip-item-text"},Li={key:1,class:"dss-tooltip-section"},Ti={class:"dss-tooltip-section-title"},Ai={class:"dss-tooltip-item-content"},Di={class:"dss-tooltip-item-title"},Hi={key:0,class:"dss-tooltip-item-description"},Ri=["onClick","onMouseenter"],Fi={class:"dss-legend-text"},Ii={key:1,class:"dss-context-menu-separator"},zi={key:0,class:"dss-context-menu-separator"},Pi={key:0,class:"dss-context-menu-separator"},Oi=["onClick"],qi=["innerHTML"],Wi={key:0,class:"dss-context-menu-icon"},Zi={class:"dss-marker-modal-header"},Ui={class:"dss-marker-modal-body"},Xi={class:"dss-form-group"},Yi={class:"dss-form-group"},ji={for:"dss-marker-description"},Ki={key:0,class:"dss-form-text-display"},Gi=["placeholder"],Qi={class:"dss-marker-modal-footer"},Ji={class:"modal-footer-left"},ec={class:"dss-modal-footer-right"},tc=["disabled"],nc={name:"DSSChart"},lc=Object.assign(nc,{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:T=>typeof T=="object"&&T!==null},innerSize:{type:Number,default:null},old:{type:Boolean,default:!1}},emits:["add-marker","update-marker","delete-marker"],setup(T,{emit:te}){const{t:_,locale:L}=Gl.useI18n(),ce=te,z=e.ref(null),A=e.ref(null),X=e.ref(null),je=e.ref(0),ge=e.ref(0);let f=null,xe=null;const he=20,ne=e.computed(()=>{if(ge.value,je.value,!z.value||!A.value)return 0;try{const t=z.value.getBoundingClientRect();return A.value.getBoundingClientRect().top-t.top}catch{return 0}}),le=e.computed(()=>`chart-clip-${H.chartId}`),fe=e.computed(()=>`url(#${le.value})`),H=T,be={chart:{type:"line",width:800,height:400,orientation:"vertical"},title:{text:"",style:{}},subtitle:{text:"",style:{}},zAxis:"",xAxis:{title:{text:""},type:"category"},yAxis:{min:"auto",max:"auto",title:{text:""}},legend:{show:!0,position:"top",orientation:"horizontal"},radialLabels:{show:!1,pointerLength:25,horizontalLength:35,fontSize:14,color:"#000",textOffset:8},radialBar:{dataLabels:{show:!1,minAngleDegrees:20},dataCenter:{show:!1,fontSize:16}},miniRadial:{minVisiblePercent:1,trackColor:"#E5E7EB",thresholds:{low:33,medium:66},colors:{low:"#E53E3E",medium:"#ED8936",high:"#38A169"}},grid:{show:!0,style:{}},watermark:{enabled:!0,opacity:.05,size:35,position:"bottom-right"},colors:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"],logos:[],stroke:{width:2,curve:"smooth"},bubbles:{size:4},markers:{show:!0,icon:null,iconSize:25,customIcons:{}},fill:{area:{opacity:.3},spider:{opacity:.15}},crosshair:{show:!1,color:"#666"},bubbles:{size:4,tooltip:{fields:["x","y","size"],labels:{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},formatters:{}}},spider:{gridLabels:null,gridSteps:5},zoom:{enabled:!1,minScale:1,maxScale:2.5},smoothing:{enabled:!1,factor:.3,barRadius:4},animations:{enabled:!0,type:"draw",duration:2500,delay:0,staggerDelay:200,easing:"ease-out",onDataChange:!0,respectReducedMotion:!0},valueFormat:{extension:""},contextMenu:{enabled:!0,items:{addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0},customItems:[]}};function Te(t,a){const n=Object.assign({},t);return rt(t)&&rt(a)&&Object.keys(a).forEach(i=>{rt(a[i])?i in t?n[i]=Te(t[i],a[i]):Object.assign(n,{[i]:a[i]}):Object.assign(n,{[i]:a[i]})}),n}const ze=()=>{let t=20,a=0,n=0;if(st.value&&(t+=30),Et.value&&(t+=25),Q.value&&H.series.length>0){const i=H.series.filter((p,g)=>!ot.value.has(g)).length;if(ye.value==="top"||ye.value==="bottom"){if(Me.value==="horizontal"){const g=Math.floor(Ce.value/100);a=Math.ceil(i/g)*25+10}else a=i*25+10;t+=a}else n=150}return{height:t,legendHeight:a,legendWidth:n}};function rt(t){return t&&typeof t=="object"&&!Array.isArray(t)}const R=e.computed(()=>Te(be,H.options)),Ee=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.width==="auto"}),Be=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.height==="auto"}),Ce=e.computed(()=>{const t=R.value;return Ee.value?je.value||800:t&&t.chart&&typeof t.chart.width=="number"?t.chart.width:800}),gt=e.ref(he),pt=e.computed(()=>{if(Be.value){const t=pt.value;return t??Math.max(0,(ge.value||400)-gt.value*5)}}),de=e.computed(()=>{const t=R.value;if(Oe.value==="mini-radial")return Ce.value;if(Be.value){const a=pt.value;return a??Math.max(0,(ge.value||400)-gt.value)}return t&&t.chart&&typeof t.chart.height=="number"?t.chart.height:400}),ut=e.computed(()=>{if(Be.value&&Oe.value==="semi-radial"&&pt.value!=null)return gt.value+de.value+"px";if(Be.value)return"100%";if(vn.value)return gt.value+de.value+"px";if(Q.value&&ye.value==="bottom"){const t=ze();return de.value+(t.legendHeight||35)+"px"}return de.value+(Q.value?20:0)+"px"}),Oe=e.computed(()=>{const t=R.value;return t&&t.chart&&t.chart.type?t.chart.type:"line"}),Ut=e.computed(()=>{const t=H.series.map(a=>a.type||Oe.value);return new Set(t).size>1}),st=e.computed(()=>{const t=R.value;return t&&t.title&&t.title.text?t.title.text:""}),Et=e.computed(()=>{const t=R.value;return t&&t.subtitle&&t.subtitle.text?t.subtitle.text:""}),Tt=e.computed(()=>{const t=R.value;if(!t||!t.zAxis)return"";const a=t.zAxis;return typeof a=="string"?a:a&&typeof a.label=="string"?a.label:""}),qt=e.computed(()=>{const t=R.value;return t&&t.xAxis&&t.xAxis.title&&t.xAxis.title.text?t.xAxis.title.text:""}),Ft=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.title&&t.yAxis.title.text?t.yAxis.title.text:""}),G=e.computed(()=>{const t=R.value;return t&&t.yAxis&&t.yAxis.secondary&&typeof t.yAxis.secondary=="object"?t.yAxis.secondary:null}),me=e.computed(()=>{const t=G.value;return t&&t.title&&t.title.text?t.title.text:""}),He=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return wn;const a=t.yAxis.min;return typeof a=="number"||a===wn?a:wn}),Ue=e.computed(()=>{const t=R.value;if(!t||!t.yAxis)return wn;const a=t.yAxis.max;return typeof a=="number"||a===wn?a:wn}),Wt=e.computed(()=>{const t=G.value;if(!t)return wn;const a=t.min;return typeof a=="number"||a===wn?a:wn}),yt=e.computed(()=>{const t=G.value;if(!t)return wn;const a=t.max;return typeof a=="number"||a===wn?a:wn}),Pt=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.min=="number"?t.xAxis.min:null}),wt=e.computed(()=>{const t=R.value;return!t||!t.xAxis?null:typeof t.xAxis.max=="number"?t.xAxis.max:null}),It=e.computed(()=>{const t=R.value;return t&&t.grid&&t.grid.show!==!1}),Q=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.show!==!1}),ye=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.position?t.legend.position:"top"}),Me=e.computed(()=>{const t=R.value;return t&&t.legend&&t.legend.orientation?t.legend.orientation:"horizontal"}),qe=e.computed(()=>{const t=R.value;return!t||!t.tooltip?!0:t.tooltip.enabled!==!1}),et=e.computed(()=>{const t=R.value;if(!t||!t.crosshair)return!1;const a=t.crosshair.show;return a===!0||a==="true"}),St=e.computed(()=>{const t=R.value;return t&&t.crosshair&&t.crosshair.color?t.crosshair.color:"#666"}),Xe=e.computed(()=>{const t=R.value;return!t||!t.zoom?!1:t.zoom.enabled===!0}),Vt=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.minScale=="number"?t.zoom.minScale:1}),Ye=e.computed(()=>{const t=R.value;return t&&t.zoom&&typeof t.zoom.maxScale=="number"?t.zoom.maxScale:2.5}),W=e.computed(()=>{const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:2}),Z=e.computed(()=>{if(!vn.value)return 0;const t=R.value;return t&&t.stroke&&typeof t.stroke.width=="number"?t.stroke.width:0}),K=e.computed(()=>{const t=R.value;return t&&t.bubbles&&typeof t.bubbles.size=="number"?t.bubbles.size:4}),ve=e.computed(()=>{const{maxX:t}=Zt.value;return t===0}),We=(t,a)=>ve.value&&a===0?5:a,Ke=t=>{const a=Number(t);return!Number.isFinite(a)||a<=0?0:a},Nt=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.area&&typeof t.fill.area.opacity=="number"?t.fill.area.opacity:.3}),Qe=e.computed(()=>{const t=R.value;return t&&t.smoothing&&t.smoothing.enabled===!0}),lt=e.computed(()=>{const t=R.value;return t&&t.smoothing&&typeof t.smoothing.factor=="number"?t.smoothing.factor:.3}),Xt=e.computed(()=>{const t=R.value;return Qe.value?t&&t.smoothing&&typeof t.smoothing.barRadius=="number"?t.smoothing.barRadius:4:0}),ln=e.computed(()=>{const t=R.value,a=t&&t.colors&&Array.isArray(t.colors)?t.colors:[];return a.length>0?a:["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"]}),$t=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.enabled!==!1}),Qt=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.type?t.animations.type:"draw"}),V=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.duration=="number"?t.animations.duration:2500}),w=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.delay=="number"?t.animations.delay:0}),S=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.easing?t.animations.easing:"ease-out"}),Y=e.computed(()=>{const t=R.value;return t&&t.animations&&typeof t.animations.staggerDelay=="number"?t.animations.staggerDelay:200}),J=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.onDataChange!==!1}),Pe=e.computed(()=>{const t=R.value;return t&&t.animations&&t.animations.respectReducedMotion!==!1}),ft=e.computed(()=>{const t=R.value;return t&&t.fill&&t.fill.spider&&typeof t.fill.spider.opacity=="number"?t.fill.spider.opacity:.15}),tt=e.computed(()=>R.value?.spider?.gridSteps||5),we=e.computed(()=>{const t=[],a=tt.value;for(let n=1;n<=a;n++)t.push(it.value/a*n);return t}),Bt=t=>{const a=At.value;if(a&&Array.isArray(a)&&a[t]!==void 0)return a[t].toString();const n=we.value[t];return Math.round(n/it.value*100)+"%"},At=e.computed(()=>R.value?.spider?.gridLabels||null),kt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&t.contextMenu.enabled===!0}),nt=e.computed(()=>{const t=R.value,a={addMarker:!0,downloadSvg:!0,downloadPng:!0,downloadCsv:!0};return t&&t.contextMenu&&t.contextMenu.items?{...a,...t.contextMenu.items}:a}),dt=e.computed(()=>{const t=R.value;return t&&t.contextMenu&&Array.isArray(t.contextMenu.customItems)?t.contextMenu.customItems:[]}),Wn=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.icon?t.markers.icon:Nl.value}),O=e.computed(()=>{const t=R.value;return t&&t.markers&&t.markers.customIcons?t.markers.customIcons:{}}),U=e.computed(()=>{const t=R.value;return t&&t.markers&&typeof t.markers.iconSize=="number"?t.markers.iconSize:20}),P=e.computed(()=>{const a=R.value?.valueFormat?.extension;return typeof a=="string"?a:""}),se=t=>{const a=P.value;if(t==null)return"";const n=String(t);return a?n+a:n},Fe=e.computed(()=>!ae.value.isZooming);e.computed(()=>Lt.value.map(t=>{if(t.categoryIndex!==void 0&&(bn.value||jt.value)){const a=Kt(t.categoryIndex),n=ne.value+F.value.bottom-U.value/2;return{...t,x:a,y:n}}return t}));function ct(t,a){let n;if(t instanceof Date)n=new Date(t.getFullYear(),t.getMonth(),t.getDate());else if(typeof t=="string"){const[g,C,b]=t.split("-"),I=Number(b?.length===2?`20${b}`:b);n=new Date(I,Number(C)-1,Number(g))}else return 0;let i=0,p=1/0;return a.forEach((g,C)=>{const[b,I,N]=g.split("-"),$=Number(N?.length===2?`20${N}`:N),B=new Date($,Number(I)-1,Number(b)),ee=Math.abs(B-n);ee<p&&(p=ee,i=C)}),i}const mt=e.computed(()=>{const t=H.markers.map(n=>{const i=ct(n.marker_date,H.categories),p=Kt(i),g=ne.value+F.value.bottom-U.value/2;return{...n,x:p,y:g,categoryIndex:i,source:"props"}}),a=Lt.value.map(n=>{if(n.categoryIndex!==void 0&&(bn.value||jt.value)){const i=Kt(n.categoryIndex),p=ne.value+F.value.bottom-U.value/2;return{...n,x:i,y:p,source:"internal"}}return{...n,source:"internal"}});return[...t,...a]}),Je=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.enabled===!0}),xt=e.computed(()=>{const t=R.value;return t&&t.watermark&&typeof t.watermark.opacity=="number"?t.watermark.opacity:.05}),zt=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.size?t.watermark.size:35}),Tn=e.computed(()=>{const t=R.value;return t&&t.watermark&&t.watermark.position?t.watermark.position:"bottom-right"}),An=e.computed(()=>{const t={left:F.value.left,top:F.value.top,width:F.value.width,height:F.value.height};let a,n;const i=String(zt.value);if(i.includes("%")){const p=parseFloat(i)/100;a=t.width*p,n=a*(96/499)}else{const p=parseFloat(i)||25;a=Math.min(t.width*.25,200)*(p/25),n=a*(96/499)}return{width:a,height:n,area:t}}),Dn=e.computed(()=>{const{width:t,height:a}=An.value,n=Tn.value;let i,p;const g=F.value.left,C=F.value.right,b=F.value.top,I=F.value.bottom,N=F.value.width,$=F.value.height;switch(n){case"center":i=g+(N-t)/2,p=b+($-a)/2;break;case"top-left":i=g+15,p=b+5;break;case"top-right":i=C-t-15,p=b+5;break;case"bottom-left":i=g+15,p=I-a-5;break;case"bottom-right":default:i=C-t-15,p=I-a-5;break}return{backgroundPositionX:i+"px",backgroundPositionY:p+"px",backgroundSize:`${t}px ${a}px`}}),cl=t=>!H.flags||!H.flags.length?[]:H.flags.filter(a=>a.categoryIndex===t),Hn=t=>{const a=cl(t),n=Tl(t),i=a.filter(C=>C.manual),p=a.filter(C=>!C.manual),g=[];return i.length>0&&g.push({type:_("chart.tooltip.manualFlags"),color:"#698dbe",flags:i.map(C=>({text:C.text,color:"#698dbe"}))}),p.length>0&&g.push({type:_("chart.tooltip.autoFlags"),color:"#a1d499",flags:p.map(C=>({text:C.text,color:"#a1d499"}))}),{flagGroups:g,markers:n.map(C=>({title:C.title,description:C.description,type:_("chart.tooltip.markers"),color:C.color||"#9784ba"}))}},Nl=e.computed(()=>{const t=H.old?`<svg width="55" height="56" viewBox="0 0 55 56" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
2
|
<path d="M55 51.841V4.14647C55 1.86149 53.1797 0.00915527 50.9343 0.00915527L4.06568 0.00915527C1.82027 0.00915527 0 1.86149 0 4.14647V51.841C0 54.126 1.82027 55.9783 4.06568 55.9783H50.9343C53.1797 55.9783 55 54.126 55 51.841Z" fill="#020203"/>
|
|
3
3
|
<path d="M27.7145 10.8883H16.9591C12.7639 10.8883 9.3623 14.3498 9.3623 18.619C9.3623 22.8882 12.7639 26.3497 16.9591 26.3497H27.8036C28.3624 26.3497 28.816 25.8881 28.816 25.3112L28.7188 11.9103C28.7188 11.3416 28.2653 10.8883 27.7064 10.8883H27.7145Z" fill="#FFC230"/>
|
|
4
4
|
<path d="M38.6799 25.649C42.5176 25.649 45.6288 22.483 45.6288 18.5776C45.6288 14.6722 42.5176 11.5063 38.6799 11.5063C34.8421 11.5063 31.731 14.6722 31.731 18.5776C31.731 22.483 34.8421 25.649 38.6799 25.649Z" fill="white"/>
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<rect width="57" height="57" fill="white"/>
|
|
16
16
|
</clipPath>
|
|
17
17
|
</defs>
|
|
18
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
18
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),nl=e.computed(()=>{const t=H.old?`<svg width="499" height="96" viewBox="0 0 499 96" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
19
19
|
<path d="M171.52 37.8399H160.38C160.26 36.4799 160.02 35.0599 159.68 33.5699C159.34 32.0799 158.77 30.7399 157.96 29.5299C157.16 28.3199 156 27.3199 154.48 26.5099C152.96 25.7099 150.94 25.2999 148.4 25.2999C144.69 25.2999 141.93 26.1299 140.14 27.8099C138.34 29.4799 137.45 31.5499 137.45 34.0299C137.45 37.7999 139.29 40.0799 142.97 40.8499C146.65 41.6299 150.67 42.3799 155.03 43.1199C159.39 43.8599 163.41 45.3899 167.09 47.7099C170.77 50.0299 172.61 54.6199 172.61 61.4899C172.61 64.6499 172.02 67.5099 170.85 70.0699C169.67 72.6399 168.02 74.7899 165.89 76.5199C163.76 78.2499 161.19 79.5799 158.19 80.5099C155.19 81.4399 151.93 81.8999 148.4 81.8999C143.95 81.8999 140.12 81.2699 136.94 79.9999C133.75 78.7299 131.19 77.0799 129.24 75.0399C127.29 72.9999 125.93 70.6899 125.16 68.1299C124.39 65.5599 124.19 62.9499 124.56 60.2899H136.25C136.37 62.0799 136.58 63.7899 136.85 65.3899C137.13 66.9999 137.68 68.4099 138.52 69.6099C139.35 70.8199 140.58 71.7799 142.19 72.4899C143.8 73.1999 145.99 73.5599 148.78 73.5599C153.3 73.5599 156.47 72.6199 158.29 70.7299C160.11 68.8399 161.03 66.6899 161.03 64.2799C161.03 60.2599 159.19 57.7799 155.51 56.8599C151.83 55.9299 147.79 55.0499 143.4 54.2099C139.01 53.3799 134.97 51.7699 131.29 49.3799C127.61 46.9999 125.77 42.3699 125.77 35.5099C125.77 32.8499 126.3 30.3899 127.35 28.1299C128.4 25.8699 129.9 23.9199 131.85 22.2799C133.8 20.6399 136.16 19.3399 138.95 18.3799C141.73 17.4199 144.8 16.9399 148.14 16.9399C152.41 16.9399 156.07 17.4699 159.14 18.5199C162.2 19.5699 164.69 21.0299 166.61 22.8799C168.53 24.7399 169.89 26.9499 170.69 29.5199C171.49 32.0899 171.77 34.8599 171.52 37.8199V37.8399Z" fill="#020203"/>
|
|
20
20
|
<path d="M179.04 58.1699C179.04 55.0799 179.55 52.0499 180.57 49.0699C181.59 46.0999 183.04 43.4899 184.93 41.2299C186.82 38.9699 189.09 37.1499 191.75 35.7499C194.41 34.3599 197.35 33.6599 200.57 33.6599C207 33.6599 212.15 35.9299 216.02 40.4799C219.89 45.0299 221.97 51.5999 222.28 60.1999H189.34C189.77 64.2199 191.09 67.1499 193.28 68.9699C195.48 70.7999 198.12 71.7099 201.21 71.7099C203 71.7099 204.5 71.4599 205.71 70.9699C206.92 70.4799 207.91 69.8899 208.68 69.2099C209.45 68.5299 210.06 67.8199 210.49 67.0799C210.92 66.3399 211.26 65.7199 211.51 65.2199H221.72C221.6 66.7699 221.1 68.5099 220.24 70.4599C219.37 72.4099 218.14 74.2299 216.53 75.9399C214.92 77.6399 212.85 79.0599 210.31 80.2099C207.77 81.3499 204.77 81.9299 201.31 81.9299C197.85 81.9299 194.91 81.2799 192.12 79.9799C189.34 78.6799 186.98 76.9499 185.07 74.7799C183.15 72.6099 181.67 70.0899 180.61 67.2199C179.56 64.3399 179.03 61.3299 179.03 58.1699H179.04ZM200.94 42.0199C198.47 42.0199 196.24 42.7299 194.26 44.1499C192.28 45.5699 190.89 47.8299 190.08 50.9199H211.33C211.02 48.0799 209.95 45.8799 208.13 44.3299C206.3 42.7899 203.91 42.0099 200.94 42.0099V42.0199Z" fill="#020203"/>
|
|
21
21
|
<path d="M268.59 80.9999H258.01V50.3799C258.01 48.2099 257.3 46.5099 255.88 45.2799C254.46 44.0399 252.6 43.4199 250.31 43.4199C248.45 43.4199 246.94 43.8399 245.76 44.6699C244.58 45.4999 243.67 46.5399 243.02 47.7799C242.37 49.0199 241.94 50.3799 241.72 51.8599C241.5 53.3399 241.4 54.7099 241.4 55.9399V80.9999H230.82V34.5999H241.03V38.3099C241.83 37.6899 243.27 36.7599 245.34 35.5199C247.41 34.2799 250.3 33.6599 254.02 33.6599C256.68 33.6599 259.12 34.1599 261.35 35.1399C263.58 36.1299 265.31 37.6799 266.55 39.7799C267.04 39.2899 267.71 38.6799 268.55 37.9699C269.38 37.2599 270.41 36.5799 271.61 35.9299C272.82 35.2799 274.22 34.7399 275.83 34.3099C277.44 33.8799 279.23 33.6599 281.21 33.6599C285.23 33.6599 288.67 34.8099 291.51 37.0899C294.36 39.3799 295.78 43.0599 295.78 48.1299V80.9799H285.2V50.3599C285.2 48.1899 284.49 46.4899 283.07 45.2599C281.65 44.0199 279.79 43.3999 277.5 43.3999C275.64 43.3999 274.13 43.8199 272.95 44.6499C271.77 45.4799 270.86 46.5199 270.21 47.7599C269.56 48.9999 269.13 50.3599 268.91 51.8399C268.69 53.3199 268.59 54.6899 268.59 55.9199V80.9799V80.9999Z" fill="#020203"/>
|
|
@@ -41,23 +41,23 @@
|
|
|
41
41
|
<rect width="45" height="45" fill="white" transform="translate(0 1)"/>
|
|
42
42
|
</clipPath>
|
|
43
43
|
</defs>
|
|
44
|
-
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),
|
|
45
|
-
`)}})}),_l=e.ref({show:!1,x:0,y:0,content:"",count:0}),wn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Nn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),Yn=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),tt=e.ref(new Set),re=e.ref(null),dl=e.ref(!1),yt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),Vt=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),rt=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),bt=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),J=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Gt=e.ref([]),_e=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 O.value&&t.push(...Object.keys(O.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=qt.value;return Array.from({length:t+1},(a,n)=>_("chart.fallback.item",{number:n+1}))}return H.categories});const Ol=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),xl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),Bn=e.computed(()=>_e.value.editingMarkerId!==null),tn=e.computed(()=>_e.value.readonly),zn=t=>{tt.value.has(t)||(Ko.value=!0,re.value=t)},nn=()=>{Ko.value=!1,re.value=null},Mn=t=>{if(fo.value||To.value){rt.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.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(dl.value=g,jt.value){if(!et.value||!g||J.value.isDragging||J.value.isZooming){rt.value.show=!1;return}if(j.value.find(ie=>!ie||ie.isHidden?!1:Math.sqrt(Math.pow(ie.x-i,2)+Math.pow(ie.y-p,2))<=ie.radius+3))rt.value.show=!1;else{const ie=j.value.filter(ye=>!ye||ye.isHidden?!1:Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2))<=250);if(ie.length>0){let ye=ie[0],Ne=Math.sqrt(Math.pow(ye.x-i,2)+Math.pow(ye.y-p,2));ie.forEach(Oe=>{const Le=Math.sqrt(Math.pow(Oe.x-i,2)+Math.pow(Oe.y-p,2));Le<Ne&&(Ne=Le,ye=Oe)});const fe=30,Je=j.value.filter(Oe=>!Oe||Oe.isHidden?!1:Math.abs(Oe.x-ye.x)<=fe).sort((Oe,Le)=>Oe.y-Le.y);rt.value={show:!0,x:ye.x,categoryIndex:Math.round(ye.originalX),data:(()=>{const Oe=wn.value,Le=Nn.value,$e=[];return Je.forEach(Ae=>{Oe.forEach(Nt=>{const Rt=Le[Nt]||Nt,Zn=ol(Nt,Ae);Zn&&$e.push({seriesName:Ae.seriesName,label:Ae.label,value:`${Rt}: ${Zn}`,color:Ae.color,y:Ae.y})})}),$e})()}}else rt.value.show=!1}return}if(J.value.isDragging&&J.value.scale>1&&Cn.value&&je.value){rt.value.show=!1;const Ue=t.clientX-J.value.lastMouseX,{minX:ie,maxX:ye}=qt.value,Ne=ye-ie||1,Je=Ue*.8;J.value.offsetX+=Je;const Oe=Ne/J.value.scale,Le=Ne-Oe,$e=0,Ae=-Le/Ne*F.value.width,Nt=$e;J.value.offsetX=Math.max(Ae,Math.min(Nt,J.value.offsetX)),J.value.lastMouseX=t.clientX,J.value.lastMouseY=t.clientY;return}if(!et.value||!Cn.value||J.value.isDragging||J.value.isZooming||!g){rt.value.show=!1;return}const{minX:C,maxX:b}=qt.value,I=b-C||1,N=I/J.value.scale,$=C-J.value.offsetX/F.value.width*I,B=(i-F.value.left)/F.value.width,ee=$+B*N,Ee=Math.round(ee);if(Ee>=0&&Ee<=b){const Ue=Kt(Ee),ie=Qn.value.map((ye,Ne)=>{const fe=H.series.findIndex(Oe=>Oe===ye),Je=ye.data[Ee];return{seriesName:ye.name,value:Je!==void 0?Je:null,color:c(fe),y:Je!==void 0?yn(ye,Je):null}}).filter(ye=>ye.value!==null);rt.value={show:!0,x:Ue,categoryIndex:Ee,data:ie}}},to=()=>{rt.value.show=!1,dl.value=!1,To.value=!1,fo.value||(_l.value.show=!1),J.value.isDragging&&(J.value.isDragging=!1),J.value.zoomTimeout&&(clearTimeout(J.value.zoomTimeout),J.value.zoomTimeout=null),J.value.isZooming=!1,setTimeout(()=>{re.value=null,yt.value.show=!1},150)},ql=t=>{if(t.preventDefault(),t.stopPropagation(),!st.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(fn.value){bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,C=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=b&&(bt.value.show=!1,e.nextTick(()=>{bt.value.show=!0,bt.value.x=t.clientX,bt.value.y=t.clientY,bt.value.categoryIndex=null;const I=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,$=F.value.width/o.value.length,B=Math.floor(I/$);B>=0&&B<o.value.length&&(bt.value.categoryIndex=B)}))},xn=t=>{if(!(t&&t.button===2)){if(bt.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}bt.value.show=!1}},Yt=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:Gt.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:bt.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},$l=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Ll=t=>t.style||{},k=t=>t.type&&O.value[t.type]?O.value[t.type]:t.customIcon?t.customIcon:Fn.value,y=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",S=t=>Gt.value.length?Gt.value.filter(a=>a.categoryIndex===t):[],Z=t=>{if(!Cn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=ne.value+F.value.bottom-W.value/2;return{x:a,y:n}},pe=()=>{Gt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(Cn.value||jt.value)){const a=Z(t.categoryIndex);t.x=a.x,t.y=a.y}})},Bt=()=>{if(_e.value.description&&_e.value.description.length&&_e.value.date){if(Bn.value){const t=Gt.value.findIndex(a=>a.id===_e.value.editingMarkerId);t!==-1?(Gt.value[t].description=_e.value.description||"",Gt.value[t].color=_e.value.color||"",Gt.value[t].type=_e.value.type||"default",ce("update-marker",Gt.value[t])):ce("update-marker",{id:_e.value.editingMarkerId,description:_e.value.description||"",color:_e.value.color||"",type:_e.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ut(_e.value.date,H.categories||[]);if(jt.value){const{maxX:C}=qt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else Cn.value&&(a=Math.max(0,Math.min(a,qt.value.maxX)));const n=Kt(a),i=ne.value+F.value.bottom-W.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:_e.value.description||"",color:_e.value.color||"",type:_e.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};_e.value.categoryIndex=a,Gt.value.push(g),ce("add-marker",g)}lt(),kn()}},lt=()=>{_e.value.show=!1,_e.value.title="",_e.value.description="",_e.value.color="#FF6B6B",_e.value.type="default",_e.value.editingMarkerId=null,_e.value.readonly=!1,_e.value.categoryIndex=null,_e.value.fromButton=!1,_e.value.date=null},Jt=()=>{Bn.value&&(pn(_e.value.editingMarkerId),lt())},pn=t=>{const a=Gt.value.findIndex(n=>n.id===t);a!==-1&&(Gt.value.splice(a,1),kn()),ce("delete-marker",t)},cn=t=>{if(_e.value.show=!0,_e.value.title=t?.title??t?.comment??"",_e.value.description=t?.description??t?.comment??"",_e.value.color=t?.color??"",_e.value.type=t?.type??"default",_e.value.editingMarkerId=t?.id??t?.marker_id??null,_e.value.readonly=t?.readonly??!1,_e.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?_e.value.date=new Date(p,C,g):_e.value.date=null}else _e.value.date=null},kn=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(Gt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},jn=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(Gt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Gt.value=[]}},Pn=t=>{const a=it.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},_n=()=>{const t=rt.value.show,a=yt.value.show;return rt.value.show=!1,yt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},tl=t=>{rt.value.show=t.originalCrosshair,yt.value.show=t.originalTooltip},Tl=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),I=b.getContext("2d");b.width=a,b.height=n,I.fillStyle="#fafafa",I.fillRect(0,0,a,n),I.drawImage(g,0,0,a,n);const N=b.toDataURL("image/png");i(N)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),Po=async()=>{try{const t=_n();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),tl(t);return}const n=qe(),i=ke.value,p=de.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(fe=>fe.remove());const b=g.querySelectorAll("image"),I=Array.from(b).map(async fe=>{const Je=fe.getAttribute("xlink:href")||fe.getAttribute("href");if(Je&&!Je.startsWith("data:"))try{const Oe=await Tl(Je,32,32);fe.setAttribute("xlink:href",Oe),fe.setAttribute("href",Oe)}catch(Oe){console.warn("Failed to convert logo to base64:",Oe)}});await Promise.all(I);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",ee=30;if(it.value&&(B+=`
|
|
44
|
+
</svg>`;return`data:image/svg+xml;base64,${btoa(t)}`}),yl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.show===!0}),Bl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.fontSize=="number"?t.radialLabels.fontSize:12});e.computed(()=>{const t=R.value;return t&&t.radialLabels&&t.radialLabels.color?t.radialLabels.color:"#000"});const zl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.pointerLength=="number"?t.radialLabels.pointerLength:25}),Ml=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.horizontalLength=="number"?t.radialLabels.horizontalLength:40}),Pl=e.computed(()=>{const t=R.value;return t&&t.radialLabels&&typeof t.radialLabels.textOffset=="number"?t.radialLabels.textOffset:8}),Vn=e.computed(()=>{const a=R.value?.radialBar?.dataLabels;return a&&(a.show===!0||a.enabled===!0)}),to=e.computed(()=>{const a=R.value?.radialBar?.dataLabels?.minAngleDegrees;return typeof a=="number"&&a>=0?a:20}),ll=e.computed(()=>{const a=R.value?.radialBar?.dataCenter;return Dl.value?!0:Ln.value&&a&&(a.show===!0||a.enabled===!0)}),pn=e.computed(()=>{if(!ll.value||!at.value.length)return"";if(Dl.value){const i=at.value[1]??at.value[0];return se(i?.value??0)}const n=R.value?.radialBar?.dataCenter?.showValueOnly===!0?at.value[0]?.value??0:at.value.reduce((i,p)=>i+(p.value??0),0);return se(n)}),$n=e.computed(()=>{const a=R.value?.radialBar?.dataCenter?.fontSize;return typeof a=="number"&&a>0?a:24}),xn=e.computed(()=>({x:Dt.value,y:Dl.value?bt.value:bt.value-$n.value/2})),kl=e.computed(()=>{const a=R.value?.radialBar?.dataCenter?.color;return typeof a=="string"&&a?a:"#333"}),Ol=e.computed(()=>{if(!Vn.value||!vn.value||!at.value.length)return[];const t=to.value*Math.PI/180,a=(Ot.value+it.value)/2;return at.value.map(n=>{const p=n.endAngle-n.startAngle>=t&&!n.isHidden,g=Dt.value+Math.cos(n.midAngle)*a,C=bt.value+Math.sin(n.midAngle)*a;return{value:se(n.value),x:g,y:C,show:p,color:n.color,contrastColor:d(n.color)}})}),ul=e.computed(()=>{if(!H.flags||!H.flags.length)return[];const t=new Map;return H.flags.forEach(a=>{const n=a.categoryIndex;t.has(n)||t.set(n,[]),t.get(n).push(a)}),Array.from(t.entries()).map(([a,n])=>{const i=Kt(a),p=n.filter(C=>C.manual),g=n.filter(C=>!C.manual);return{categoryIndex:parseInt(a),x:i,flags:n,manualCount:p.length,autoCount:g.length,totalCount:n.length,hasManual:p.length>0,hasAuto:g.length>0,texts:n.map(C=>C.text).join(`
|
|
45
|
+
`)}})}),Cl=e.ref({show:!1,x:0,y:0,content:"",count:0}),Nn=e.computed(()=>R.value?.bubbles?.tooltip?.fields||["x","y","size","label"]),Bn=e.computed(()=>{const t=R.value;return{...{x:"X",y:"Y",size:"Size",label:"Label",seriesName:"Series"},...t?.bubbles?.tooltip?.labels||{}}}),dl=e.computed(()=>R.value?.bubbles?.tooltip?.formatters||{}),ot=e.ref(new Set),re=e.ref(null),ol=e.ref(!1),vt=e.ref({show:!1,x:0,y:0,title:"",value:"",bubbleData:[],spiderAreas:[]}),fn=e.ref({show:!1,x:0,y:0,categoryValue:"",description:""}),Ae=e.ref({show:!1,x:0,categoryIndex:-1,data:[]}),Ct=e.ref({show:!1,x:0,y:0,mouseDataX:0,mouseDataY:0,categoryIndex:-1,chartX:0,chartY:0}),ae=e.ref({scale:1,offsetX:0,minScale:1,maxScale:2.5,isDragging:!1,lastMouseX:0,lastMouseY:0,isZooming:!1,zoomTimeout:null}),Lt=e.ref([]),$e=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 O.value&&t.push(...Object.keys(O.value)),t}),e.computed(()=>{if(!H.categories||H.categories.length===0){const{maxX:t}=Zt.value;return Array.from({length:t+1},(a,n)=>_("chart.fallback.item",{number:n+1}))}return H.categories});const bl=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[0],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),_l=e.computed(()=>{if(!H.categories||H.categories.length===0)return null;const t=H.categories[H.categories.length-1],[a,n,i]=String(t).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;return!g||!n||!p?null:new Date(p,C,g)}),kn=e.computed(()=>$e.value.editingMarkerId!==null),Jt=e.computed(()=>$e.value.readonly),Kn=t=>{ot.value.has(t)||(Ko.value=!0,re.value=t)},on=()=>{Ko.value=!1,re.value=null},Zn=t=>{if(fo.value||To.value){Ae.value.show=!1;return}const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top,g=jt.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(ol.value=g,jt.value){if(!et.value||!g||ae.value.isDragging||ae.value.isZooming){Ae.value.show=!1;return}if(j.value.find(ie=>!ie||ie.isHidden?!1:Math.sqrt(Math.pow(ie.x-i,2)+Math.pow(ie.y-p,2))<=ie.radius+3))Ae.value.show=!1;else{const ie=j.value.filter(ke=>!ke||ke.isHidden?!1:Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2))<=250);if(ie.length>0){let ke=ie[0],Ne=Math.sqrt(Math.pow(ke.x-i,2)+Math.pow(ke.y-p,2));ie.forEach(Ie=>{const Le=Math.sqrt(Math.pow(Ie.x-i,2)+Math.pow(Ie.y-p,2));Le<Ne&&(Ne=Le,ke=Ie)});const pe=30,Ge=j.value.filter(Ie=>!Ie||Ie.isHidden?!1:Math.abs(Ie.x-ke.x)<=pe).sort((Ie,Le)=>Ie.y-Le.y);Ae.value={show:!0,x:ke.x,categoryIndex:Math.round(ke.originalX),data:(()=>{const Ie=Nn.value,Le=Bn.value,_e=[];return Ge.forEach(De=>{Ie.forEach(_t=>{const Rt=Le[_t]||_t,On=el(_t,De);On&&_e.push({seriesName:De.seriesName,label:De.label,value:`${Rt}: ${On}`,color:De.color,y:De.y})})}),_e})()}}else Ae.value.show=!1}return}if(ae.value.isDragging&&ae.value.scale>1&&bn.value&&Xe.value){Ae.value.show=!1;const Ze=t.clientX-ae.value.lastMouseX,{minX:ie,maxX:ke}=Zt.value,Ne=ke-ie||1,Ge=Ze*.8;ae.value.offsetX+=Ge;const Ie=Ne/ae.value.scale,Le=Ne-Ie,_e=0,De=-Le/Ne*F.value.width,_t=_e;ae.value.offsetX=Math.max(De,Math.min(_t,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY;return}if(!et.value||!bn.value||ae.value.isDragging||ae.value.isZooming||!g){Ae.value.show=!1;return}const{minX:C,maxX:b}=Zt.value,I=b-C||1,N=I/ae.value.scale,$=C-ae.value.offsetX/F.value.width*I,B=(i-F.value.left)/F.value.width,ee=$+B*N,Se=Math.round(ee);if(Se>=0&&Se<=b){const Ze=Kt(Se),ie=Yn.value.map((ke,Ne)=>{const pe=H.series.findIndex(Ie=>Ie===ke),Ge=ke.data[Se];return{seriesName:ke.name,value:Ge!==void 0?Ge:null,color:c(pe),y:Ge!==void 0?yn(ke,Ge):null}}).filter(ke=>ke.value!==null);Ae.value={show:!0,x:Ze,categoryIndex:Se,data:ie}}},al=()=>{Ae.value.show=!1,ol.value=!1,To.value=!1,fo.value||(Cl.value.show=!1),ae.value.isDragging&&(ae.value.isDragging=!1),ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1,setTimeout(()=>{re.value=null,vt.value.show=!1},150)},$l=t=>{if(t.preventDefault(),t.stopPropagation(),!kt.value)return;const a=t.currentTarget.getBoundingClientRect(),n=t.clientX-a.left,i=t.clientY-a.top;if(vn.value){Ct.value.show=!1,e.nextTick(()=>{Ct.value.show=!0,Ct.value.x=t.clientX,Ct.value.y=t.clientY,Ct.value.categoryIndex=null});return}const p=Math.max(0,F.value.left-20),g=F.value.right,C=F.value.top,b=F.value.bottom+80;n>=p&&n<=g&&i>=C&&i<=b&&(Ct.value.show=!1,e.nextTick(()=>{Ct.value.show=!0,Ct.value.x=t.clientX,Ct.value.y=t.clientY,Ct.value.categoryIndex=null;const I=Math.max(F.value.left,Math.min(n,F.value.right))-F.value.left,$=F.value.width/o.value.length,B=Math.floor(I/$);B>=0&&B<o.value.length&&(Ct.value.categoryIndex=B)}))},Mn=t=>{if(!(t&&t.button===2)){if(Ct.value.show&&t&&t.type==="click"){const a=document.querySelector(".dss-context-menu");if(a&&a.contains(t.target))return}Ct.value.show=!1}},Cn=t=>{if(typeof t.template=="function"){const a={series:H.series,categories:H.categories,markers:Lt.value},n={chartX:Ct.value.chartX,chartY:Ct.value.chartY,dataX:Ct.value.mouseDataX,dataY:Ct.value.mouseDataY,categoryIndex:Ct.value.categoryIndex};return t.template(a,n)}return t.template||t.label||""},ql=t=>{const a=["dss-context-menu-item"];return t.cssClass&&a.push(t.cssClass),a},Gn=t=>t.style||{},Rn=t=>t.type&&O.value[t.type]?O.value[t.type]:t.customIcon?t.customIcon:Wn.value,Ll=t=>t==null?"":H.categories&&H.categories[t]?H.categories[t]:"",Tl=t=>Lt.value.length?Lt.value.filter(a=>a.categoryIndex===t):[],k=t=>{if(!bn.value&&!jt.value)return{x:0,y:0};const a=Kt(t),n=ne.value+F.value.bottom-U.value/2;return{x:a,y:n}},h=()=>{Lt.value.forEach(t=>{if(t.categoryIndex!==void 0&&(bn.value||jt.value)){const a=k(t.categoryIndex);t.x=a.x,t.y=a.y}})},x=()=>{if($e.value.description&&$e.value.description.length&&$e.value.date){if(kn.value){const t=Lt.value.findIndex(a=>a.id===$e.value.editingMarkerId);t!==-1?(Lt.value[t].description=$e.value.description||"",Lt.value[t].color=$e.value.color||"",Lt.value[t].type=$e.value.type||"default",ce("update-marker",Lt.value[t])):ce("update-marker",{id:$e.value.editingMarkerId,description:$e.value.description||"",color:$e.value.color||"",type:$e.value.type||"default"})}else{const t="dss-marker-"+Date.now()+"-"+Math.random().toString(36).substring(2,9);let a=ct($e.value.date,H.categories||[]);if(jt.value){const{maxX:C}=Zt.value;a=Math.max(0,Math.min(a,Math.floor(C)))}else bn.value&&(a=Math.max(0,Math.min(a,Zt.value.maxX)));const n=Kt(a),i=ne.value+F.value.bottom-U.value/2,p=Array.isArray(H.categories)?H.categories[a]:null,g={id:t,title:"",description:$e.value.description||"",color:$e.value.color||"",type:$e.value.type||"default",categoryIndex:a,x:n,y:i,marker_date:p||null};$e.value.categoryIndex=a,Lt.value.push(g),ce("add-marker",g)}q(),Yt()}},q=()=>{$e.value.show=!1,$e.value.title="",$e.value.description="",$e.value.color="#FF6B6B",$e.value.type="default",$e.value.editingMarkerId=null,$e.value.readonly=!1,$e.value.categoryIndex=null,$e.value.fromButton=!1,$e.value.date=null},ue=()=>{kn.value&&(ht($e.value.editingMarkerId),q())},ht=t=>{const a=Lt.value.findIndex(n=>n.id===t);a!==-1&&(Lt.value.splice(a,1),Yt()),ce("delete-marker",t)},Mt=t=>{if($e.value.show=!0,$e.value.title=t?.title??t?.comment??"",$e.value.description=t?.description??t?.comment??"",$e.value.color=t?.color??"",$e.value.type=t?.type??"default",$e.value.editingMarkerId=t?.id??t?.marker_id??null,$e.value.readonly=t?.readonly??!1,$e.value.categoryIndex=t?.categoryIndex??null,t?.marker_date){const[a,n,i]=String(t.marker_date).split("-"),p=Number(i?.length===2?`20${i}`:i),g=Number(a),C=Number(n)-1;g&&n&&p?$e.value.date=new Date(p,C,g):$e.value.date=null}else $e.value.date=null},Yt=()=>{try{const t=`dss-chart-markers-${H.chartId}`;localStorage.setItem(t,JSON.stringify(Lt.value))}catch(t){console.warn("Could not save markers to localStorage:",t)}},an=()=>{try{const t=`dss-chart-markers-${H.chartId}`,a=localStorage.getItem(t);if(a){const n=JSON.parse(a);Array.isArray(n)&&(Lt.value=n.map(i=>({...i,originalYOffset:i.originalYOffset!==void 0?i.originalYOffset:15})))}}catch(t){console.warn("Could not load markers from localStorage:",t),Lt.value=[]}},tn=t=>{const a=st.value||"Chart",n=new Date().toLocaleDateString("en-GB",{day:"2-digit",month:"2-digit",year:"2-digit"}).replace(/\//g,"-");return`${a.replace(/[^a-zA-Z0-9\s]/g,"").replace(/\s+/g,"-").substring(0,50).replace(/^-|-$/g,"")||"Chart"}-${n}.${t}`},sn=()=>{const t=Ae.value.show,a=vt.value.show;return Ae.value.show=!1,vt.value.show=!1,{originalCrosshair:t,originalTooltip:a}},Fn=t=>{Ae.value.show=t.originalCrosshair,vt.value.show=t.originalTooltip},Al=async(t,a=32,n=32)=>new Promise((i,p)=>{if(t.startsWith("data:")){i(t);return}const g=new Image;g.crossOrigin="anonymous";const C=setTimeout(()=>{console.warn("Image conversion timeout for:",t),i(t)},5e3);g.onload=()=>{clearTimeout(C);try{const b=document.createElement("canvas"),I=b.getContext("2d");b.width=a,b.height=n,I.fillStyle="#fafafa",I.fillRect(0,0,a,n),I.drawImage(g,0,0,a,n);const N=b.toDataURL("image/png");i(N)}catch(b){console.warn("Canvas conversion failed:",b),i(t)}},g.onerror=b=>{clearTimeout(C),console.warn("Failed to load image:",t,b),i(t)},g.src=t}),Po=async()=>{try{const t=sn();setTimeout(async()=>{try{const a=A.value;if(!a){console.error("Chart SVG element not found"),Fn(t);return}const n=ze(),i=Ce.value,p=de.value+n.height,g=a.cloneNode(!0);g.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text").forEach(pe=>pe.remove());const b=g.querySelectorAll("image"),I=Array.from(b).map(async pe=>{const Ge=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Ge&&!Ge.startsWith("data:"))try{const Ie=await Al(Ge,32,32);pe.setAttribute("xlink:href",Ie),pe.setAttribute("href",Ie)}catch(Ie){console.warn("Failed to convert logo to base64:",Ie)}});await Promise.all(I);const $=new XMLSerializer().serializeToString(g).replace(/<svg[^>]*>/,"").replace("</svg>","");let B="",ee=30;if(st.value&&(B+=`
|
|
46
46
|
<text x="24" y="${ee}"
|
|
47
47
|
font-family="Arial, sans-serif"
|
|
48
48
|
font-size="18"
|
|
49
49
|
font-weight="bold"
|
|
50
50
|
fill="#333">
|
|
51
|
-
${
|
|
51
|
+
${st.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
52
52
|
</text>`,ee+=30),Et.value&&(B+=`
|
|
53
53
|
<text x="24" y="${ee}"
|
|
54
54
|
font-family="Arial, sans-serif"
|
|
55
55
|
font-size="14"
|
|
56
56
|
fill="#666">
|
|
57
57
|
${Et.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}
|
|
58
|
-
</text>`,ee+=25),Q.value&&H.series.length>0){let
|
|
59
|
-
<g opacity="${
|
|
60
|
-
<g transform="translate(${mn}, ${
|
|
58
|
+
</text>`,ee+=25),Q.value&&H.series.length>0){let pe=i-200,Ge=st.value||Et.value?35:25;const Ie=Math.floor((i-250)/120);let Le=0;H.series.forEach((_e,De)=>{if(!ot.value.has(De)){const _t=c(De),Rt=_e.name.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");B+=`<circle cx="${pe+6}" cy="${Ge-4}" r="6" fill="${_t}"/>`,B+=`<text x="${pe+18}" y="${Ge}" font-family="Arial, sans-serif" font-size="12" fill="#333">${Rt}</text>`,Le++,Le%Ie===0?(pe=i-200,Ge+=20):pe+=Math.min(120,Rt.length*8+35)}})}let Se="";if(Je.value)try{const{width:pe,height:Ge}=An.value,Ie=Tn.value,Le=F.value.left,_e=F.value.right,De=F.value.top,_t=F.value.bottom,Rt=F.value.width,On=F.value.height;let mn,qn;switch(Ie){case"center":mn=Le+(Rt-pe)/2,qn=De+(On-Ge)/2;break;case"top-left":mn=Le+15,qn=De+5;break;case"top-right":mn=_e-pe-5,qn=De+5;break;case"bottom-left":mn=Le+15,qn=_t-Ge-5;break;case"bottom-right":default:mn=_e-pe-5,qn=_t-Ge-5;break}Se=`
|
|
59
|
+
<g opacity="${xt.value}">
|
|
60
|
+
<g transform="translate(${mn}, ${qn}) scale(${pe/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(pe){console.warn("Watermark processing failed, skipping watermark in SVG:",pe),Se=""}const Ze=`<?xml version="1.0" encoding="UTF-8"?>
|
|
76
76
|
<svg width="${i}" height="${p}"
|
|
77
77
|
xmlns="http://www.w3.org/2000/svg"
|
|
78
78
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
@@ -87,32 +87,32 @@
|
|
|
87
87
|
${B}
|
|
88
88
|
<g transform="translate(0, ${n.height})">
|
|
89
89
|
${$}
|
|
90
|
-
${
|
|
90
|
+
${Se}
|
|
91
91
|
</g>
|
|
92
|
-
</svg>`,ie=new Blob([
|
|
92
|
+
</svg>`,ie=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ie),Ne=document.createElement("a");Ne.href=ke,Ne.download=tn("svg"),document.body.appendChild(Ne),Ne.click(),document.body.removeChild(Ne),URL.revokeObjectURL(ke),Fn(t),Mn()}catch(a){console.error("Error downloading SVG:",a),Fn(t)}},50)}catch(t){console.error("Error downloading SVG:",t)}},ho=async()=>{try{const t=sn();z.value&&z.value.offsetHeight,await new Promise(pe=>setTimeout(pe,300));const a=ze(),n=Ce.value,i=de.value+a.height,p=document.createElement("canvas"),g=p.getContext("2d"),C=2;p.width=n*C,p.height=i*C,p.style.width=n+"px",p.style.height=i+"px",g.scale(C,C),g.fillStyle="#fafafa",g.fillRect(0,0,n,i);let b=30;if(st.value&&(g.fillStyle="#333",g.font="bold 18px Arial, sans-serif",g.fillText(st.value,24,b),b+=30),Et.value&&(g.fillStyle="#666",g.font="14px Arial, sans-serif",g.fillText(Et.value,24,b),b+=25),Q.value&&H.series.length>0){let pe=n-200,Ge=st.value||Et.value?35:25;const Ie=Math.floor((n-250)/120);let Le=0;g.font="12px Arial, sans-serif",H.series.forEach((_e,De)=>{if(!ot.value.has(De)){const _t=c(De);g.beginPath(),g.arc(pe+6,Ge-4,6,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.fillStyle="#333",g.fillText(_e.name,pe+18,Ge),Le++,Le%Ie===0?(pe=n-200,Ge+=20):pe+=Math.min(120,_e.name.length*8+35)}})}const N=A.value.cloneNode(!0),$=N.querySelectorAll(".dss-flag-markers, .dss-flag-line, .dss-flag-extension-line, .dss-flag-count-indicator, .dss-flag-count-text"),B=N.querySelectorAll(".dss-crosshair"),ee=N.querySelectorAll('[class*="tooltip"]');$.forEach(pe=>pe.remove()),B.forEach(pe=>pe.remove()),ee.forEach(pe=>pe.remove()),N.querySelectorAll("image").forEach((pe,Ge)=>{const Ie=pe.getAttribute("xlink:href")||pe.getAttribute("href");if(Ie&&!Ie.startsWith("data:")){const Le=Lo.value[Ge],_e=Le?c(Le.seriesIndex):"#3B82F6",De=pe.getAttribute("x")||0,_t=pe.getAttribute("y")||0,Rt=pe.getAttribute("width")||32,On=pe.getAttribute("height")||32,mn=document.createElementNS("http://www.w3.org/2000/svg","circle");mn.setAttribute("cx",parseFloat(De)+parseFloat(Rt)/2),mn.setAttribute("cy",parseFloat(_t)+parseFloat(On)/2),mn.setAttribute("r",Math.min(parseFloat(Rt),parseFloat(On))/2-1),mn.setAttribute("fill",_e),mn.setAttribute("stroke","#fafafa"),mn.setAttribute("stroke-width","2"),pe.parentNode.replaceChild(mn,pe)}});const Ze=new XMLSerializer().serializeToString(N),ie=new Blob([Ze],{type:"image/svg+xml;charset=utf-8"}),ke=URL.createObjectURL(ie),Ne=new Image;return new Promise((pe,Ge)=>{Ne.onload=async()=>{try{if(g.drawImage(Ne,0,a.height),Lo.value.forEach(Ie=>{const Le=Ie.x,_e=Ie.y+a.height,De=(Ie.width||32)/2,_t=c(Ie.seriesIndex);g.save(),g.beginPath(),g.arc(Le,_e,De-1,0,2*Math.PI),g.fillStyle=_t,g.fill(),g.strokeStyle="#fafafa",g.lineWidth=2,g.stroke(),g.restore()}),Je.value){const Ie=new Image,Le=()=>{const{width:De,height:_t}=An.value,Rt=Tn.value,On=F.value.left,mn=F.value.right,qn=F.value.top,Do=F.value.bottom,xa=F.value.width,Ea=F.value.height;let jl,Kl;switch(Rt){case"center":jl=On+(xa-De)/2,Kl=qn+a.height+(Ea-_t)/2;break;case"top-left":jl=On+15,Kl=qn+a.height+10;break;case"top-right":jl=mn-De-5,Kl=qn+a.height+10;break;case"bottom-left":jl=On+15,Kl=Do+a.height-_t-5;break;case"bottom-right":default:jl=mn-De-5,Kl=Do+a.height-_t-5;break}g.globalAlpha=xt.value,g.drawImage(Ie,jl,Kl,De,_t),g.globalAlpha=1,_e()},_e=()=>{p.toBlob(De=>{const _t=URL.createObjectURL(De),Rt=document.createElement("a");Rt.href=_t,Rt.download=tn("png"),document.body.appendChild(Rt),Rt.click(),document.body.removeChild(Rt),URL.revokeObjectURL(_t),URL.revokeObjectURL(ke),Fn(t),Mn(),pe()},"image/png")};Ie.onload=Le,Ie.onerror=_e,Ie.src=nl.value}else p.toBlob(Ie=>{const Le=URL.createObjectURL(Ie),_e=document.createElement("a");_e.href=Le,_e.download=tn("png"),document.body.appendChild(_e),_e.click(),document.body.removeChild(_e),URL.revokeObjectURL(Le),URL.revokeObjectURL(ke),Fn(t),Mn(),pe()},"image/png")}catch(Ie){URL.revokeObjectURL(ke),Fn(t),Ge(Ie)}},Ne.onerror=()=>{URL.revokeObjectURL(ke),Fn(t),Ge(new Error("Failed to load SVG image"))},Ne.src=ke})}catch(t){console.error("Error downloading PNG:",t)}},yo=()=>{try{let t="";st.value&&(t+=`# ${_("chart.csv.chartTitle")}: ${st.value}
|
|
93
93
|
`),Et.value&&(t+=`# ${_("chart.csv.chartSubtitle")}: ${Et.value}
|
|
94
94
|
`),t+=`# ${_("chart.csv.generated")}: ${new Date().toLocaleString()}
|
|
95
95
|
|
|
96
96
|
`,t+="Category",H.series.forEach(g=>{const C=g.name.replace(/"/g,'""');t+=',"'+C+'"'}),t+=`
|
|
97
97
|
`;const a=Math.max(...H.series.map(g=>g.data?.length||0));for(let g=0;g<a;g++){let I='"'+(H.categories[g]||_("chart.fallback.item",{number:g+1})).toString().replace(/"/g,'""')+'"';H.series.forEach(N=>{const $=N.data&&N.data[g]!==void 0?N.data[g]:"";I+=","+$}),t+=I+`
|
|
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=Pn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),xn()}catch(t){console.error("Error downloading CSV:",t)}},Oo=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:Gt.value},n={chartX:bt.value.chartX,chartY:bt.value.chartY,dataX:bt.value.mouseDataX,dataY:bt.value.mouseDataY,categoryIndex:clampedCategoryIndex||bt.value.categoryIndex};t.action(a,n)}xn()},qo=()=>{lt(),_e.value.show=!0,_e.value.categoryIndex=bt.value.categoryIndex,_e.value.fromButton=!1,xn()},ko=()=>{lt(),_e.value.show=!0,_e.value.categoryIndex=0,_e.value.fromButton=!0},Co=t=>{if(bt.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(bt.value.show=!1)}},no=t=>{bt.value.show&&!t.target.closest(".context-menu")&&(bt.value.show=!1)},bo=t=>{if(!Cn.value||!je.value)return;t.preventDefault(),t.stopPropagation(),J.value.isZooming=!0,rt.value.show=!1,J.value.zoomTimeout&&clearTimeout(J.value.zoomTimeout);const n=t.currentTarget.getBoundingClientRect(),i=t.clientX-n.left,p=t.clientY-n.top;if(i<F.value.left-50||i>F.value.right+50||p<F.value.top-50||p>F.value.bottom+100){J.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(J.value.minScale,Math.min(J.value.maxScale,J.value.scale*g));if(C!==J.value.scale){const{minX:b,maxX:I}=qt.value,N=I-b||1,$=N/J.value.scale,B=b-J.value.offsetX/F.value.width*N,ee=(i-F.value.left)/F.value.width,Ee=B+ee*$;J.value.scale=C;const Ue=N/J.value.scale,ie=Ee-ee*Ue;J.value.offsetX=-(ie-b)/N*F.value.width,J.value.scale<=1.01&&(J.value.scale=1,J.value.offsetX=0)}J.value.zoomTimeout=setTimeout(()=>{J.value.isZooming=!1,J.value.zoomTimeout=null},300)},lo=t=>{if(!Cn.value||!je.value||J.value.scale<=1)return;rt.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,J.value.isDragging=!0,J.value.lastMouseX=t.clientX,J.value.lastMouseY=t.clientY,t.preventDefault()},wo=()=>{J.value.isDragging=!1},oo=()=>{!Cn.value||!je.value||(J.value.scale=1,J.value.offsetX=0,J.value.isDragging=!1,J.value.zoomTimeout&&(clearTimeout(J.value.zoomTimeout),J.value.zoomTimeout=null),J.value.isZooming=!1)},Wo=()=>!Cn.value||!dl.value||!je.value?"default":J.value.isDragging?"grabbing":J.value.scale>1?"grab":"dss-crosshair",Wl=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 a=`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],C=t[Math.min(n+2,t.length-1)],b=p.x+(g.x-i.x)/6*ht.value,I=p.y+(g.y-i.y)/6*ht.value,N=g.x-(C.x-p.x)/6*ht.value,$=g.y-(C.y-p.y)/6*ht.value;a+=` C ${b} ${I} ${N} ${$} ${g.x} ${g.y}`}return a},En=e.computed(()=>{const a=R.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(Wt.value?30:0)+60;if(Sn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(fn.value){const B=!Q.value,ee=Cl.value,Ee=ee?Il.value+bl.value+Math.max(24,Ml.value+16):0,Ue=B?12:p;let ie=0;it.value&&(ie+=B?8:15),Et.value&&(ie+=B?6:10);const ye=qe();let Ne=Ue+(B?4:16)+(ee?Ee:0),fe=Ue+(ee?Ee:0);Q.value&&be.value==="left"?Ne+=ye.legendWidth||150:Q.value&&be.value==="right"&&(fe+=ye.legendWidth||150);const Oe=We.value==="semi-radial"?ee?Ee:8:ee?Ee:B?8:p+80,Le=ee?14:0,$e=Ue+ie+Le,Ae={left:Ne,top:$e,right:fe,bottom:Oe};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 C=0;it.value&&(C+=15),Et.value&&(C+=10);const b=qe();let I=p+16,N=p;Q.value&&be.value==="left"?I+=b.legendWidth||150:Q.value&&be.value==="right"&&(N+=b.legendWidth||150),$n.value&&(N+=44);const $={left:I,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),F=e.computed(()=>({left:En.value.left,top:En.value.top,right:ke.value-En.value.right,bottom:de.value-En.value.bottom,width:ke.value-(En.value.left+En.value.right),height:de.value-(En.value.top+En.value.bottom)})),Cn=e.computed(()=>["line","area","bar"].includes(We.value)||Pt.value),On=e.computed(()=>Pt.value),Al=e.computed(()=>We.value==="mini-radial"),fn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(We.value)),Sn=e.computed(()=>We.value==="spider"),jt=e.computed(()=>We.value==="bubble"),Qt=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(We.value==="bar"||On.value)),rl=t=>{const{minY:a,maxY:n}=qt.value,i=n-a||1;return F.value.left+(t-a)/i*F.value.width},ml=t=>{const{maxX:a}=qt.value,n=a+1,p=F.value.height/n;return F.value.top+(t+.5)*p},At=e.computed(()=>fn.value?En.value.left+(ke.value-En.value.left-En.value.right)/2:ke.value/2),wt=e.computed(()=>Sn.value?de.value/2-40:fn.value?En.value.top+(de.value-En.value.top-En.value.bottom)/2:de.value/2),dt=e.computed(()=>{if(Sn.value){const t=F.value.width-80,a=F.value.height-80;return Math.min(t,a)/2}return Math.min(F.value.width,F.value.height)/2}),zt=e.computed(()=>{const t=R.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return dt.value*n}),Dl=e.computed(()=>{const t=R.value,a=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(fn.value||Sn.value)?1:1+a/100}),en=e.computed(()=>{const t=Dl.value;if(t===1||t<=0)return;const a=At.value,n=wt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),El=e.ref(0),Zl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),Ln=e.computed(()=>We.value==="semi-radial"),nl=e.computed(()=>Ln.value&&$t.value&&!hl.value),ll=e.computed(()=>Ln.value&&$t.value&&!hl.value&&an.value==="fill"),pl=e.computed(()=>{const t=nl.value?El.value:1,a=At.value,n=wt.value,i=zt.value,p=dt.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const b=a+p*Math.cos(g),I=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),ee=n+i*Math.sin(C),Ee=a+i*Math.cos(g),Ue=n+i*Math.sin(g),ie=t>.5?1:0;return`M ${a} ${n} L ${b} ${I} A ${p} ${p} 0 ${ie} 1 ${N} ${$} L ${B} ${ee} A ${i} ${i} 0 ${ie} 1 ${Ee} ${Ue} Z`}),fl=e.computed(()=>{if(!(!Ln.value||!nl.value)&&!ll.value)return`url(#${Zl.value})`}),Zo=t=>{if(!(!ll.value||t!==0))return`url(#${Zl.value})`},vl=e.ref(0),Sl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Kn=e.computed(()=>We.value==="radial"),Hl=e.computed(()=>{const t=Kn.value?vl.value:1,a=At.value,n=wt.value,i=Math.max(dt.value*1.5,ke.value,de.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,ee=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${ee} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),b=n+i*Math.sin(p),I=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${b} A ${i} ${i} 0 ${$} 1 ${I} ${N} Z`}),xo=e.computed(()=>{if(fl.value)return fl.value;if(Kn.value)return`url(#${Sl.value})`});let Rl=null;const Uo=()=>{if(!nl.value)return;El.value=0;const t=V.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);El.value=Go(E.value,g),g<1&&(Rl=requestAnimationFrame(n))};Rl=requestAnimationFrame(n)},Fl=e.computed(()=>R.value?.bubbles?.minSize||8),ao=e.computed(()=>R.value?.bubbles?.maxSize||50),Ul=e.computed(()=>R.value?.bubbles?.opacity||.7),Eo=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},So=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},so=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Gn=e.computed(()=>H.series),Qn=e.computed(()=>H.series.filter((t,a)=>!tt.value.has(a))),Xl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ro=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Vo=e.computed(()=>Qn.value.filter(t=>Xl(t)==="primary")),Vl=e.computed(()=>Qn.value.filter(t=>Xl(t)==="secondary")),$n=e.computed(()=>!Qt.value&&!!G.value&&Vl.value.length>0),bn="auto",io=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let b;if(a===bn){const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}else if(typeof a=="number")b=a;else{const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}let I;if(n===bn){const N=C-g,$=N>0?N*.1:2;I=C+$}else if(typeof n=="number")I=n;else{const N=C-g,$=N>0?N*.1:2;I=C+$}return{minY:b,maxY:I}},qt=e.computed(()=>{if(jt.value)return Xo();if(!Qn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Qn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),H.categories.length>0&&(t=Math.max(t,H.categories.length-1));const a=io(Vo.value.length?Vo.value:Qn.value,De.value,Xe.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),No=e.computed(()=>$n.value?io(Vl.value,Zt.value,kt.value,qt.value.minY,qt.value.maxY):{minY:qt.value.minY,maxY:qt.value.maxY}),Xo=()=>{if(!Qn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(Qn.value.forEach((Ee,Ue)=>{Ee?.data?.length&&Ee.data.forEach((ie,ye)=>{let Ne,fe,Je;if(typeof ie=="object"&&ie!==null&&!Array.isArray(ie))Ne=typeof ie.x=="number"?ie.x:ye,fe=typeof ie.y=="number"?ie.y:0,Je=typeof ie.size=="number"?ie.size:20;else if(Array.isArray(ie)&&ie.length>=3)Ne=typeof ie[0]=="number"?ie[0]:ye,fe=typeof ie[1]=="number"?ie[1]:0,Je=typeof ie[2]=="number"?ie[2]:20;else if(typeof ie=="number")Ne=ye,fe=ie,Je=Eo(Ue,ye);else return;isFinite(Ne)&&isFinite(fe)&&isFinite(Je)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),n=Math.min(n,fe),i=Math.max(i,fe),p=Math.min(p,Je),g=Math.max(g,Je),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=a-t,I=i-n;let N,$,B,ee;return xt.value!==null?N=xt.value:N=t-b*.1,Mt.value!==null?$=Mt.value:$=a+b*.1,De.value!==null&&typeof De.value=="number"?B=De.value:B=Math.max(0,n-I*.1),Xe.value!==null&&typeof Xe.value=="number"?ee=Xe.value:ee=i+I*.1,{minX:N,maxX:$,minY:B,maxY:ee,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:b,maxX:I}=qt.value,N=I-b||1;return F.value.left+(t-b)/N*F.value.width}const{minX:a,maxX:n}=qt.value,i=n-a;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/J.value.scale,g=a-J.value.offsetX/F.value.width*i,C=(t-g)/p;return F.value.left+C*F.value.width},hn=t=>{const{minY:a,maxY:n}=qt.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Bo=t=>{const{minY:a,maxY:n}=No.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},yn=(t,a)=>$n.value&&Xl(t)==="secondary"?Bo(a):hn(a),co=t=>{if(!jt.value)return K.value||4;const{maxSize:a}=qt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return Fl.value+i*(ao.value-Fl.value)},Nl=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Nl.canvas||(Nl.canvas=document.createElement("canvas"));const i=Nl.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},uo=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Nl(t,n)<=a)return t;const i="..";if(Nl(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(Nl(C,n)<=a)return C;g-=1}return i},Mo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(We.value==="bar"){if(Qt.value){const $e=[],{minY:Ae,maxY:Nt}=qt.value,Rt=5,Zn=Nt-Ae||1;for(let mn=0;mn<=Rt;mn++){const Un=Ae+Zn*(mn/Rt),Do=rl(Un);$e.push({x:Do,y:F.value.bottom+20,text:se(Math.round(Un))})}return $e}const ye=[],{maxX:Ne}=qt.value,fe=Ne+1,Je=5,Le=(F.value.width-Je*2)/fe;for(let $e=0;$e<=Ne;$e++){const Ae=F.value.left+Je+($e+.5)*Le;ye.push({x:Ae,y:F.value.bottom+20,text:uo(H.categories[$e]||_("chart.fallback.item",{number:$e+1}),Math.max(Le-8,24))})}return ye}const t=[],{minX:a,maxX:n}=qt.value,i=xt.value!==null?xt.value:a,p=Mt.value!==null?Mt.value:n,g=p-i||1,C=g/J.value.scale,b=i-J.value.offsetX/F.value.width*g,I=b+C,N=Math.max(0,Math.floor(b-2)),$=Math.min(p,Math.ceil(I+2)),B=$-N,ee=F.value.width,Ue=Math.floor(ee/60);let ie=1;B>Ue&&(ie=Math.ceil(B/Ue));for(let ye=N;ye<=$;ye+=ie)if(ye>=0&&ye<=p){const Ne=Kt(ye);Ne>=F.value.left-100&&Ne<=F.value.right+100&&t.push({x:Ne,y:F.value.bottom+20,text:H.categories[ye]||`Item ${ye+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=qt.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,b=Kt(C);if(b>=F.value.left-10&&b<=F.value.right+10){const I=Math.round(C),N=H.categories?.[I];t.push({x:b,y:F.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Qt.value){const p=[],{maxX:g}=qt.value;for(let C=0;C<=g;C++)p.push({x:F.value.left-10,y:ml(C),text:uo(H.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=qt.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.left-10,y:hn(g),text:se(C)})}return t}),r=e.computed(()=>{if(!$n.value||Qt.value)return[];const t=[],{minY:a,maxY:n}=No.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.right+10,y:Bo(g),text:se(C)})}return t}),c=t=>{const a=on.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.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=a.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 I=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(I){let N=I[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.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)),C=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${b})`}const i=a.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)),C=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${b}, ${i[4]})`}const p=a.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 C=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))),I=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,b,I].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=R.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=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;a+=Math.sqrt(i*i+p*p)}return a},h=e.computed(()=>We.value==="line"||On.value?(On.value?H.series.filter(a=>(a.type||We.value)==="line"):Gn.value).map((a,n)=>{const i=H.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,ee)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Qt.value?rl(B):Kt(ee),y:Qt.value?ml(ee):yn(a,B),index:ee})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let ee="";Pe.value?ee=Wl(B):ee=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Ee=>` L ${Ee.x} ${Ee.y}`).join(""),C+=(C?" ":"")+ee}});const b=p.reduce((B,ee)=>B+v(ee),0),I=tt.value.has(i),N=re.value===i,$=re.value!==null&&re.value!==i;return{path:C,color:c(i),strokeDasharray:ro(a),pathLength:b,seriesIndex:i,animationDelay:n*Y.value,isHighlighted:N,isDimmed:$,isHidden:I}}):[]),M=e.computed(()=>{if(!(We.value==="line"||On.value))return[];const t=On.value?H.series.filter(n=>(n.type||We.value)==="line"):Gn.value,a=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let b=-1,I=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)I++;else{b=N;break}}if(I>0&&b!==-1){const N=n.data[b],$=Qt.value?rl(C):Kt(g),B=Qt.value?ml(g):yn(n,C),ee=Qt.value?rl(N):Kt(b),Ee=Qt.value?ml(b):yn(n,N),Ue=tt.value.has(p),ie=re.value===p,ye=re.value!==null&&re.value!==p;a.push({path:`M ${$} ${B} L ${ee} ${Ee}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ie,isDimmed:ye,isHidden:Ue,gapSize:I}),g=b-1}}}}),a}),D=e.computed(()=>We.value==="line"||On.value?!$t.value||hl.value||Dt.value.hasAnimated?[]:(On.value?H.series.filter(a=>(a.type||We.value)==="line"):Gn.value).map((a,n)=>{const i=H.series.findIndex(I=>I===a);let p="",g=null;a.data.forEach((I,N)=>{if(I!=null){const $={x:Qt.value?rl(I):Kt(N),y:Qt.value?ml(N):yn(a,I)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,ee)=>ee>N&&B!==null&&B!==void 0);if($!==-1){const B={x:Qt.value?rl(a.data[$]):Kt($),y:Qt.value?ml($):yn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((I,N)=>I==null?null:{x:Qt.value?rl(I):Kt(N),y:Qt.value?ml(N):yn(a,I)}).filter(I=>I!==null),b=v(C);return{path:p,pathLength:b,color:c(i),strokeDasharray:ro(a),animationDelay:n*Y.value,seriesIndex:i}}):[]),x=e.computed(()=>{if(We.value!=="line")return[];const t=[];return Gn.value.forEach((a,n)=>{const i=re.value===n,p=re.value!==null&&re.value!==n,g=tt.value.has(n);a.data.forEach((C,b)=>{C!=null&&t.push({x:Kt(b),y:yn(a,C),color:c(n),value:C,label:H.categories[b]||b.toString(),seriesName:a.name,categoryIndex:b,dataIndex:b,animationDelay:(n*a.data.length+b)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),ae=e.computed(()=>{if(!On.value)return[];const t=[];return H.series.filter(n=>(n.type||We.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(I=>I===n),g=re.value===p,C=re.value!==null&&re.value!==p,b=tt.value.has(p);n.data.forEach((I,N)=>{I!=null&&t.push({x:Kt(N),y:yn(n,I),color:c(p),value:I,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:C,isHidden:b})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Gn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=re.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=tt.value.has(n);a.data.forEach((b,I)=>{let N,$,B,ee,Ee;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:I,$=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,ee=b.label||H.categories?.[I]||`Point ${I+1}`,Ee=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:I,$=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,ee=b[3]||H.categories?.[I]||`Point ${I+1}`,Ee=b[4];else if(typeof b=="number")N=I,$=b,B=Eo(n,I),ee=H.categories?.[I]||`Point ${I+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:hn($),radius:co(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:ee,imageUrl:Ee,seriesIndex:n,dataIndex:I,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Ul.value})})}),t}),He=e.computed(()=>We.value!=="area"?[]:Gn.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,ee)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(ee),y:yn(t,B),index:ee})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:tt.value.has(a)};const p=F.value.bottom+1;let g="",C="";n.forEach((B,ee)=>{if(B.length===0)return;let Ee=`M ${B[0].x} ${B[0].y}`;Pe.value&&B.length>1?Ee=Wl(B):B.slice(1).forEach(ie=>{Ee+=` L ${ie.x} ${ie.y}`}),g+=(g?" ":"")+Ee;let Ue=`M ${B[0].x} ${p}`;if(Ue+=` L ${B[0].x} ${B[0].y}`,Pe.value&&B.length>1){const ie=Wl(B),ye=ie.substring(ie.indexOf("C")||ie.indexOf("Q")||ie.indexOf("L"));ye?Ue+=" "+ye:B.slice(1).forEach(Ne=>{Ue+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(ie=>{Ue+=` L ${ie.x} ${ie.y}`});Ue+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ue});const b=re.value===a,I=re.value!==null&&re.value!==a,N=tt.value.has(a),$=n.reduce((B,ee)=>B+v(ee),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:b,isDimmed:I,isHidden:N}})),Se=e.computed(()=>{if(!(["bar"].includes(We.value)||On.value))return[];const t=[],{maxX:a}=qt.value,n=On.value?H.series.filter(p=>(p.type||We.value)==="bar"):Gn.value,i=n.length;if(Qt.value){const p=a+1,C=F.value.height/p,b=C*(2/3),I=Math.min(4,b/i*.15),N=b-(i-1)*I,$=Math.max(4,N/i);n.forEach((B,ee)=>{const Ee=H.series.findIndex(Ne=>Ne===B),Ue=re.value===Ee,ie=re.value!==null&&re.value!==Ee,ye=tt.value.has(Ee);B.data.forEach((Ne,fe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.top+(fe+.5)*C-b/2+ee*($+I),$e=F.value.left,Ae=Math.abs(rl(Ne)-F.value.left);let Nt="";if(Pe.value&&Ae>0){const Rt=Math.min(Ot.value,$/2,Ae/2);Nt=[`M ${$e} ${Le}`,`L ${$e+Ae-Rt} ${Le}`,`Q ${$e+Ae} ${Le} ${$e+Ae} ${Le+Rt}`,`L ${$e+Ae} ${Le+$-Rt}`,`Q ${$e+Ae} ${Le+$} ${$e+Ae-Rt} ${Le+$}`,`L ${$e} ${Le+$}`,"Z"].join(" ")}t.push({x:$e,y:Le,width:Ae,height:$,color:c(i===1?fe:Ee),value:Ne,label:H.categories[fe]||fe.toString(),seriesName:B.name,animationDelay:(ee*n.length+fe)*(Y.value/4),isHighlighted:Ue,isDimmed:ie,isHidden:ye,barPath:Nt,isSmooth:Pe.value&&Ae>0})})})}else{const p=a+1,C=F.value.width/p,b=C*.8,I=b/i,N=I*.05,$=I-N;n.forEach((B,ee)=>{const Ee=H.series.findIndex(Ne=>Ne===B),Ue=re.value===Ee,ie=re.value!==null&&re.value!==Ee,ye=tt.value.has(Ee);B.data.forEach((Ne,fe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.left+(fe+.5)*C-b/2+ee*I+N/2,$e=hn(Math.max(0,Ne)),Ae=Math.abs(hn(0)-hn(Ne));let Nt="";if(Pe.value&&Ae>0){const Rt=Math.min(Ot.value,$/2,Ae/2);Nt=[`M ${Le} ${$e+Ae}`,`L ${Le} ${$e+Rt}`,`Q ${Le} ${$e} ${Le+Rt} ${$e}`,`L ${Le+$-Rt} ${$e}`,`Q ${Le+$} ${$e} ${Le+$} ${$e+Rt}`,`L ${Le+$} ${$e+Ae}`,"Z"].join(" ")}t.push({x:Le,y:$e,width:$,height:Ae,color:c(i===1?fe:Ee),value:Ne,label:H.categories[fe]||fe.toString(),seriesName:B.name,animationDelay:(ee*n.length+fe)*(Y.value/4),isHighlighted:Ue,isDimmed:ie,isHidden:ye,barPath:Nt,isSmooth:Pe.value&&Ae>0})})})}return t}),ot=e.computed(()=>{if(!fn.value)return[];const t=Gn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!tt.value.has(C));if(t.length===0)return[];let a=We.value==="semi-radial"?Math.PI:-Math.PI/2;const n=We.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,b,I,N,$,B)=>{const ee=C+(b-C)/2,Ee=b-C,Ue=At.value+Math.cos(C)*zt.value,ie=wt.value+Math.sin(C)*zt.value,ye=At.value+Math.cos(b)*zt.value,Ne=wt.value+Math.sin(b)*zt.value,fe=At.value+Math.cos(b)*dt.value,Je=wt.value+Math.sin(b)*dt.value,Oe=At.value+Math.cos(C)*dt.value,Le=wt.value+Math.sin(C)*dt.value,$e=Ee>Math.PI?1:0,Ae=[`M ${Ue} ${ie}`,`A ${zt.value} ${zt.value} 0 ${$e} 1 ${ye} ${Ne}`,`L ${fe} ${Je}`,`A ${dt.value} ${dt.value} 0 ${$e} 0 ${Oe} ${Le}`,"Z"].join(" "),Nt=B||c(I);return{path:Ae,color:Nt,strokeWidth:X.value,strokeColor:m(i.length,Nt),value:$,seriesName:N,opacity:.8,isHighlighted:re.value===I,isDimmed:re.value!==null&&re.value!==I,isHidden:!1,startAngle:C,endAngle:b,midAngle:ee}};if(Al.value){const{series:C,originalIndex:b}=t[0],I=Number(C?.data?.[0]??0),N=Number.isFinite(I)?Math.min(Math.max(I,0),100):0,$=R.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Ee=(N<=0?B:N)/100*n,Ue=Number($?.miniRadial?.thresholds?.low??33),ie=Number($?.miniRadial?.thresholds?.medium??66),ye=$?.miniRadial?.colors?.low||"#E53E3E",Ne=$?.miniRadial?.colors?.medium||"#ED8936",fe=$?.miniRadial?.colors?.high||"#38A169",Je=N<=Ue?ye:N<=ie?Ne:fe,Oe=$?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return i.push(p(a,a+n-.001,b+1,"Track",100,Oe)),i.push(p(a,a+Ee,b,Le,N,Je)),i}if(t.length===1){const{series:C,originalIndex:b}=t[0],I=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,ee=At.value+Math.cos(N)*zt.value,Ee=wt.value+Math.sin(N)*zt.value,Ue=At.value+Math.cos($)*zt.value,ie=wt.value+Math.sin($)*zt.value,ye=At.value+Math.cos($)*dt.value,Ne=wt.value+Math.sin($)*dt.value,fe=At.value+Math.cos(N)*dt.value,Je=wt.value+Math.sin(N)*dt.value,Oe=1,Le=[`M ${ee} ${Ee}`,`A ${zt.value} ${zt.value} 0 ${Oe} 1 ${Ue} ${ie}`,`L ${ye} ${Ne}`,`A ${dt.value} ${dt.value} 0 ${Oe} 0 ${fe} ${Je}`,"Z"].join(" "),$e=c(b);return i.push({path:Le,color:$e,strokeWidth:X.value,strokeColor:m(0,$e),value:I,seriesName:C.name,opacity:.8,isHighlighted:re.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(ll.value&&t.length===2){const C=t[0],b=t[1],I=Math.min(100,Math.max(0,C.series.data[0]||0)),N=I/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,I)),i.push(p(a,a+n,b.originalIndex,b.series.name,100)),i}const g=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const I=C.data[0]||0,N=I/g*n,$=a,B=a+N,ee=$+N/2,Ee=At.value+Math.cos($)*zt.value,Ue=wt.value+Math.sin($)*zt.value,ie=At.value+Math.cos(B)*zt.value,ye=wt.value+Math.sin(B)*zt.value,Ne=At.value+Math.cos(B)*dt.value,fe=wt.value+Math.sin(B)*dt.value,Je=At.value+Math.cos($)*dt.value,Oe=wt.value+Math.sin($)*dt.value,Le=N>Math.PI?1:0,$e=[`M ${Ee} ${Ue}`,`A ${zt.value} ${zt.value} 0 ${Le} 1 ${ie} ${ye}`,`L ${Ne} ${fe}`,`A ${dt.value} ${dt.value} 0 ${Le} 0 ${Je} ${Oe}`,"Z"].join(" "),Ae=c(b);i.push({path:$e,color:Ae,strokeWidth:X.value,strokeColor:m(i.length,Ae),value:I,seriesName:C.name,opacity:.8,isHighlighted:re.value===b,isDimmed:re.value!==null&&re.value!==b,isHidden:!1,startAngle:$,endAngle:B,midAngle:ee}),a=B}),i)}),vn=e.computed(()=>{const t=ot.value;return ll.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),un=e.computed(()=>{if(!Cl.value||!fn.value)return[];const t=Ml.value,a=Il.value,n=bl.value,i=wl.value,p=15,g=t*1.3,C=.55,b=(B,ee)=>{const Ee=At.value+Math.cos(B.midAngle)*dt.value,Ue=wt.value+Math.sin(B.midAngle)*dt.value,ie=At.value+Math.cos(B.midAngle)*(dt.value+a),ye=wt.value+Math.sin(B.midAngle)*(dt.value+a),fe=ie+n*(ee?1:-1),Je=ee?ie+p:ie-p,Oe=ye-i,Le=`${B.seriesName}: ${se(B.value)}`,$e=Le.length*t*C;return{pointerStartX:Ee,pointerStartY:Ue,pointerEndX:ie,pointerEndY:ye,horizontalEndX:fe,horizontalEndY:ye,textX:Je,textY:Oe,text:Le,textWidth:$e,textAnchor:ee?"start":"end",isRightSide:ee,pointerLineLength:Math.hypot(ie-Ee,ye-Ue),horizontalLineLength:Math.hypot(fe-ie,0)}},I=(B,ee)=>{const Ee=Math.abs(B.textY-ee.textY)<g,Ue=B.isRightSide?B.textX:B.textX-B.textWidth,ie=B.isRightSide?B.textX+B.textWidth:B.textX,ye=ee.isRightSide?ee.textX:ee.textX-ee.textWidth,Ne=ee.isRightSide?ee.textX+ee.textWidth:ee.textX,fe=Ue<Ne&&ye<ie;return Ee&&fe},N=ot.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const ee=N[B];let Ee=Math.cos(ee.midAngle)>=0;if(B>0){const ie=$[B-1],ye=b(ee,Ee);I(ie,ye)&&(Ee=!Ee)}const Ue=b(ee,Ee);$.push({...Ue,color:ee.color,isHighlighted:ee.isHighlighted,isDimmed:ee.isDimmed})}return $}),ln=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Ul.value||.7;return re.value===null||re.value===void 0?a:re.value!==null?t.seriesIndex===re.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},dn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return re.value!==null?t.seriesIndex===re.value?Math.min(1,a+.1):a*.7:a},sn=(t,a)=>{if(t)try{if(re.value===t.seriesIndex?re.value=null:re.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},rn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];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(" ")},qn=(t,a)=>{if(!t||(a.stopPropagation(),To.value=!0,re.value=t.seriesIndex,rt.value.show=!1,!Ze.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120;p+C>ke.value&&(p=a.clientX-i.left-C-10),g+b>i.height&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const I=wn.value,N=Nn.value,$=I.map(B=>{const ee=N[B]||B,Ee=ol(B,t);return Ee?{seriesName:t.seriesName,label:t.label,value:`${ee}: ${Ee}`,color:t.color}:null}).filter(Boolean);yt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},ol=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=Yn.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return q.value?p+q.value:p}return n?.toString()||""},il=()=>{if(!jt.value||!rt.value.data||rt.value.data.length===0)return"Bubbles";const t=[],a=new Set;return rt.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},mo=(t,a)=>{t&&(To.value=!1,re.value=null,yt.value.show=!1,yt.value.bubbleData=[])},_o=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=y(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,b=a.clientY-i.top-10;const I=200,N=g?80:50;C+I>ke.value&&(C=a.clientX-i.left-I-15),b+N>de.value&&(b=a.clientY-i.top-N-10),C<0&&(C=10),b<0&&(b=10),Vt.value={show:!0,x:C,y:b,categoryValue:p,description:g}},Yo=()=>{Vt.value.show=!1},gl=e.computed(()=>H.categories.length||Math.max(...Qn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Qn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),po=e.computed(()=>{const t=[],a=gl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=At.value+Math.cos(i)*dt.value,g=wt.value+Math.sin(i)*dt.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Yl=e.computed(()=>{const t=[],a=gl.value;return po.value.forEach((n,i)=>{const p=dt.value+15,g=i*2*Math.PI/a-Math.PI/2,C=At.value+Math.cos(g)*p,b=wt.value+Math.sin(g)*p+5;let I="middle",N="middle";Math.abs(Math.cos(g))>.5&&(I=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:I,baseline:N})}),t}),$o=e.ref(new Set),al=(t,a,n)=>{const i=`current-${n}`,p=$o.value.has(i);return!p&&re.value===null?a.fillOpacity||at.value:a.isHighlighted||p?(a.fillOpacity||at.value)+.15:a.isDimmed?(a.fillOpacity||at.value)*.3:a.fillOpacity||at.value},Jn=e.computed(()=>{if(!Sn.value)return[];const t=[],a=gl.value;return Gn.value.forEach((n,i)=>{const p=[],g=[],C=[],b=re.value===i,I=re.value!==null&&re.value!==i,N=tt.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Ee=B/ta.value*dt.value,Ue=$*2*Math.PI/a-Math.PI/2,ie=At.value+Math.cos(Ue)*Ee,ye=wt.value+Math.sin(Ue)*Ee;p.push(`${ie},${ye}`),g.push({x:ie,y:ye}),C.push({x:ie,y:ye,value:B,label:H.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:at.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:I,isHidden:N,seriesIndex:i})}),t}),Wn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,b=a[p].x,I=a[p].y;C>t.y!=I>t.y&&t.x<(b-g)*(t.y-C)/(I-C)+g&&(n=!n)}return n},na=t=>{if(!Sn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=A.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=Jn.value.filter(b=>b.isHidden?!1:Wn({x:p,y:g},b.polygonPoints));if(C.length>0){C.length,re.value=C[0].seriesIndex;const b=t.clientX-n.left+10,I=t.clientY-n.top-10,N=C.length>1?460:260,$=70+gl.value*20;let B=b,ee=I;B+N>ke.value&&(B=t.clientX-n.left-N-10),ee+$>de.value&&(ee=t.clientY-n.top-$-10),B<0&&(B=10),ee<0&&(ee=10);const Ee=C.map(Ue=>({seriesName:Ue.seriesName,color:Ue.color,points:Ue.dataPoints.map(ie=>({label:ie.label,value:se(ie.value)}))}));yt.value={show:!0,x:B,y:ee,title:"",value:"",bubbleData:[],spiderAreas:Ee}}else cl()},Lo=e.computed(()=>{const t=R.value;return t.logos.map((a,n)=>{const i=H.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||tt.value.has(a.seriesIndex))return null;let p,g;if(Cn.value){let b=-1,I=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){b=$,I=i.data[$];break}if(b===-1||I===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:yn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Dt.value.isAnimating||!Dt.value.hasAnimated))if(Dt.value.isAnimating){const $=Dt.value.currentFrame/Dt.value.totalFrames,B=Go(t.animations.easing,Math.min($,1)),ee=wa(N,B);p=ee.x+(a.offsetX||0),g=ee.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(b)+(a.offsetX||0),g=hn(I)+(a.offsetY||0)}else if(fn.value||Sn.value){const b=Math.PI*2/t.logos.length*n;p=At.value+Math.cos(b)*(dt.value+30)+(a.offsetX||0),g=wt.value+Math.sin(b)*(dt.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),fa=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},va=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},jo=t=>{tt.value.has(t)?tt.value.delete(t):tt.value.add(t)},ga=e.computed(()=>{if(!yt.value.show&&!(et.value&&rt.value.show&&!J.value.isZooming))return{display:"none"};let t,a;if(et.value&&rt.value.show&&!J.value.isZooming){t=rt.value.x+15,a=F.value.top;const n=jt.value?200:150;t+n>ke.value&&(t=rt.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=yt.value.x,a=yt.value.y;return{left:t+"px",top:a+"px"}}),Bl=(t,a)=>{if(!Ze.value||fo.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120,I=ke.value,N=de.value;p+C>I&&(p=a.clientX-i.left-C-10),g+b>N&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&H.categories.includes(t.label)&&($=H.categories.indexOf(t.label));const B=(Qt.value||We.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";yt.value={show:!0,x:p,y:g,title:B,value:se(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),To=e.ref(!1),cl=()=>{yt.value.show=!1,yt.value.spiderAreas=[],yt.value.bubbleData=[],rt.value.show=!1,Ko.value||(re.value=null)},fo=e.ref(!1),vo=(t,a)=>{fo.value=!0,yt.value.show=!1,rt.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>ke.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),_l.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},go=()=>{fo.value=!1,_l.value.show=!1},Dt=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Go=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},hl=e.computed(()=>Ye.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!$t.value||hl.value){Dt.value.hasAnimated=!0,Kn.value&&(vl.value=1);return}Kn.value&&(vl.value=0),Dt.value.isAnimating=!0,Dt.value.currentFrame=0,Dt.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const a=Dt.value.currentFrame/Dt.value.totalFrames,n=Go(E.value,Math.min(a,1));ha(n),Kn.value&&(vl.value=n),a<1?(Dt.value.currentFrame++,Dt.value.animationId=requestAnimationFrame(t)):ya()};Dt.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=z.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Dt.value.isAnimating=!1,Dt.value.hasAnimated=!0,Kn.value&&(vl.value=1),Dt.value.animationId&&(cancelAnimationFrame(Dt.value.animationId),Dt.value.animationId=null)},Qo=e.computed(()=>!fn.value||Dt.value.hasAnimated?!0:Kn.value?vl.value>=1:Ln.value?El.value>=1:!0),oa=e.computed(()=>Cl.value&&Qo.value),Ao=e.ref(!1);e.watch(oa,t=>{t?(Ao.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ao.value=!0})})):Ao.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!$t.value||hl.value||Dt.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Ca(E.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),Ca=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ba=()=>{if(!$t.value||hl.value)return"";const t=["dss-chart-animated"];return Dt.value.hasAnimated||t.push(`dss-animate-${an.value}`),Dt.value.hasAnimated||(fn.value&&We.value!=="semi-radial"?t.push("dss-animate-fill"):fn.value||t.push(`dss-animate-${an.value}`)),Dt.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{le.value&&a&&Dt.value.hasAnimated&&(Dt.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),w.value)}))},{deep:!0}),e.watch(()=>J.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{pe()},50)}),e.watch(()=>[J.value.scale,J.value.offsetX],()=>{!J.value.isZooming&&!J.value.isDragging&&pe()},{flush:"post"}),e.watch([_t,Re],([t,a])=>{J.value.minScale=t,J.value.maxScale=a,(J.value.scale<t||J.value.scale>a)&&oo()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>bt.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",no)}):document.removeEventListener("click",no)}),e.onMounted(()=>{re.value=null,Kn.value&&(!$t.value||hl.value)&&(vl.value=1),jn(),z.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(we&&cancelAnimationFrame(we),we=requestAnimationFrame(()=>{we=null;const{width:n,height:i}=a.contentRect;Ke.value=Math.round(n),he.value=Math.round(i),U.value&&(mt.value=U.value.offsetHeight||ge)}))}),f.observe(z.value)),$t.value&&!hl.value?We.value==="semi-radial"?setTimeout(()=>Uo(),w.value):setTimeout(()=>la(),w.value):(Dt.value.hasAnimated=!0,We.value==="semi-radial"&&(El.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",Co)}),e.onUnmounted(()=>{we&&cancelAnimationFrame(we),f&&z.value&&(f.unobserve(z.value),f.disconnect(),f=null),Dt.value.animationId&&cancelAnimationFrame(Dt.value.animationId),Rl&&(cancelAnimationFrame(Rl),Rl=null),J.value.zoomTimeout&&clearTimeout(J.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",Co),document.removeEventListener("click",no)});const aa=t=>{if(J.value.isDragging&&J.value.scale>1&&Cn.value){rt.value.show=!1;const a=t.clientX-J.value.lastMouseX,{minX:n,maxX:i}=qt.value,p=i-n||1,C=a*.8;J.value.offsetX+=C;const b=p/J.value.scale,I=p-b,N=0,$=-I/p*F.value.width,B=N;J.value.offsetX=Math.max($,Math.min(B,J.value.offsetX)),J.value.lastMouseX=t.clientX,J.value.lastMouseY=t.clientY}},sa=()=>{J.value.isDragging&&(J.value.isDragging=!1,setTimeout(()=>{!J.value.isDragging&&J.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let b=1;b<n.length;b++){const I=n[b].x-n[b-1].x,N=n[b].y-n[b-1].y,$=Math.sqrt(I*I+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let b=0;b<p.length;b++){const I=C+p[b];if(g<=I){const N=(g-C)/p[b],$=n[b],B=n[b+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=I}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ba(),{"dss-chart-fill-width":xe.value,"dss-chart-fill-height":Be.value,"dss-chart-compact":fn.value&&!Q.value}]]),style:e.normalizeStyle({width:xe.value?"100%":ke.value+"px",height:gt.value,...xe.value||Be.value?{overflow:fn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:Wo()}),"data-chart-type":We.value,ref_key:"containerEl",ref:z,onWheel:bo,onMousedown:lo,onMousemove:Mn,onMouseup:wo,onMouseleave:to,onDblclick:oo,onContextmenu:e.withModifiers(ql,["prevent"]),onClick:e.withModifiers(xn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:U},[e.createElementVNode("div",vs,[it.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(it.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0)]),Q.value&&be.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-top":be.value==="top","dss-legend-bottom":be.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":tt.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>zn(i),onMouseleave:nn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ks,e.toDisplayString(n.name),1)],46,ys))),128))],2)):e.createCommentVNode("",!0),Q.value&&(be.value==="left"||be.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":be.value==="left","dss-legend-right":be.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":tt.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>zn(i),onMouseleave:nn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",bs,e.toDisplayString(n.name),1)],46,Cs))),128))],2)):e.createCommentVNode("",!0)],512),T.showAddMarkerButton&&st.value&&Ge.value.addMarker&&(Cn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Fn.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,xs),a[4]||(a[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,ws)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[jt.value&&Tt.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(Tt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:ke.value,height:de.value,class:"dss-chart-svg","data-smooth":Pe.value,"data-animated":$t.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:oe.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:ke.value,height:F.value.height*4},null,8,Bs)],8,Ns),Ln.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Zl.value},[e.createElementVNode("path",{d:pl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),Kn.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:Sl.value},[e.createElementVNode("path",{d:Hl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),Cn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[Ut.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":ve.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.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,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[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,Rs),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,Fs),$n.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Is)):e.createCommentVNode("",!0)]),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.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,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.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,Os))),128)),$n.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,qs))),128)):e.createCommentVNode("",!0),Wt.value?(e.openBlock(),e.createElementBlock("text",{key:1,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(Wt.value),9,Ws)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:2,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(Ft.value),9,Zs)):e.createCommentVNode("",!0),$n.value&&ue.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:ke.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${ke.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(ue.value),9,Us)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":ve.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,js)):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:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Ks)):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:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Gs)):e.createCommentVNode("",!0)],8,Ys),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:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Qs)):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?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Js),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,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":ve.value},[On.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Qt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.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=>Bl(n,p),onMouseleave:cl},null,46,lr)):(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=>Bl(n,p),onMouseleave:cl},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?P.value+2:P.value,"stroke-dasharray":n.strokeDasharray,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,sr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?P.value+2:P.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,rr))),128)),K.value>0||me.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(ae.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:nt(n.isHighlighted?ze(n,K.value)+2:ze(n,K.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=>Bl(n,p),onMouseleave:cl},null,46,ir))),128)):e.createCommentVNode("",!0)])])):We.value==="line"?(e.openBlock(),e.createElementBlock("g",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":P.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Dt.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ur))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?P.value+2:P.value,"stroke-dasharray":n.strokeDasharray,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,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?P.value+2:P.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,mr))),128)),K.value>0||me.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(x.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:nt(n.isHighlighted?ze(n,K.value)+2:ze(n,K.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=>Bl(n,p),onMouseleave:cl},null,46,pr))),128)):e.createCommentVNode("",!0)])):We.value==="area"?(e.openBlock(),e.createElementBlock("g",fr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.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,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?St.value+.2:St.value,mask:`url(#area-mask-${i}-${T.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,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?P.value+1:P.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*Y.value}ms`})},null,14,yr))),128))])):We.value==="bar"?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass({"dss-horizontal-bars":Qt.value})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Se.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=>Bl(n,p),onMouseleave:cl},null,46,kr)):(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=>Bl(n,p),onMouseleave:cl},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),et.value&&rt.value.show&&!J.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":ve.value},[e.createElementVNode("line",{x1:rt.value.x,x2:rt.value.x,y1:F.value.top,y2:F.value.bottom,stroke:pt.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:rt.value.x,cy:n.y,r:nt(K.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,xr))),128))],8,br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:nt(n.radius),fill:n.color,"fill-opacity":ln(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(rn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>qn(n,p),onMouseleave:p=>mo(n),onClick:p=>sn(n,p)},null,42,Vr),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:dn(n)}),onLoad:p=>So(i),onError:p=>so(i),onMouseenter:p=>qn(n,p),onMouseleave:p=>mo(n),onClick:p=>sn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),fn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:en.value},[We.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:At.value,cy:wt.value,r:dt.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Mr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":We.value,"clip-path":xo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vn.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":Zo(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=>Bl(n.segment,p),onMouseleave:cl},null,42,$r))),128))],8,_r),In.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pl.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,Tr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),gn.value&&(Qo.value||Ln.value||Al.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:Xn.value.x,y:Xn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":Rn.value,fill:zl.value,class:"dss-radial-data-center"},e.toDisplayString(Vn.value),9,Ar)):e.createCommentVNode("",!0),oa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Ao.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.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,Dr),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,Hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Ml.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:en.value},[Ut.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:At.value,cy:wt.value,r:nt(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,zr))),128)),e.createElementVNode("g",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Fe.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:At.value-16,y:wt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:At.value,y:wt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(It(i)),9,qr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:At.value,x2:n.x,y1:wt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Wr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/gl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/gl.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,Ur))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:cl},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Jn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":al("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?P.value+1:P.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*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Xr),(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:nt(n.isHighlighted?K.value+1:K.value>0?K.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*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Bl(p,C),onMouseleave:cl},null,46,Yr))),128))]))),128))],32)],8,Fr)):e.createCommentVNode("",!0),e.createElementVNode("g",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:nt(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Kr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.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=>fa(i),onError:p=>va(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,Gr))),128))])],8,Vs))]),Qe.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:de.value+"px",backgroundImage:`url('${kl.value}')`,backgroundRepeat:"no-repeat",...Dn.value,opacity:Ct.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ft.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:W.value+"px",height:W.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>cn(n),["stop"]),onMouseenter:p=>_o(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:k(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Jr)],44,Qr)),[[e.vShow,Ie.value]])),128)),Vt.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:Vt.value.x+"px",top:Vt.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(Vt.value.categoryValue),1),Vt.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(Vt.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),Ze.value&&(yt.value.show||et.value&&rt.value.show&&!J.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":et.value&&rt.value.show&&!J.value.isZooming,"dss-spider-tooltip":Sn.value&&yt.value.spiderAreas&&yt.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!et.value||!rt.value.show||J.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Sn.value&&yt.value.spiderAreas&&yt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",li,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",oi,e.toDisplayString(p.label),1),e.createElementVNode("span",ai,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&yt.value.bubbleData&&yt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[yt.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(yt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(yt.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",ci,[e.createElementVNode("div",ui,e.toDisplayString(yt.value.title),1),e.createElementVNode("div",di,e.toDisplayString(yt.value.value),1)])),yt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Hn(yt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",mi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(yt.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",fi,[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",vi,[e.createElementVNode("div",gi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(yt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",yi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(yt.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",ki,[e.createElementVNode("div",Ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",bi,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",wi,[e.createElementVNode("div",xi,e.toDisplayString(jt.value?il():T.categories[rt.value.categoryIndex]||`Category ${rt.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(rt.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(rt.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",Si,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Vi,e.toDisplayString(se(n.value)),1)]))),128))]),Hn(rt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ni,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(rt.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Mi,[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",_i,[e.createElementVNode("div",$i,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(rt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Li,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(rt.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",Di,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Hi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),Cn.value&&je.value&&J.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(J.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,fs),Q.value&&be.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":tt.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>zn(i),onMouseleave:nn,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Fi,e.toDisplayString(n.name),1)],46,Ri))),128))],2)):e.createCommentVNode("",!0),bt.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:bt.value.x+"px",top:bt.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[Ge.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:qo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),Ge.value.addMarker&&(Ge.value.downloadSvg||Ge.value.downloadPng||Ge.value.downloadCsv||Lt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),Ge.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Po},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),Ge.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ho},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),Ge.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:yo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),Lt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[Ge.value.downloadSvg||Ge.value.downloadPng||Ge.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lt.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass($l(n)),style:e.normalizeStyle(Ll(n)),onClick:p=>Oo(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Yt(n),class:"dss-custom-menu-content"},null,8,qi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",Wi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Oi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),_e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:lt},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Zi,[e.createElementVNode("h3",null,e.toDisplayString(tn.value?e.unref(_)("chart.modalMarker.viewMarker"):Bn.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:lt},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:_e.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>_e.value.date=n),"min-date":Ol.value,"max-date":xl.value,disabled:tn.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),tn.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString(_e.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>_e.value.description=n),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,_e.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[Bn.value&&!tn.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:Jt},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:lt},e.toDisplayString(tn.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),tn.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:Bt,disabled:!(_e.value.description&&_e.value.description.length)},e.toDisplayString(Bn.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,tc))])])])])):e.createCommentVNode("",!0)],64))}}),oc={class:"dss-modal-title"},ac={class:"dss-modal-actions"},Jo={__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(T,{emit:te}){const _=T,L=te,ce=e.ref(null),z=e.ref(null),A=e.computed(()=>{const oe={"max-width":_.width};return _.height!=="auto"&&(oe.height=_.height,oe["min-height"]="0"),oe}),U=e.computed(()=>({}));function Ke(){L("close-modal")}function he(){_.backDrop&&!ce.value&&L("close-modal")}function f(oe){oe.target.tagName==="INPUT"&&(ce.value=oe.target.tagName)}function we(){setTimeout(()=>{ce.value=null},300)}function ge(){const oe=document.body,ve=document.documentElement;z.value={bodyOverflow:oe.style.overflow,bodyPosition:oe.style.position,bodyTop:oe.style.top,bodyWidth:oe.style.width,htmlOverflow:ve.style.overflow,scrollY:window.scrollY},oe.style.overflow="hidden",oe.style.position="fixed",oe.style.top=`-${z.value.scrollY}px`,oe.style.width="100%",oe.style.left="0",ve.style.overflow="hidden"}function ne(){if(!z.value)return;const oe=document.body,ve=document.documentElement,{bodyOverflow:H,bodyPosition:Ce,bodyTop:Te,bodyWidth:qe,htmlOverflow:ct,scrollY:R}=z.value;oe.style.overflow=H||"",oe.style.position=Ce||"",oe.style.top=Te||"",oe.style.width=qe||"",oe.style.left="",ve.style.overflow=ct||"",window.scrollTo(0,R||0)}return e.watch(()=>_.showModal,oe=>{if(oe)ge(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const ve=document.getElementById("dss-modal-backdrop");ve&&(ve.addEventListener("focusin",f),ve.addEventListener("focusout",we))},100);else{ne(),document.body.classList.remove("dss-modal-open");const ve=document.getElementById("dss-modal-backdrop");ve&&(ve.removeEventListener("focusin",f),ve.removeEventListener("focusout",we))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&ne()}),(oe,ve)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:he},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:ve[0]||(ve[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",oc,[e.renderSlot(oe.$slots,"title",{},()=>[ve[1]||(ve[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(oe.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:Ke,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(U.value)},[e.renderSlot(oe.$slots,"content",{},()=>[ve[2]||(ve[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(oe.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},sc={key:0,class:"dss-table-toolbar"},rc={class:"dss-table-toolbar-left"},ic=["aria-expanded"],cc={class:"dss-pagination-select-dropdown",role:"listbox"},uc={class:"dss-table-column-visibility-label"},dc={class:"dss-table-checkbox-wrapper"},mc=["checked","onChange"],pc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fc={class:"dss-table-column-visibility-text"},vc={class:"dss-table-toolbar-right"},gc=["placeholder","aria-label"],hc=["aria-label"],yc=["aria-label","aria-expanded"],kc={key:1,class:"dss-table-toolbar-extra"},Cc={class:"dss-table-thead"},bc={key:0,class:"dss-table-th dss-table-selection-column"},wc={key:0,class:"dss-table-checkbox-wrapper"},xc=["checked","indeterminate"],Ec={key:0,class:"dss-table-checkbox__indeterminate"},Sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Vc=["aria-label"],Nc=["onClick"],Bc={class:"dss-table-th-content"},Mc={class:"dss-table-th-text"},_c={key:0},$c={key:1},Lc={key:2},Tc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Ac={class:"dss-table-tbody"},Dc=["onClick"],Hc={class:"dss-table-checkbox-wrapper"},Rc=["type","name","checked","onChange"],Fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ic={key:1,class:"dss-table-checkbox__dot"},zc=["onClick"],Pc=["aria-expanded","aria-label"],Oc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},qc={key:0,class:"dss-table-expansion-row"},Wc=["colspan"],Zc=["colspan"],Uc={key:1,class:"dss-table-pagination"},Xc={class:"dss-table-pagination-left"},Yc={key:0},jc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Kc={class:"dss-table-pagination-center"},Gc={key:0,class:"dss-pagination-controls"},Qc=["disabled","title"],Jc=["disabled","title"],eu=["aria-label","onKeydown"],tu={class:"dss-pagination-of"},nu=["disabled","title"],lu=["disabled","title"],ou={class:"dss-table-pagination-right"},au={class:"dss-pagination-rows-label"},su=["aria-expanded"],ru=["aria-selected","onClick"],iu={key:0,class:"dss-table-filter-row"},cu=["value","placeholder"],uu=["min","max","value"],du=["min","max","value"],mu={class:"dss-table-filter-double-range-values"},pu={key:2,class:"dss-table-filter-daterange"},fu={class:"dss-table-filter-daterange-row"},vu={class:"dss-table-filter-daterange-label"},gu=["value"],hu={class:"dss-table-filter-daterange-row"},yu={class:"dss-table-filter-daterange-label"},ku=["value"],Cu=["value","placeholder"],bu={class:"dss-table-filter-list"},wu=["checked","onChange"],xu={class:"dss-table-filter-actions"},Eu={name:"DSSTable"},Su=Object.assign(Eu,{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:T=>typeof T=="object"&&T!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(T,{emit:te}){const{t:_,locale:L}=Gl.useI18n(),ce=T,z=te,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single"},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function U(k,y){const S=Object.assign({},k);return Ke(k)&&Ke(y)&&Object.keys(y).forEach(Z=>{Ke(y[Z])?Z in k?S[Z]=U(k[Z],y[Z]):Object.assign(S,{[Z]:y[Z]}):Object.assign(S,{[Z]:y[Z]})}),S}function Ke(k){return k&&typeof k=="object"&&!Array.isArray(k)}const he=e.computed(()=>U(A,ce.options)),f=e.computed(()=>{const k=he.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),we=e.computed(()=>he.value.table.height),ge=e.computed(()=>he.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:ge.value})),oe=e.computed(()=>he.value.table.expandable===!0),ve=e.computed(()=>he.value.table.expandableRowData??null),H=e.computed(()=>he.value.table.expandableRowCondition??null),Ce=e.computed(()=>he.value.table.truncated===!0),Te=e.computed(()=>he.value.table.striped),qe=e.computed(()=>he.value.table.bordered),ct=e.computed(()=>he.value.table.hoverable),R=e.computed(()=>he.value.table.size),xe=e.computed(()=>he.value.table.align||"left");e.computed(()=>he.value.title.text),e.computed(()=>he.value.subtitle.text);const Be=e.computed(()=>he.value.selection.enabled),ke=e.computed(()=>he.value.selection.mode),mt=e.computed(()=>he.value.sorting.enabled),vt=e.computed(()=>he.value.sorting.mode),de=e.computed(()=>he.value.pagination.enabled),gt=e.computed(()=>he.value.pagination.rows),We=e.computed(()=>he.value.pagination.rowsPerPageOptions),Pt=e.computed(()=>he.value.pagination.showCounter!==!1),it=e.computed(()=>he.value.pagination.showControlsGroup),Et=e.computed(()=>it.value===!1?!1:he.value.pagination.showControls!==!1),Tt=e.computed(()=>it.value===!1?!1:he.value.pagination.showRowsPerPage!==!1),Wt=e.computed(()=>de.value&&(Pt.value||Et.value||Tt.value)),Ft=e.computed(()=>he.value.scrollable),G=e.computed(()=>he.value.emptyMessage||_("table.emptyMessage")),ue=e.computed(()=>he.value.toolbar?.downloads?.pdf!==!1),De=e.computed(()=>he.value.toolbar?.downloads?.excel!==!1),Xe=e.computed(()=>he.value.toolbar?.search!==!1),Zt=e.computed(()=>ue.value||De.value||Xe.value||kt.value),kt=e.computed(()=>he.value.toolbar?.columnVisibility!==!1),xt=e.ref(""),Mt=e.ref(!1),Ut=e.ref(null);let Q=null;function be(){Mt.value?(Q&&(clearTimeout(Q),Q=null),Mt.value=!1,xt.value="",z("search",""),Ut.value?.blur()):(Mt.value=!0,Q=setTimeout(()=>{Q=null,Ut.value?.focus()},80))}function Me(){xt.value||(Mt.value=!1)}function Ze(){xt.value="",z("search",""),Ut.value?.focus()}const et=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":qe.value,"dss-table-hoverable":ct.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":Ce.value})),pt=(k,y)=>k?.field??k?.key??y,je=e.ref(new Set);function _t(){const k=new Set;ce.columns.forEach((y,S)=>{y?.hidden!==!0&&k.add(pt(y,S))}),je.value=k}const Re=e.computed(()=>ce.columns.filter((k,y)=>je.value.has(pt(k,y)))),P=k=>{const y=ce.columns.findIndex(S=>S===k);return pt(k,y>=0?y:0)},X=(k,y)=>je.value.has(pt(k,y));function K(k,y){const S=pt(k,y),Z=new Set(je.value);Z.has(S)?Z.delete(S):Z.add(S),je.value=Z}const me=e.ref(null),ze=e.ref(!1);function nt(k){me.value&&!me.value.contains(k.target)&&(ze.value=!1)}const St=e.computed(()=>Re.value.length+(Be.value?1:0)+(oe.value?1:0)),Pe=(k,y)=>k?.id??k?.key??y,ht=e.ref(new Set),Ot=e.ref(null),on=(k,y)=>ht.value.has(Pe(k,y)),$t=(k,y)=>{if(!oe.value)return!1;if(typeof H.value=="function")return!!H.value(k,y);if(typeof ve.value=="string"&&ve.value.trim()){const S=Yt(k,ve.value.trim());return Array.isArray(S)?S.length>0:S&&typeof S=="object"?Object.keys(S).length>0:S!=null&&S!==""}return!0},an=(k,y,S)=>{if(S&&S.stopPropagation(),!$t(k,y))return;const Z=Pe(k,y),pe=new Set(ht.value);pe.has(Z)?(pe.delete(Z),z("row-collapse",{data:k,index:y})):(pe.add(Z),z("row-expand",{data:k,index:y})),ht.value=pe},V=(k,y)=>{if(!Ce.value)return;const S=Pe(k,y);Ot.value!==S&&(Ot.value=S)},w=e.ref(null),E=e.ref(0),Y=e.ref([]),le=k=>{if(vt.value==="single")return w.value===k.field?E.value:0;{const y=Y.value.find(S=>S.field===k.field);return y?y.order:0}},Ye=k=>{const y=le(k);return{"dss-sort-active":y!==0,"dss-sort-asc":y===1,"dss-sort-desc":y===-1}},at=e.ref({}),Ve=e.ref(null),Fe=e.ref(null),It=220,Ht=e.ref(null),st=e.computed(()=>Re.value.find(k=>P(k)===Ve.value)??null),Ge=e.computed(()=>{if(!st.value||st.value.filter!=="range")return null;const k=st.value,y=Ve.value,{min:S,max:Z}=Dn(k),pe=k.filterMin??S,Bt=k.filterMax??Z,lt=W(y),Jt=lt.min??pe,pn=lt.max??Bt,cn=Bt-pe,kn=cn===0?0:(Jt-pe)/cn*100,jn=cn===0?100:(pn-pe)/cn*100;return{rangeMin:pe,rangeMax:Bt,currentMin:Jt,currentMax:pn,minPct:kn,maxPct:jn}}),Lt=e.ref(null),Fn=e.ref("max");function O(k){const y=Lt.value,S=Ge.value;if(!y||!S)return;const Z=y.getBoundingClientRect(),Bt=(k.clientX-Z.left)/Z.width*100,lt=(S.minPct+S.maxPct)/2;Fn.value=Bt<lt?"min":"max"}function W(k){return at.value[k]??{}}function q(k,y){at.value={...at.value,[k]:y}}function se(k){const y=at.value[k];return y?y.type==="string"?!!y.value?.trim():y.type==="range"?y.min!=null||y.max!=null:y.type==="dateRange"?!!(y.from||y.to):y.type==="list"?y.selected?.length>0:!1:!1}function Ie(k){const y={...at.value};delete y[k],at.value=y,Ve.value=null,Fe.value=null}function ut(){if(!Ve.value){Fe.value=null;return}const k=Ht.value;if(!k)return;const y=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${Ve.value}"]`);if(!y)return;const S=y.getBoundingClientRect();Fe.value={top:S.bottom+6,left:Math.max(8,S.right-It)}}const ft=e.computed(()=>{const k=String(xt.value??"").trim().toLowerCase();return k?ce.data.filter(y=>Re.value.some(S=>Ct(xn(y,S)).some(pe=>String(pe).toLowerCase().includes(k)))):ce.data}),Qe=e.computed(()=>{let k=[...ft.value];const y=(xt.value??"").trim().toLowerCase();return y&&(k=k.filter(S=>ce.columns.some(Z=>{if(!Z||!Z.field)return!1;const pe=xn(S,Z);return String(pe??"").toLowerCase().includes(y)}))),Re.value.forEach(S=>{const Z=P(S),pe=at.value[Z];if(!pe)return;const Bt=S.field;if(Bt){if(pe.type==="string"&&pe.value?.trim()){const lt=pe.value.trim().toLowerCase();k=k.filter(Jt=>{const pn=xn(Jt,S);return String(pn??"").toLowerCase().includes(lt)})}else if(pe.type==="range")k=k.filter(lt=>{const Jt=Yt(lt,Bt),pn=Number(Jt);return!(Number.isNaN(pn)||pe.min!=null&&pn<pe.min||pe.max!=null&&pn>pe.max)});else if(pe.type==="dateRange"){const lt=pe.from?new Date(pe.from).getTime():null,Jt=pe.to?new Date(pe.to).getTime():null;k=k.filter(pn=>{const cn=Yt(pn,Bt),kn=cn?new Date(cn).getTime():NaN;return!(Number.isNaN(kn)||lt!=null&&kn<lt||Jt!=null&&kn>Jt)})}else if(pe.type==="list"&&pe.selected?.length){const lt=new Set(pe.selected);k=k.filter(Jt=>Ct(xn(Jt,S)).some(cn=>lt.has(cn)))}}}),k});function Ct(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(Ct);if(typeof k=="object"){const y=k?.label??k?.name??k?.value??k?.title;return[y!=null?String(y):String(k)]}return[String(k)]}function Xt(k){const y=new Set;return ce.data.forEach(S=>{Ct(xn(S,k)).forEach(pe=>y.add(pe))}),Array.from(y).sort((S,Z)=>String(S).localeCompare(String(Z)))}function Tn(k,y){if(Ve.value===k){Ve.value=null,Fe.value=null;return}if(Ve.value=k,y?.currentTarget){const S=y.currentTarget.getBoundingClientRect();Fe.value={top:S.bottom+6,left:Math.max(8,S.right-It)}}else ut()}function An(k,y){q(k,{type:"string",value:y})}function Dn(k){const y=k.field;if(!y)return{min:0,max:100};let S=1/0,Z=-1/0;return ce.data.forEach(pe=>{const Bt=Yt(pe,y),lt=Number(Bt);Number.isNaN(lt)||(S=Math.min(S,lt),Z=Math.max(Z,lt))}),{min:S===1/0?0:S,max:Z===-1/0?100:Z}}function sl(k,y,S){const Z={...W(k),type:"range"},pe=S===""?null:Number(S),Bt=pe===null||Number.isNaN(pe)?null:pe;Z[y]=Bt,Bt!=null&&(y==="min"&&Z.max!=null&&Bt>Z.max&&(Z.max=Bt),y==="max"&&Z.min!=null&&Bt<Z.min&&(Z.min=Bt)),q(k,Z)}function Hn(k,y,S){const Z={...W(k),type:"dateRange"};Z[y]=S||"",q(k,Z)}const yl=e.reactive({});function kl(k,y){yl[k]=y}function Cl(k){const y=P(k),S=(yl[y]??"").trim().toLowerCase(),Z=Xt(k);return S?Z.filter(pe=>String(pe).toLowerCase().includes(S)):Z}function Ml(k,y){return(W(k).selected??[]).includes(y!=null?String(y):"")}function Il(k,y){const Z=[...W(k).selected??[]],pe=y!=null?String(y):"",Bt=Z.indexOf(pe);Bt>=0?Z.splice(Bt,1):Z.push(pe),q(k,{type:"list",selected:Z})}function bl(k){Ve.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(Ve.value=null,Fe.value=null)}function wl(){ut(),Rn.value&&Nn()}const In=k=>{if(!(k.sortable===!1||!mt.value))if(vt.value==="single")w.value===k.field?E.value=E.value===1?-1:E.value===-1?0:1:(w.value=k.field,E.value=1),E.value===0&&(w.value=null),z("sort",{field:w.value,order:E.value});else{const y=Y.value.findIndex(S=>S.field===k.field);y>=0?Y.value[y].order===1?Y.value[y].order=-1:Y.value.splice(y,1):Y.value.push({field:k.field,order:1}),z("sort",{multiSortMeta:Y.value})}},el=e.computed(()=>{if(!mt.value)return Qe.value;let k=[...Qe.value];return vt.value==="single"&&w.value&&E.value!==0?k.sort((y,S)=>{const Z=Yt(y,w.value),pe=Yt(S,w.value);return Z===pe?0:Z==null?1:pe==null?-1:(Z<pe?-1:Z>pe?1:0)*E.value}):vt.value==="multiple"&&Y.value.length>0&&k.sort((y,S)=>{for(const Z of Y.value){const pe=Yt(y,Z.field),Bt=Yt(S,Z.field);if(pe===Bt)continue;if(pe==null)return 1;if(Bt==null)return-1;const lt=pe<Bt?-1:pe>Bt?1:0;if(lt!==0)return lt*Z.order}return 0}),k}),gn=e.ref(0),Vn=e.ref(gt.value),Rn=e.ref(!1),Xn=e.ref(null),zl=e.ref(null),Pl=e.ref("bottom"),ul=e.ref(null),_l=k=>{Vn.value=k,Rn.value=!1,gn.value=0,z("page",{page:0,rows:Vn.value})};function wn(k){Xn.value&&!Xn.value.contains(k.target)&&(Rn.value=!1)}function Nn(){const k=Xn.value,y=zl.value;if(!k||!y)return;const S=k.querySelector(".dss-pagination-select-dropdown");if(!S)return;const Z=y.getBoundingClientRect(),pe=S.offsetHeight||0,lt=(window.innerHeight||document.documentElement.clientHeight)-Z.bottom,Jt=Z.top;Pl.value=lt<pe+8&&Jt>lt?"top":"bottom",ul.value={width:`${Math.ceil(Z.width)}px`,left:`${Math.max(0,Math.round(y.offsetLeft))}px`}}const Yn=e.computed(()=>el.value.length),tt=e.computed(()=>Math.ceil(Yn.value/Vn.value)),re=e.computed(()=>Math.max(tt.value,1)),dl=e.computed(()=>Yn.value===0?0:Vt.value+1),yt=e.computed(()=>rt.value),Vt=e.computed(()=>de.value?gn.value*Vn.value:0),rt=e.computed(()=>de.value?Math.min((gn.value+1)*Vn.value,Yn.value):Yn.value),bt=e.computed(()=>{if(!de.value)return el.value;const k=Vt.value,y=rt.value;return el.value.slice(k,y)}),J=e.ref(new Set),Gt=e.computed(()=>el.value.filter((k,y)=>J.value.has(Pe(k,y)))),_e=e.computed(()=>{const k=el.value.length;return k>0&&J.value.size===k}),Ol=e.computed(()=>{const k=el.value.length,y=J.value.size;return y>0&&y<k}),xl=(k,y)=>J.value.has(Pe(k,y)),Bn=()=>{if(_e.value)J.value=new Set,z("unselect-all");else{const k=new Set;el.value.forEach((y,S)=>k.add(Pe(y,S))),J.value=k,z("select-all",Gt.value)}},tn=(k,y)=>{const S=Pe(k,y),Z=new Set(J.value),pe=Z.has(S);ke.value==="single"?pe?(Z.delete(S),z("row-unselect",k)):(Z.clear(),Z.add(S),z("row-select",k)):pe?(Z.delete(S),z("row-unselect",k)):(Z.add(S),z("row-select",k)),J.value=Z},zn=e.ref("1"),nn=()=>{const k=Number.parseInt(String(zn.value),10);if(!Number.isFinite(k)){zn.value=String(gn.value+1);return}const y=Math.min(re.value,Math.max(1,k));y!==gn.value+1?Mn(y-1):zn.value=String(y)},Mn=k=>{k<0||k>=tt.value||(gn.value=k,z("page",{page:k,rows:Vn.value}))},to=(k,y,S)=>{z("row-click",{data:k,index:y,originalEvent:S}),V(k,Vt.value+y)},ql=(k,y)=>{const S=Vt.value+y;return{"dss-table-row-selected":xl(k,S),"dss-table-row-even":y%2===0,"dss-table-row-odd":y%2!==0,"dss-table-row-truncated-clickable":Ce.value,"dss-table-row-truncated-expanded":Ot.value===Pe(k,S)}},xn=(k,y)=>y.field?Yt(k,y.field):"",Yt=(k,y)=>y.split(".").reduce((S,Z)=>S&&S[Z],k),$l=k=>{const y=k.align??xe.value;return{"dss-table-sortable":k.sortable!==!1&&mt.value,"dss-table-align-left":y==="left","dss-table-align-center":y==="center","dss-table-align-right":y==="right",[k.className]:k.className}},Ll=k=>{const y={};return k.width&&(y.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(y.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(y.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),y};return e.watch(()=>ce.locale,k=>{k&&k!==L.value&&(L.value=k)},{immediate:!0}),e.watch(gt,k=>{Vn.value=k,gn.value=0}),e.watch(Rn,async k=>{k&&(await e.nextTick(),Nn())}),e.watch(gn,k=>{zn.value=String(k+1)},{immediate:!0}),e.watch(xt,k=>{z("search",k??"")}),e.watch(()=>ce.columns,()=>{_t()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",wn),document.addEventListener("click",nt),document.addEventListener("click",bl),window.addEventListener("resize",wl),window.addEventListener("scroll",wl,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",wn),document.removeEventListener("click",nt),document.removeEventListener("click",bl),window.removeEventListener("resize",wl),window.removeEventListener("scroll",wl,!0)}),(k,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:Ht,style:e.normalizeStyle({width:f.value+"px",height:we.value?we.value+"px":"auto"})},[Zt.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",rc,[ue.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:y[0]||(y[0]=S=>z("download-pdf"))},[y[22]||(y[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),De.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:y[1]||(y[1]=S=>z("download-excel"))},[y[23]||(y[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),kt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:me},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":ze.value}]),onClick:y[2]||(y[2]=S=>ze.value=!ze.value),"aria-expanded":ze.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),y[24]||(y[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ic),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,(S,Z)=>(e.openBlock(),e.createElementBlock("li",{key:pt(S,Z),role:"option",class:"dss-table-column-visibility-option",onClick:y[3]||(y[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",uc,[e.createElementVNode("span",dc,[e.createElementVNode("input",{type:"checkbox",checked:X(S,Z),onChange:pe=>K(S,Z),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),X(S,Z)?(e.openBlock(),e.createElementBlock("span",pc,[...y[25]||(y[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",fc,e.toDisplayString(S.header),1)])]))),128))],512),[[e.vShow,ze.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Xe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":Mt.value||xt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Ut,"onUpdate:modelValue":y[4]||(y[4]=S=>xt.value=S),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:y[5]||(y[5]=S=>Mt.value=!0),onBlur:Me},null,40,gc),[[e.vModelText,xt.value]]),xt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:Ze},[...y[26]||(y[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,hc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":Mt.value||!!xt.value,onMousedown:e.withModifiers(be,["prevent"])},[...y[27]||(y[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,yc)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":Ft.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",et.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[Be.value?(e.openBlock(),e.createElementBlock("th",bc,[ke.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:_e.value,indeterminate:Ol.value,onChange:Bn,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),Ol.value?(e.openBlock(),e.createElementBlock("span",Ec)):_e.value?(e.openBlock(),e.createElementBlock("span",Sc,[...y[28]||(y[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Vc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(S,Z)=>(e.openBlock(),e.createElementBlock("th",{key:P(S),class:e.normalizeClass(["dss-table-th",$l(S)]),style:e.normalizeStyle(Ll(S)),onClick:pe=>In(S)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(S.header),1),S.sortable!==!1&&mt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",Ye(S)])},[le(S)===0?(e.openBlock(),e.createElementBlock("span",_c,[...y[29]||(y[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):le(S)===1?(e.openBlock(),e.createElementBlock("span",$c,[...y[30]||(y[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):le(S)===-1?(e.openBlock(),e.createElementBlock("span",Lc,[...y[31]||(y[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),S.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":Ve.value===P(S)}]),onClick:y[6]||(y[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":se(P(S))}]),"data-filter-column-key":P(S),"aria-expanded":Ve.value===P(S),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:pe=>Tn(P(S),pe)},[...y[32]||(y[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(bt.value,(S,Z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Pe(S,Vt.value+Z)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",ql(S,Z)]),style:e.normalizeStyle(ne.value),onClick:pe=>to(S,Z,pe)},[Be.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:y[7]||(y[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Hc,[e.createElementVNode("input",{type:ke.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:xl(S,Vt.value+Z),onChange:pe=>tn(S,Vt.value+Z),class:e.normalizeClass(["dss-table-checkbox",ke.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio"])},null,42,Rc),ke.value==="multiple"&&xl(S,Vt.value+Z)?(e.openBlock(),e.createElementBlock("span",Fc,[...y[33]||(y[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):ke.value==="single"&&xl(S,Vt.value+Z)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),oe.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(pe=>an(S,Vt.value+Z,pe),["stop"])},[$t(S,Vt.value+Z)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":on(S,Vt.value+Z),"aria-label":on(S,Vt.value+Z)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":on(S,Vt.value+Z)}]),"aria-hidden":"true"},[...y[34]||(y[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Pc)):(e.openBlock(),e.createElementBlock("span",Oc))],8,zc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(pe,Bt)=>(e.openBlock(),e.createElementBlock("td",{key:P(pe),class:e.normalizeClass(["dss-table-td",$l(pe)]),style:e.normalizeStyle(Ll(pe))},[e.renderSlot(k.$slots,`cell-${pe.field}`,{data:S,column:pe,rowIndex:Z,isExpanded:Ot.value===Pe(S,Vt.value+Z)},()=>[e.createTextVNode(e.toDisplayString(xn(S,pe)),1)])],6))),128))],14,Dc),oe.value&&$t(S,Vt.value+Z)&&on(S,Vt.value+Z)?(e.openBlock(),e.createElementBlock("tr",qc,[e.createElementVNode("td",{colspan:St.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:S,rowIndex:Z})],8,Wc)])):e.createCommentVNode("",!0)],64))),128)),bt.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:St.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(G.value),1)])],8,Zc)],4))])],2)],2),Wt.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[Pt.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(_)("table.showingRange",{start:dl.value,end:yt.value,total:Yn.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[Et.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:gn.value===0,onClick:y[8]||(y[8]=S=>Mn(0)),title:e.unref(_)("table.firstPage")},[...y[35]||(y[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Qc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:gn.value===0,onClick:y[9]||(y[9]=S=>Mn(gn.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":y[10]||(y[10]=S=>zn.value=S),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:nn,onKeydown:e.withKeys(e.withModifiers(nn,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,zn.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(_)("table.ofPages",{total:re.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:gn.value>=tt.value-1,onClick:y[11]||(y[11]=S=>Mn(gn.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:gn.value>=tt.value-1,onClick:y[12]||(y[12]=S=>Mn(tt.value-1)),title:e.unref(_)("table.lastPage")},[...y[36]||(y[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,lu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ou,[Tt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:Xn},[e.createElementVNode("span",au,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Rn.value}]),onClick:y[13]||(y[13]=S=>Rn.value=!Rn.value),"aria-expanded":Rn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:zl},[e.createTextVNode(e.toDisplayString(Vn.value)+" ",1),y[37]||(y[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,su),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":Pl.value==="top"}]),style:e.normalizeStyle(ul.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S,role:"option","aria-selected":S===Vn.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":S===Vn.value}]),onClick:Z=>_l(S)},e.toDisplayString(S),11,ru))),128))],6),[[e.vShow,Rn.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Fe.value?{top:Fe.value.top+"px",left:Fe.value.left+"px",width:It+"px"}:void 0),onClick:y[21]||(y[21]=e.withModifiers(()=>{},["stop"]))},[st.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[st.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:W(Ve.value).value??"",onInput:y[14]||(y[14]=S=>An(Ve.value,S.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,cu)])):st.value.filter==="range"&&Ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":Ge.value.minPct+"%","--range-max-pct":Ge.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Lt,class:"dss-table-filter-double-range-track",onMousemove:O,onMouseenter:O},[e.createElementVNode("input",{type:"range",min:Ge.value.rangeMin,max:Ge.value.rangeMax,value:Ge.value.currentMin,onInput:y[15]||(y[15]=S=>sl(Ve.value,"min",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:Fn.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:Ge.value.rangeMin,max:Ge.value.rangeMax,value:Ge.value.currentMax,onInput:y[16]||(y[16]=S=>sl(Ve.value,"max",S.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:Fn.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(Ge.value.currentMin)+" – "+e.toDisplayString(Ge.value.currentMax),1)],4)):st.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",fu,[e.createElementVNode("label",vu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:W(Ve.value).from??"",onInput:y[17]||(y[17]=S=>Hn(Ve.value,"from",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,gu)]),e.createElementVNode("div",hu,[e.createElementVNode("label",yu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:W(Ve.value).to??"",onInput:y[18]||(y[18]=S=>Hn(Ve.value,"to",S.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):st.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:yl[Ve.value]??"",onInput:y[19]||(y[19]=S=>kl(Ve.value,S.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,Cu),e.createElementVNode("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Cl(st.value),S=>(e.openBlock(),e.createElementBlock("label",{key:S,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:Ml(Ve.value,S),onChange:Z=>Il(Ve.value,S)},null,40,wu),e.createElementVNode("span",null,e.toDisplayString(S),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:y[20]||(y[20]=S=>Ie(Ve.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,Ve.value&&st.value&&Fe.value]])]),_:1})]))],64))}}),Vu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Nu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Bu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",_u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",$u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Lu={class:"dss-toolbar-left"},Tu=["title"],Au=["title"],Du={class:"dss-toolbar-dropdown-wrapper"},Hu=["title"],Ru=["src"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],qu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Wu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["title"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad={key:2,class:"dss-toolbar-separator"},sd=["title"],rd={key:4,class:"dss-toolbar-separator"},id={key:5,class:"dss-toolbar-dropdown-wrapper"},cd=["title"],ud={class:"dss-toolbar-dropdown-ai"},dd={class:"dss-toolbar-right"},md={key:0,class:"dss-toolbar-custom-group"},pd={key:1,class:"dss-toolbar-separator"},fd={class:"dss-link-modal-content"},vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-image-modal-tabs"},wd={key:0,class:"dss-image-tab-content"},xd={class:"dss-link-modal-content"},Ed={class:"dss-link-modal-field"},Sd={key:0,class:"dss-link-modal-label"},Vd=["src"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-link-modal-field"},$d={class:"dss-link-modal-label"},Ld=["placeholder"],Td={class:"dss-link-modal-field"},Ad={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={key:1,class:"dss-image-tab-content"},Rd={class:"dss-link-modal-content"},Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},qd=["placeholder"],Wd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-text-editor-title-input-container"},Gd={key:0,class:"dss-text-editor-title-preview"},Qd={key:0},Jd={key:1,class:"dss-text-editor-preview-placeholder"},e1=["value","placeholder","disabled"],t1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},n1={class:"dss-text-editor-description-input-container"},l1={key:0,class:"dss-text-editor-description-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},i1=["data-comment-id","onMouseenter"],c1=["onClick"],u1=["src","alt"],d1={key:1},m1=["onClick"],p1=["src","alt"],f1={key:1},v1=["data-has-second-user","onClick"],g1={class:"editor-comment-marker-count"},h1={key:4,class:"dss-text-editor-textarea-wrapper"},y1=["value","placeholder","rows","disabled"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1={key:5,class:"dss-text-editor-content-wrapper"},E1={key:0,class:"dss-comment-overlay-body"},S1={class:"dss-comment-selection-wrapper"},V1=["innerHTML"],N1={class:"dss-comment-messages-wrapper"},B1={key:0,class:"dss-comment-avatar-wrapper"},M1={class:"dss-comment-avatar"},_1=["src","alt"],$1={key:1},L1={class:"dss-comment-header"},T1={class:"dss-comment-header-text"},A1={class:"dss-comment-author"},D1={key:0,class:"dss-comment-date"},H1=["onClick","title"],R1={class:"dss-comment-overlay-inner"},F1=["placeholder","onKeydown"],I1={class:"dss-text-editor-footer"},z1={class:"dss-text-editor-footer-content"},P1={class:"dss-text-editor-footer-stat"},O1={class:"dss-text-editor-footer-stat"},q1=["title"],W1=["title"],Z1={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:""},U1={class:"dss-image-popup-content"},X1={key:0,class:"dss-image-popup-no-alt-icon"},Y1=["title"],j1=["title"],K1={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:""},G1={class:"dss-toolbar-left"},Q1=["title"],J1=["title"],em={class:"dss-toolbar-dropdown-wrapper"},tm=["title"],nm=["src"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},cm=["title"],um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km={key:2,class:"dss-toolbar-separator"},Cm={key:3,class:"dss-toolbar-dropdown-wrapper"},bm=["title"],wm={class:"dss-toolbar-dropdown-ai"},xm={key:0,class:"dss-toolbar-right"},Em={key:0,class:"dss-toolbar-separator"},Sm={key:0,class:"dss-toolbar-custom-group"},Vm={key:1,class:"dss-toolbar-separator"},Nm={name:"DSSTextEditor"},Bm=Object.assign(Nm,{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:T=>typeof T=="object"&&T!==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:T=>typeof T=="object"&&T!==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(T,{expose:te,emit:_}){const{t:L,locale:ce}=Gl.useI18n(),z={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,U=_,Ke=e.useSlots(),he=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
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=tn("csv"),document.body.appendChild(p),p.click(),document.body.removeChild(p),URL.revokeObjectURL(i),Mn()}catch(t){console.error("Error downloading CSV:",t)}},Oo=t=>{if(typeof t.action=="function"){const a={series:H.series,categories:H.categories,markers:Lt.value},n={chartX:Ct.value.chartX,chartY:Ct.value.chartY,dataX:Ct.value.mouseDataX,dataY:Ct.value.mouseDataY,categoryIndex:clampedCategoryIndex||Ct.value.categoryIndex};t.action(a,n)}Mn()},qo=()=>{q(),$e.value.show=!0,$e.value.categoryIndex=Ct.value.categoryIndex,$e.value.fromButton=!1,Mn()},ko=()=>{q(),$e.value.show=!0,$e.value.categoryIndex=0,$e.value.fromButton=!0},Co=t=>{if(Ct.value.show){const a=document.querySelector(".dss-context-menu");a&&!a.contains(t.target)&&(Ct.value.show=!1)}},no=t=>{Ct.value.show&&!t.target.closest(".context-menu")&&(Ct.value.show=!1)},bo=t=>{if(!bn.value||!Xe.value)return;t.preventDefault(),t.stopPropagation(),ae.value.isZooming=!0,Ae.value.show=!1,ae.value.zoomTimeout&&clearTimeout(ae.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){ae.value.isZooming=!1;return}const g=t.deltaY>0?.9:1.1,C=Math.max(ae.value.minScale,Math.min(ae.value.maxScale,ae.value.scale*g));if(C!==ae.value.scale){const{minX:b,maxX:I}=Zt.value,N=I-b||1,$=N/ae.value.scale,B=b-ae.value.offsetX/F.value.width*N,ee=(i-F.value.left)/F.value.width,Se=B+ee*$;ae.value.scale=C;const Ze=N/ae.value.scale,ie=Se-ee*Ze;ae.value.offsetX=-(ie-b)/N*F.value.width,ae.value.scale<=1.01&&(ae.value.scale=1,ae.value.offsetX=0)}ae.value.zoomTimeout=setTimeout(()=>{ae.value.isZooming=!1,ae.value.zoomTimeout=null},300)},lo=t=>{if(!bn.value||!Xe.value||ae.value.scale<=1)return;Ae.value.show=!1;const n=t.currentTarget.getBoundingClientRect();t.clientX-n.left,t.clientY-n.top,ae.value.isDragging=!0,ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY,t.preventDefault()},wo=()=>{ae.value.isDragging=!1},oo=()=>{!bn.value||!Xe.value||(ae.value.scale=1,ae.value.offsetX=0,ae.value.isDragging=!1,ae.value.zoomTimeout&&(clearTimeout(ae.value.zoomTimeout),ae.value.zoomTimeout=null),ae.value.isZooming=!1)},Wo=()=>!bn.value||!ol.value||!Xe.value?"default":ae.value.isDragging?"grabbing":ae.value.scale>1?"grab":"dss-crosshair",Wl=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 a=`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],C=t[Math.min(n+2,t.length-1)],b=p.x+(g.x-i.x)/6*lt.value,I=p.y+(g.y-i.y)/6*lt.value,N=g.x-(C.x-p.x)/6*lt.value,$=g.y-(C.y-p.y)/6*lt.value;a+=` C ${b} ${I} ${N} ${$} ${g.x} ${g.y}`}return a},En=e.computed(()=>{const a=R.value?.chart?.padding,n=typeof a=="number"?a:null,i=a&&typeof a=="object"?a:null,p=50;let g=p+(qt.value?30:0)+60;if(Sn.value){const B={left:p+40,top:p+40,right:p+40,bottom:p+40};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??B.left,top:i.top??B.top,right:i.right??B.right,bottom:i.bottom??B.bottom}:B}if(vn.value){const B=!Q.value,ee=yl.value,Se=ee?zl.value+Ml.value+Math.max(24,Bl.value+16):0,Ze=B?12:p;let ie=0;st.value&&(ie+=B?8:15),Et.value&&(ie+=B?6:10);const ke=ze();let Ne=Ze+(B?4:16)+(ee?Se:0),pe=Ze+(ee?Se:0);Q.value&&ye.value==="left"?Ne+=ke.legendWidth||150:Q.value&&ye.value==="right"&&(pe+=ke.legendWidth||150);const Ie=Oe.value==="semi-radial"?ee?Se:8:ee?Se:B?8:p+80,Le=ee?14:0,_e=Ze+ie+Le,De={left:Ne,top:_e,right:pe,bottom:Ie};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??De.left,top:i.top??De.top,right:i.right??De.right,bottom:i.bottom??De.bottom}:De}let C=0;st.value&&(C+=15),Et.value&&(C+=10);const b=ze();let I=p+16,N=p;Q.value&&ye.value==="left"?I+=b.legendWidth||150:Q.value&&ye.value==="right"&&(N+=b.legendWidth||150),_n.value&&(N+=44);const $={left:I,top:p+C,right:N,bottom:g};return n!=null?{left:n,top:n,right:n,bottom:n}:i?{left:i.left??$.left,top:i.top??$.top,right:i.right??$.right,bottom:i.bottom??$.bottom}:$}),F=e.computed(()=>({left:En.value.left,top:En.value.top,right:Ce.value-En.value.right,bottom:de.value-En.value.bottom,width:Ce.value-(En.value.left+En.value.right),height:de.value-(En.value.top+En.value.bottom)})),bn=e.computed(()=>["line","area","bar"].includes(Oe.value)||Ut.value),In=e.computed(()=>Ut.value),Dl=e.computed(()=>Oe.value==="mini-radial"),vn=e.computed(()=>["radial","semi-radial","mini-radial"].includes(Oe.value)),Sn=e.computed(()=>Oe.value==="spider"),jt=e.computed(()=>Oe.value==="bubble"),Gt=e.computed(()=>R.value?.chart?.orientation==="horizontal"&&(Oe.value==="bar"||In.value)),sl=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.left+(t-a)/i*F.value.width},ml=t=>{const{maxX:a}=Zt.value,n=a+1,p=F.value.height/n;return F.value.top+(t+.5)*p},Dt=e.computed(()=>vn.value?En.value.left+(Ce.value-En.value.left-En.value.right)/2:Ce.value/2),bt=e.computed(()=>Sn.value?de.value/2-40:vn.value?En.value.top+(de.value-En.value.top-En.value.bottom)/2:de.value/2),it=e.computed(()=>{if(Sn.value){const t=F.value.width-80,a=F.value.height-80;return Math.min(t,a)/2}return Math.min(F.value.width,F.value.height)/2}),Ot=e.computed(()=>{const t=R.value,a=t?.plotOptions?.radialBar?.innerRadiusRatio??t?.radialBar?.innerRadiusRatio,n=typeof a=="number"&&a>=0&&a<=1?a:.45;return it.value*n}),Hl=e.computed(()=>{const t=R.value,a=typeof H.innerSize=="number"?H.innerSize:t?.innerSize;return typeof a!="number"||a<=-100||!(vn.value||Sn.value)?1:1+a/100}),en=e.computed(()=>{const t=Hl.value;if(t===1||t<=0)return;const a=Dt.value,n=bt.value;return`translate(${a}, ${n}) scale(${t}) translate(${-a}, ${-n})`}),wl=e.ref(0),Zl=e.computed(()=>`semi-radial-fill-clip-${H.chartId}`),Ln=e.computed(()=>Oe.value==="semi-radial"),Qn=e.computed(()=>Ln.value&&$t.value&&!hl.value),Jn=e.computed(()=>Ln.value&&$t.value&&!hl.value&&Qt.value==="fill"),pl=e.computed(()=>{const t=Qn.value?wl.value:1,a=Dt.value,n=bt.value,i=Ot.value,p=it.value,g=Math.PI,C=Math.PI+t*Math.PI;if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;const b=a+p*Math.cos(g),I=n+p*Math.sin(g),N=a+p*Math.cos(C),$=n+p*Math.sin(C),B=a+i*Math.cos(C),ee=n+i*Math.sin(C),Se=a+i*Math.cos(g),Ze=n+i*Math.sin(g),ie=t>.5?1:0;return`M ${a} ${n} L ${b} ${I} A ${p} ${p} 0 ${ie} 1 ${N} ${$} L ${B} ${ee} A ${i} ${i} 0 ${ie} 1 ${Se} ${Ze} Z`}),fl=e.computed(()=>{if(!(!Ln.value||!Qn.value)&&!Jn.value)return`url(#${Zl.value})`}),Zo=t=>{if(!(!Jn.value||t!==0))return`url(#${Zl.value})`},vl=e.ref(0),xl=e.computed(()=>`radial-reveal-clip-${H.chartId}`),Un=e.computed(()=>Oe.value==="radial"),Rl=e.computed(()=>{const t=Un.value?vl.value:1,a=Dt.value,n=bt.value,i=Math.max(it.value*1.5,Ce.value,de.value);if(t<=0)return`M ${a} ${n} L ${a} ${n} Z`;if(t>=1){const B=a-i,ee=a+i;return`M ${B} ${n} A ${i} ${i} 0 0 1 ${ee} ${n} A ${i} ${i} 0 0 1 ${B} ${n} Z`}const p=-Math.PI/2,g=p+t*Math.PI*2,C=a+i*Math.cos(p),b=n+i*Math.sin(p),I=a+i*Math.cos(g),N=n+i*Math.sin(g),$=t>=.5?1:0;return`M ${a} ${n} L ${C} ${b} A ${i} ${i} 0 ${$} 1 ${I} ${N} Z`}),xo=e.computed(()=>{if(fl.value)return fl.value;if(Un.value)return`url(#${xl.value})`});let Fl=null;const Uo=()=>{if(!Qn.value)return;wl.value=0;const t=V.value,a=performance.now(),n=i=>{const p=i-a,g=Math.min(1,p/t);wl.value=Go(S.value,g),g<1&&(Fl=requestAnimationFrame(n))};Fl=requestAnimationFrame(n)},Il=e.computed(()=>R.value?.bubbles?.minSize||8),ao=e.computed(()=>R.value?.bubbles?.maxSize||50),Ul=e.computed(()=>R.value?.bubbles?.opacity||.7),Eo=(t,a)=>{const n=[15,20,25,18,22],i=n[t%n.length]||20,p=1+Math.sin(a*.5)*.2;return Math.max(5,i*p)},So=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.opacity="1")},so=t=>{const a=document.querySelector(`.dss-bubble-image-${t}`);a&&(a.style.display="none")},Xn=e.computed(()=>H.series),Yn=e.computed(()=>H.series.filter((t,a)=>!ot.value.has(a))),Xl=t=>{if(!t)return"primary";const a=t.yAxis??t.axis??t.yAxisId;return a==="secondary"||a==="right"||a===1?"secondary":"primary"},ro=t=>t?typeof t.strokeDasharray=="string"?t.strokeDasharray:Array.isArray(t.strokeDasharray)?t.strokeDasharray.join(","):t.dotted===!0?"4,4":null:null,Vo=e.computed(()=>Yn.value.filter(t=>Xl(t)==="primary")),El=e.computed(()=>Yn.value.filter(t=>Xl(t)==="secondary")),_n=e.computed(()=>!Gt.value&&!!G.value&&El.value.length>0),wn="auto",io=(t,a,n,i=0,p=100)=>{let g=1/0,C=-1/0;if(t.forEach(N=>{N?.data?.length&&N.data.forEach($=>{typeof $=="number"&&Number.isFinite($)&&(g=Math.min(g,$),C=Math.max(C,$))})}),g===1/0)return{minY:i,maxY:p};let b;if(a===wn){const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}else if(typeof a=="number")b=a;else{const N=C-g,$=N>0?N*.1:1;b=Math.max(0,g-$)}let I;if(n===wn){const N=C-g,$=N>0?N*.1:2;I=C+$}else if(typeof n=="number")I=n;else{const N=C-g,$=N>0?N*.1:2;I=C+$}return{minY:b,maxY:I}},Zt=e.computed(()=>{if(jt.value)return Xo();if(!Yn.value.length)return{minX:0,maxX:1,minY:0,maxY:1};let t=0;Yn.value.forEach(n=>{n.data&&n.data.length&&(t=Math.max(t,n.data.length-1))}),H.categories.length>0&&(t=Math.max(t,H.categories.length-1));const a=io(Vo.value.length?Vo.value:Yn.value,He.value,Ue.value);return{minX:0,maxX:t,minY:a.minY,maxY:a.maxY}}),No=e.computed(()=>_n.value?io(El.value,Wt.value,yt.value,Zt.value.minY,Zt.value.maxY):{minY:Zt.value.minY,maxY:Zt.value.maxY}),Xo=()=>{if(!Yn.value.length)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};let t=1/0,a=-1/0,n=1/0,i=-1/0,p=1/0,g=-1/0,C=!1;if(Yn.value.forEach((Se,Ze)=>{Se?.data?.length&&Se.data.forEach((ie,ke)=>{let Ne,pe,Ge;if(typeof ie=="object"&&ie!==null&&!Array.isArray(ie))Ne=typeof ie.x=="number"?ie.x:ke,pe=typeof ie.y=="number"?ie.y:0,Ge=typeof ie.size=="number"?ie.size:20;else if(Array.isArray(ie)&&ie.length>=3)Ne=typeof ie[0]=="number"?ie[0]:ke,pe=typeof ie[1]=="number"?ie[1]:0,Ge=typeof ie[2]=="number"?ie[2]:20;else if(typeof ie=="number")Ne=ke,pe=ie,Ge=Eo(Ze,ke);else return;isFinite(Ne)&&isFinite(pe)&&isFinite(Ge)&&(t=Math.min(t,Ne),a=Math.max(a,Ne),n=Math.min(n,pe),i=Math.max(i,pe),p=Math.min(p,Ge),g=Math.max(g,Ge),C=!0)})}),!C)return{minX:0,maxX:8,minY:0,maxY:50,minSize:10,maxSize:30};t===a&&(t=Math.min(t,0),a=Math.max(a,H.categories?.length-1||8)),n===i&&(n=Math.max(0,n-10),i=n+20);const b=a-t,I=i-n;let N,$,B,ee;return Pt.value!==null?N=Pt.value:N=t-b*.1,wt.value!==null?$=wt.value:$=a+b*.1,He.value!==null&&typeof He.value=="number"?B=He.value:B=Math.max(0,n-I*.1),Ue.value!==null&&typeof Ue.value=="number"?ee=Ue.value:ee=i+I*.1,{minX:N,maxX:$,minY:B,maxY:ee,minSize:p,maxSize:g}},Kt=t=>{if(jt.value){const{minX:b,maxX:I}=Zt.value,N=I-b||1;return F.value.left+(t-b)/N*F.value.width}const{minX:a,maxX:n}=Zt.value,i=n-a;if(n===0||i===0)return F.value.left+F.value.width/2;const p=i/ae.value.scale,g=a-ae.value.offsetX/F.value.width*i,C=(t-g)/p;return F.value.left+C*F.value.width},hn=t=>{const{minY:a,maxY:n}=Zt.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},Bo=t=>{const{minY:a,maxY:n}=No.value,i=n-a||1;return F.value.bottom-(t-a)/i*F.value.height},yn=(t,a)=>_n.value&&Xl(t)==="secondary"?Bo(a):hn(a),co=t=>{if(!jt.value)return K.value||4;const{maxSize:a}=Zt.value,n=Math.max(1,a),i=Math.min(1,Math.max(0,t/n));return Il.value+i*(ao.value-Il.value)},Sl=(t,a=12,n="Arial, sans-serif")=>{if(typeof t!="string"||!t)return 0;if(typeof document>"u")return t.length*(a*.62);Sl.canvas||(Sl.canvas=document.createElement("canvas"));const i=Sl.canvas.getContext("2d");return i?(i.font=`${a}px ${n}`,i.measureText(t).width):t.length*(a*.62)},uo=(t,a,n=12)=>{if(typeof t!="string"||typeof a!="number"||a<=0||Sl(t,n)<=a)return t;const i="..";if(Sl(i,n)>=a)return i;let g=t.length;for(;g>0;){const C=`${t.slice(0,g)}${i}`;if(Sl(C,n)<=a)return C;g-=1}return i},Mo=e.computed(()=>s.value.map(t=>({y:t.y}))),o=e.computed(()=>{if(jt.value)return l();if(Oe.value==="bar"){if(Gt.value){const _e=[],{minY:De,maxY:_t}=Zt.value,Rt=5,On=_t-De||1;for(let mn=0;mn<=Rt;mn++){const qn=De+On*(mn/Rt),Do=sl(qn);_e.push({x:Do,y:F.value.bottom+20,text:se(Math.round(qn))})}return _e}const ke=[],{maxX:Ne}=Zt.value,pe=Ne+1,Ge=5,Le=(F.value.width-Ge*2)/pe;for(let _e=0;_e<=Ne;_e++){const De=F.value.left+Ge+(_e+.5)*Le;ke.push({x:De,y:F.value.bottom+20,text:uo(H.categories[_e]||_("chart.fallback.item",{number:_e+1}),Math.max(Le-8,24))})}return ke}const t=[],{minX:a,maxX:n}=Zt.value,i=Pt.value!==null?Pt.value:a,p=wt.value!==null?wt.value:n,g=p-i||1,C=g/ae.value.scale,b=i-ae.value.offsetX/F.value.width*g,I=b+C,N=Math.max(0,Math.floor(b-2)),$=Math.min(p,Math.ceil(I+2)),B=$-N,ee=F.value.width,Ze=Math.floor(ee/60);let ie=1;B>Ze&&(ie=Math.ceil(B/Ze));for(let ke=N;ke<=$;ke+=ie)if(ke>=0&&ke<=p){const Ne=Kt(ke);Ne>=F.value.left-100&&Ne<=F.value.right+100&&t.push({x:Ne,y:F.value.bottom+20,text:H.categories[ke]||`Item ${ke+1}`})}return t}),l=()=>{const t=[],{minX:a,maxX:n}=Zt.value,i=n-a||1,p=Math.min(8,Math.max(4,Math.floor(F.value.width/80)));for(let g=0;g<=p;g++){const C=a+i*g/p,b=Kt(C);if(b>=F.value.left-10&&b<=F.value.right+10){const I=Math.round(C),N=H.categories?.[I];t.push({x:b,y:F.value.bottom+20,text:N||(Number.isInteger(C)?C.toString():C.toFixed(1))})}}return t},s=e.computed(()=>{if(Gt.value){const p=[],{maxX:g}=Zt.value;for(let C=0;C<=g;C++)p.push({x:F.value.left-10,y:ml(C),text:uo(H.categories[C]||`Item ${C+1}`,Math.max(F.value.left-28,40))});return p}const t=[],{minY:a,maxY:n}=Zt.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.left-10,y:hn(g),text:se(C)})}return t}),r=e.computed(()=>{if(!_n.value||Gt.value)return[];const t=[],{minY:a,maxY:n}=No.value,i=5;for(let p=0;p<=i;p++){const g=a+(n-a)*(p/i),C=Math.round(g);t.push({x:F.value.right+10,y:Bo(g),text:se(C)})}return t}),c=t=>{const a=ln.value;if(!a||a.length===0){const n=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#F97316","#06B6D4","#84CC16"];return n[t%n.length]}return a[t%a.length]},d=t=>{if(!t||typeof t!="string")return"#3a3a3a";const a=t.trim();let n=0,i=0,p=0;const g=a.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=a.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 I=a.match(/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);if(I){let N=I[1];N.length===3&&(N=N[0]+N[0]+N[1]+N[1]+N[2]+N[2]),n=parseInt(N.slice(0,2),16)/255,i=parseInt(N.slice(2,4),16)/255,p=parseInt(N.slice(4,6),16)/255}else if(typeof document<"u"){const N=document.createElement("span");N.style.color=a,N.style.display="none",document.body.appendChild(N);const $=getComputedStyle(N).color;document.body.removeChild(N);const B=$.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);if(B)n=Number(B[1])/255,i=Number(B[2])/255,p=Number(B[3])/255;else return"#3a3a3a"}else return"#3a3a3a"}}return .2126*n+.7152*i+.0722*p>.5?"#3a3a3a":"#fafafa"},u=t=>{if(!t||typeof t!="string")return t;const a=t.trim(),n=a.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)),C=Math.max(0,Math.floor(Number(n[2])*.65)),b=Math.max(0,Math.floor(Number(n[3])*.65));return`rgb(${g}, ${C}, ${b})`}const i=a.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)),C=Math.max(0,Math.floor(Number(i[2])*.65)),b=Math.max(0,Math.floor(Number(i[3])*.65));return`rgba(${g}, ${C}, ${b}, ${i[4]})`}const p=a.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 C=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))),I=Math.max(0,Math.min(255,Math.floor(parseInt(g.slice(4,6),16)*.65)));return`#${[C,b,I].map(N=>N.toString(16).padStart(2,"0")).join("")}`}return a},m=(t,a)=>{const i=R.value?.stroke?.color;return i==null?u(a):typeof i=="string"?i:Array.isArray(i)&&i.length?i[t%i.length]??u(a):u(a)},v=t=>{let a=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;a+=Math.sqrt(i*i+p*p)}return a},y=e.computed(()=>Oe.value==="line"||In.value?(In.value?H.series.filter(a=>(a.type||Oe.value)==="line"):Xn.value).map((a,n)=>{const i=H.series.findIndex(B=>B===a),p=[];let g=[];a.data.forEach((B,ee)=>{B==null?g.length>0&&(p.push([...g]),g=[]):g.push({x:Gt.value?sl(B):Kt(ee),y:Gt.value?ml(ee):yn(a,B),index:ee})}),g.length>0&&p.push(g);let C="";p.forEach(B=>{if(B.length>0){let ee="";Qe.value?ee=Wl(B):ee=`M ${B[0].x} ${B[0].y}`+B.slice(1).map(Se=>` L ${Se.x} ${Se.y}`).join(""),C+=(C?" ":"")+ee}});const b=p.reduce((B,ee)=>B+v(ee),0),I=ot.value.has(i),N=re.value===i,$=re.value!==null&&re.value!==i;return{path:C,color:c(i),strokeDasharray:ro(a),pathLength:b,seriesIndex:i,animationDelay:n*Y.value,isHighlighted:N,isDimmed:$,isHidden:I}}):[]),M=e.computed(()=>{if(!(Oe.value==="line"||In.value))return[];const t=In.value?H.series.filter(n=>(n.type||Oe.value)==="line"):Xn.value,a=[];return t.forEach((n,i)=>{const p=H.series.findIndex(g=>g===n);for(let g=0;g<n.data.length-1;g++){const C=n.data[g];if(C!=null){let b=-1,I=0;for(let N=g+1;N<n.data.length;N++){const $=n.data[N];if($==null)I++;else{b=N;break}}if(I>0&&b!==-1){const N=n.data[b],$=Gt.value?sl(C):Kt(g),B=Gt.value?ml(g):yn(n,C),ee=Gt.value?sl(N):Kt(b),Se=Gt.value?ml(b):yn(n,N),Ze=ot.value.has(p),ie=re.value===p,ke=re.value!==null&&re.value!==p;a.push({path:`M ${$} ${B} L ${ee} ${Se}`,color:c(p),seriesIndex:p,animationDelay:i*Y.value,isHighlighted:ie,isDimmed:ke,isHidden:Ze,gapSize:I}),g=b-1}}}}),a}),D=e.computed(()=>Oe.value==="line"||In.value?!$t.value||hl.value||Ht.value.hasAnimated?[]:(In.value?H.series.filter(a=>(a.type||Oe.value)==="line"):Xn.value).map((a,n)=>{const i=H.series.findIndex(I=>I===a);let p="",g=null;a.data.forEach((I,N)=>{if(I!=null){const $={x:Gt.value?sl(I):Kt(N),y:Gt.value?ml(N):yn(a,I)};g===null?p+=`M ${$.x} ${$.y}`:p+=` L ${$.x} ${$.y}`,g=$}else if(g!==null){const $=a.data.findIndex((B,ee)=>ee>N&&B!==null&&B!==void 0);if($!==-1){const B={x:Gt.value?sl(a.data[$]):Kt($),y:Gt.value?ml($):yn(a,a.data[$])};p+=` L ${B.x} ${B.y}`,g=B}}});const C=a.data.map((I,N)=>I==null?null:{x:Gt.value?sl(I):Kt(N),y:Gt.value?ml(N):yn(a,I)}).filter(I=>I!==null),b=v(C);return{path:p,pathLength:b,color:c(i),strokeDasharray:ro(a),animationDelay:n*Y.value,seriesIndex:i}}):[]),E=e.computed(()=>{if(Oe.value!=="line")return[];const t=[];return Xn.value.forEach((a,n)=>{const i=re.value===n,p=re.value!==null&&re.value!==n,g=ot.value.has(n);a.data.forEach((C,b)=>{C!=null&&t.push({x:Kt(b),y:yn(a,C),color:c(n),value:C,label:H.categories[b]||b.toString(),seriesName:a.name,categoryIndex:b,dataIndex:b,animationDelay:(n*a.data.length+b)*(Y.value/8),isHighlighted:i,isDimmed:p,isHidden:g})})}),t}),oe=e.computed(()=>{if(!In.value)return[];const t=[];return H.series.filter(n=>(n.type||Oe.value)==="line").forEach((n,i)=>{const p=H.series.findIndex(I=>I===n),g=re.value===p,C=re.value!==null&&re.value!==p,b=ot.value.has(p);n.data.forEach((I,N)=>{I!=null&&t.push({x:Kt(N),y:yn(n,I),color:c(p),value:I,label:H.categories[N]||N.toString(),seriesName:n.name,categoryIndex:N,dataIndex:N,animationDelay:(i*n.data.length+N)*(Y.value/8),isHighlighted:g,isDimmed:C,isHidden:b})})}),t}),j=e.computed(()=>{if(!jt.value)return[];const t=[];return Xn.value.forEach((a,n)=>{if(!a?.data?.length)return;const i=re.value,p=i!==null&&i===n,g=i!==null&&i!==n,C=ot.value.has(n);a.data.forEach((b,I)=>{let N,$,B,ee,Se;if(typeof b=="object"&&b!==null&&!Array.isArray(b))N=typeof b.x=="number"?b.x:I,$=typeof b.y=="number"?b.y:0,B=typeof b.size=="number"?b.size:20,ee=b.label||H.categories?.[I]||`Point ${I+1}`,Se=b.image||b.imageUrl;else if(Array.isArray(b)&&b.length>=3)N=typeof b[0]=="number"?b[0]:I,$=typeof b[1]=="number"?b[1]:0,B=typeof b[2]=="number"?b[2]:20,ee=b[3]||H.categories?.[I]||`Point ${I+1}`,Se=b[4];else if(typeof b=="number")N=I,$=b,B=Eo(n,I),ee=H.categories?.[I]||`Point ${I+1}`;else return;!isFinite(N)||!isFinite($)||!isFinite(B)||t.push({x:Kt(N),y:hn($),radius:co(B),originalX:N,originalY:$,originalSize:B,color:c(n),seriesName:a.name||`Series ${n+1}`,label:ee,imageUrl:Se,seriesIndex:n,dataIndex:I,categoryIndex:Math.round(N),isHighlighted:p,isDimmed:g,isHidden:C,opacity:Ul.value})})}),t}),Re=e.computed(()=>Oe.value!=="area"?[]:Xn.value.map((t,a)=>{const n=[];let i=[];if(t.data.forEach((B,ee)=>{B==null?i.length>0&&(n.push([...i]),i=[]):i.push({x:Kt(ee),y:yn(t,B),index:ee})}),i.length>0&&n.push(i),n.length===0)return{linePath:"",areaPath:"",color:c(a),isHidden:ot.value.has(a)};const p=F.value.bottom+1;let g="",C="";n.forEach((B,ee)=>{if(B.length===0)return;let Se=`M ${B[0].x} ${B[0].y}`;Qe.value&&B.length>1?Se=Wl(B):B.slice(1).forEach(ie=>{Se+=` L ${ie.x} ${ie.y}`}),g+=(g?" ":"")+Se;let Ze=`M ${B[0].x} ${p}`;if(Ze+=` L ${B[0].x} ${B[0].y}`,Qe.value&&B.length>1){const ie=Wl(B),ke=ie.substring(ie.indexOf("C")||ie.indexOf("Q")||ie.indexOf("L"));ke?Ze+=" "+ke:B.slice(1).forEach(Ne=>{Ze+=` L ${Ne.x} ${Ne.y}`})}else B.slice(1).forEach(ie=>{Ze+=` L ${ie.x} ${ie.y}`});Ze+=` L ${B[B.length-1].x} ${p} Z`,C+=(C?" ":"")+Ze});const b=re.value===a,I=re.value!==null&&re.value!==a,N=ot.value.has(a),$=n.reduce((B,ee)=>B+v(ee),0);return{linePath:g,areaPath:C,color:c(a),pathLength:$,isHighlighted:b,isDimmed:I,isHidden:N}})),Ve=e.computed(()=>{if(!(["bar"].includes(Oe.value)||In.value))return[];const t=[],{maxX:a}=Zt.value,n=In.value?H.series.filter(p=>(p.type||Oe.value)==="bar"):Xn.value,i=n.length;if(Gt.value){const p=a+1,C=F.value.height/p,b=C*(2/3),I=Math.min(4,b/i*.15),N=b-(i-1)*I,$=Math.max(4,N/i);n.forEach((B,ee)=>{const Se=H.series.findIndex(Ne=>Ne===B),Ze=re.value===Se,ie=re.value!==null&&re.value!==Se,ke=ot.value.has(Se);B.data.forEach((Ne,pe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.top+(pe+.5)*C-b/2+ee*($+I),_e=F.value.left,De=Math.abs(sl(Ne)-F.value.left);let _t="";if(Qe.value&&De>0){const Rt=Math.min(Xt.value,$/2,De/2);_t=[`M ${_e} ${Le}`,`L ${_e+De-Rt} ${Le}`,`Q ${_e+De} ${Le} ${_e+De} ${Le+Rt}`,`L ${_e+De} ${Le+$-Rt}`,`Q ${_e+De} ${Le+$} ${_e+De-Rt} ${Le+$}`,`L ${_e} ${Le+$}`,"Z"].join(" ")}t.push({x:_e,y:Le,width:De,height:$,color:c(i===1?pe:Se),value:Ne,label:H.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(ee*n.length+pe)*(Y.value/4),isHighlighted:Ze,isDimmed:ie,isHidden:ke,barPath:_t,isSmooth:Qe.value&&De>0})})})}else{const p=a+1,C=F.value.width/p,b=C*.8,I=b/i,N=I*.05,$=I-N;n.forEach((B,ee)=>{const Se=H.series.findIndex(Ne=>Ne===B),Ze=re.value===Se,ie=re.value!==null&&re.value!==Se,ke=ot.value.has(Se);B.data.forEach((Ne,pe)=>{if(Ne==null||typeof Ne!="number"||!isFinite(Ne))return;const Le=F.value.left+(pe+.5)*C-b/2+ee*I+N/2,_e=hn(Math.max(0,Ne)),De=Math.abs(hn(0)-hn(Ne));let _t="";if(Qe.value&&De>0){const Rt=Math.min(Xt.value,$/2,De/2);_t=[`M ${Le} ${_e+De}`,`L ${Le} ${_e+Rt}`,`Q ${Le} ${_e} ${Le+Rt} ${_e}`,`L ${Le+$-Rt} ${_e}`,`Q ${Le+$} ${_e} ${Le+$} ${_e+Rt}`,`L ${Le+$} ${_e+De}`,"Z"].join(" ")}t.push({x:Le,y:_e,width:$,height:De,color:c(i===1?pe:Se),value:Ne,label:H.categories[pe]||pe.toString(),seriesName:B.name,animationDelay:(ee*n.length+pe)*(Y.value/4),isHighlighted:Ze,isDimmed:ie,isHidden:ke,barPath:_t,isSmooth:Qe.value&&De>0})})})}return t}),at=e.computed(()=>{if(!vn.value)return[];const t=Xn.value.map((C,b)=>({series:C,originalIndex:b})).filter(({originalIndex:C})=>!ot.value.has(C));if(t.length===0)return[];let a=Oe.value==="semi-radial"?Math.PI:-Math.PI/2;const n=Oe.value==="semi-radial"?Math.PI:Math.PI*2,i=[],p=(C,b,I,N,$,B)=>{const ee=C+(b-C)/2,Se=b-C,Ze=Dt.value+Math.cos(C)*Ot.value,ie=bt.value+Math.sin(C)*Ot.value,ke=Dt.value+Math.cos(b)*Ot.value,Ne=bt.value+Math.sin(b)*Ot.value,pe=Dt.value+Math.cos(b)*it.value,Ge=bt.value+Math.sin(b)*it.value,Ie=Dt.value+Math.cos(C)*it.value,Le=bt.value+Math.sin(C)*it.value,_e=Se>Math.PI?1:0,De=[`M ${Ze} ${ie}`,`A ${Ot.value} ${Ot.value} 0 ${_e} 1 ${ke} ${Ne}`,`L ${pe} ${Ge}`,`A ${it.value} ${it.value} 0 ${_e} 0 ${Ie} ${Le}`,"Z"].join(" "),_t=B||c(I);return{path:De,color:_t,strokeWidth:Z.value,strokeColor:m(i.length,_t),value:$,seriesName:N,opacity:.8,isHighlighted:re.value===I,isDimmed:re.value!==null&&re.value!==I,isHidden:!1,startAngle:C,endAngle:b,midAngle:ee}};if(Dl.value){const{series:C,originalIndex:b}=t[0],I=Number(C?.data?.[0]??0),N=Number.isFinite(I)?Math.min(Math.max(I,0),100):0,$=R.value,B=Math.min(Math.max(Number($?.miniRadial?.minVisiblePercent??1),0),100),Se=(N<=0?B:N)/100*n,Ze=Number($?.miniRadial?.thresholds?.low??33),ie=Number($?.miniRadial?.thresholds?.medium??66),ke=$?.miniRadial?.colors?.low||"#E53E3E",Ne=$?.miniRadial?.colors?.medium||"#ED8936",pe=$?.miniRadial?.colors?.high||"#38A169",Ge=N<=Ze?ke:N<=ie?Ne:pe,Ie=$?.miniRadial?.trackColor||"#E5E7EB",Le=C?.name||"Score";return i.push(p(a,a+n-.001,b+1,"Track",100,Ie)),i.push(p(a,a+Se,b,Le,N,Ge)),i}if(t.length===1){const{series:C,originalIndex:b}=t[0],I=C.data[0]||0,N=a,$=a+n-.001,B=N+n/2,ee=Dt.value+Math.cos(N)*Ot.value,Se=bt.value+Math.sin(N)*Ot.value,Ze=Dt.value+Math.cos($)*Ot.value,ie=bt.value+Math.sin($)*Ot.value,ke=Dt.value+Math.cos($)*it.value,Ne=bt.value+Math.sin($)*it.value,pe=Dt.value+Math.cos(N)*it.value,Ge=bt.value+Math.sin(N)*it.value,Ie=1,Le=[`M ${ee} ${Se}`,`A ${Ot.value} ${Ot.value} 0 ${Ie} 1 ${Ze} ${ie}`,`L ${ke} ${Ne}`,`A ${it.value} ${it.value} 0 ${Ie} 0 ${pe} ${Ge}`,"Z"].join(" "),_e=c(b);return i.push({path:Le,color:_e,strokeWidth:Z.value,strokeColor:m(0,_e),value:I,seriesName:C.name,opacity:.8,isHighlighted:re.value===b,isDimmed:!1,isHidden:!1,startAngle:N,endAngle:$,midAngle:B}),i}if(Jn.value&&t.length===2){const C=t[0],b=t[1],I=Math.min(100,Math.max(0,C.series.data[0]||0)),N=I/100*n;return i.push(p(a,a+N,C.originalIndex,C.series.name,I)),i.push(p(a,a+n,b.originalIndex,b.series.name,100)),i}const g=t.reduce((C,{series:b})=>C+(b.data[0]||0),0);return g===0?[]:(t.forEach(({series:C,originalIndex:b})=>{const I=C.data[0]||0,N=I/g*n,$=a,B=a+N,ee=$+N/2,Se=Dt.value+Math.cos($)*Ot.value,Ze=bt.value+Math.sin($)*Ot.value,ie=Dt.value+Math.cos(B)*Ot.value,ke=bt.value+Math.sin(B)*Ot.value,Ne=Dt.value+Math.cos(B)*it.value,pe=bt.value+Math.sin(B)*it.value,Ge=Dt.value+Math.cos($)*it.value,Ie=bt.value+Math.sin($)*it.value,Le=N>Math.PI?1:0,_e=[`M ${Se} ${Ze}`,`A ${Ot.value} ${Ot.value} 0 ${Le} 1 ${ie} ${ke}`,`L ${Ne} ${pe}`,`A ${it.value} ${it.value} 0 ${Le} 0 ${Ge} ${Ie}`,"Z"].join(" "),De=c(b);i.push({path:_e,color:De,strokeWidth:Z.value,strokeColor:m(i.length,De),value:I,seriesName:C.name,opacity:.8,isHighlighted:re.value===b,isDimmed:re.value!==null&&re.value!==b,isHidden:!1,startAngle:$,endAngle:B,midAngle:ee}),a=B}),i)}),gn=e.computed(()=>{const t=at.value;return Jn.value&&t.length>=2?[{segment:t[1],originalIndex:1},{segment:t[0],originalIndex:0}]:t.map((a,n)=>({segment:a,originalIndex:n}))}),un=e.computed(()=>{if(!yl.value||!vn.value)return[];const t=Bl.value,a=zl.value,n=Ml.value,i=Pl.value,p=15,g=t*1.3,C=.55,b=(B,ee)=>{const Se=Dt.value+Math.cos(B.midAngle)*it.value,Ze=bt.value+Math.sin(B.midAngle)*it.value,ie=Dt.value+Math.cos(B.midAngle)*(it.value+a),ke=bt.value+Math.sin(B.midAngle)*(it.value+a),pe=ie+n*(ee?1:-1),Ge=ee?ie+p:ie-p,Ie=ke-i,Le=`${B.seriesName}: ${se(B.value)}`,_e=Le.length*t*C;return{pointerStartX:Se,pointerStartY:Ze,pointerEndX:ie,pointerEndY:ke,horizontalEndX:pe,horizontalEndY:ke,textX:Ge,textY:Ie,text:Le,textWidth:_e,textAnchor:ee?"start":"end",isRightSide:ee,pointerLineLength:Math.hypot(ie-Se,ke-Ze),horizontalLineLength:Math.hypot(pe-ie,0)}},I=(B,ee)=>{const Se=Math.abs(B.textY-ee.textY)<g,Ze=B.isRightSide?B.textX:B.textX-B.textWidth,ie=B.isRightSide?B.textX+B.textWidth:B.textX,ke=ee.isRightSide?ee.textX:ee.textX-ee.textWidth,Ne=ee.isRightSide?ee.textX+ee.textWidth:ee.textX,pe=Ze<Ne&&ke<ie;return Se&&pe},N=at.value.filter(B=>!B.isHidden),$=[];for(let B=0;B<N.length;B++){const ee=N[B];let Se=Math.cos(ee.midAngle)>=0;if(B>0){const ie=$[B-1],ke=b(ee,Se);I(ie,ke)&&(Se=!Se)}const Ze=b(ee,Se);$.push({...Ze,color:ee.color,isHighlighted:ee.isHighlighted,isDimmed:ee.isDimmed})}return $}),nn=t=>{if(!t||t.isHidden)return 0;const a=t.opacity||Ul.value||.7;return re.value===null||re.value===void 0?a:re.value!==null?t.seriesIndex===re.value?Math.min(1,a+.1):Math.max(.5,a*.8):a},dn=t=>{if(!t||t.isHidden)return 0;const a=t.radius>20?.9:.8;return re.value!==null?t.seriesIndex===re.value?Math.min(1,a+.1):a*.7:a},rn=(t,a)=>{if(t)try{if(re.value===t.seriesIndex?re.value=null:re.value=t.seriesIndex,typeof window<"u"&&window.dispatchEvent){const n=new CustomEvent("dss-bubble-click",{detail:{bubble:t,originalEvent:a,chartId:H.chartId}});window.dispatchEvent(n)}}catch(n){console.error("Error in onBubbleClick:",n)}},cn=(t,a)=>{const n=[`dss-bubble-fallback-${a}`];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(" ")},zn=(t,a)=>{if(!t||(a.stopPropagation(),To.value=!0,re.value=t.seriesIndex,Ae.value.show=!1,!qe.value))return;const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120;p+C>Ce.value&&(p=a.clientX-i.left-C-10),g+b>i.height&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);const I=Nn.value,N=Bn.value,$=I.map(B=>{const ee=N[B]||B,Se=el(B,t);return Se?{seriesName:t.seriesName,label:t.label,value:`${ee}: ${Se}`,color:t.color}:null}).filter(Boolean);vt.value={show:!0,x:p,y:g,title:t.label||t.seriesName||"",value:"",bubbleData:$,categoryIndex:void 0,spiderAreas:[]}},el=(t,a)=>{let n;switch(t){case"x":n=a.originalX;break;case"y":n=a.originalY;break;case"size":n=a.originalSize;break;case"label":n=a.label;break;case"seriesName":n=a.seriesName;break;default:n=a[t]||""}const i=dl.value[t];if(typeof i=="function")return i(n,a);if(typeof n=="number"){const p=n.toFixed(1);return P.value?p+P.value:p}return n?.toString()||""},rl=()=>{if(!jt.value||!Ae.value.data||Ae.value.data.length===0)return"Bubbles";const t=[],a=new Set;return Ae.value.data.forEach(n=>{if(n.seriesName&&n.label){const i=`${n.seriesName} - ${n.label}`;a.has(i)||(t.push(i),a.add(i))}else n.seriesName&&(a.has(n.seriesName)||(t.push(n.seriesName),a.add(n.seriesName)))}),t.length>0?t.join(" | "):"Bubbles"},mo=(t,a)=>{t&&(To.value=!1,re.value=null,vt.value.show=!1,vt.value.bubbleData=[])},_o=(t,a)=>{const n=a.target.closest(".dss-custom-chart-container");if(!n)return;const i=n.getBoundingClientRect(),p=Ll(t.categoryIndex),g=t.description||t.comment||"";let C=a.clientX-i.left+15,b=a.clientY-i.top-10;const I=200,N=g?80:50;C+I>Ce.value&&(C=a.clientX-i.left-I-15),b+N>de.value&&(b=a.clientY-i.top-N-10),C<0&&(C=10),b<0&&(b=10),fn.value={show:!0,x:C,y:b,categoryValue:p,description:g}},Yo=()=>{fn.value.show=!1},gl=e.computed(()=>H.categories.length||Math.max(...Yn.value.map(t=>t.data.length))),ta=e.computed(()=>{let t=0;return Yn.value.forEach(a=>{a.data.forEach(n=>{typeof n=="number"&&(t=Math.max(t,n))})}),t||100}),po=e.computed(()=>{const t=[],a=gl.value;for(let n=0;n<a;n++){const i=n*2*Math.PI/a-Math.PI/2,p=Dt.value+Math.cos(i)*it.value,g=bt.value+Math.sin(i)*it.value;t.push({x:p,y:g,angle:i,index:n})}return t}),Yl=e.computed(()=>{const t=[],a=gl.value;return po.value.forEach((n,i)=>{const p=it.value+15,g=i*2*Math.PI/a-Math.PI/2,C=Dt.value+Math.cos(g)*p,b=bt.value+Math.sin(g)*p+5;let I="middle",N="middle";Math.abs(Math.cos(g))>.5&&(I=Math.cos(g)>0?"start":"end"),Math.abs(Math.sin(g))>.5&&(N=Math.sin(g)>0?"hanging":"auto"),t.push({x:C,y:b,text:H.categories[i]||`Axis ${i+1}`,anchor:I,baseline:N})}),t}),$o=e.ref(new Set),tl=(t,a,n)=>{const i=`current-${n}`,p=$o.value.has(i);return!p&&re.value===null?a.fillOpacity||ft.value:a.isHighlighted||p?(a.fillOpacity||ft.value)+.15:a.isDimmed?(a.fillOpacity||ft.value)*.3:a.fillOpacity||ft.value},jn=e.computed(()=>{if(!Sn.value)return[];const t=[],a=gl.value;return Xn.value.forEach((n,i)=>{const p=[],g=[],C=[],b=re.value===i,I=re.value!==null&&re.value!==i,N=ot.value.has(i);for(let $=0;$<a;$++){const B=n.data[$]||0,Se=B/ta.value*it.value,Ze=$*2*Math.PI/a-Math.PI/2,ie=Dt.value+Math.cos(Ze)*Se,ke=bt.value+Math.sin(Ze)*Se;p.push(`${ie},${ke}`),g.push({x:ie,y:ke}),C.push({x:ie,y:ke,value:B,label:H.categories[$]||`Axis ${$+1}`,seriesName:n.name})}t.push({points:p.join(" "),polygonPoints:g,dataPoints:C,color:c(i),fillOpacity:ft.value,seriesName:n.name,value:`${n.name}: ${n.data.join(", ")}`,isHighlighted:b,isDimmed:I,isHidden:N,seriesIndex:i})}),t}),Pn=(t,a)=>{if(!a||a.length<3)return!1;let n=!1;for(let i=0,p=a.length-1;i<a.length;p=i++){const g=a[i].x,C=a[i].y,b=a[p].x,I=a[p].y;C>t.y!=I>t.y&&t.x<(b-g)*(t.y-C)/(I-C)+g&&(n=!n)}return n},na=t=>{if(!Sn.value)return;const a=t.currentTarget.closest(".dss-custom-chart-container");if(!a)return;const n=a.getBoundingClientRect(),i=A.value?.getBoundingClientRect();if(!i)return;const p=t.clientX-i.left,g=t.clientY-i.top,C=jn.value.filter(b=>b.isHidden?!1:Pn({x:p,y:g},b.polygonPoints));if(C.length>0){C.length,re.value=C[0].seriesIndex;const b=t.clientX-n.left+10,I=t.clientY-n.top-10,N=C.length>1?460:260,$=70+gl.value*20;let B=b,ee=I;B+N>Ce.value&&(B=t.clientX-n.left-N-10),ee+$>de.value&&(ee=t.clientY-n.top-$-10),B<0&&(B=10),ee<0&&(ee=10);const Se=C.map(Ze=>({seriesName:Ze.seriesName,color:Ze.color,points:Ze.dataPoints.map(ie=>({label:ie.label,value:se(ie.value)}))}));vt.value={show:!0,x:B,y:ee,title:"",value:"",bubbleData:[],spiderAreas:Se}}else il()},Lo=e.computed(()=>{const t=R.value;return t.logos.map((a,n)=>{const i=H.series[a.seriesIndex];if(!i||!i.data||i.data.length===0||ot.value.has(a.seriesIndex))return null;let p,g;if(bn.value){let b=-1,I=null;for(let $=i.data.length-1;$>=0;$--)if(i.data[$]!==null&&i.data[$]!==void 0){b=$,I=i.data[$];break}if(b===-1||I===null)return null;const N=i.data.map(($,B)=>$==null?null:{x:Kt(B),y:yn(i,$),index:B}).filter($=>$!==null);if(t.animations.enabled&&!hl.value&&t.animations.type==="draw"&&t.chart.type==="line"&&(Ht.value.isAnimating||!Ht.value.hasAnimated))if(Ht.value.isAnimating){const $=Ht.value.currentFrame/Ht.value.totalFrames,B=Go(t.animations.easing,Math.min($,1)),ee=wa(N,B);p=ee.x+(a.offsetX||0),g=ee.y+(a.offsetY||0)}else p=N[0].x+(a.offsetX||0),g=N[0].y+(a.offsetY||0);else p=Kt(b)+(a.offsetX||0),g=hn(I)+(a.offsetY||0)}else if(vn.value||Sn.value){const b=Math.PI*2/t.logos.length*n;p=Dt.value+Math.cos(b)*(it.value+30)+(a.offsetX||0),g=bt.value+Math.sin(b)*(it.value+30)+(a.offsetY||0)}return{...a,x:p,y:g,seriesIndex:a.seriesIndex}}).filter(Boolean)}),fa=t=>{const a=document.querySelector(`.dss-logo-fallback-${t}`),n=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.opacity="0"),n&&(n.style.opacity="1")},va=t=>{console.warn(`Logo ${t} failed to load, keeping fallback circle`);const a=document.querySelector(`.dss-logo-image-${t}`);a&&(a.style.display="none")},jo=t=>{ot.value.has(t)?ot.value.delete(t):ot.value.add(t)},ga=e.computed(()=>{if(!vt.value.show&&!(et.value&&Ae.value.show&&!ae.value.isZooming))return{display:"none"};let t,a;if(et.value&&Ae.value.show&&!ae.value.isZooming){t=Ae.value.x+15,a=F.value.top;const n=jt.value?200:150;t+n>Ce.value&&(t=Ae.value.x-n-15),t<0&&(t=10),a<10&&(a=10)}else t=vt.value.x,a=vt.value.y;return{left:t+"px",top:a+"px"}}),Vl=(t,a)=>{if(!qe.value||fo.value)return;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+10,g=a.clientY-i.top-10;const C=200,b=120,I=Ce.value,N=de.value;p+C>I&&(p=a.clientX-i.left-C-10),g+b>N&&(g=a.clientY-i.top-b-10),p<0&&(p=10),g<0&&(g=10);let $;typeof t.categoryIndex=="number"?$=t.categoryIndex:typeof t.dataIndex=="number"?$=t.dataIndex:t.label&&H.categories.includes(t.label)&&($=H.categories.indexOf(t.label));const B=(Gt.value||Oe.value==="bar")&&t.label?t.label:t.seriesName||t.label||"";vt.value={show:!0,x:p,y:g,title:B,value:se(t.value)||"",categoryIndex:$,spiderAreas:[]}},Ko=e.ref(!1),To=e.ref(!1),il=()=>{vt.value.show=!1,vt.value.spiderAreas=[],vt.value.bubbleData=[],Ae.value.show=!1,Ko.value||(re.value=null)},fo=e.ref(!1),vo=(t,a)=>{fo.value=!0,vt.value.show=!1,Ae.value.show=!1;const i=a.target.closest(".dss-custom-chart-container").getBoundingClientRect();let p=a.clientX-i.left+15,g=a.clientY-i.top-10;const C=250;p+C>Ce.value&&(p=a.clientX-i.left-C-15),p<0&&(p=10),g<0&&(g=10),Cl.value={show:!0,x:p,y:g,content:t.texts,count:t.totalCount}},go=()=>{fo.value=!1,Cl.value.show=!1},Ht=e.ref({isAnimating:!1,currentFrame:0,totalFrames:0,animationId:null,hasAnimated:!1}),Go=(t,a)=>{switch(t){case"linear":return a;case"ease":return a<.5?2*a*a:-1+(4-2*a)*a;case"ease-in":return a*a;case"ease-out":return a*(2-a);case"ease-in-out":return a<.5?2*a*a:-1+(4-2*a)*a;default:return a}},hl=e.computed(()=>Pe.value?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1),la=()=>{if(!$t.value||hl.value){Ht.value.hasAnimated=!0,Un.value&&(vl.value=1);return}Un.value&&(vl.value=0),Ht.value.isAnimating=!0,Ht.value.currentFrame=0,Ht.value.totalFrames=Math.ceil(V.value/16.67);const t=()=>{const a=Ht.value.currentFrame/Ht.value.totalFrames,n=Go(S.value,Math.min(a,1));ha(n),Un.value&&(vl.value=n),a<1?(Ht.value.currentFrame++,Ht.value.animationId=requestAnimationFrame(t)):ya()};Ht.value.animationId=requestAnimationFrame(t)},ha=t=>{const a=z.value;a&&a.style.setProperty("--dss-animation-progress",t)},ya=()=>{Ht.value.isAnimating=!1,Ht.value.hasAnimated=!0,Un.value&&(vl.value=1),Ht.value.animationId&&(cancelAnimationFrame(Ht.value.animationId),Ht.value.animationId=null)},Qo=e.computed(()=>!vn.value||Ht.value.hasAnimated?!0:Un.value?vl.value>=1:Ln.value?wl.value>=1:!0),oa=e.computed(()=>yl.value&&Qo.value),Ao=e.ref(!1);e.watch(oa,t=>{t?(Ao.value=!1,e.nextTick(()=>{requestAnimationFrame(()=>{Ao.value=!0})})):Ao.value=!1},{immediate:!0});const ka=e.computed(()=>{if(!$t.value||hl.value||Ht.value.hasAnimated)return{};const t={};return t["--dss-animation-duration"]=`${V.value}ms`,t["--dss-animation-easing"]=Ca(S.value),t["--dss-stagger-delay"]=`${Y.value}ms`,t}),Ca=t=>({linear:"linear",ease:"ease","ease-in":"ease-in","ease-out":"ease-out","ease-in-out":"ease-in-out"})[t]||"ease-out",ba=()=>{if(!$t.value||hl.value)return"";const t=["dss-chart-animated"];return Ht.value.hasAnimated||t.push(`dss-animate-${Qt.value}`),Ht.value.hasAnimated||(vn.value&&Oe.value!=="semi-radial"?t.push("dss-animate-fill"):vn.value||t.push(`dss-animate-${Qt.value}`)),Ht.value.isAnimating&&t.push("dss-is-animating"),t.join(" ")};e.watch(()=>H.series,(t,a)=>{J.value&&a&&Ht.value.hasAnimated&&(Ht.value.hasAnimated=!1,e.nextTick(()=>{setTimeout(()=>la(),w.value)}))},{deep:!0}),e.watch(()=>ae.value.isZooming,(t,a)=>{a&&!t&&setTimeout(()=>{h()},50)}),e.watch(()=>[ae.value.scale,ae.value.offsetX],()=>{!ae.value.isZooming&&!ae.value.isDragging&&h()},{flush:"post"}),e.watch([Vt,Ye],([t,a])=>{ae.value.minScale=t,ae.value.maxScale=a,(ae.value.scale<t||ae.value.scale>a)&&oo()},{immediate:!0}),e.watch(()=>H.locale,t=>{t&&t!==L.value&&(L.value=t)},{immediate:!0}),e.watch(()=>Ct.value.show,t=>{t?e.nextTick(()=>{document.addEventListener("click",no)}):document.removeEventListener("click",no)}),e.onMounted(()=>{re.value=null,Un.value&&(!$t.value||hl.value)&&(vl.value=1),an(),z.value&&typeof ResizeObserver<"u"&&(f=new ResizeObserver(t=>{const a=t[0];!a||!a.contentRect||(xe&&cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{xe=null;const{width:n,height:i}=a.contentRect;je.value=Math.round(n),ge.value=Math.round(i),X.value&&(gt.value=X.value.offsetHeight||he)}))}),f.observe(z.value)),$t.value&&!hl.value?Oe.value==="semi-radial"?setTimeout(()=>Uo(),w.value):setTimeout(()=>la(),w.value):(Ht.value.hasAnimated=!0,Oe.value==="semi-radial"&&(wl.value=1)),document.addEventListener("mousemove",aa),document.addEventListener("mouseup",sa),document.addEventListener("click",Co)}),e.onUnmounted(()=>{xe&&cancelAnimationFrame(xe),f&&z.value&&(f.unobserve(z.value),f.disconnect(),f=null),Ht.value.animationId&&cancelAnimationFrame(Ht.value.animationId),Fl&&(cancelAnimationFrame(Fl),Fl=null),ae.value.zoomTimeout&&clearTimeout(ae.value.zoomTimeout),document.removeEventListener("mousemove",aa),document.removeEventListener("mouseup",sa),document.removeEventListener("click",Co),document.removeEventListener("click",no)});const aa=t=>{if(ae.value.isDragging&&ae.value.scale>1&&bn.value){Ae.value.show=!1;const a=t.clientX-ae.value.lastMouseX,{minX:n,maxX:i}=Zt.value,p=i-n||1,C=a*.8;ae.value.offsetX+=C;const b=p/ae.value.scale,I=p-b,N=0,$=-I/p*F.value.width,B=N;ae.value.offsetX=Math.max($,Math.min(B,ae.value.offsetX)),ae.value.lastMouseX=t.clientX,ae.value.lastMouseY=t.clientY}},sa=()=>{ae.value.isDragging&&(ae.value.isDragging=!1,setTimeout(()=>{!ae.value.isDragging&&ae.value.isZooming},100))},wa=(t,a)=>{const n=t.filter(b=>b!=null);if(!n||n.length===0)return{x:0,y:0};if(n.length===1||a<=0)return n[0];if(a>=1)return n[n.length-1];let i=0;const p=[];for(let b=1;b<n.length;b++){const I=n[b].x-n[b-1].x,N=n[b].y-n[b-1].y,$=Math.sqrt(I*I+N*N);p.push($),i+=$}const g=i*a;let C=0;for(let b=0;b<p.length;b++){const I=C+p[b];if(g<=I){const N=(g-C)/p[b],$=n[b],B=n[b+1];return{x:$.x+(B.x-$.x)*N,y:$.y+(B.y-$.y)*N}}C=I}return n[n.length-1]};return(t,a)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass(["dss-custom-chart-container",[ba(),{"dss-chart-fill-width":Ee.value,"dss-chart-fill-height":Be.value,"dss-chart-compact":vn.value&&!Q.value}]]),style:e.normalizeStyle({width:Ee.value?"100%":Ce.value+"px",height:ut.value,...Ee.value||Be.value?{overflow:vn.value?"visible":"hidden",maxWidth:"100%",maxHeight:"100%"}:{},...ka.value,cursor:Wo()}),"data-chart-type":Oe.value,ref_key:"containerEl",ref:z,onWheel:bo,onMousedown:lo,onMousemove:Zn,onMouseup:wo,onMouseleave:al,onDblclick:oo,onContextmenu:e.withModifiers($l,["prevent"]),onClick:e.withModifiers(Mn,["left"]),onWheelCapture:bo},[e.createElementVNode("div",{class:"dss-chart-header",ref_key:"headerEl",ref:X},[e.createElementVNode("div",vs,[st.value?(e.openBlock(),e.createElementBlock("div",gs,e.toDisplayString(st.value),1)):e.createCommentVNode("",!0),Et.value?(e.openBlock(),e.createElementBlock("div",hs,e.toDisplayString(Et.value),1)):e.createCommentVNode("",!0)]),Q.value&&ye.value==="top"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-top":ye.value==="top","dss-legend-bottom":ye.value==="bottom"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",ks,e.toDisplayString(n.name),1)],46,ys))),128))],2)):e.createCommentVNode("",!0),Q.value&&(ye.value==="left"||ye.value==="right")?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-chart-legend-side",{"dss-legend-left":ye.value==="left","dss-legend-right":ye.value==="right"}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",bs,e.toDisplayString(n.name),1)],46,Cs))),128))],2)):e.createCommentVNode("",!0)],512),T.showAddMarkerButton&&kt.value&&nt.value.addMarker&&(bn.value||jt.value)?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-add-marker-button",onClick:ko,title:e.unref(_)("chart.contextMenu.addMarker")},[e.createElementVNode("img",{src:Wn.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,xs),a[4]||(a[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,ws)):e.createCommentVNode("",!0),e.createElementVNode("div",Es,[jt.value&&Tt.value?(e.openBlock(),e.createElementBlock("div",Ss,"Bubble size: "+e.toDisplayString(Tt.value),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createElementBlock("svg",{width:Ce.value,height:de.value,class:"dss-chart-svg","data-smooth":Qe.value,"data-animated":$t.value,ref_key:"svgEl",ref:A},[e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:le.value},[e.createElementVNode("rect",{x:0,y:F.value.top,width:Ce.value,height:F.value.height*4},null,8,Bs)],8,Ns),Ln.value?(e.openBlock(),e.createElementBlock("clipPath",{key:0,id:Zl.value},[e.createElementVNode("path",{d:pl.value},null,8,_s)],8,Ms)):e.createCommentVNode("",!0),Un.value?(e.openBlock(),e.createElementBlock("clipPath",{key:1,id:xl.value},[e.createElementVNode("path",{d:Rl.value},null,8,Ls)],8,$s)):e.createCommentVNode("",!0)]),bn.value||jt.value?(e.openBlock(),e.createElementBlock("g",Ts,[It.value?(e.openBlock(),e.createElementBlock("g",{key:0,class:"dss-grid-lines","clip-path":fe.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Mo.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,Ds))),128))],8,As)):e.createCommentVNode("",!0),e.createElementVNode("g",Hs,[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,Rs),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,Fs),_n.value?(e.openBlock(),e.createElementBlock("line",{key:0,x1:F.value.right,x2:F.value.right,y1:F.value.top,y2:F.value.bottom,stroke:"#ccc","stroke-width":"1"},null,8,Is)):e.createCommentVNode("",!0)]),e.createElementVNode("g",zs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.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,Ps))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.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,Os))),128)),_n.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(r.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`y-secondary-${i}`,x:n.x,y:n.y,"text-anchor":"start","font-size":"12",fill:"#666","dominant-baseline":"middle",style:e.normalizeStyle({animationDelay:`${i*80}ms`})},e.toDisplayString(n.text),13,qs))),128)):e.createCommentVNode("",!0),qt.value?(e.openBlock(),e.createElementBlock("text",{key:1,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(qt.value),9,Ws)):e.createCommentVNode("",!0),Ft.value?(e.openBlock(),e.createElementBlock("text",{key:2,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(Ft.value),9,Zs)):e.createCommentVNode("",!0),_n.value&&me.value?(e.openBlock(),e.createElementBlock("text",{key:3,x:Ce.value-15,y:F.value.top+12+F.value.height/2,"text-anchor":"middle","font-size":"14","font-weight":"bold",fill:"#333",transform:`rotate(90, ${Ce.value-15}, ${F.value.top+F.value.height/2})`},e.toDisplayString(me.value),9,Us)):e.createCommentVNode("",!0)]),ul.value.length>0?(e.openBlock(),e.createElementBlock("g",Xs,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ul.value,n=>(e.openBlock(),e.createElementBlock("g",{key:`flag-group-${n.categoryIndex}`},[e.createElementVNode("g",{"clip-path":fe.value},[n.hasManual?(e.openBlock(),e.createElementBlock("line",{key:0,x1:n.x,x2:n.x,y1:F.value.bottom,y2:F.value.top,stroke:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,js)):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:"#a1d499","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Ks)):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:"#698dbe","stroke-width":"2","stroke-dasharray":"8",opacity:"0.9",class:"dss-flag-line",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Gs)):e.createCommentVNode("",!0)],8,Ys),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:"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"flag-count-circle",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Qs)):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?"#698dbe":"#a1d499",stroke:"#fafafa","stroke-width":"2",class:"dss-flag-count-indicator",onMouseover:i=>vo(n,i),onMouseleave:go},null,40,Js),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,er)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-chart-data","clip-path":fe.value},[In.value?(e.openBlock(),e.createElementBlock("g",nr,[e.createElementVNode("g",{class:e.normalizeClass(["dss-bar-chart",{"dss-horizontal-bars":Gt.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ve.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=>Vl(n,p),onMouseleave:il},null,46,lr)):(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=>Vl(n,p),onMouseleave:il},null,46,or))],64))),128))],2),e.createElementVNode("g",ar,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,"stroke-dasharray":n.strokeDasharray,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,sr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`mixed-gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.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,rr))),128)),K.value>0||ve.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(oe.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`mixed-point-${i}`,cx:n.x,cy:n.y,r:Ke(n.isHighlighted?We(n,K.value)+2:We(n,K.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=>Vl(n,p),onMouseleave:il},null,46,ir))),128)):e.createCommentVNode("",!0)])])):Oe.value==="line"?(e.openBlock(),e.createElementBlock("g",cr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(D.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`anim-${i}`,d:n.path,stroke:n.color,"stroke-width":W.value,"stroke-dasharray":n.strokeDasharray,fill:"none","stroke-linecap":"round","stroke-linejoin":"round",class:e.normalizeClass(["dss-line-animation-overlay",{"dss-animation-complete":Ht.value.hasAnimated}]),style:e.normalizeStyle({"--dss-path-length":n.pathLength,animationDelay:`${n.animationDelay}ms`})},null,14,ur))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`line-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.value,"stroke-dasharray":n.strokeDasharray,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,dr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`gap-connector-${i}`,d:n.path,stroke:n.color,"stroke-width":n.isHighlighted?W.value+2:W.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,mr))),128)),K.value>0||ve.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(E.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`point-${i}`,cx:n.x,cy:n.y,r:Ke(n.isHighlighted?We(n,K.value)+2:We(n,K.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=>Vl(n,p),onMouseleave:il},null,46,pr))),128)):e.createCommentVNode("",!0)])):Oe.value==="area"?(e.openBlock(),e.createElementBlock("g",fr,[e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("mask",{key:`mask-${i}`,id:`area-mask-${i}-${T.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,gr)],8,vr))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-fill-${i}`,d:n.areaPath,fill:n.color,"fill-opacity":n.isHighlighted?Nt.value+.2:Nt.value,mask:`url(#area-mask-${i}-${T.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,hr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Re.value,(n,i)=>(e.openBlock(),e.createElementBlock("path",{key:`area-line-${i}`,d:n.linePath,stroke:n.color,"stroke-width":n.isHighlighted?W.value+1:W.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*Y.value}ms`})},null,14,yr))),128))])):Oe.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(Ve.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=>Vl(n,p),onMouseleave:il},null,46,kr)):(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=>Vl(n,p),onMouseleave:il},null,46,Cr))],64))),128))],2)):e.createCommentVNode("",!0)],8,tr),et.value&&Ae.value.show&&!ae.value.isZooming?(e.openBlock(),e.createElementBlock("g",{key:2,class:"dss-crosshair","clip-path":fe.value},[e.createElementVNode("line",{x1:Ae.value.x,x2:Ae.value.x,y1:F.value.top,y2:F.value.bottom,stroke:St.value,"stroke-width":"1","stroke-dasharray":"4,4",opacity:"0.8"},null,8,wr),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.value.data,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`dss-crosshair-point-${i}`,cx:Ae.value.x,cy:n.y,r:Ke(K.value+2),fill:n.color,stroke:"none",opacity:"0.9"},null,8,xr))),128))],8,br)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),jt.value?(e.openBlock(),e.createElementBlock("g",Er,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(j.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:`bubble-${i}`},[n?(e.openBlock(),e.createElementBlock("g",Sr,[e.createElementVNode("circle",{cx:n.x,cy:n.y,r:Ke(n.radius),fill:n.color,"fill-opacity":nn(n),stroke:n.color,"stroke-width":"1","stroke-opacity":"0.8",class:e.normalizeClass(cn(n,i)),style:{cursor:"pointer",transition:"all 0.3s ease"},onMouseenter:p=>zn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,42,Vr),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:dn(n)}),onLoad:p=>So(i),onError:p=>so(i),onMouseenter:p=>zn(n,p),onMouseleave:p=>mo(n),onClick:p=>rn(n,p)},null,46,Nr)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0),vn.value?(e.openBlock(),e.createElementBlock("g",{key:2,class:"radial-chart",transform:en.value},[Oe.value==="radial"?(e.openBlock(),e.createElementBlock("circle",{key:0,cx:Dt.value,cy:bt.value,r:it.value,fill:"none",stroke:"#e0e0e0","stroke-width":"1"},null,8,Mr)):e.createCommentVNode("",!0),e.createElementVNode("g",{class:"dss-radial-data","data-chart-type":Oe.value,"clip-path":xo.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gn.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":Zo(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=>Vl(n.segment,p),onMouseleave:il},null,42,$r))),128))],8,_r),Vn.value&&Qo.value?(e.openBlock(),e.createElementBlock("g",Lr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ol.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,Tr)),[[e.vShow,n.show]])),128))])):e.createCommentVNode("",!0),ll.value&&(Qo.value||Ln.value||Dl.value)?(e.openBlock(),e.createElementBlock("text",{key:2,x:xn.value.x,y:xn.value.y,"text-anchor":"middle","dominant-baseline":"middle","font-size":$n.value,fill:kl.value,class:"dss-radial-data-center"},e.toDisplayString(pn.value),9,Ar)):e.createCommentVNode("",!0),oa.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:e.normalizeClass(["dss-radial-labels dss-radial-labels-initial",{"dss-radial-labels-animated":Ao.value}])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(un.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,Dr),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,Hr),e.createElementVNode("text",{class:"dss-radial-label-text",x:n.textX,y:n.textY,"text-anchor":n.textAnchor,"font-size":Bl.value,"dominant-baseline":"middle"},e.toDisplayString(n.text),9,Rr)],6))),128))],2)):e.createCommentVNode("",!0)],8,Br)):e.createCommentVNode("",!0),Sn.value?(e.openBlock(),e.createElementBlock("g",{key:3,class:"dss-spider-chart",transform:en.value},[It.value?(e.openBlock(),e.createElementBlock("g",Ir,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`spider-grid-circle-${i}`,cx:Dt.value,cy:bt.value,r:Ke(n),fill:"none",stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*150}ms`})},null,12,zr))),128)),e.createElementVNode("g",Pr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(we.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-grid-label-group-${i}`},[e.createElementVNode("rect",{x:Dt.value-16,y:bt.value-n-7,width:"32",height:"16",fill:"transparent",stroke:"none"},null,8,Or),e.createElementVNode("text",{x:Dt.value,y:bt.value-n+2,"text-anchor":"middle","dominant-baseline":"central",class:"dss-spider-grid-label",style:{fontSize:"10px",fill:"#999",fontWeight:"600"}},e.toDisplayString(Bt(i)),9,qr)]))),128))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(po.value,(n,i)=>(e.openBlock(),e.createElementBlock("line",{key:`spider-axis-${i}`,x1:Dt.value,x2:n.x,y1:bt.value,y2:n.y,stroke:"#dedede","stroke-width":"1",style:e.normalizeStyle({animationDelay:`${i*100}ms`})},null,12,Wr))),128))])):e.createCommentVNode("",!0),e.createElementVNode("g",Zr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Yl.value,(n,i)=>(e.openBlock(),e.createElementBlock("text",{key:`spider-label-${i}`,x:n.x+Math.cos(i*2*Math.PI/gl.value-Math.PI/2)*16,y:n.y+Math.sin(i*2*Math.PI/gl.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,Ur))),128))]),e.createElementVNode("g",{class:"dss-spider-data",onMousemove:na,onMouseleave:il},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(jn.value,(n,i)=>(e.openBlock(),e.createElementBlock("g",{key:`spider-${i}`},[e.createElementVNode("polygon",{points:n.points,fill:n.color,"fill-opacity":tl("current",n,i),stroke:n.color,"stroke-width":n.isHighlighted?W.value+1:W.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*Y.value}ms`,transition:"all 0.2s ease"})},null,14,Xr),(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:Ke(n.isHighlighted?K.value+1:K.value>0?K.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*Y.value+g*50}ms`,transition:"all 0.2s ease"}),onMouseover:C=>Vl(p,C),onMouseleave:il},null,46,Yr))),128))]))),128))],32)],8,Fr)):e.createCommentVNode("",!0),e.createElementVNode("g",jr,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.value,(n,i)=>(e.openBlock(),e.createElementBlock("circle",{key:`logo-fallback-${i}`,cx:n.x,cy:n.y,r:Ke(n.width/2),fill:c(n.seriesIndex),stroke:"#fafafa","stroke-width":"2",class:e.normalizeClass(`logo-fallback-${i}`),style:e.normalizeStyle({animationDelay:`${i*200}ms`})},null,14,Kr))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Lo.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=>fa(i),onError:p=>va(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,Gr))),128))])],8,Vs))]),Je.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-watermark",style:e.normalizeStyle({position:"absolute",top:"0px",left:"0px",width:Ce.value+"px",height:de.value+"px",backgroundImage:`url('${nl.value}')`,backgroundRepeat:"no-repeat",...Dn.value,opacity:xt.value,pointerEvents:"none",zIndex:10})},null,4)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.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:U.value+"px",height:U.value+"px",backgroundColor:"#fafafa",borderRadius:"50%",border:"2px solid #ddd",cursor:"pointer",zIndex:500}),onClick:e.withModifiers(p=>Mt(n),["stop"]),onMouseenter:p=>_o(n,p),onMouseleave:Yo},[e.createElementVNode("img",{src:Rn(n),class:"dss-marker-icon",alt:"Marker Icon",style:{width:"100%",height:"100%","object-fit":"contain","border-radius":"50%","pointer-events":"none"}},null,8,Jr)],44,Qr)),[[e.vShow,Fe.value]])),128)),fn.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-tooltip",style:e.normalizeStyle({left:fn.value.x+"px",top:fn.value.y+"px"})},[e.createElementVNode("div",ei,e.toDisplayString(fn.value.categoryValue),1),fn.value.description?(e.openBlock(),e.createElementBlock("div",ti,e.toDisplayString(fn.value.description),1)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),qe.value&&(vt.value.show||et.value&&Ae.value.show&&!ae.value.isZooming)?(e.openBlock(),e.createElementBlock("div",{key:3,class:e.normalizeClass(["dss-chart-tooltip",{"dss-crosshair-tooltip":et.value&&Ae.value.show&&!ae.value.isZooming,"dss-spider-tooltip":Sn.value&&vt.value.spiderAreas&&vt.value.spiderAreas.length>0}]),style:e.normalizeStyle(ga.value)},[!et.value||!Ae.value.show||ae.value.isZooming?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[Sn.value&&vt.value.spiderAreas&&vt.value.spiderAreas.length>0?(e.openBlock(),e.createElementBlock("div",ni,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value.spiderAreas,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-area-${i}`,class:"dss-spider-tooltip-area"},[e.createElementVNode("div",li,[e.createElementVNode("span",{class:"dss-spider-tooltip-area-indicator",style:e.normalizeStyle({backgroundColor:n.color})},null,4),e.createTextVNode(" "+e.toDisplayString(n.seriesName),1)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.points,(p,g)=>(e.openBlock(),e.createElementBlock("div",{key:`spider-tooltip-point-${i}-${g}`,class:"dss-tooltip-series"},[e.createElementVNode("span",oi,e.toDisplayString(p.label),1),e.createElementVNode("span",ai,e.toDisplayString(p.value),1)]))),128))]))),128))])):jt.value&&vt.value.bubbleData&&vt.value.bubbleData.length>0?(e.openBlock(),e.createElementBlock("div",si,[vt.value.title?(e.openBlock(),e.createElementBlock("div",ri,e.toDisplayString(vt.value.title),1)):e.createCommentVNode("",!0),e.createElementVNode("div",ii,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.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",ci,[e.createElementVNode("div",ui,e.toDisplayString(vt.value.title),1),e.createElementVNode("div",di,e.toDisplayString(vt.value.value),1)])),vt.value.categoryIndex!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[Hn(vt.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",mi,[a[5]||(a[5]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",pi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(vt.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`tooltip-flag-group-${i}`},[e.createElementVNode("div",fi,[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",vi,[e.createElementVNode("div",gi,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(vt.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",hi,[a[6]||(a[6]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",yi,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(vt.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",ki,[e.createElementVNode("div",Ci,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",bi,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",wi,[e.createElementVNode("div",xi,e.toDisplayString(jt.value?rl():T.categories[Ae.value.categoryIndex]||`Category ${Ae.value.categoryIndex+1}`),1),jt.value?(e.openBlock(),e.createElementBlock("div",Ei,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ae.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(Ae.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",Si,e.toDisplayString(n.seriesName)+":",1),e.createElementVNode("span",Vi,e.toDisplayString(se(n.value)),1)]))),128))]),Hn(Ae.value.categoryIndex).flagGroups.length>0?(e.openBlock(),e.createElementBlock("div",Ni,[a[7]||(a[7]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Bi,e.toDisplayString(e.unref(_)("chart.tooltip.flags")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Ae.value.categoryIndex).flagGroups,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`crosshair-flag-group-${i}`},[e.createElementVNode("div",Mi,[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",_i,[e.createElementVNode("div",$i,e.toDisplayString(p.text),1)])]))),128))]))),128))])):e.createCommentVNode("",!0),Hn(Ae.value.categoryIndex).markers.length>0?(e.openBlock(),e.createElementBlock("div",Li,[a[8]||(a[8]=e.createElementVNode("div",{class:"dss-tooltip-separator"},null,-1)),e.createElementVNode("div",Ti,e.toDisplayString(e.unref(_)("chart.tooltip.markers")),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Hn(Ae.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",Di,e.toDisplayString(n.title),1),n.description?(e.openBlock(),e.createElementBlock("div",Hi,e.toDisplayString(n.description),1)):e.createCommentVNode("",!0)])]))),128))])):e.createCommentVNode("",!0)],64))],6)):e.createCommentVNode("",!0),bn.value&&Xe.value&&ae.value.scale>1?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-zoom-indicator",onClick:oo},[a[9]||(a[9]=e.createElementVNode("span",{style:{display:"inline-block",transform:"scaleX(-1)","font-size":"14px"}},"⌕",-1)),e.createTextVNode(" "+e.toDisplayString(Math.round(ae.value.scale*100))+"% "+e.toDisplayString(e.unref(_)("chart.zoom.doubleClickToReset")),1)])):e.createCommentVNode("",!0)],46,fs),Q.value&&ye.value==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-chart-legend",{"dss-legend-horizontal":Me.value==="horizontal","dss-legend-vertical":Me.value==="vertical","dss-legend-bottom":!0}]),style:{display:"flex","flex-wrap":"wrap","justify-content":"center",padding:"6px 8px 0"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(H.series,(n,i)=>(e.openBlock(),e.createElementBlock("div",{key:`legend-bottom-${i}`,class:e.normalizeClass(["dss-legend-item",{"dss-legend-hidden":ot.value.has(i),"dss-legend-hovered":re.value===i,"dss-legend-dimmed":re.value!==null&&re.value!==i}]),onClick:p=>jo(i),onMouseenter:p=>Kn(i),onMouseleave:on,style:e.normalizeStyle({animationDelay:`${i*100}ms`})},[e.createElementVNode("div",{class:"dss-legend-color",style:e.normalizeStyle({backgroundColor:c(i)})},null,4),e.createElementVNode("span",Fi,e.toDisplayString(n.name),1)],46,Ri))),128))],2)):e.createCommentVNode("",!0),Ct.value.show?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-chart-context-menu",style:e.normalizeStyle({left:Ct.value.x+"px",top:Ct.value.y+"px"}),onClick:a[0]||(a[0]=e.withModifiers(()=>{},["stop"]))},[nt.value.addMarker?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-context-menu-item",onClick:qo},e.toDisplayString(e.unref(_)("chart.contextMenu.addMarker")),1)):e.createCommentVNode("",!0),nt.value.addMarker&&(nt.value.downloadSvg||nt.value.downloadPng||nt.value.downloadCsv||dt.value.length>0)?(e.openBlock(),e.createElementBlock("div",Ii)):e.createCommentVNode("",!0),nt.value.downloadSvg?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-context-menu-item",onClick:Po},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadSvg")),1)):e.createCommentVNode("",!0),nt.value.downloadPng?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-context-menu-item",onClick:ho},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadPng")),1)):e.createCommentVNode("",!0),nt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",{key:4,class:"dss-context-menu-item",onClick:yo},e.toDisplayString(e.unref(_)("chart.contextMenu.downloadCsv")),1)):e.createCommentVNode("",!0),dt.value.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[nt.value.downloadSvg||nt.value.downloadPng||nt.value.downloadCsv?(e.openBlock(),e.createElementBlock("div",zi)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(dt.value,(n,i)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:"custom-"+i},[n.separator?(e.openBlock(),e.createElementBlock("div",Pi)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(ql(n)),style:e.normalizeStyle(Gn(n)),onClick:p=>Oo(n)},[n.template?(e.openBlock(),e.createElementBlock("div",{key:0,innerHTML:Cn(n),class:"dss-custom-menu-content"},null,8,qi)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.icon?(e.openBlock(),e.createElementBlock("span",Wi,e.toDisplayString(n.icon),1)):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(n.label),1)],64))],14,Oi)],64))),128))],64)):e.createCommentVNode("",!0)],4)):e.createCommentVNode("",!0),$e.value.show?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-marker-modal-overlay",onClick:q},[e.createElementVNode("div",{class:"dss-marker-modal",onClick:a[3]||(a[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",Zi,[e.createElementVNode("h3",null,e.toDisplayString(Jt.value?e.unref(_)("chart.modalMarker.viewMarker"):kn.value?e.unref(_)("chart.modalMarker.editMarker"):e.unref(_)("chart.contextMenu.addMarker")),1),e.createElementVNode("button",{class:"dss-modal-close-btn",onClick:q},"×")]),e.createElementVNode("div",Ui,[e.createElementVNode("div",Xi,[e.createVNode(ea,{id:"dss-marker-date",mode:"single",modelValue:$e.value.date,"onUpdate:modelValue":a[1]||(a[1]=n=>$e.value.date=n),"min-date":bl.value,"max-date":_l.value,disabled:Jt.value},null,8,["modelValue","min-date","max-date","disabled"])]),e.createElementVNode("div",Yi,[e.createElementVNode("label",ji,e.toDisplayString(e.unref(_)("chart.modalMarker.description")),1),Jt.value?(e.openBlock(),e.createElementBlock("div",Ki,e.toDisplayString($e.value.description),1)):e.withDirectives((e.openBlock(),e.createElementBlock("textarea",{key:1,id:"dss-marker-description","onUpdate:modelValue":a[2]||(a[2]=n=>$e.value.description=n),placeholder:e.unref(_)("chart.modalMarker.placeholderDescription"),class:"dss-form-textarea",rows:"5"},null,8,Gi)),[[e.vModelText,$e.value.description]])])]),e.createElementVNode("div",Qi,[e.createElementVNode("div",Ji,[kn.value&&!Jt.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-danger",onClick:ue},e.toDisplayString(e.unref(_)("chart.modalMarker.deleteMarker")),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",ec,[e.createElementVNode("button",{class:"dss-btn dss-btn-secondary",onClick:q},e.toDisplayString(Jt.value?e.unref(_)("chart.modalMarker.close"):e.unref(_)("chart.modalMarker.cancel")),1),Jt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-btn dss-btn-primary",onClick:x,disabled:!($e.value.description&&$e.value.description.length)},e.toDisplayString(kn.value?e.unref(_)("chart.modalMarker.save"):e.unref(_)("chart.contextMenu.addMarker")),9,tc))])])])])):e.createCommentVNode("",!0)],64))}}),oc={class:"dss-modal-title"},ac={class:"dss-modal-actions"},Jo={__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(T,{emit:te}){const _=T,L=te,ce=e.ref(null),z=e.ref(null),A=e.computed(()=>{const le={"max-width":_.width};return _.height!=="auto"&&(le.height=_.height,le["min-height"]="0"),le}),X=e.computed(()=>({}));function je(){L("close-modal")}function ge(){_.backDrop&&!ce.value&&L("close-modal")}function f(le){le.target.tagName==="INPUT"&&(ce.value=le.target.tagName)}function xe(){setTimeout(()=>{ce.value=null},300)}function he(){const le=document.body,fe=document.documentElement;z.value={bodyOverflow:le.style.overflow,bodyPosition:le.style.position,bodyTop:le.style.top,bodyWidth:le.style.width,htmlOverflow:fe.style.overflow,scrollY:window.scrollY},le.style.overflow="hidden",le.style.position="fixed",le.style.top=`-${z.value.scrollY}px`,le.style.width="100%",le.style.left="0",fe.style.overflow="hidden"}function ne(){if(!z.value)return;const le=document.body,fe=document.documentElement,{bodyOverflow:H,bodyPosition:be,bodyTop:Te,bodyWidth:ze,htmlOverflow:rt,scrollY:R}=z.value;le.style.overflow=H||"",le.style.position=be||"",le.style.top=Te||"",le.style.width=ze||"",le.style.left="",fe.style.overflow=rt||"",window.scrollTo(0,R||0)}return e.watch(()=>_.showModal,le=>{if(le)he(),document.body.classList.add("dss-modal-open"),setTimeout(()=>{const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.addEventListener("focusin",f),fe.addEventListener("focusout",xe))},100);else{ne(),document.body.classList.remove("dss-modal-open");const fe=document.getElementById("dss-modal-backdrop");fe&&(fe.removeEventListener("focusin",f),fe.removeEventListener("focusout",xe))}},{immediate:!0}),e.onUnmounted(()=>{_.showModal&&ne()}),(le,fe)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.showModal?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-modal-backdrop",onClick:ge},[e.withDirectives(e.createElementVNode("div",{id:"dss-modal-backdrop",class:"dss-modal",style:e.normalizeStyle(A.value)},[e.createElementVNode("div",{class:"dss-modal-content",onClick:fe[0]||(fe[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-modal-header",style:e.normalizeStyle({"justify-content":T.headerType,"font-size":T.titleSize})},[e.createElementVNode("h1",oc,[e.renderSlot(le.$slots,"title",{},()=>[fe[1]||(fe[1]=e.createTextVNode("Default Title",-1))])]),e.renderSlot(le.$slots,"title-data"),T.showCloseBtn?(e.openBlock(),e.createElementBlock("span",{key:0,class:"dss-modal-close",onClick:je,title:"Close"},"×")):e.createCommentVNode("",!0)],4),e.createElementVNode("div",{class:"dss-modal-body",style:e.normalizeStyle(X.value)},[e.renderSlot(le.$slots,"content",{},()=>[fe[2]||(fe[2]=e.createTextVNode("Default Content",-1))])],4),e.createElementVNode("div",ac,[e.renderSlot(le.$slots,"actions")])])],4),[[e.vShow,T.showModal]])])):e.createCommentVNode("",!0)]))}},sc={key:0,class:"dss-table-toolbar"},rc={class:"dss-table-toolbar-left"},ic=["aria-expanded"],cc={class:"dss-pagination-select-dropdown",role:"listbox"},uc={class:"dss-table-column-visibility-label"},dc={class:"dss-table-checkbox-wrapper"},mc=["checked","onChange"],pc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},fc={class:"dss-table-column-visibility-text"},vc={class:"dss-table-toolbar-right"},gc=["placeholder","aria-label"],hc=["aria-label"],yc=["aria-label","aria-expanded"],kc={key:1,class:"dss-table-toolbar-extra"},Cc={class:"dss-table-thead"},bc={key:0,class:"dss-table-th dss-table-selection-column"},wc={key:0,class:"dss-table-checkbox-wrapper"},xc=["checked","indeterminate"],Ec={key:0,class:"dss-table-checkbox__indeterminate"},Sc={key:1,class:"dss-table-checkbox__check","aria-hidden":"true"},Vc=["aria-label"],Nc=["onClick"],Bc={class:"dss-table-th-content"},Mc={class:"dss-table-th-text"},_c={key:0},$c={key:1},Lc={key:2},Tc=["data-filter-column-key","aria-expanded","aria-label","onClick"],Ac={class:"dss-table-tbody"},Dc=["onClick"],Hc={class:"dss-table-checkbox-wrapper"},Rc=["type","name","checked","disabled","onChange"],Fc={key:0,class:"dss-table-checkbox__check","aria-hidden":"true"},Ic={key:1,class:"dss-table-checkbox__dot"},zc=["onClick"],Pc=["aria-expanded","aria-label"],Oc={key:1,class:"dss-table-expansion-placeholder","aria-hidden":"true"},qc={key:0,class:"dss-table-expansion-row"},Wc=["colspan"],Zc=["colspan"],Uc={key:1,class:"dss-table-pagination"},Xc={class:"dss-table-pagination-left"},Yc={key:0},jc={key:1,class:"dss-table-pagination-placeholder","aria-hidden":"true"},Kc={class:"dss-table-pagination-center"},Gc={key:0,class:"dss-pagination-controls"},Qc=["disabled","title"],Jc=["disabled","title"],eu=["aria-label","onKeydown"],tu={class:"dss-pagination-of"},nu=["disabled","title"],lu=["disabled","title"],ou={class:"dss-table-pagination-right"},au={class:"dss-pagination-rows-label"},su=["aria-expanded"],ru=["aria-selected","onClick"],iu={key:0,class:"dss-table-filter-row"},cu=["value","placeholder"],uu=["min","max","value"],du=["min","max","value"],mu={class:"dss-table-filter-double-range-values"},pu={key:2,class:"dss-table-filter-daterange"},fu={class:"dss-table-filter-daterange-row"},vu={class:"dss-table-filter-daterange-label"},gu=["value"],hu={class:"dss-table-filter-daterange-row"},yu={class:"dss-table-filter-daterange-label"},ku=["value"],Cu=["value","placeholder"],bu={class:"dss-table-filter-list"},wu=["checked","onChange"],xu={class:"dss-table-filter-actions"},Eu={name:"DSSTable"},Su=Object.assign(Eu,{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:T=>typeof T=="object"&&T!==null}},emits:["row-click","row-select","row-unselect","select-all","unselect-all","row-expand","row-collapse","sort","page","download-pdf","download-excel","search"],setup(T,{emit:te}){const{t:_,locale:L}=Gl.useI18n(),ce=T,z=te,A={table:{width:"auto",height:null,rowHeight:"auto",truncated:!1,expandable:!1,expandableRowData:null,expandableRowCondition:null,striped:!1,bordered:!1,hoverable:!0,size:"default",align:"left"},title:{text:""},subtitle:{text:""},selection:{enabled:!1,mode:"single",rowCondition:null},sorting:{enabled:!0,mode:"single"},pagination:{enabled:!1,rows:10,rowsPerPageOptions:[5,10,25,50,100],showCounter:!0,showControlsGroup:!0,showControls:!0,showRowsPerPage:!0},toolbar:{downloads:{pdf:!0,excel:!0},columnVisibility:!0,search:!0},scrollable:!1,emptyMessage:null};function X(k,h){const x=Object.assign({},k);return je(k)&&je(h)&&Object.keys(h).forEach(q=>{je(h[q])?q in k?x[q]=X(k[q],h[q]):Object.assign(x,{[q]:h[q]}):Object.assign(x,{[q]:h[q]})}),x}function je(k){return k&&typeof k=="object"&&!Array.isArray(k)}const ge=e.computed(()=>X(A,ce.options)),f=e.computed(()=>{const k=ge.value.table.width;return k==="auto"?null:typeof k=="number"?k:null}),xe=e.computed(()=>ge.value.table.height),he=e.computed(()=>ge.value.table.rowHeight??"auto"),ne=e.computed(()=>({height:he.value})),le=e.computed(()=>ge.value.table.expandable===!0),fe=e.computed(()=>ge.value.table.expandableRowData??null),H=e.computed(()=>ge.value.table.expandableRowCondition??null),be=e.computed(()=>ge.value.table.truncated===!0),Te=e.computed(()=>ge.value.table.striped),ze=e.computed(()=>ge.value.table.bordered),rt=e.computed(()=>ge.value.table.hoverable),R=e.computed(()=>ge.value.table.size),Ee=e.computed(()=>ge.value.table.align||"left");e.computed(()=>ge.value.title.text),e.computed(()=>ge.value.subtitle.text);const Be=e.computed(()=>ge.value.selection.enabled),Ce=e.computed(()=>ge.value.selection.mode),gt=e.computed(()=>ge.value.selection.rowCondition??null),pt=e.computed(()=>ge.value.sorting.enabled),de=e.computed(()=>ge.value.sorting.mode),ut=e.computed(()=>ge.value.pagination.enabled),Oe=e.computed(()=>ge.value.pagination.rows),Ut=e.computed(()=>ge.value.pagination.rowsPerPageOptions),st=e.computed(()=>ge.value.pagination.showCounter!==!1),Et=e.computed(()=>ge.value.pagination.showControlsGroup),Tt=e.computed(()=>Et.value===!1?!1:ge.value.pagination.showControls!==!1),qt=e.computed(()=>Et.value===!1?!1:ge.value.pagination.showRowsPerPage!==!1),Ft=e.computed(()=>ut.value&&(st.value||Tt.value||qt.value)),G=e.computed(()=>ge.value.scrollable),me=e.computed(()=>ge.value.emptyMessage||_("table.emptyMessage")),He=e.computed(()=>ge.value.toolbar?.downloads?.pdf!==!1),Ue=e.computed(()=>ge.value.toolbar?.downloads?.excel!==!1),Wt=e.computed(()=>ge.value.toolbar?.search!==!1),yt=e.computed(()=>He.value||Ue.value||Wt.value||Pt.value),Pt=e.computed(()=>ge.value.toolbar?.columnVisibility!==!1),wt=e.ref(""),It=e.ref(!1),Q=e.ref(null);let ye=null;function Me(){It.value?(ye&&(clearTimeout(ye),ye=null),It.value=!1,wt.value="",z("search",""),Q.value?.blur()):(It.value=!0,ye=setTimeout(()=>{ye=null,Q.value?.focus()},80))}function qe(){wt.value||(It.value=!1)}function et(){wt.value="",z("search",""),Q.value?.focus()}const St=e.computed(()=>({"dss-table-striped":Te.value,"dss-table-bordered":ze.value,"dss-table-hoverable":rt.value,[`dss-table-${R.value}`]:R.value!=="default","dss-table-truncated":be.value})),Xe=(k,h)=>k?.field??k?.key??h,Vt=e.ref(new Set);function Ye(){const k=new Set;ce.columns.forEach((h,x)=>{h?.hidden!==!0&&k.add(Xe(h,x))}),Vt.value=k}const W=e.computed(()=>ce.columns.filter((k,h)=>Vt.value.has(Xe(k,h)))),Z=k=>{const h=ce.columns.findIndex(x=>x===k);return Xe(k,h>=0?h:0)},K=(k,h)=>Vt.value.has(Xe(k,h));function ve(k,h){const x=Xe(k,h),q=new Set(Vt.value);q.has(x)?q.delete(x):q.add(x),Vt.value=q}const We=e.ref(null),Ke=e.ref(!1);function Nt(k){We.value&&!We.value.contains(k.target)&&(Ke.value=!1)}const Qe=e.computed(()=>W.value.length+(Be.value?1:0)+(le.value?1:0)),lt=(k,h)=>k?.id??k?.key??h,Xt=e.ref(new Set),ln=e.ref(null),$t=(k,h)=>Xt.value.has(lt(k,h)),Qt=(k,h)=>{if(!le.value)return!1;if(typeof H.value=="function")return!!H.value(k,h);if(typeof fe.value=="string"&&fe.value.trim()){const x=Rn(k,fe.value.trim());return Array.isArray(x)?x.length>0:x&&typeof x=="object"?Object.keys(x).length>0:x!=null&&x!==""}return!0},V=(k,h,x)=>{if(x&&x.stopPropagation(),!Qt(k,h))return;const q=lt(k,h),ue=new Set(Xt.value);ue.has(q)?(ue.delete(q),z("row-collapse",{data:k,index:h})):(ue.add(q),z("row-expand",{data:k,index:h})),Xt.value=ue},w=(k,h)=>{if(!be.value)return;const x=lt(k,h);ln.value!==x&&(ln.value=x)},S=e.ref(null),Y=e.ref(0),J=e.ref([]),Pe=k=>{if(de.value==="single")return S.value===k.field?Y.value:0;{const h=J.value.find(x=>x.field===k.field);return h?h.order:0}},ft=k=>{const h=Pe(k);return{"dss-sort-active":h!==0,"dss-sort-asc":h===1,"dss-sort-desc":h===-1}},tt=e.ref({}),we=e.ref(null),Bt=e.ref(null),At=220,kt=e.ref(null),nt=e.computed(()=>W.value.find(k=>Z(k)===we.value)??null),dt=e.computed(()=>{if(!nt.value||nt.value.filter!=="range")return null;const k=nt.value,h=we.value,{min:x,max:q}=cl(k),ue=k.filterMin??x,ht=k.filterMax??q,Mt=P(h),Yt=Mt.min??ue,an=Mt.max??ht,tn=ht-ue,sn=tn===0?0:(Yt-ue)/tn*100,Fn=tn===0?100:(an-ue)/tn*100;return{rangeMin:ue,rangeMax:ht,currentMin:Yt,currentMax:an,minPct:sn,maxPct:Fn}}),Wn=e.ref(null),O=e.ref("max");function U(k){const h=Wn.value,x=dt.value;if(!h||!x)return;const q=h.getBoundingClientRect(),ht=(k.clientX-q.left)/q.width*100,Mt=(x.minPct+x.maxPct)/2;O.value=ht<Mt?"min":"max"}function P(k){return tt.value[k]??{}}function se(k,h){tt.value={...tt.value,[k]:h}}function Fe(k){const h=tt.value[k];return h?h.type==="string"?!!h.value?.trim():h.type==="range"?h.min!=null||h.max!=null:h.type==="dateRange"?!!(h.from||h.to):h.type==="list"?h.selected?.length>0:!1:!1}function ct(k){const h={...tt.value};delete h[k],tt.value=h,we.value=null,Bt.value=null}function mt(){if(!we.value){Bt.value=null;return}const k=kt.value;if(!k)return;const h=k.querySelector(`.dss-table-filter-trigger[data-filter-column-key="${we.value}"]`);if(!h)return;const x=h.getBoundingClientRect();Bt.value={top:x.bottom+6,left:Math.max(8,x.right-At)}}const Je=e.computed(()=>{const k=String(wt.value??"").trim().toLowerCase();return k?ce.data.filter(h=>W.value.some(x=>zt(Gn(h,x)).some(ue=>String(ue).toLowerCase().includes(k)))):ce.data}),xt=e.computed(()=>{let k=[...Je.value];const h=(wt.value??"").trim().toLowerCase();return h&&(k=k.filter(x=>ce.columns.some(q=>{if(!q||!q.field)return!1;const ue=Gn(x,q);return String(ue??"").toLowerCase().includes(h)}))),W.value.forEach(x=>{const q=Z(x),ue=tt.value[q];if(!ue)return;const ht=x.field;if(ht){if(ue.type==="string"&&ue.value?.trim()){const Mt=ue.value.trim().toLowerCase();k=k.filter(Yt=>{const an=Gn(Yt,x);return String(an??"").toLowerCase().includes(Mt)})}else if(ue.type==="range")k=k.filter(Mt=>{const Yt=Rn(Mt,ht),an=Number(Yt);return!(Number.isNaN(an)||ue.min!=null&&an<ue.min||ue.max!=null&&an>ue.max)});else if(ue.type==="dateRange"){const Mt=ue.from?new Date(ue.from).getTime():null,Yt=ue.to?new Date(ue.to).getTime():null;k=k.filter(an=>{const tn=Rn(an,ht),sn=tn?new Date(tn).getTime():NaN;return!(Number.isNaN(sn)||Mt!=null&&sn<Mt||Yt!=null&&sn>Yt)})}else if(ue.type==="list"&&ue.selected?.length){const Mt=new Set(ue.selected);k=k.filter(Yt=>zt(Gn(Yt,x)).some(tn=>Mt.has(tn)))}}}),k});function zt(k){if(k==null)return[""];if(Array.isArray(k))return k.flatMap(zt);if(typeof k=="object"){const h=k?.label??k?.name??k?.value??k?.title;return[h!=null?String(h):String(k)]}return[String(k)]}function Tn(k){const h=new Set;return ce.data.forEach(x=>{zt(Gn(x,k)).forEach(ue=>h.add(ue))}),Array.from(h).sort((x,q)=>String(x).localeCompare(String(q)))}function An(k,h){if(we.value===k){we.value=null,Bt.value=null;return}if(we.value=k,h?.currentTarget){const x=h.currentTarget.getBoundingClientRect();Bt.value={top:x.bottom+6,left:Math.max(8,x.right-At)}}else mt()}function Dn(k,h){se(k,{type:"string",value:h})}function cl(k){const h=k.field;if(!h)return{min:0,max:100};let x=1/0,q=-1/0;return ce.data.forEach(ue=>{const ht=Rn(ue,h),Mt=Number(ht);Number.isNaN(Mt)||(x=Math.min(x,Mt),q=Math.max(q,Mt))}),{min:x===1/0?0:x,max:q===-1/0?100:q}}function Hn(k,h,x){const q={...P(k),type:"range"},ue=x===""?null:Number(x),ht=ue===null||Number.isNaN(ue)?null:ue;q[h]=ht,ht!=null&&(h==="min"&&q.max!=null&&ht>q.max&&(q.max=ht),h==="max"&&q.min!=null&&ht<q.min&&(q.min=ht)),se(k,q)}function Nl(k,h,x){const q={...P(k),type:"dateRange"};q[h]=x||"",se(k,q)}const nl=e.reactive({});function yl(k,h){nl[k]=h}function Bl(k){const h=Z(k),x=(nl[h]??"").trim().toLowerCase(),q=Tn(k);return x?q.filter(ue=>String(ue).toLowerCase().includes(x)):q}function zl(k,h){return(P(k).selected??[]).includes(h!=null?String(h):"")}function Ml(k,h){const q=[...P(k).selected??[]],ue=h!=null?String(h):"",ht=q.indexOf(ue);ht>=0?q.splice(ht,1):q.push(ue),se(k,{type:"list",selected:q})}function Pl(k){we.value&&!k.target.closest(".dss-table-filter-wrap")&&!k.target.closest(".dss-table-filter-dropdown")&&(we.value=null,Bt.value=null)}function Vn(){mt(),xn.value&&dl()}const to=k=>{if(!(k.sortable===!1||!pt.value))if(de.value==="single")S.value===k.field?Y.value=Y.value===1?-1:Y.value===-1?0:1:(S.value=k.field,Y.value=1),Y.value===0&&(S.value=null),z("sort",{field:S.value,order:Y.value});else{const h=J.value.findIndex(x=>x.field===k.field);h>=0?J.value[h].order===1?J.value[h].order=-1:J.value.splice(h,1):J.value.push({field:k.field,order:1}),z("sort",{multiSortMeta:J.value})}},ll=e.computed(()=>{if(!pt.value)return xt.value;let k=[...xt.value];return de.value==="single"&&S.value&&Y.value!==0?k.sort((h,x)=>{const q=Rn(h,S.value),ue=Rn(x,S.value);return q===ue?0:q==null?1:ue==null?-1:(q<ue?-1:q>ue?1:0)*Y.value}):de.value==="multiple"&&J.value.length>0&&k.sort((h,x)=>{for(const q of J.value){const ue=Rn(h,q.field),ht=Rn(x,q.field);if(ue===ht)continue;if(ue==null)return 1;if(ht==null)return-1;const Mt=ue<ht?-1:ue>ht?1:0;if(Mt!==0)return Mt*q.order}return 0}),k}),pn=e.ref(0),$n=e.ref(Oe.value),xn=e.ref(!1),kl=e.ref(null),Ol=e.ref(null),ul=e.ref("bottom"),Cl=e.ref(null),Nn=k=>{$n.value=k,xn.value=!1,pn.value=0,z("page",{page:0,rows:$n.value})};function Bn(k){kl.value&&!kl.value.contains(k.target)&&(xn.value=!1)}function dl(){const k=kl.value,h=Ol.value;if(!k||!h)return;const x=k.querySelector(".dss-pagination-select-dropdown");if(!x)return;const q=h.getBoundingClientRect(),ue=x.offsetHeight||0,Mt=(window.innerHeight||document.documentElement.clientHeight)-q.bottom,Yt=q.top;ul.value=Mt<ue+8&&Yt>Mt?"top":"bottom",Cl.value={width:`${Math.ceil(q.width)}px`,left:`${Math.max(0,Math.round(h.offsetLeft))}px`}}const ot=e.computed(()=>ll.value.length),re=e.computed(()=>Math.ceil(ot.value/$n.value)),ol=e.computed(()=>Math.max(re.value,1)),vt=e.computed(()=>ot.value===0?0:Ae.value+1),fn=e.computed(()=>Ct.value),Ae=e.computed(()=>ut.value?pn.value*$n.value:0),Ct=e.computed(()=>ut.value?Math.min((pn.value+1)*$n.value,ot.value):ot.value),ae=e.computed(()=>{if(!ut.value)return ll.value;const k=Ae.value,h=Ct.value;return ll.value.slice(k,h)}),Lt=e.ref(new Set),$e=e.computed(()=>ll.value.filter((k,h)=>Lt.value.has(lt(k,h)))),bl=(k,h)=>{const x=gt.value;return typeof x!="function"?!0:!!x(k,h)},_l=e.computed(()=>ll.value.map((k,h)=>({row:k,index:h})).filter(({row:k,index:h})=>bl(k,h))),kn=e.computed(()=>{const k=_l.value;return k.length===0?!1:k.every(({row:h,index:x})=>Lt.value.has(lt(h,x)))}),Jt=e.computed(()=>{const k=_l.value;if(k.length===0)return!1;const h=k.filter(({row:x,index:q})=>Lt.value.has(lt(x,q))).length;return h>0&&h<k.length}),Kn=(k,h)=>Lt.value.has(lt(k,h)),on=()=>{if(kn.value)Lt.value=new Set,z("unselect-all");else{const k=new Set;_l.value.forEach(({row:h,index:x})=>k.add(lt(h,x))),Lt.value=k,z("select-all",$e.value)}},Zn=(k,h)=>{if(!bl(k,h))return;const x=lt(k,h),q=new Set(Lt.value),ue=q.has(x);Ce.value==="single"?ue?(q.delete(x),z("row-unselect",k)):(q.clear(),q.add(x),z("row-select",k)):ue?(q.delete(x),z("row-unselect",k)):(q.add(x),z("row-select",k)),Lt.value=q},al=e.ref("1"),$l=()=>{const k=Number.parseInt(String(al.value),10);if(!Number.isFinite(k)){al.value=String(pn.value+1);return}const h=Math.min(ol.value,Math.max(1,k));h!==pn.value+1?Mn(h-1):al.value=String(h)},Mn=k=>{k<0||k>=re.value||(pn.value=k,z("page",{page:k,rows:$n.value}))},Cn=(k,h,x)=>{z("row-click",{data:k,index:h,originalEvent:x}),w(k,Ae.value+h)},ql=(k,h)=>{const x=Ae.value+h;return{"dss-table-row-selected":Kn(k,x),"dss-table-row-even":h%2===0,"dss-table-row-odd":h%2!==0,"dss-table-row-truncated-clickable":be.value,"dss-table-row-truncated-expanded":ln.value===lt(k,x)}},Gn=(k,h)=>h.field?Rn(k,h.field):"",Rn=(k,h)=>h.split(".").reduce((x,q)=>x&&x[q],k),Ll=k=>{const h=k.align??Ee.value;return{"dss-table-sortable":k.sortable!==!1&&pt.value,"dss-table-align-left":h==="left","dss-table-align-center":h==="center","dss-table-align-right":h==="right",[k.className]:k.className}},Tl=k=>{const h={};return k.width&&(h.width=typeof k.width=="number"?`${k.width}px`:k.width),k.minWidth&&(h.minWidth=typeof k.minWidth=="number"?`${k.minWidth}px`:k.minWidth),k.maxWidth&&(h.maxWidth=typeof k.maxWidth=="number"?`${k.maxWidth}px`:k.maxWidth),h};return e.watch(()=>ce.locale,k=>{k&&k!==L.value&&(L.value=k)},{immediate:!0}),e.watch(Oe,k=>{$n.value=k,pn.value=0}),e.watch(xn,async k=>{k&&(await e.nextTick(),dl())}),e.watch(pn,k=>{al.value=String(k+1)},{immediate:!0}),e.watch(wt,k=>{z("search",k??"")}),e.watch(()=>ce.columns,()=>{Ye()},{immediate:!0,deep:!0}),e.onMounted(()=>{document.addEventListener("click",Bn),document.addEventListener("click",Nt),document.addEventListener("click",Pl),window.addEventListener("resize",Vn),window.addEventListener("scroll",Vn,!0)}),e.onUnmounted(()=>{document.removeEventListener("click",Bn),document.removeEventListener("click",Nt),document.removeEventListener("click",Pl),window.removeEventListener("resize",Vn),window.removeEventListener("scroll",Vn,!0)}),(k,h)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"dss-table-container",ref_key:"tableContainerRef",ref:kt,style:e.normalizeStyle({width:f.value+"px",height:xe.value?xe.value+"px":"auto"})},[yt.value?(e.openBlock(),e.createElementBlock("div",sc,[e.createElementVNode("div",rc,[He.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-btn",onClick:h[0]||(h[0]=x=>z("download-pdf"))},[h[22]||(h[22]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadPdf")),1)])):e.createCommentVNode("",!0),Ue.value?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-table-toolbar-btn",onClick:h[1]||(h[1]=x=>z("download-excel"))},[h[23]||(h[23]=e.createStaticVNode('<span class="dss-table-toolbar-btn-icon" aria-hidden="true"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_download_excel)"><path d="M16.59 9H15V4C15 3.45 14.55 3 14 3H10C9.45 3 9 3.45 9 4V9H7.41C6.52 9 6.07 10.08 6.7 10.71L11.29 15.3C11.68 15.69 12.31 15.69 12.7 15.3L17.29 10.71C17.92 10.08 17.48 9 16.59 9ZM5 19C5 19.55 5.45 20 6 20H18C18.55 20 19 19.55 19 19C19 18.45 18.55 18 18 18H6C5.45 18 5 18.45 5 19Z" fill="currentColor"></path></g><defs><clipPath id="clip0_download_excel"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg></span>',1)),e.createTextVNode(" "+e.toDisplayString(e.unref(_)("table.downloadExcel")),1)])):e.createCommentVNode("",!0),Pt.value?(e.openBlock(),e.createElementBlock("div",{key:2,class:"dss-table-toolbar-column-visibility",ref_key:"columnVisibilityDropdownRef",ref:We},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":Ke.value}]),onClick:h[2]||(h[2]=x=>Ke.value=!Ke.value),"aria-expanded":Ke.value,"aria-haspopup":"listbox"},[e.createTextVNode(e.toDisplayString(e.unref(_)("table.columnVisibility"))+" ",1),h[24]||(h[24]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,ic),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",cc,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,(x,q)=>(e.openBlock(),e.createElementBlock("li",{key:Xe(x,q),role:"option",class:"dss-table-column-visibility-option",onClick:h[3]||(h[3]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("label",uc,[e.createElementVNode("span",dc,[e.createElementVNode("input",{type:"checkbox",checked:K(x,q),onChange:ue=>ve(x,q),class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,mc),K(x,q)?(e.openBlock(),e.createElementBlock("span",pc,[...h[25]||(h[25]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("span",fc,e.toDisplayString(x.header),1)])]))),128))],512),[[e.vShow,Ke.value]])]),_:1})],512)):e.createCommentVNode("",!0)]),e.createElementVNode("div",vc,[Wt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["dss-table-toolbar-search",{"dss-table-toolbar-search--expanded":It.value||wt.value}])},[e.withDirectives(e.createElementVNode("input",{ref_key:"searchInputRef",ref:Q,"onUpdate:modelValue":h[4]||(h[4]=x=>wt.value=x),type:"text",class:"dss-table-toolbar-search-input",placeholder:e.unref(_)("table.searchPlaceholder"),"aria-label":e.unref(_)("table.searchTableAriaLabel"),onFocus:h[5]||(h[5]=x=>It.value=!0),onBlur:qe},null,40,gc),[[e.vModelText,wt.value]]),wt.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-toolbar-search-clear","aria-label":e.unref(_)("table.clearSearchAriaLabel"),onClick:et},[...h[26]||(h[26]=[e.createElementVNode("span",{"aria-hidden":"true"},"×",-1)])],8,hc)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",class:"dss-table-toolbar-search-trigger","aria-label":e.unref(_)("table.searchAriaLabel"),"aria-expanded":It.value||!!wt.value,onMousedown:e.withModifiers(Me,["prevent"])},[...h[27]||(h[27]=[e.createElementVNode("span",{class:"dss-table-toolbar-search-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.81738 0C7.47741 0.000327759 9.63379 2.09488 9.63379 4.67773C9.63366 5.68756 9.30172 6.62133 8.74121 7.38574L11.2324 9.80469C11.653 10.213 11.6528 10.8885 11.2324 11.2969C10.829 11.6886 10.1866 11.6886 9.7832 11.2969L7.16895 8.75781C6.47333 9.13671 5.67174 9.35439 4.81738 9.35449C2.15724 9.35449 -0.000652839 7.26049 -0.000976562 4.67773C-0.000976562 2.09468 2.15704 0 4.81738 0ZM4.81738 1.41895C2.96425 1.41895 1.46213 2.87754 1.46191 4.67676C1.46202 6.47611 2.96418 7.93555 4.81738 7.93555C6.67025 7.93519 8.17275 6.47589 8.17285 4.67676C8.17263 2.87776 6.67018 1.4193 4.81738 1.41895Z",fill:"currentColor"})])],-1)])],40,yc)],2)):e.createCommentVNode("",!0),k.$slots["toolbar-extra"]?(e.openBlock(),e.createElementBlock("div",kc,[e.renderSlot(k.$slots,"toolbar-extra")])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-table-wrapper",{"dss-table-scrollable":G.value}])},[e.createElementVNode("table",{class:e.normalizeClass(["dss-table",St.value])},[e.createElementVNode("thead",Cc,[e.createElementVNode("tr",null,[Be.value?(e.openBlock(),e.createElementBlock("th",bc,[Ce.value==="multiple"?(e.openBlock(),e.createElementBlock("span",wc,[e.createElementVNode("input",{type:"checkbox",checked:kn.value,indeterminate:Jt.value,onChange:on,class:"dss-table-checkbox dss-table-checkbox--checkbox"},null,40,xc),Jt.value?(e.openBlock(),e.createElementBlock("span",Ec)):kn.value?(e.openBlock(),e.createElementBlock("span",Sc,[...h[28]||(h[28]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("th",{key:1,class:"dss-table-th dss-table-expansion-column","aria-label":e.unref(_)("table.expandRowAriaLabel")},null,8,Vc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(x,q)=>(e.openBlock(),e.createElementBlock("th",{key:Z(x),class:e.normalizeClass(["dss-table-th",Ll(x)]),style:e.normalizeStyle(Tl(x)),onClick:ue=>to(x)},[e.createElementVNode("div",Bc,[e.createElementVNode("span",Mc,e.toDisplayString(x.header),1),x.sortable!==!1&&pt.value?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["dss-table-sort-icon",ft(x)])},[Pe(x)===0?(e.openBlock(),e.createElementBlock("span",_c,[...h[29]||(h[29]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"#3a3a3a"})],-1)])])):Pe(x)===1?(e.openBlock(),e.createElementBlock("span",$c,[...h[30]||(h[30]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"#7fa2cc"})],-1)])])):Pe(x)===-1?(e.openBlock(),e.createElementBlock("span",Lc,[...h[31]||(h[31]=[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"#7fa2cc"})],-1)])])):e.createCommentVNode("",!0)],2)):e.createCommentVNode("",!0),x.filter?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-table-filter-wrap",{"dss-table-filter-wrap--open":we.value===Z(x)}]),onClick:h[6]||(h[6]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-table-filter-trigger",{"dss-table-filter-trigger--active":Fe(Z(x))}]),"data-filter-column-key":Z(x),"aria-expanded":we.value===Z(x),"aria-label":e.unref(_)("table.filterColumnAriaLabel"),onClick:ue=>An(Z(x),ue)},[...h[32]||(h[32]=[e.createElementVNode("span",{class:"dss-table-filter-icon","aria-hidden":"true"},[e.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 1.54409L11.7537 1.54928L7.84558 5.72226V8.92411C7.84581 9.07639 7.80836 9.22636 7.73658 9.36067C7.6648 9.49497 7.56091 9.60943 7.43417 9.69385L5.58772 10.9252C5.44858 11.0179 5.28688 11.071 5.11988 11.079C4.95288 11.087 4.78685 11.0494 4.63952 10.9704C4.49219 10.8914 4.36908 10.7738 4.28334 10.6303C4.1976 10.4868 4.15244 10.3226 4.15269 10.1555V5.72226L0.244567 1.54928L0.239951 1.54409C0.119785 1.41185 0.0405781 1.24758 0.0119374 1.0712C-0.0167033 0.894829 0.00645342 0.713935 0.0785984 0.550463C0.150743 0.386991 0.268776 0.247968 0.418378 0.150258C0.56798 0.0525488 0.742722 0.000352071 0.921405 0H11.0769C11.2557 1.73676e-05 11.4307 0.051972 11.5805 0.149551C11.7304 0.247131 11.8487 0.386134 11.9211 0.549673C11.9934 0.713211 12.0167 0.894244 11.9881 1.07078C11.9596 1.24731 11.8803 1.41174 11.7601 1.54409H11.7583Z",fill:"currentColor"})])],-1)])],10,Tc)],2)):e.createCommentVNode("",!0)])],14,Nc))),128))])]),e.createElementVNode("tbody",Ac,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ae.value,(x,q)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:lt(x,Ae.value+q)},[e.createElementVNode("tr",{class:e.normalizeClass(["dss-table-tr",ql(x,q)]),style:e.normalizeStyle(ne.value),onClick:ue=>Cn(x,q,ue)},[Be.value?(e.openBlock(),e.createElementBlock("td",{key:0,class:"dss-table-td dss-table-selection-cell",onClick:h[7]||(h[7]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("span",Hc,[e.createElementVNode("input",{type:Ce.value==="multiple"?"checkbox":"radio",name:`dss-table-select-${T.tableId}`,checked:Kn(x,Ae.value+q),disabled:!bl(x,Ae.value+q),onChange:ue=>Zn(x,Ae.value+q),class:e.normalizeClass(["dss-table-checkbox",Ce.value==="multiple"?"dss-table-checkbox--checkbox":"dss-table-checkbox--radio",{"dss-table-checkbox--disabled":!bl(x,Ae.value+q)}])},null,42,Rc),Ce.value==="multiple"&&Kn(x,Ae.value+q)?(e.openBlock(),e.createElementBlock("span",Fc,[...h[33]||(h[33]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",preserveAspectRatio:"xMidYMid meet",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4.82415 9.75587C4.46867 10.0814 3.89442 10.0814 3.53893 9.75587L0.266616 6.75952C-0.088872 6.43401 -0.088872 5.90819 0.266616 5.58268C0.622104 5.25717 1.19635 5.25717 1.55184 5.58268L4.17698 7.98644L10.4482 2.24413C10.8036 1.91862 11.3779 1.91862 11.7334 2.24413C12.0889 2.56964 12.0889 3.09546 11.7334 3.42097L4.82415 9.75587Z","stroke-width":"1.2",stroke:"currentColor",fill:"currentColor"})],-1)])])):Ce.value==="single"&&Kn(x,Ae.value+q)?(e.openBlock(),e.createElementBlock("span",Ic)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),le.value?(e.openBlock(),e.createElementBlock("td",{key:1,class:"dss-table-td dss-table-expansion-cell",onClick:e.withModifiers(ue=>V(x,Ae.value+q,ue),["stop"])},[Qt(x,Ae.value+q)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-table-expansion-trigger","aria-expanded":$t(x,Ae.value+q),"aria-label":$t(x,Ae.value+q)?e.unref(_)("table.collapseRowAriaLabel"):e.unref(_)("table.expandRowAriaLabel")},[e.createElementVNode("span",{class:e.normalizeClass(["dss-table-expansion-icon",{"dss-table-expansion-icon--expanded":$t(x,Ae.value+q)}]),"aria-hidden":"true"},[...h[34]||(h[34]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10.1611 2.81093L5.99463 6.93546L1.82819 2.81093C1.4094 2.39636 0.732886 2.39636 0.314094 2.81093C-0.104698 3.22551 -0.104698 3.89522 0.314094 4.30979L5.24295 9.18907C5.66175 9.60364 6.33826 9.60364 6.75705 9.18907L11.6859 4.30979C12.1047 3.89522 12.1047 3.22551 11.6859 2.81093C11.2671 2.40699 10.5799 2.39636 10.1611 2.81093Z",fill:"#3a3a3a"})],-1)])],2)],8,Pc)):(e.openBlock(),e.createElementBlock("span",Oc))],8,zc)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(W.value,(ue,ht)=>(e.openBlock(),e.createElementBlock("td",{key:Z(ue),class:e.normalizeClass(["dss-table-td",Ll(ue)]),style:e.normalizeStyle(Tl(ue))},[e.renderSlot(k.$slots,`cell-${ue.field}`,{data:x,column:ue,rowIndex:q,isExpanded:ln.value===lt(x,Ae.value+q)},()=>[e.createTextVNode(e.toDisplayString(Gn(x,ue)),1)])],6))),128))],14,Dc),le.value&&Qt(x,Ae.value+q)&&$t(x,Ae.value+q)?(e.openBlock(),e.createElementBlock("tr",qc,[e.createElementVNode("td",{colspan:Qe.value,class:"dss-table-expansion-content-cell"},[e.renderSlot(k.$slots,"expansion",{data:x,rowIndex:q})],8,Wc)])):e.createCommentVNode("",!0)],64))),128)),ae.value.length?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("tr",{key:0,class:"dss-table-empty",style:e.normalizeStyle(ne.value)},[e.createElementVNode("td",{colspan:Qe.value,class:"dss-table-empty-cell"},[e.renderSlot(k.$slots,"empty",{},()=>[e.createTextVNode(e.toDisplayString(me.value),1)])],8,Zc)],4))])],2)],2),Ft.value?(e.openBlock(),e.createElementBlock("div",Uc,[e.createElementVNode("div",Xc,[st.value?(e.openBlock(),e.createElementBlock("span",Yc,e.toDisplayString(e.unref(_)("table.showingRange",{start:vt.value,end:fn.value,total:ot.value})),1)):(e.openBlock(),e.createElementBlock("span",jc," "))]),e.createElementVNode("div",Kc,[Tt.value?(e.openBlock(),e.createElementBlock("div",Gc,[e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value===0,onClick:h[8]||(h[8]=x=>Mn(0)),title:e.unref(_)("table.firstPage")},[...h[35]||(h[35]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"‹"),e.createElementVNode("span",null,"‹")],-1)])],8,Qc),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value===0,onClick:h[9]||(h[9]=x=>Mn(pn.value-1)),title:e.unref(_)("table.previousPage")}," ‹ ",8,Jc),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":h[10]||(h[10]=x=>al.value=x),type:"text",class:"dss-pagination-page-input","aria-label":e.unref(_)("table.currentPageAriaLabel"),onBlur:$l,onKeydown:e.withKeys(e.withModifiers($l,["prevent"]),["enter"])},null,40,eu),[[e.vModelText,al.value]]),e.createElementVNode("span",tu,e.toDisplayString(e.unref(_)("table.ofPages",{total:ol.value})),1),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value>=re.value-1,onClick:h[11]||(h[11]=x=>Mn(pn.value+1)),title:e.unref(_)("table.nextPage")}," › ",8,nu),e.createElementVNode("button",{class:"dss-pagination-btn",disabled:pn.value>=re.value-1,onClick:h[12]||(h[12]=x=>Mn(re.value-1)),title:e.unref(_)("table.lastPage")},[...h[36]||(h[36]=[e.createElementVNode("span",{class:"dss-pagination-double-arrow"},[e.createElementVNode("span",null,"›"),e.createElementVNode("span",null,"›")],-1)])],8,lu)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",ou,[qt.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-pagination-rows-per-page",ref_key:"rowsPerPageDropdownRef",ref:kl},[e.createElementVNode("span",au,e.toDisplayString(e.unref(_)("table.rowsPerPage"))+":",1),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-pagination-select-trigger",{"dss-pagination-select-open":xn.value}]),onClick:h[13]||(h[13]=x=>xn.value=!xn.value),"aria-expanded":xn.value,"aria-haspopup":"listbox",ref_key:"rowsPerPageTriggerRef",ref:Ol},[e.createTextVNode(e.toDisplayString($n.value)+" ",1),h[37]||(h[37]=e.createElementVNode("span",{class:"dss-pagination-select-chevron","aria-hidden":"true"},"▼",-1))],10,su),e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("ul",{class:e.normalizeClass(["dss-pagination-select-dropdown",{"dss-pagination-select-dropdown--top":ul.value==="top"}]),style:e.normalizeStyle(Cl.value),role:"listbox"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,x=>(e.openBlock(),e.createElementBlock("li",{key:x,role:"option","aria-selected":x===$n.value,class:e.normalizeClass(["dss-pagination-select-option",{"dss-pagination-select-option--selected":x===$n.value}]),onClick:q=>Nn(x)},e.toDisplayString(x),11,ru))),128))],6),[[e.vShow,xn.value]])]),_:1})],512)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],4),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{name:"dss-dropdown"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{class:"dss-table-filter-dropdown dss-table-filter-dropdown--teleport",style:e.normalizeStyle(Bt.value?{top:Bt.value.top+"px",left:Bt.value.left+"px",width:At+"px"}:void 0),onClick:h[21]||(h[21]=e.withModifiers(()=>{},["stop"]))},[nt.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[nt.value.filter==="string"?(e.openBlock(),e.createElementBlock("div",iu,[e.createElementVNode("input",{type:"text",value:P(we.value).value??"",onInput:h[14]||(h[14]=x=>Dn(we.value,x.target.value)),class:"dss-table-filter-input",placeholder:e.unref(_)("table.search")},null,40,cu)])):nt.value.filter==="range"&&dt.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-table-filter-double-range",style:e.normalizeStyle({"--range-min-pct":dt.value.minPct+"%","--range-max-pct":dt.value.maxPct+"%"})},[e.createElementVNode("div",{ref_key:"doubleRangeTrackRef",ref:Wn,class:"dss-table-filter-double-range-track",onMousemove:U,onMouseenter:U},[e.createElementVNode("input",{type:"range",min:dt.value.rangeMin,max:dt.value.rangeMax,value:dt.value.currentMin,onInput:h[15]||(h[15]=x=>Hn(we.value,"min",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--min",style:e.normalizeStyle({zIndex:O.value==="min"?2:1})},null,44,uu),e.createElementVNode("input",{type:"range",min:dt.value.rangeMin,max:dt.value.rangeMax,value:dt.value.currentMax,onInput:h[16]||(h[16]=x=>Hn(we.value,"max",x.target.value)),class:"dss-table-filter-double-range-input dss-table-filter-double-range-input--max",style:e.normalizeStyle({zIndex:O.value==="max"?2:1})},null,44,du)],544),e.createElementVNode("div",mu,e.toDisplayString(dt.value.currentMin)+" – "+e.toDisplayString(dt.value.currentMax),1)],4)):nt.value.filter==="dateRange"?(e.openBlock(),e.createElementBlock("div",pu,[e.createElementVNode("div",fu,[e.createElementVNode("label",vu,e.toDisplayString(e.unref(_)("table.filterFrom")),1),e.createElementVNode("input",{type:"date",value:P(we.value).from??"",onInput:h[17]||(h[17]=x=>Nl(we.value,"from",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,gu)]),e.createElementVNode("div",hu,[e.createElementVNode("label",yu,e.toDisplayString(e.unref(_)("table.filterTo")),1),e.createElementVNode("input",{type:"date",value:P(we.value).to??"",onInput:h[18]||(h[18]=x=>Nl(we.value,"to",x.target.value)),class:"dss-table-filter-input dss-table-filter-daterange-input"},null,40,ku)])])):nt.value.filter==="list"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:3},[e.createElementVNode("input",{type:"text",value:nl[we.value]??"",onInput:h[19]||(h[19]=x=>yl(we.value,x.target.value)),class:"dss-table-filter-input dss-table-filter-list-search",placeholder:e.unref(_)("table.search")},null,40,Cu),e.createElementVNode("div",bu,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Bl(nt.value),x=>(e.openBlock(),e.createElementBlock("label",{key:x,class:"dss-table-filter-list-item"},[e.createElementVNode("input",{type:"checkbox",checked:zl(we.value,x),onChange:q=>Ml(we.value,x)},null,40,wu),e.createElementVNode("span",null,e.toDisplayString(x),1)]))),128))])],64)):e.createCommentVNode("",!0),e.createElementVNode("div",xu,[e.createElementVNode("button",{type:"button",class:"dss-table-filter-clear",onClick:h[20]||(h[20]=x=>ct(we.value))},e.toDisplayString(e.unref(_)("table.clearFilter")),1)])],64)):e.createCommentVNode("",!0)],4),[[e.vShow,we.value&&nt.value&&Bt.value]])]),_:1})]))],64))}}),Vu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M6.008%2014V12.68H8.288V6.572L5.996%208.276V6.692L8.012%205.24H9.788V12.68H11.624V14H6.008Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Nu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M5.948%2014V12.548L8.684%209.8C9.068%209.408%209.352%209.056%209.536%208.744C9.72%208.424%209.812%208.096%209.812%207.76C9.812%207.352%209.7%207.036%209.476%206.812C9.252%206.58%208.948%206.464%208.564%206.464C8.14%206.464%207.808%206.588%207.568%206.836C7.328%207.076%207.208%207.412%207.208%207.844H5.708C5.716%207.284%205.836%206.804%206.068%206.404C6.308%205.996%206.644%205.68%207.076%205.456C7.508%205.232%208.012%205.12%208.588%205.12C9.14%205.12%209.62%205.224%2010.028%205.432C10.436%205.64%2010.752%205.932%2010.976%206.308C11.2%206.684%2011.312%207.132%2011.312%207.652C11.312%208.188%2011.172%208.712%2010.892%209.224C10.62%209.728%2010.18%2010.272%209.572%2010.856L7.748%2012.644H11.42V14H5.948Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Bu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.516%2014.12C7.948%2014.12%207.452%2014.016%207.028%2013.808C6.612%2013.6%206.288%2013.308%206.056%2012.932C5.824%2012.556%205.708%2012.112%205.708%2011.6H7.22C7.22%2011.992%207.332%2012.3%207.556%2012.524C7.788%2012.74%208.112%2012.848%208.528%2012.848C8.944%2012.848%209.264%2012.736%209.488%2012.512C9.712%2012.288%209.824%2011.984%209.824%2011.6V10.916C9.824%2010.524%209.712%2010.22%209.488%2010.004C9.264%209.78%208.944%209.668%208.528%209.668H7.544V8.312L9.476%206.524H6.104V5.24H11V6.596L8.528%208.864V8.384C9.392%208.384%2010.076%208.612%2010.58%209.068C11.084%209.524%2011.336%2010.14%2011.336%2010.916V11.6C11.336%2012.112%2011.22%2012.556%2010.988%2012.932C10.756%2013.308%2010.428%2013.6%2010.004%2013.808C9.58%2014.016%209.084%2014.12%208.516%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Mu="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M9.68%2014V12.26H5.78V10.088L9.152%205.24H10.832L7.22%2010.484V10.94H9.68V8.96H11.18V14H9.68Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",_u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.588%2014.12C7.78%2014.12%207.132%2013.92%206.644%2013.52C6.156%2013.112%205.888%2012.56%205.84%2011.864H7.34C7.372%2012.168%207.492%2012.404%207.7%2012.572C7.916%2012.732%208.212%2012.812%208.588%2012.812C9.004%2012.812%209.32%2012.704%209.536%2012.488C9.752%2012.264%209.86%2011.956%209.86%2011.564V10.712C9.86%2010.312%209.752%2010.008%209.536%209.8C9.32%209.584%209.004%209.476%208.588%209.476C8.332%209.476%208.112%209.528%207.928%209.632C7.744%209.736%207.604%209.88%207.508%2010.064H6.044L6.104%205.24H11.036V6.596H7.52L7.496%209.14H7.844L7.484%209.44C7.484%209.072%207.628%208.784%207.916%208.576C8.212%208.36%208.608%208.252%209.104%208.252C9.816%208.244%2010.368%208.46%2010.76%208.9C11.16%209.332%2011.36%209.936%2011.36%2010.712V11.564C11.36%2012.356%2011.112%2012.98%2010.616%2013.436C10.128%2013.892%209.452%2014.12%208.588%2014.12Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",$u="data:image/svg+xml,%3csvg%20width='13'%20height='18'%20viewBox='0%200%2013%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.116%2012V3.24H2.196V6.984H5.004V3.24H6.084V12H5.004V7.968H2.196V12H1.116Z'%20fill='%233a3a3a'/%3e%3cpath%20d='M8.6%2014.12C8.016%2014.12%207.5%2014%207.052%2013.76C6.612%2013.512%206.268%2013.168%206.02%2012.728C5.78%2012.28%205.66%2011.764%205.66%2011.18C5.66%2010.764%205.728%2010.328%205.864%209.872C6.008%209.416%206.204%208.988%206.452%208.588L8.516%205.24H10.184L7.592%209.32L7.664%209.368C7.824%209.12%208.04%208.932%208.312%208.804C8.584%208.676%208.888%208.612%209.224%208.612C9.696%208.612%2010.104%208.724%2010.448%208.948C10.792%209.172%2011.06%209.484%2011.252%209.884C11.444%2010.284%2011.54%2010.752%2011.54%2011.288C11.54%2011.856%2011.416%2012.352%2011.168%2012.776C10.928%2013.2%2010.588%2013.532%2010.148%2013.772C9.716%2014.004%209.2%2014.12%208.6%2014.12ZM8.6%2012.848C9.04%2012.848%209.396%2012.708%209.668%2012.428C9.94%2012.14%2010.076%2011.768%2010.076%2011.312C10.076%2010.84%209.94%2010.464%209.668%2010.184C9.396%209.896%209.04%209.752%208.6%209.752C8.16%209.752%207.804%209.896%207.532%2010.184C7.26%2010.464%207.124%2010.84%207.124%2011.312C7.124%2011.768%207.26%2012.14%207.532%2012.428C7.804%2012.708%208.16%2012.848%208.6%2012.848Z'%20fill='%23CFBEED'/%3e%3c/svg%3e",Lu={class:"dss-toolbar-left"},Tu=["title"],Au=["title"],Du={class:"dss-toolbar-dropdown-wrapper"},Hu=["title"],Ru=["src"],Fu=["src"],Iu=["src"],zu=["src"],Pu=["src"],Ou=["src"],qu={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},Wu=["src"],Zu=["src"],Uu=["src"],Xu=["src"],Yu=["src"],ju=["src"],Ku=["title"],Gu=["title"],Qu=["title"],Ju=["title"],ed=["title"],td=["title"],nd=["title"],ld=["title"],od=["title"],ad={key:2,class:"dss-toolbar-separator"},sd=["title"],rd={key:4,class:"dss-toolbar-separator"},id={key:5,class:"dss-toolbar-dropdown-wrapper"},cd=["title"],ud={class:"dss-toolbar-dropdown-ai"},dd={class:"dss-toolbar-right"},md={key:0,class:"dss-toolbar-custom-group"},pd={key:1,class:"dss-toolbar-separator"},fd={class:"dss-link-modal-content"},vd={class:"dss-link-modal-field"},gd={class:"dss-link-modal-label"},hd=["placeholder"],yd={class:"dss-link-modal-field"},kd={class:"dss-link-modal-label"},Cd=["placeholder"],bd={class:"dss-image-modal-tabs"},wd={key:0,class:"dss-image-tab-content"},xd={class:"dss-link-modal-content"},Ed={class:"dss-link-modal-field"},Sd={key:0,class:"dss-link-modal-label"},Vd=["src"],Nd={class:"dss-link-modal-field"},Bd={class:"dss-link-modal-label"},Md=["placeholder"],_d={class:"dss-link-modal-field"},$d={class:"dss-link-modal-label"},Ld=["placeholder"],Td={class:"dss-link-modal-field"},Ad={class:"dss-link-modal-label"},Dd=["placeholder"],Hd={key:1,class:"dss-image-tab-content"},Rd={class:"dss-link-modal-content"},Fd={class:"dss-link-modal-field"},Id={class:"dss-link-modal-label"},zd=["placeholder"],Pd={class:"dss-link-modal-field"},Od={class:"dss-link-modal-label"},qd=["placeholder"],Wd={class:"dss-link-modal-field"},Zd={class:"dss-link-modal-label"},Ud=["placeholder"],Xd={class:"dss-link-modal-field"},Yd={class:"dss-link-modal-label"},jd=["placeholder"],Kd={class:"dss-text-editor-title-input-container"},Gd={key:0,class:"dss-text-editor-title-preview"},Qd={key:0},Jd={key:1,class:"dss-text-editor-preview-placeholder"},e1=["value","placeholder","disabled"],t1={key:2,class:"dss-text-editor-title-slot dss-text-editor-slot-last"},n1={class:"dss-text-editor-description-input-container"},l1={key:0,class:"dss-text-editor-description-preview"},o1={key:0},a1={key:1,class:"dss-text-editor-preview-placeholder"},s1=["value","placeholder","disabled"],r1={key:3,class:"dss-text-editor-description-slot dss-text-editor-slot-last"},i1=["data-comment-id","onMouseenter"],c1=["onClick"],u1=["src","alt"],d1={key:1},m1=["onClick"],p1=["src","alt"],f1={key:1},v1=["data-has-second-user","onClick"],g1={class:"editor-comment-marker-count"},h1={key:4,class:"dss-text-editor-textarea-wrapper"},y1=["value","placeholder","rows","disabled"],k1={class:"dss-text-editor-footer"},C1={class:"dss-text-editor-footer-content"},b1={class:"dss-text-editor-footer-stat"},w1={class:"dss-text-editor-footer-stat"},x1={key:5,class:"dss-text-editor-content-wrapper"},E1={key:0,class:"dss-comment-overlay-body"},S1={class:"dss-comment-selection-wrapper"},V1=["innerHTML"],N1={class:"dss-comment-messages-wrapper"},B1={key:0,class:"dss-comment-avatar-wrapper"},M1={class:"dss-comment-avatar"},_1=["src","alt"],$1={key:1},L1={class:"dss-comment-header"},T1={class:"dss-comment-header-text"},A1={class:"dss-comment-author"},D1={key:0,class:"dss-comment-date"},H1=["onClick","title"],R1={class:"dss-comment-overlay-inner"},F1=["placeholder","onKeydown"],I1={class:"dss-text-editor-footer"},z1={class:"dss-text-editor-footer-content"},P1={class:"dss-text-editor-footer-stat"},O1={class:"dss-text-editor-footer-stat"},q1=["title"],W1=["title"],Z1={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:""},U1={class:"dss-image-popup-content"},X1={key:0,class:"dss-image-popup-no-alt-icon"},Y1=["title"],j1=["title"],K1={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:""},G1={class:"dss-toolbar-left"},Q1=["title"],J1=["title"],em={class:"dss-toolbar-dropdown-wrapper"},tm=["title"],nm=["src"],lm=["src"],om=["src"],am=["src"],sm=["src"],rm=["src"],im={key:6,width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},cm=["title"],um=["title"],dm=["title"],mm=["title"],pm=["title"],fm=["title"],vm=["title"],gm=["title"],hm=["title"],ym=["title"],km={key:2,class:"dss-toolbar-separator"},Cm={key:3,class:"dss-toolbar-dropdown-wrapper"},bm=["title"],wm={class:"dss-toolbar-dropdown-ai"},xm={key:0,class:"dss-toolbar-right"},Em={key:0,class:"dss-toolbar-separator"},Sm={key:0,class:"dss-toolbar-custom-group"},Vm={key:1,class:"dss-toolbar-separator"},Nm={name:"DSSTextEditor"},Bm=Object.assign(Nm,{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:T=>typeof T=="object"&&T!==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:T=>typeof T=="object"&&T!==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(T,{expose:te,emit:_}){const{t:L,locale:ce}=Gl.useI18n(),z={h1:Vu,h2:Nu,h3:Bu,h4:Mu,h5:_u,h6:$u},A=T,X=_,je=e.useSlots(),ge=`<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
99
99
|
<path d="M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z" fill="#c13340"/>
|
|
100
|
-
</svg>`,f=e.ref(null),we=e.ref(null),ge=e.ref(!1),ne=e.ref(!1),oe=e.ref(!1),ve=e.ref(""),H=e.ref({}),Ce=e.ref(!1),Te=e.ref(!1),qe=e.ref(""),ct=e.ref(""),R=e.ref(null),xe=e.ref(null),Be=e.ref(null),ke=e.ref(null),mt=e.ref(""),vt=e.ref(!1),de=e.ref({}),gt=e.ref(!1),We=e.ref({}),Pt=e.ref(null),it=e.ref(null),Et=e.ref(!1),Tt=e.ref(""),Wt=e.ref(null),Ft=e.ref(""),G=e.ref(""),ue=e.ref(""),De=e.ref(null),Xe=e.ref(null),Zt=e.ref(null),kt=e.ref(null),xt=e.ref(null),Mt=e.ref(!1),Ut=e.ref(""),Q=e.ref({}),be=e.ref(!1),Me=e.ref("upload"),Ze=e.ref(""),et=e.ref(null),pt=e.ref(null),je=e.ref([]),_t=e.ref([]),Re=e.ref(null),P=e.ref(!1),X=e.ref(""),K=e.ref(""),me=e.ref(""),ze=e.ref(""),nt=e.ref(""),St=e.ref(""),Pe=e.ref(null),ht=e.ref(null),Ot=e.ref(null),on=e.ref(!1),$t=e.ref(null),an=e.ref(!1),V=e.ref(!1),w=e.ref(null),E=e.ref("p"),Y=e.ref(!1),le=e.ref([]),Ye=e.ref(null),at=e.ref(null),Ve=e.ref(null),Fe=e.ref(!1),It=e.ref(0),Ht=100,st=e.ref(null),Ge=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":lt.value!==null})),Lt=e.computed(()=>({})),Fn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),O=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),W=e.computed(()=>A.richText&&_t.value.length>0),q=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.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 A.modelValue}),se=e.computed(()=>{const o=q.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Ie=e.computed(()=>q.value.length),ut=e.computed(()=>kt.value!==null&&Me.value==="upload"&&Ft.value&&Ft.value.startsWith("data:")),ft=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),Qe=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),Ct=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),Xt=o=>Ke&&Ke[o]!==void 0,Tn=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++)if(Xt(A.customToolbarSlots[l]))return!0;return!1},An=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++){const s=A.customToolbarSlots[l];if(Xt(s)&&Dn(s))return!0}return!1},Dn=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,sl=e.computed(()=>A.customToolbarSlots.some(o=>Xt(o)&&Dn(o))),Hn=e.computed(()=>Xt("title-slot")),yl=e.computed(()=>Xt("description-slot")),kl=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},Cl=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Ml=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},Il=o=>{try{const l=String(o.getDate()).padStart(2,"0"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][o.getMonth()],c=o.getFullYear();return`${l} ${r} ${c}`}catch{return""}},bl=o=>{if(!o||typeof o!="string")return!1;const l=o.trim();if(!l)return!1;if(["Started conversation","A démarré la conversation","started_conversation","conv_started"].includes(l))return!0;try{const c=L("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"},wl=o=>{const l=o.target.value;U("update:modelValue",l),U("change",l)},In=()=>{if(!Pe.value)return;const o=Pe.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 s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},el=()=>{an.value=!0,In()},gn=()=>{an.value=!1,Vn()},Vn=()=>{if(!Pe.value)return;const o=Pe.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},Rn=o=>{const s=o.target.value;an.value&&In(),U("update:title",s),U("title-change",s),Ot.value="title",A.richText&&(P.value||(K.value=X.value,nt.value=me.value,St.value=ze.value),Re.value&&clearTimeout(Re.value),P.value=!0,Re.value=setTimeout(()=>{P.value=!1,tt()},500))},Xn=()=>{if(!ht.value)return;const o=ht.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 s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},zl=()=>{V.value=!0,Xn()},Pl=()=>{V.value=!1,ul()},ul=()=>{if(!ht.value)return;const o=ht.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},_l=o=>{const s=o.target.value;V.value&&Xn(),U("update:description",s),U("description-change",s),Ot.value="description",A.richText&&(P.value||(K.value=X.value,nt.value=me.value,St.value=ze.value),Re.value&&clearTimeout(Re.value),P.value=!0,Re.value=setTimeout(()=>{P.value=!1,tt()},500))},wn=()=>{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 s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Nn=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);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&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.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(s)}catch{f.value.focus()}},Yn=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=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=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(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)},tt=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===X.value&&s===me.value&&r===ze.value)return;const c={content:K.value||X.value,title:nt.value!==void 0?nt.value:me.value,description:St.value!==void 0?St.value:ze.value},d=je.value.length>0?je.value[je.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&&(je.value.push(c),je.value.length>50&&je.value.shift(),_t.value=[]),X.value=l,me.value=s,ze.value=r,K.value=l,nt.value=s,St.value=r},re=o=>{if(!f.value)return;dl(),f.value&&Ml(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=wn(),yt()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&w.value&&(w.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=kl(r);U("update:modelValue",c),U("change",c),Ot.value="editor",P.value||(K.value=X.value,nt.value=me.value,St.value=ze.value),Re.value&&clearTimeout(Re.value),P.value=!0,Re.value=setTimeout(()=>{P.value=!1,tt(),Ul(),So()},500),e.nextTick(()=>{l&&Nn(l),dl();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(h=>{try{if(v&&w.value?.command===h){de.value[h]=w.value.state;return}if(h==="bold")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M;let x=!1;if(D&&((D.tagName==="STRONG"||D.tagName==="B"||D.closest&&D.closest("strong, b"))&&(x=!0),!x&&D.style&&parseInt(D.style.fontWeight)>=600&&(x=!0),!x))try{const ae=window.getComputedStyle(D);parseInt(ae.fontWeight)>=600&&(x=!0)}catch{}de.value[h]=x}else de.value.hasOwnProperty(h)||(de.value[h]=!1);else if(h==="italic")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M,x=D&&(D.tagName==="EM"||D.tagName==="I"||D.closest&&D.closest("em, i"));de.value[h]=!!x}else{const M=document.queryCommandState(h);de.value[h]=M}else{const M=document.queryCommandState(h);de.value[h]=M}}catch{}}),Z(),Vt(),_e(),en(),wt(),hn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const h=o.data||"";h&&h.length===1&&setTimeout(()=>So(h),0),(h===" "||h===`
|
|
101
|
-
`||/[.,;:!?]/.test(h))&&setTimeout(()=>{Ul()},100)}ne.value=!1})},dl=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;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)}}}},yt=()=>{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"]),s=Array.from(o.childNodes);let r=null;s.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)}})},Vt=()=>{if(f.value&&!on.value){on.value=!0;try{f.value.querySelectorAll(".dss-image-wrapper").forEach(r=>{r.querySelector("img")||r.remove()}),f.value.querySelectorAll(".dss-image-no-alt-icon").forEach(r=>{const c=r.parentElement;!c||!c.classList.contains("dss-image-wrapper")?r.remove():c.querySelector("img")||r.remove()}),f.value.querySelectorAll("img").forEach(r=>{let c=r.getAttribute("alt");c===null&&(c=r.alt||"");const d=r.getAttribute("src")||r.src||"";if(c){const h=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===h;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const h=m.querySelector(".dss-image-no-alt-icon");h&&h.remove()}else{const h=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;h&&h.remove()}if(u){v?m.setAttribute("contenteditable","false"):(m=document.createElement("span"),m.className="dss-image-wrapper",m.setAttribute("contenteditable","false"),r.parentNode.insertBefore(m,r),m.appendChild(r));const h=document.createElement("div");h.className="dss-image-no-alt-icon",h.setAttribute("contenteditable","false"),h.innerHTML=he,m.appendChild(h)}else if(v&&m.children.length===1){const h=m.parentNode;h.insertBefore(r,m),h.removeChild(m)}})}finally{on.value=!1}}},rt=o=>{Ul(),U("blur",o),Dl()},bt=()=>{if(A.disabled||!A.richText||!f.value)return;nn(),Re.value&&(clearTimeout(Re.value),Re.value=null),P.value&&(tt(),P.value=!1);const o=Ot.value==="title",l=Ot.value==="description",s=Ot.value==="editor";if(je.value.length===0){o&&Pe.value?Pe.value.focus():l&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{re()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};_t.value.push(r);const c=je.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,me.value=u,ze.value=m,K.value=d,nt.value=u,St.value=m,e.nextTick(()=>{Z(),Yt(),dt(),en();const v=kl(d);U("update:modelValue",v),U("update:title",u),U("update:description",m),U("change",v),U("title-change",u),U("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Pe.value){Pe.value.focus();const h=u.length;Pe.value.setSelectionRange&&Pe.value.setSelectionRange(h,h),In()}}else if(l){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(s)Yn();else if(Pe.value&&document.activeElement===Pe.value){const h=u.length;Pe.value.setSelectionRange&&Pe.value.setSelectionRange(h,h),In()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&Yn()},10)})})}},J=()=>{if(A.disabled||!A.richText||!f.value)return;nn();const o=Ot.value==="title",l=Ot.value==="description",s=Ot.value==="editor";if(_t.value.length===0){o&&Pe.value?Pe.value.focus():l&&ht.value?ht.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{re()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};je.value.push(r);const c=_t.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,X.value=d,me.value=u,ze.value=m,K.value=d,nt.value=u,St.value=m,e.nextTick(()=>{Z(),Yt(),dt(),en();const v=kl(d);U("update:modelValue",v),U("update:title",u),U("update:description",m),U("change",v),U("title-change",u),U("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Pe.value){Pe.value.focus();const h=u.length;Pe.value.setSelectionRange&&Pe.value.setSelectionRange(h,h),In()}}else if(l){if(ht.value){ht.value.focus();const h=m.length;ht.value.setSelectionRange(h,h)}}else if(s)Yn();else if(Pe.value&&document.activeElement===Pe.value){const h=u.length;Pe.value.setSelectionRange&&Pe.value.setSelectionRange(h,h),In()}else if(ht.value&&document.activeElement===ht.value){const h=m.length;ht.value.setSelectionRange(h,h)}else f.value&&Yn()},10)})})}},Gt=()=>{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"})},_e=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},Ol=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!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"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!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"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{_e()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{_e()});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(()=>{_e()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{_e()})}return!0},xl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!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"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!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"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Gt()}),!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)}}Gt()});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(()=>{Gt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Gt()})}return!0},Bn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt(),nn(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&zt(d)&&(r=wn())}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=xl();de.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(Nn(r),e.nextTick(()=>{const m=tn("bold");de.value.bold=m})),re(),Yt(),en()});return}if(o==="italic"){const d=Ol();de.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(Nn(r),e.nextTick(()=>{const m=tn("italic");de.value.italic=m})),re(),_e(),Yt(),en()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&Nn(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=tn("bold");de.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=tn("italic");de.value.italic=u});else{const u=document.queryCommandState(o);de.value[o]=u}else{const u=document.queryCommandState(o);de.value[o]=u}}catch{de.value.hasOwnProperty(o)?de.value[o]=!de.value[o]:de.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)})}re(),Yt(),en()})},tn=(o,l=null)=>{if(A.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 de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let x=M.parentElement;for(;x&&x!==f.value;){if(x.tagName==="STRONG"||x.tagName==="B"){u=!0;break}if(x.style&&parseInt(x.style.fontWeight)>=600){u=!0;break}x=x.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}}if(u)break}}return de.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 de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const h=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=h.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let x=M.parentElement;for(;x&&x!==f.value;){if(x.tagName==="EM"||x.tagName==="I"){u=!0;break}if(x.style&&x.style.fontStyle==="italic"){u=!0;break}x=x.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return de.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=d,d)}return de.value.hasOwnProperty(o)?de.value[o]:!1}catch{return de.value.hasOwnProperty(o)?de.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},zn=o=>{A.disabled||!A.richText||(we.value=we.value===o?null:o,o==="askAi"&&(it.value=null))},nn=()=>{we.value=null,et.value=null},Mn=o=>{Bn("formatBlock",o),nn()},to=o=>{if(!o||!f.value)return o;const l=He=>{let Se=He.nodeType===Node.TEXT_NODE?He.parentElement:He;for(;Se&&Se!==f.value;){const ot=Se.tagName;if(ot==="P"){const vn=Se.parentElement;if(vn===f.value||vn.tagName==="BLOCKQUOTE")return Se}if(ot==="BLOCKQUOTE")break;Se=Se.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:He=>{const Se=He.tagName;if(Se==="P"){const ot=He.parentElement;if(ot===f.value||ot.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Se==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const h=Math.min(m,v),M=Math.max(m,v),D=c.slice(h,M+1);if(D.length===0)return o;const x=D[0],ae=D[D.length-1],j=document.createRange();return j.setStartBefore(x),j.setEndAfter(ae),j},ql=()=>{if(A.disabled||!A.richText||!f.value)return;P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt(),nn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&zt(l)&&(l=to(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&zt(l)&&(s=wn());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:x=>x.parentNode===u&&x.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=h.nextNode();)v.push(M);if(v.forEach(x=>{const ae=document.createElement("p");x.parentNode.insertBefore(ae,x),ae.appendChild(x)}),u.querySelectorAll("p, div").forEach(x=>{x.textContent.trim()===""&&!x.querySelector("img")&&(x.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const x=document.createElement("p");x.innerHTML="<br>",u.appendChild(x)}}e.nextTick(()=>{s&&Nn(s),dt(),re(),en()})},xn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const D=M.textContent||"",ae=(M.innerHTML||"").trim();return D.trim()===""||ae===""||ae==="<br>"||ae==="<br/>"||ae==="<p></p>"||ae==="<p><br></p>"||ae==="<p><br/></p>"||ae==="<p> </p>"||ae==="<p><br> </p>"||ae==="<div></div>"||ae==="<div><br></div>"||ae==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const D=r.children[M];if((D.tagName==="P"||D.tagName==="DIV")&&c(D))D.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(()=>{dt(),re()})},Yt=()=>{if(!f.value){ge.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");ge.value=!!r}else ge.value=!1}catch{ge.value=!1}},$l=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),ke.value=wn();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),qe.value="",ct.value=s,mt.value="",Be.value=null,Te.value=!0,nn(),e.nextTick(()=>{R.value&&R.value.focus()})},Ll=()=>{if(!f.value)return;P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt();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&&Be.value&&(l=Be.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Be.value=null}else Bn("unlink");ge.value=!1,nn(),e.nextTick(()=>{re(),Yt()})},k=()=>{A.disabled||!A.richText||f.value&&(P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt(),nn(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{Z(),re(),en()}))},y=()=>{A.disabled||!A.richText||f.value&&(P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt(),nn(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{Z(),re(),en()}))},S=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},Z=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=S(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},pe=()=>{if(A.disabled||!A.richText||!f.value)return;nn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{Z(),re()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.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=S(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),Z();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{re(),en()})}else document.execCommand("indent",!1),e.nextTick(()=>{Z(),re(),en()})},Bt=()=>{if(A.disabled||!A.richText||!f.value)return;nn(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{Z(),re()});return}const r=s.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"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),Z();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{re(),en()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{Z(),re(),en()})},lt=e.ref(null),Jt=e.ref(null),pn=e.ref({}),cn=e.ref(""),kn=e.ref(null),jn=e.ref("");e.ref("");const Pn=e.ref(null);e.ref("");const _n=e.ref([]),tl=e.ref(!1),Tl=e.ref(!1),Po=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},ho=()=>{if(A.disabled||!A.richText||!f.value)return;if(lt.value!==null){lt.value=null,cn.value="",jn.value="",Pn.value=null,_n.value=[],yn(!0);return}nn(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!zt(l))return;jn.value=Po(l)||"",Pn.value=wn();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);pn.value={top:`${m}px`,bottom:"auto"},lt.value=Date.now(),e.nextTick(()=>{if(cn.value="",kn.value){const h=kn.value;h.style.height="auto",h.style.height=`${h.scrollHeight}px`,h.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const h=r.querySelector(".dss-text-editor-footer");if(h){const M=r.getBoundingClientRect(),D=v.getBoundingClientRect(),x=h.getBoundingClientRect(),ae=D.bottom-M.top,j=x.top-M.top,He=8;if(ae>j-He){const Se=x.height;pn.value={bottom:`${Se+He}px`,top:"auto"}}else pn.value={top:`${m}px`,bottom:"auto"}}}})},yo=()=>{if(!cn.value.trim())return;const o=cn.value.trim(),l=new Date,s={text:o,selectionText:jn.value,selectionRange:Pn.value,commentId:lt.value,user:A.commentUser||null,createdAt:l.toISOString()};_n.value=[..._n.value,s],U("comment-submitted",s),no(s),Pn.value&&!qo(Pn.value)&&Co(lt.value,Pn.value),cn.value="",e.nextTick(()=>{if(kn.value){const r=kn.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}hn("sendComment")})},Oo=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(_n.value=_n.value.filter((s,r)=>r!==l),lt.value!==null&&f.value){const s=String(lt.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&_n.value.length>0){const c=[],d=new Set;_n.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(_n.value.length))}else r&&_n.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(U("comment-deleted",{comment:o,index:l,commentId:lt.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));U("update:comments",s)}e.nextTick(()=>{hn("deleteComment")})}},qo=o=>{if(!o||!f.value)return!1;try{const l=ko(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ko=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 s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Co=(o,l)=>{if(!(!o||!l||!f.value))try{const s=ko(l);if(!s||s.collapsed)return;const r=s.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=s.startContainer,v=s.endContainer,h=s.startOffset,M=s.endOffset,D=m.nodeType===3?m.parentNode:m,x=v.nodeType===3?v.parentNode:v;if(D===x&&h===0&&M===(v.nodeType===3?v.length:x.childNodes.length)&&(D.tagName==="P"||D.tagName==="DIV"||D.tagName==="H1"||D.tagName==="H2"||D.tagName==="H3"||D.tagName==="H4"||D.tagName==="H5"||D.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{hn("wrapSelectionWithCommentMarker"),re()})}catch{}},no=o=>{if(!o||!o.commentId)return;const l=Array.isArray(A.comments)?[...A.comments]:[],s=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(s)||d.conversation_id===s);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:s,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)}tl.value=!0,U("update:comments",l)},bo=(o,l=[])=>{if(A.disabled||!A.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;nn(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),jn.value=r.innerHTML||"",Pn.value=wn();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const M=m.getBoundingClientRect(),D=u.bottom-M.top,ae=Math.max(D+8,0);pn.value={top:`${ae}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let h=[];if(v&&A.comments&&Array.isArray(A.comments)){const M=A.comments.find(D=>String(D.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const D=M.conversation.map(x=>({id:x.id||x.commentary_id,commentary_id:x.id||x.commentary_id,conversation_id:M.id||M.conversation_id,text:x.text,user:x.user,createdAt:x.created_at||x.createdAt,updated_at:x.updated_at||x.updatedAt}));h.push(...D)}}h.length===0&&Array.isArray(l)&&l.length>0&&(h=l.slice()),h.sort((M,D)=>{const x=He=>{if(!He)return 0;const Se=new Date(He).getTime();return isNaN(Se)?0:Se},ae=x(M.createdAt),j=x(D.createdAt);return ae===j?0:ae-j}),_n.value=h,yn(!0),lt.value=v||null,r&&(Jt.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(cn.value="",kn.value){const M=kn.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const D=m.querySelector(".dss-text-editor-footer");if(D){const x=m.getBoundingClientRect(),ae=M.getBoundingClientRect(),j=D.getBoundingClientRect(),He=ae.bottom-x.top,Se=j.top-x.top,ot=8;if(He>Se-ot){const vn=j.height;pn.value={bottom:`${vn+ot}px`,top:"auto"}}}}}hn("openCommentOverlayForSelector")})},lo=e.ref(null),wo=e.ref(0),oo=o=>{if(!(A.disabled||!A.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(()=>{xn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.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=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.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 s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.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=s.startContainer;let u=d;d.nodeType===3&&(s.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=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.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,D=s.cloneContents().textContent?.trim()||"",x=c.textContent?.trim()||"";(!v||!h||D.length>x.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(()=>{re()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?Bt():pe();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let h=v.previousSibling;for(;h;){if(h.classList&&h.classList.contains("dss-image-wrapper")||h.tagName==="IMG"||h.querySelector&&h.querySelector(".dss-image-wrapper")||h.querySelector&&h.querySelector("img"))return!0;h=h.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const h=v.closest("p, div");if(h&&h!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const D=s.startOffset;D<u.length&&(M=u.splitText(D));const x=document.createElement("p");if(M?x.appendChild(M):x.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}h.nextSibling?h.parentNode.insertBefore(x,h.nextSibling):h.parentNode.appendChild(x);const ae=document.createRange();M?ae.setStart(M,0):ae.setStart(x,0),ae.collapse(!0),l.removeAllRanges(),l.addRange(ae),e.nextTick(()=>{re()});return}}}}const r=s.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=j=>{if(!j)return!1;const He=j.textContent||"",ot=(j.innerHTML||"").trim(),vn=ot.replace(/<br\s*\/?>/gi,"").trim();return He.trim()===""||ot===""||vn===""||ot==="<br>"||ot==="<br/>"||ot==="<p></p>"||ot==="<p><br></p>"||ot==="<p><br/></p>"||ot==="<p> </p>"||ot==="<p><br> </p>"||ot==="<div></div>"||ot==="<div><br></div>"||ot==="<div><br/></div>"},v=c.lastChild,h=v&&v.nodeType===1&&v.tagName==="BR",M=s.startContainer,D=M.nodeType===3?M.parentElement:M,x=D===c||D&&D.parentElement===c;if(u&&m(u)||h&&x){o.preventDefault(),setTimeout(()=>{xn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-wo.value;if(lo.value===" "&&s<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(),pe();return}}}}lo.value=" ",wo.value=l}else lo.value=o.key}},Wo=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),tt();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(D=>{if(h>0){const x=v.createElement("p");x.innerHTML=D.innerHTML,D.parentNode.replaceChild(x,D)}else h++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],x=Array.from(v.body.children).filter(ae=>D.includes(ae.tagName));if(x.length===1){const ae=x[0].tagName,j=c.tagName,He=c.textContent.trim()===""&&!c.querySelector("img");let Se=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Se=!0:He||(ae===j||ae==="P")&&(Se=!0),Se)return x[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);re()},Wl=o=>{if(we.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&nn()}if(gt.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Dl()}if(it.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Zl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(et.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&zt(r)}else Y.value=!1}if(lt.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.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&&(lt.value=null,cn.value="",jn.value="",Pn.value=null,_n.value=[],yn(!0))}},En=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),pt.value&&(clearTimeout(pt.value),pt.value=null),et.value=l},F=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}pt.value&&clearTimeout(pt.value),pt.value=setTimeout(()=>{et.value=null,pt.value=null},150)},Cn=o=>{et.value=null};let On=0;const Al=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.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=s.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-${++On}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.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&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},fn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Al(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&&En(v,h)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=h=>{const M=c.getAttribute("data-submenu-id");M&&En(h,M)},m=F;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",Cn)})})})};let Sn=null;const jt=()=>{if(et.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${et.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${et.value}"]`);o&&l&&Mo(o,l)}if(gt.value&&en(),A.richText){if(Sn!==null)return;Sn=setTimeout(()=>{Sn=null,hn("handleWindowResize")},150)}},Qt=()=>{if(!A.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")})})},rl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{an.value?In():Vn(),V.value?Xn():ul()})}),e.nextTick(()=>{rl()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Wl),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},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 s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{fn(),Qt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!A.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),D=v.closest(".dss-image-wrapper");if(M||D&&v===D){m.preventDefault(),m.stopPropagation();const x=window.getSelection(),ae=document.createRange();ae.setStartAfter(D),ae.collapse(!0),x.removeAllRanges(),x.addRange(ae)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const x=window.getSelection();if(x.rangeCount>0){const j=x.getRangeAt(0).commonAncestorContainer,He=j.nodeType===3?j.parentElement:j;if(D.contains(He)&&He!==D.querySelector("img")){const Se=document.createRange();Se.setStartAfter(D),Se.collapse(!0),x.removeAllRanges(),x.addRange(Se)}}else{const ae=document.createRange();ae.setStartAfter(D),ae.collapse(!0),x.addRange(ae)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,h=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(h||M&&v.tagName!=="IMG"){m.preventDefault();const D=window.getSelection(),x=document.createRange();M&&(x.setStartAfter(M),x.collapse(!0),D.removeAllRanges(),D.addRange(x))}},!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 D=h.getAttribute("alt")||h.alt||"";if(D){const x=h.getAttribute("src")||h.src||"",ae=x.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===x||D===ae;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="")}}}),Vt()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,h=v.tagName==="IMG"?v:v.closest("img"),M=h?.closest(".dss-image-wrapper");h&&f.value.contains(h)&&($t.value=M||h,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{$t.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{$t.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!$t.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=$t.value,h=v.classList?.contains("dss-image-wrapper"),M=h?v.querySelector("img"):v,D=h?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){$t.value=null;return}let x=null;const ae=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)x=document.caretRangeFromPoint(ae,j);else{const ln=window.getSelection();ln.rangeCount>0?x=ln.getRangeAt(0).cloneRange():(x=document.createRange(),x.selectNodeContents(f.value),x.collapse(!1))}if(!x){$t.value=null;return}const He=x.commonAncestorContainer,Se=He.nodeType===3?He.parentElement:He;if(Se?.closest(".dss-image-wrapper")===D||D&&D.contains(Se)){$t.value=null;return}if(D&&(Se===D||D.contains(Se))){$t.value=null;return}const vn=M.getAttribute("src");let un=null;D?un=D.cloneNode(!0):un=M.cloneNode(!0);try{let ln=x.startContainer;if(ln.nodeType===3&&(ln=ln.parentElement),D&&(ln===D||D.contains(ln))){const rn=document.createRange();rn.setStartAfter(D),rn.collapse(!0),x=rn}x.insertNode(un);const dn=document.createRange();dn.setStartAfter(un),dn.collapse(!0);const sn=window.getSelection();sn.removeAllRanges(),sn.addRange(dn)}catch{if(f.value.childNodes.length===0){const dn=document.createElement("p");dn.appendChild(un),f.value.appendChild(dn)}else{const dn=f.value.lastChild;if(dn&&dn.nodeType===1)dn.appendChild(un);else{const sn=document.createElement("p");sn.appendChild(un),f.value.appendChild(sn)}}}D?D.remove():M.remove(),$t.value=null,e.nextTick(()=>{const ln=f.value.querySelectorAll("img");let dn=!1;ln.forEach(sn=>{if(sn.getAttribute("src")===vn)if(!dn)dn=!0;else{const rn=sn.closest(".dss-image-wrapper");rn?rn.remove():sn.remove()}}),Vt(),re()})}),f.value.addEventListener("dragend",m=>{$t.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(h=>{if(h.nodeType===1){h.tagName==="IMG"&&(h.removeAttribute("alt"),h.removeAttribute("data-alt"),h.setAttribute("alt",""),h.setAttribute("data-alt",""),h.alt="");const M=h.querySelectorAll&&h.querySelectorAll("img");M&&M.forEach(D=>{D.removeAttribute("alt"),D.removeAttribute("data-alt"),D.setAttribute("alt",""),D.setAttribute("data-alt",""),D.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{Vt(),Qt(),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(()=>{Qt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=Cl(A.modelValue);f.value.innerHTML=m,yt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",h=A.description||"";X.value=m,me.value=v,ze.value=h,nt.value=v,St.value=h,Z(),Vt(),_e(),wt(),uo(),bn()}),Yt(),dt(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Wl),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Sn!==null&&(clearTimeout(Sn),Sn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Re.value&&clearTimeout(Re.value),pt.value&&clearTimeout(pt.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Ye.value&&Ye.value.disconnect(),at.value!==null&&(cancelAnimationFrame(at.value),at.value=null),Ve.value!==null&&(clearTimeout(Ve.value),Ve.value=null),st.value!==null&&(clearTimeout(st.value),st.value=null),yn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ml=o=>{const l=o.target,s=l.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);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)}}Vt(),Yt(),dt(),en(),wt()}):e.nextTick(()=>{Vt(),Yt(),dt(),en(),wt()})},At=()=>{dl();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&zt(s),!s.collapsed&&w.value&&(w.value=null)}else Y.value=!1;if(Vt(),Yt(),dt(),en(),wt(),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(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="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{}de.value[s]=m}else{const d=document.queryCommandState(s);de.value[s]=d}}}catch{}})},wt=()=>{if(!A.richText||A.disabled||!f.value){E.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){E.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){E.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){E.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?E.value=d:E.value="p"}catch{E.value="p"}},dt=()=>{if(!f.value){vt.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))}vt.value=l}catch{vt.value=!1}},zt=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Dl=()=>{gt.value=!1},en=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){gt.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){gt.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!zt(l)){gt.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){gt.value=!1;return}const r=f.value;if(!r){gt.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){gt.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const h=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Pt.value&&(M=Pt.value.getBoundingClientRect().width);const D=(M||320)/2;let x=c.left+D,ae=c.right-D;if(ae<x){const j=c.left+c.width/2;x=j,ae=j}if(h>0){const j=D+u,He=h-D-u;if(x=Math.max(x,j),ae=Math.min(ae,He),ae<x){const Se=h/2;x=Se,ae=Se}}v<x?v=x:v>ae&&(v=ae),We.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},gt.value=!0},El=o=>{A.disabled||!A.richText||(it.value=it.value===o?null:o,o==="askAi"&&(we.value=null))},Zl=()=>{it.value=null,et.value=null},Ln=o=>{Mn(o),Zl()};let nl=null,ll=null,pl=null,fl=null;const Zo=o=>{if(A.disabled||!A.richText){Sl(),Hl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(nl&&(clearTimeout(nl),nl=null),pl&&(clearTimeout(pl),pl=null),s&&s!==ll){Hl(),ll=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Be.value=s,ve.value=c,oe.value=!0,Ce.value=!0,Kn(s)}else!s&&ll?(ll=null,nl=setTimeout(()=>{Ce.value||Sl()},150)):s&&s===ll&&Kn(s);if(r&&r!==fl){Sl(),fl=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),kt.value=r,Ut.value=c.trim()||L("textEditor.image.noAlt"),Mt.value=!0,be.value=!0,xo(r)}else!r&&fl?(fl=null,pl=setTimeout(()=>{be.value||Hl()},150)):r&&r===fl&&xo(r)},vl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(ll=null,fl=null,nl&&(clearTimeout(nl),nl=null),pl&&(clearTimeout(pl),pl=null),Sl(),Hl())},Sl=()=>{Ce.value=!1,setTimeout(()=>{Ce.value||(oe.value=!1,ve.value="",Te.value||(Be.value=null))},100)},Kn=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Hl=()=>{be.value=!1,setTimeout(()=>{be.value||(Mt.value=!1,Ut.value="",Et.value||(kt.value=null))},100)},xo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;Q.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Rl=()=>{if(!ve.value||!Be.value)return;let l=Be.value.getAttribute("href")||ve.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(Be.value){const o=Be.value.textContent||"",l=Be.value.getAttribute("href")||"",s=Be.value;qe.value=l,ct.value=o,mt.value=o,Ce.value=!1,oe.value=!1,ve.value="",Be.value=s,Te.value=!0}else if(ge.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";qe.value=d,ct.value=c,mt.value=c,Be.value=r,Te.value=!0}}}else{ke.value=wn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),qe.value="",ct.value=l,mt.value="",Be.value=null,Te.value=!0}e.nextTick(()=>{R.value&&(R.value.focus(),R.value.select())})},Fl=()=>{Te.value=!1,qe.value="",ct.value="",mt.value="",Be.value=null,ke.value=null},ao=()=>{if(!qe.value.trim()){Fl();return}if(P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt(),ct.value.trim()||(ct.value=qe.value.trim()),Be.value&&f.value&&f.value.contains(Be.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Be.value;if(l.setAttribute("href",qe.value.trim()),ct.value.trim()!==mt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=ct.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),re()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),ke.value&&Nn(ke.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=qe.value.trim(),s.textContent=ct.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),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 s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=qe.value.trim(),d.textContent=ct.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.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=s.textContent.substring(0,l.startOffset),M=h[h.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
100
|
+
</svg>`,f=e.ref(null),xe=e.ref(null),he=e.ref(!1),ne=e.ref(!1),le=e.ref(!1),fe=e.ref(""),H=e.ref({}),be=e.ref(!1),Te=e.ref(!1),ze=e.ref(""),rt=e.ref(""),R=e.ref(null),Ee=e.ref(null),Be=e.ref(null),Ce=e.ref(null),gt=e.ref(""),pt=e.ref(!1),de=e.ref({}),ut=e.ref(!1),Oe=e.ref({}),Ut=e.ref(null),st=e.ref(null),Et=e.ref(!1),Tt=e.ref(""),qt=e.ref(null),Ft=e.ref(""),G=e.ref(""),me=e.ref(""),He=e.ref(null),Ue=e.ref(null),Wt=e.ref(null),yt=e.ref(null),Pt=e.ref(null),wt=e.ref(!1),It=e.ref(""),Q=e.ref({}),ye=e.ref(!1),Me=e.ref("upload"),qe=e.ref(""),et=e.ref(null),St=e.ref(null),Xe=e.ref([]),Vt=e.ref([]),Ye=e.ref(null),W=e.ref(!1),Z=e.ref(""),K=e.ref(""),ve=e.ref(""),We=e.ref(""),Ke=e.ref(""),Nt=e.ref(""),Qe=e.ref(null),lt=e.ref(null),Xt=e.ref(null),ln=e.ref(!1),$t=e.ref(null),Qt=e.ref(!1),V=e.ref(!1),w=e.ref(null),S=e.ref("p"),Y=e.ref(!1),J=e.ref([]),Pe=e.ref(null),ft=e.ref(null),tt=e.ref(null),we=e.ref(!1),Bt=e.ref(0),At=100,kt=e.ref(null),nt=e.computed(()=>({"dss-text-editor-no-border":!A.border,"dss-text-editor-rounded":A.rounded,"dss-text-editor-full-height":A.fullHeight,"dss-comment-overlay-open":q.value!==null})),dt=e.computed(()=>({})),Wn=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+24+2}px`,resize:"none",overflowY:"auto"}),O=e.computed(()=>!A.fixedHeight||A.fullHeight?{}:{height:`${1.6*14*A.rows+32}px`,overflowY:"auto"}),U=e.computed(()=>A.richText&&Vt.value.length>0),P=e.computed(()=>{if(!A.modelValue)return"";if(A.richText){let o=A.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 A.modelValue}),se=e.computed(()=>{const o=P.value.trim();return o?o.split(/\s+/).filter(l=>l.length>0).length:0}),Fe=e.computed(()=>P.value.length),ct=e.computed(()=>yt.value!==null&&Me.value==="upload"&&Ft.value&&Ft.value.startsWith("data:")),mt=e.computed(()=>A.titlePlaceholder||L("textEditor.placeholders.title")),Je=e.computed(()=>A.descriptionPlaceholder||L("textEditor.placeholders.description")),xt=e.computed(()=>A.placeholder||L("textEditor.placeholders.startTyping")),zt=o=>je&&je[o]!==void 0,Tn=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++)if(zt(A.customToolbarSlots[l]))return!0;return!1},An=o=>{for(let l=o+1;l<A.customToolbarSlots.length;l++){const s=A.customToolbarSlots[l];if(zt(s)&&Dn(s))return!0}return!1},Dn=o=>A.customToolbarFloatingMap.hasOwnProperty(o)?A.customToolbarFloatingMap[o]===!0:!0,cl=e.computed(()=>A.customToolbarSlots.some(o=>zt(o)&&Dn(o))),Hn=e.computed(()=>zt("title-slot")),Nl=e.computed(()=>zt("description-slot")),nl=o=>{if(!o||o.trim()==="")return"<html></html>";const l=o.trim();return l.startsWith("<html>")&&l.endsWith("</html>")?o:`<html>${o}</html>`},yl=o=>{if(!o||o.trim()==="")return"";const l=o.replace(/<!--[\s\S]*?-->/g,""),s=l.trim();return s.startsWith("<html>")&&s.endsWith("</html>")?s.slice(6,-7).trim():l},Bl=o=>{if(!o)return;const l=document.createTreeWalker(o,NodeFilter.SHOW_COMMENT,null,!1),s=[];let r=l.nextNode();for(;r;)s.push(r),r=l.nextNode();s.forEach(c=>c.remove())},zl=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""}},Ml=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=L("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"},Pl=o=>{const l=o.target.value;X("update:modelValue",l),X("change",l)},Vn=()=>{if(!Qe.value)return;const o=Qe.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 s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},to=()=>{Qt.value=!0,Vn()},ll=()=>{Qt.value=!1,pn()},pn=()=>{if(!Qe.value)return;const o=Qe.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important"),o.style.setProperty("overflow-x","hidden","important"),o.style.setProperty("text-overflow","ellipsis","important"),o.style.setProperty("white-space","nowrap","important")},$n=o=>{const s=o.target.value;Qt.value&&Vn(),X("update:title",s),X("title-change",s),Xt.value="title",A.richText&&(W.value||(K.value=Z.value,Ke.value=ve.value,Nt.value=We.value),Ye.value&&clearTimeout(Ye.value),W.value=!0,Ye.value=setTimeout(()=>{W.value=!1,ot()},500))},xn=()=>{if(!lt.value)return;const o=lt.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 s=o.scrollHeight;o.style.setProperty("height",`${s}px`,"important"),o.style.setProperty("overflow-y","hidden","important")},kl=()=>{V.value=!0,xn()},Ol=()=>{V.value=!1,ul()},ul=()=>{if(!lt.value)return;const o=lt.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 s=o.scrollHeight;o.value=l,o.offsetHeight,o.style.setProperty("height",`${s}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")},Cl=o=>{const s=o.target.value;V.value&&xn(),X("update:description",s),X("description-change",s),Xt.value="description",A.richText&&(W.value||(K.value=Z.value,Ke.value=ve.value,Nt.value=We.value),Ye.value&&clearTimeout(Ye.value),W.value=!0,Ye.value=setTimeout(()=>{W.value=!1,ot()},500))},Nn=()=>{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 s=l.cloneRange();return s.selectNodeContents(f.value),s.setEnd(l.startContainer,l.startOffset),{type:"text",start:s.toString().length,end:s.toString().length+l.toString().length}},Bn=o=>{if(!(!o||!f.value))try{const l=window.getSelection(),s=document.createRange();if(o.type==="element"&&o.element)if(f.value.contains(o.element)){s.setStart(o.element,o.offset),s.collapse(!0),l.removeAllRanges(),l.addRange(s);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&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.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(s)}catch{f.value.focus()}},dl=()=>{if(!f.value)return;f.value.focus();const o=window.getSelection(),l=document.createRange(),s=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=s(u);if(m)return m}return c},r=s(f.value);if(r.nodeType===3)l.setStart(r,r.length),l.setEnd(r,r.length);else if(r.childNodes.length>0){const c=s(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)},ot=(o=!1)=>{if(!f.value)return;const l=f.value.innerHTML,s=A.title||"",r=A.description||"";if(!o&&l===Z.value&&s===ve.value&&r===We.value)return;const c={content:K.value||Z.value,title:Ke.value!==void 0?Ke.value:ve.value,description:Nt.value!==void 0?Nt.value:We.value},d=Xe.value.length>0?Xe.value[Xe.value.length-1]:null;let u=!0;d&&(typeof d=="string"?u=c.content!==d:u=c.content!==d.content||c.title!==d.title||c.description!==d.description),u&&(Xe.value.push(c),Xe.value.length>50&&Xe.value.shift(),Vt.value=[]),Z.value=l,ve.value=s,We.value=r,K.value=l,Ke.value=s,Nt.value=r},re=o=>{if(!f.value)return;ol(),f.value&&Bl(f.value);let l=null;f.value&&(f.value.querySelector("p")||(l=Nn(),vt()));const s=o&&o.inputType&&(o.inputType==="insertText"||o.inputType==="insertCompositionText"||o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward");s&&w.value&&(w.value=null),ne.value=!0;const r=f.value.innerHTML.replace(/<!--[\s\S]*?-->/g,"").replace(/ |\u00A0/g," "),c=nl(r);X("update:modelValue",c),X("change",c),Xt.value="editor",W.value||(K.value=Z.value,Ke.value=ve.value,Nt.value=We.value),Ye.value&&clearTimeout(Ye.value),W.value=!0,Ye.value=setTimeout(()=>{W.value=!1,ot(),Ul(),So()},500),e.nextTick(()=>{l&&Bn(l),ol();const d=["bold","italic","underline"],u=window.getSelection(),m=u.rangeCount>0?u.getRangeAt(0):null,v=m&&m.collapsed;if(d.forEach(y=>{try{if(v&&w.value?.command===y){de.value[y]=w.value.state;return}if(y==="bold")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M;let E=!1;if(D&&((D.tagName==="STRONG"||D.tagName==="B"||D.closest&&D.closest("strong, b"))&&(E=!0),!E&&D.style&&parseInt(D.style.fontWeight)>=600&&(E=!0),!E))try{const oe=window.getComputedStyle(D);parseInt(oe.fontWeight)>=600&&(E=!0)}catch{}de.value[y]=E}else de.value.hasOwnProperty(y)||(de.value[y]=!1);else if(y==="italic")if(m){const M=m.commonAncestorContainer,D=M.nodeType===3?M.parentElement:M,E=D&&(D.tagName==="EM"||D.tagName==="I"||D.closest&&D.closest("em, i"));de.value[y]=!!E}else{const M=document.queryCommandState(y);de.value[y]=M}else{const M=document.queryCommandState(y);de.value[y]=M}}catch{}}),k(),fn(),$e(),en(),bt(),hn("handleRichTextInput"),s&&(o.inputType==="insertText"||o.inputType==="insertCompositionText")){const y=o.data||"";y&&y.length===1&&setTimeout(()=>So(y),0),(y===" "||y===`
|
|
101
|
+
`||/[.,;:!?]/.test(y))&&setTimeout(()=>{Ul()},100)}ne.value=!1})},ol=()=>{if(!f.value)return;const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;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)}}}},vt=()=>{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"]),s=Array.from(o.childNodes);let r=null;s.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)}})},fn=()=>{if(f.value&&!ln.value){ln.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 y=d.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),M=c===d||c===y;(c.startsWith("http://")||c.startsWith("https://")||c.startsWith("data:")||M||M)&&(c="")}r.setAttribute("alt",c),r.setAttribute("data-alt",c);const u=!c||c.trim()==="";let m=r.parentElement;const v=m&&m.classList.contains("dss-image-wrapper");if(v){const y=m.querySelector(".dss-image-no-alt-icon");y&&y.remove()}else{const y=r.nextElementSibling?.classList.contains("dss-image-no-alt-icon")?r.nextElementSibling:null;y&&y.remove()}if(u){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 y=document.createElement("div");y.className="dss-image-no-alt-icon",y.setAttribute("contenteditable","false"),y.innerHTML=ge,m.appendChild(y)}else if(v&&m.children.length===1){const y=m.parentNode;y.insertBefore(r,m),y.removeChild(m)}})}finally{ln.value=!1}}},Ae=o=>{Ul(),X("blur",o),Hl()},Ct=()=>{if(A.disabled||!A.richText||!f.value)return;on(),Ye.value&&(clearTimeout(Ye.value),Ye.value=null),W.value&&(ot(),W.value=!1);const o=Xt.value==="title",l=Xt.value==="description",s=Xt.value==="editor";if(Xe.value.length===0){o&&Qe.value?Qe.value.focus():l&<.value?lt.value.focus():f.value.focus(),document.execCommand("undo",!1),e.nextTick(()=>{re()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Vt.value.push(r);const c=Xe.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Z.value=d,ve.value=u,We.value=m,K.value=d,Ke.value=u,Nt.value=m,e.nextTick(()=>{k(),Cn(),it(),en();const v=nl(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Qe.value){Qe.value.focus();const y=u.length;Qe.value.setSelectionRange&&Qe.value.setSelectionRange(y,y),Vn()}}else if(l){if(lt.value){lt.value.focus();const y=m.length;lt.value.setSelectionRange(y,y)}}else if(s)dl();else if(Qe.value&&document.activeElement===Qe.value){const y=u.length;Qe.value.setSelectionRange&&Qe.value.setSelectionRange(y,y),Vn()}else if(lt.value&&document.activeElement===lt.value){const y=m.length;lt.value.setSelectionRange(y,y)}else f.value&&dl()},10)})})}},ae=()=>{if(A.disabled||!A.richText||!f.value)return;on();const o=Xt.value==="title",l=Xt.value==="description",s=Xt.value==="editor";if(Vt.value.length===0){o&&Qe.value?Qe.value.focus():l&<.value?lt.value.focus():f.value.focus(),document.execCommand("redo",!1),e.nextTick(()=>{re()});return}const r={content:f.value.innerHTML,title:A.title||"",description:A.description||""};Xe.value.push(r);const c=Vt.value.pop();if(c!==void 0){ne.value=!0;const d=typeof c=="string"?c:c.content,u=typeof c=="object"&&c.title||"",m=typeof c=="object"&&c.description||"";f.value.innerHTML=d,Z.value=d,ve.value=u,We.value=m,K.value=d,Ke.value=u,Nt.value=m,e.nextTick(()=>{k(),Cn(),it(),en();const v=nl(d);X("update:modelValue",v),X("update:title",u),X("update:description",m),X("change",v),X("title-change",u),X("description-change",m),ne.value=!1,e.nextTick(()=>{setTimeout(()=>{if(o){if(Qe.value){Qe.value.focus();const y=u.length;Qe.value.setSelectionRange&&Qe.value.setSelectionRange(y,y),Vn()}}else if(l){if(lt.value){lt.value.focus();const y=m.length;lt.value.setSelectionRange(y,y)}}else if(s)dl();else if(Qe.value&&document.activeElement===Qe.value){const y=u.length;Qe.value.setSelectionRange&&Qe.value.setSelectionRange(y,y),Vn()}else if(lt.value&&document.activeElement===lt.value){const y=m.length;lt.value.setSelectionRange(y,y)}else f.value&&dl()},10)})})}},Lt=()=>{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"})},$e=()=>{if(!f.value)return;f.value.querySelectorAll("i, em").forEach(l=>{l.style.fontStyle="italic"})},bl=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!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"){s=!0;break}if(c.style&&c.style.fontStyle==="italic"){s=!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"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="EM"||u.tagName==="I"){s=!0;break}if(u.style&&u.style.fontStyle==="italic"){s=!0;break}}if(s)break}}}if(s)return document.execCommand("italic",!1),e.nextTick(()=>{$e()}),!1;if(l.collapsed)document.execCommand("italic",!1),e.nextTick(()=>{$e()});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(()=>{$e()})}catch{document.execCommand("italic",!1),e.nextTick(()=>{$e()})}return!0},_l=()=>{const o=window.getSelection();if(!o||o.rangeCount===0)return!1;const l=o.getRangeAt(0);let s=!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"){s=!0;break}if(c.style&&parseInt(c.style.fontWeight)>=600){s=!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"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}u=u.parentElement}}else if(d.nodeType===1){const u=d;if(u.tagName==="STRONG"||u.tagName==="B"){s=!0;break}if(u.style&&parseInt(u.style.fontWeight)>=600){s=!0;break}}if(s)break}}}if(s)return document.execCommand("bold",!1),e.nextTick(()=>{Lt()}),!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 y=document.createDocumentFragment();for(;u.firstChild;)y.appendChild(u.firstChild);v.appendChild(y),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)}}Lt()});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(()=>{Lt()})}catch{document.execCommand("bold",!1),e.nextTick(()=>{Lt()})}return!0},kn=(o,l=null)=>{if(A.disabled||!A.richText||!f.value)return;W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot(),on(),f.value.focus();const s=window.getSelection();let r=null;if(s&&s.rangeCount>0){const d=s.getRangeAt(0);!d.collapsed&&Ot(d)&&(r=Nn())}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=_l();de.value.bold=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"bold",state:d}),e.nextTick(()=>{r&&(Bn(r),e.nextTick(()=>{const m=Jt("bold");de.value.bold=m})),re(),Cn(),en()});return}if(o==="italic"){const d=bl();de.value.italic=d;const u=window.getSelection();u.rangeCount>0&&u.getRangeAt(0).collapsed&&(w.value={command:"italic",state:d}),e.nextTick(()=>{r&&(Bn(r),e.nextTick(()=>{const m=Jt("italic");de.value.italic=m})),re(),$e(),Cn(),en()});return}let c=!1;try{c=document.execCommand(o,!1,l)}catch{}e.nextTick(()=>{if(r&&Bn(r),["bold","italic","underline"].includes(o))try{if(o==="bold")r&&e.nextTick(()=>{const u=Jt("bold");de.value.bold=u});else if(o==="italic")if(r)e.nextTick(()=>{const u=Jt("italic");de.value.italic=u});else{const u=document.queryCommandState(o);de.value[o]=u}else{const u=document.queryCommandState(o);de.value[o]=u}}catch{de.value.hasOwnProperty(o)?de.value[o]=!de.value[o]:de.value[o]=!0}if(o==="createLink"&&l){const u=window.getSelection();if(u.rangeCount>0){const v=u.getRangeAt(0),y=v.commonAncestorContainer.nodeType===1?v.commonAncestorContainer.closest("a"):v.commonAncestorContainer.parentElement?.closest("a");y&&(!y.getAttribute("href")||y.getAttribute("href")==="")&&y.setAttribute("href",l)}f.value.querySelectorAll("a").forEach(v=>{const y=v.getAttribute("href");(!y||y===""||y==="#")&&v.setAttribute("href",l)})}re(),Cn(),en()})},Jt=(o,l=null)=>{if(A.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 y=window.getComputedStyle(v);parseInt(y.fontWeight)>=600&&(u=!0)}catch{}return de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="STRONG"||E.tagName==="B"){u=!0;break}if(E.style&&parseInt(E.style.fontWeight)>=600){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="STRONG"||D.tagName==="B"){u=!0;break}if(D.style&&parseInt(D.style.fontWeight)>=600){u=!0;break}}if(u)break}}return de.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 de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=u,u)}else{const m=c.commonAncestorContainer.nodeType===1?c.commonAncestorContainer:c.commonAncestorContainer.parentNode;let v=!1;if(m){const y=document.createTreeWalker(m,NodeFilter.SHOW_TEXT|NodeFilter.SHOW_ELEMENT,null);let M;for(;M=y.nextNode();)if(!(typeof c.intersectsNode=="function"&&!c.intersectsNode(M))){if(M.nodeType===3){if(!(M.textContent||"").trim())continue;v=!0;let E=M.parentElement;for(;E&&E!==f.value;){if(E.tagName==="EM"||E.tagName==="I"){u=!0;break}if(E.style&&E.style.fontStyle==="italic"){u=!0;break}E=E.parentElement}}else if(M.nodeType===1){const D=M;if(D.tagName==="EM"||D.tagName==="I"){u=!0;break}if(D.style&&D.style.fontStyle==="italic"){u=!0;break}}if(u)break}}return de.value[o]=u&&v,u&&v}}const d=document.queryCommandState(o);return c.collapsed&&de.value.hasOwnProperty(o)?de.value[o]:(de.value[o]=d,d)}return de.value.hasOwnProperty(o)?de.value[o]:!1}catch{return de.value.hasOwnProperty(o)?de.value[o]:!1}try{return document.queryCommandState(o)}catch{return!1}}catch{return!1}},Kn=o=>{A.disabled||!A.richText||(xe.value=xe.value===o?null:o,o==="askAi"&&(st.value=null))},on=()=>{xe.value=null,et.value=null},Zn=o=>{kn("formatBlock",o),on()},al=o=>{if(!o||!f.value)return o;const l=Re=>{let Ve=Re.nodeType===Node.TEXT_NODE?Re.parentElement:Re;for(;Ve&&Ve!==f.value;){const at=Ve.tagName;if(at==="P"){const gn=Ve.parentElement;if(gn===f.value||gn.tagName==="BLOCKQUOTE")return Ve}if(at==="BLOCKQUOTE")break;Ve=Ve.parentElement}return null},s=l(o.startContainer),r=l(o.endContainer);if(!s||!r)return o;const c=[],d=document.createTreeWalker(f.value,NodeFilter.SHOW_ELEMENT,{acceptNode:Re=>{const Ve=Re.tagName;if(Ve==="P"){const at=Re.parentElement;if(at===f.value||at.tagName==="BLOCKQUOTE")return NodeFilter.FILTER_ACCEPT}return Ve==="BLOCKQUOTE"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_SKIP}});let u;for(;u=d.nextNode();)c.push(u);const m=c.indexOf(s),v=c.indexOf(r);if(m===-1||v===-1)return o;const y=Math.min(m,v),M=Math.max(m,v),D=c.slice(y,M+1);if(D.length===0)return o;const E=D[0],oe=D[D.length-1],j=document.createRange();return j.setStartBefore(E),j.setEndAfter(oe),j},$l=()=>{if(A.disabled||!A.richText||!f.value)return;W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot(),on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;let l=o.getRangeAt(0);!l.collapsed&&Ot(l)&&(l=al(l),o.removeAllRanges(),o.addRange(l));let s=null;!l.collapsed&&Ot(l)&&(s=Nn());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 y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}else if(v.nodeType===Node.TEXT_NODE&&v.textContent.trim()){const y=document.createElement("p");y.appendChild(v.cloneNode(!0)),u.insertBefore(y,c)}}),c.remove()}}else if(l.collapsed)document.execCommand("formatBlock",!1,"<blockquote>");else{const u=document.createElement("blockquote"),m=l.extractContents();u.appendChild(m),l.insertNode(u);const v=[],y=document.createTreeWalker(u,NodeFilter.SHOW_TEXT,{acceptNode:E=>E.parentNode===u&&E.textContent.trim()?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let M;for(;M=y.nextNode();)v.push(M);if(v.forEach(E=>{const oe=document.createElement("p");E.parentNode.insertBefore(oe,E),oe.appendChild(E)}),u.querySelectorAll("p, div").forEach(E=>{E.textContent.trim()===""&&!E.querySelector("img")&&(E.innerHTML="<br>")}),u.children.length===0&&u.textContent.trim()===""){const E=document.createElement("p");E.innerHTML="<br>",u.appendChild(E)}}e.nextTick(()=>{s&&Bn(s),it(),re(),en()})},Mn=()=>{if(!f.value)return;const o=window.getSelection();if(o.rangeCount===0)return;const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.tagName==="BLOCKQUOTE"?s:s.closest("blockquote"):s.parentElement?.closest("blockquote");if(!r||!f.value.contains(r))return;const c=M=>{if(!M)return!1;const D=M.textContent||"",oe=(M.innerHTML||"").trim();return D.trim()===""||oe===""||oe==="<br>"||oe==="<br/>"||oe==="<p></p>"||oe==="<p><br></p>"||oe==="<p><br/></p>"||oe==="<p> </p>"||oe==="<p><br> </p>"||oe==="<div></div>"||oe==="<div><br></div>"||oe==="<div><br/></div>"};let d=null;for(s.nodeType===3?d=s.parentElement:s.tagName==="P"||s.tagName==="DIV"?d=s:d=s.closest("p, div"),d&&r.contains(d)&&c(d)&&d.remove();r.lastChild;){const M=r.lastChild;if(M.nodeType===1&&M.tagName==="BR")M.remove();else if(M.nodeType===3)if((M.textContent||"").trim()==="")M.remove();else break;else break}if(r.children.length>0)for(let M=r.children.length-1;M>=0;M--){const D=r.children[M];if((D.tagName==="P"||D.tagName==="DIV")&&c(D))D.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 y=document.createRange();y.selectNodeContents(v),y.collapse(!0),o.removeAllRanges(),o.addRange(y),e.nextTick(()=>{it(),re()})},Cn=()=>{if(!f.value){he.value=!1;return}try{const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");he.value=!!r}else he.value=!1}catch{he.value=!1}},ql=()=>{if(!f.value)return;const o=window.getSelection();o&&o.rangeCount>0&&o.getRangeAt(0),Ce.value=Nn();const l=window.getSelection();let s="";l.rangeCount>0&&(s=l.getRangeAt(0).toString()),ze.value="",rt.value=s,gt.value="",Be.value=null,Te.value=!0,on(),e.nextTick(()=>{R.value&&R.value.focus()})},Gn=()=>{if(!f.value)return;W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot();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&&Be.value&&(l=Be.value),l&&l.parentNode){const s=document.createDocumentFragment();for(;l.firstChild;)s.appendChild(l.firstChild);if(l.parentNode.replaceChild(s,l),s.firstChild){const r=document.createRange();r.setStartBefore(s.firstChild),r.setEndAfter(s.lastChild||s.firstChild),o.removeAllRanges(),o.addRange(r),document.execCommand("removeFormat",!1),r.collapse(!1),o.removeAllRanges(),o.addRange(r)}Be.value=null}else kn("unlink");he.value=!1,on(),e.nextTick(()=>{re(),Cn()})},Rn=()=>{A.disabled||!A.richText||f.value&&(W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot(),on(),f.value.focus(),document.execCommand("insertUnorderedList",!1),e.nextTick(()=>{k(),re(),en()}))},Ll=()=>{A.disabled||!A.richText||f.value&&(W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot(),on(),f.value.focus(),document.execCommand("insertOrderedList",!1),e.nextTick(()=>{k(),re(),en()}))},Tl=o=>{const l=o.parentElement;if(!l||l.tagName!=="OL")return null;let s=0,r=o.previousElementSibling;for(;r;)r.tagName==="LI"&&s++,r=r.previousElementSibling;return s+1},k=()=>{if(!f.value)return;f.value.querySelectorAll("li > ol").forEach(l=>{const s=l.parentElement;if(s&&s.tagName==="LI"){const r=Tl(s);r!==null&&Array.from(l.children).filter(d=>d.tagName==="LI").forEach(d=>{d.setAttribute("data-parent-num",String(r))})}})},h=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("indent",!1),e.nextTick(()=>{k(),re()});return}const r=s.parentElement;if(!r||r.tagName!=="OL"&&r.tagName!=="UL")return;const c=s.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=Tl(c);u.appendChild(s),m!==null&&r.tagName==="OL"&&s.setAttribute("data-parent-num",String(m)),k();const v=document.createRange();v.selectNodeContents(s),v.collapse(!1),o.removeAllRanges(),o.addRange(v),e.nextTick(()=>{re(),en()})}else document.execCommand("indent",!1),e.nextTick(()=>{k(),re(),en()})},x=()=>{if(A.disabled||!A.richText||!f.value)return;on(),f.value.focus();const o=window.getSelection();if(o.rangeCount===0)return;const l=o.getRangeAt(0),s=l.commonAncestorContainer.nodeType===1?l.commonAncestorContainer.closest("li"):l.commonAncestorContainer.parentElement?.closest("li");if(!s){document.execCommand("outdent",!1),e.nextTick(()=>{k(),re()});return}const r=s.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"&&s.removeAttribute("data-parent-num"),d.insertBefore(s,c.nextSibling),r.children.length===0&&r.remove(),k();const u=document.createRange();u.selectNodeContents(s),u.collapse(!1),o.removeAllRanges(),o.addRange(u),e.nextTick(()=>{re(),en()});return}}document.execCommand("outdent",!1),e.nextTick(()=>{k(),re(),en()})},q=e.ref(null),ue=e.ref(null),ht=e.ref({}),Mt=e.ref(""),Yt=e.ref(null),an=e.ref("");e.ref("");const tn=e.ref(null);e.ref("");const sn=e.ref([]),Fn=e.ref(!1),Al=e.ref(!1),Po=o=>{if(!o)return"";const l=o.cloneRange(),s=document.createElement("div");return s.appendChild(l.cloneContents()),s.innerHTML},ho=()=>{if(A.disabled||!A.richText||!f.value)return;if(q.value!==null){q.value=null,Mt.value="",an.value="",tn.value=null,sn.value=[],yn(!0);return}on(),f.value.focus();const o=window.getSelection();if(!o||o.rangeCount===0)return;const l=o.getRangeAt(0);if(l.collapsed||!Ot(l))return;an.value=Po(l)||"",tn.value=Nn();const s=l.getBoundingClientRect(),r=f.value.parentElement;if(!r)return;const c=r.getBoundingClientRect(),d=s.bottom-c.top,m=Math.max(d+8,0);ht.value={top:`${m}px`,bottom:"auto"},q.value=Date.now(),e.nextTick(()=>{if(Mt.value="",Yt.value){const y=Yt.value;y.style.height="auto",y.style.height=`${y.scrollHeight}px`,y.focus()}const v=r.querySelector(".dss-comment-overlay");if(v&&r){const y=r.querySelector(".dss-text-editor-footer");if(y){const M=r.getBoundingClientRect(),D=v.getBoundingClientRect(),E=y.getBoundingClientRect(),oe=D.bottom-M.top,j=E.top-M.top,Re=8;if(oe>j-Re){const Ve=E.height;ht.value={bottom:`${Ve+Re}px`,top:"auto"}}else ht.value={top:`${m}px`,bottom:"auto"}}}})},yo=()=>{if(!Mt.value.trim())return;const o=Mt.value.trim(),l=new Date,s={text:o,selectionText:an.value,selectionRange:tn.value,commentId:q.value,user:A.commentUser||null,createdAt:l.toISOString()};sn.value=[...sn.value,s],X("comment-submitted",s),no(s),tn.value&&!qo(tn.value)&&Co(q.value,tn.value),Mt.value="",e.nextTick(()=>{if(Yt.value){const r=Yt.value;r.style.height="auto",r.style.height=`${r.scrollHeight}px`,r.focus()}hn("sendComment")})},Oo=(o,l)=>{if(!(!A.commentUser||!o.user||o.user.id!==A.commentUser.id)){if(sn.value=sn.value.filter((s,r)=>r!==l),q.value!==null&&f.value){const s=String(q.value),r=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`);if(r&&sn.value.length>0){const c=[],d=new Set;sn.value.forEach(u=>{u.user&&u.user.id&&!d.has(u.user.id)&&(d.add(u.user.id),c.push(u.user))}),c.length>0?r.setAttribute("data-comment-user",JSON.stringify(c[0])):r.removeAttribute("data-comment-user"),c.length>1?r.setAttribute("data-comment-user-2",JSON.stringify(c[1])):r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count",String(sn.value.length))}else r&&sn.value.length===0&&(r.removeAttribute("data-comment-user"),r.removeAttribute("data-comment-user-2"),r.setAttribute("data-comment-count","0"))}if(X("comment-deleted",{comment:o,index:l,commentId:q.value}),A.comments&&Array.isArray(A.comments)){const s=A.comments.filter(r=>!(r.commentId===o.commentId&&r.text===o.text&&r.user?.id===o.user?.id));X("update:comments",s)}e.nextTick(()=>{hn("deleteComment")})}},qo=o=>{if(!o||!f.value)return!1;try{const l=ko(o);if(!l)return!1;const s=l.commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(r)return!!r.closest("[data-comment], [data-fake-comment]")}catch{}return!1},ko=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 s=0;const r=[f.value];let c=null,d=!1,u=!1;for(;!u&&(c=r.pop());)if(c.nodeType===3){const m=s+c.length;!d&&o.start>=s&&o.start<=m&&(l.setStart(c,o.start-s),d=!0),d&&o.end>=s&&o.end<=m&&(l.setEnd(c,o.end-s),u=!0),s=m}else{let m=c.childNodes.length;for(;m--;)r.push(c.childNodes[m])}return d?l:null}catch{return null}},Co=(o,l)=>{if(!(!o||!l||!f.value))try{const s=ko(l);if(!s||s.collapsed)return;const r=s.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=s.startContainer,v=s.endContainer,y=s.startOffset,M=s.endOffset,D=m.nodeType===3?m.parentNode:m,E=v.nodeType===3?v.parentNode:v;if(D===E&&y===0&&M===(v.nodeType===3?v.length:E.childNodes.length)&&(D.tagName==="P"||D.tagName==="DIV"||D.tagName==="H1"||D.tagName==="H2"||D.tagName==="H3"||D.tagName==="H4"||D.tagName==="H5"||D.tagName==="H6")){const j=s.extractContents();d.appendChild(j),s.insertNode(d)}else s.surroundContents(d)}catch{const v=s.extractContents();d.appendChild(v),s.insertNode(d)}const u=f.value.querySelector(`[data-comment="${String(o)}"]`);e.nextTick(()=>{hn("wrapSelectionWithCommentMarker"),re()})}catch{}},no=o=>{if(!o||!o.commentId)return;const l=Array.isArray(A.comments)?[...A.comments]:[],s=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(s)||d.conversation_id===s);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:s,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)}Fn.value=!0,X("update:comments",l)},bo=(o,l=[])=>{if(A.disabled||!A.richText||!f.value)return;const s=f.value;let r=null;try{r=s.querySelector(o)}catch{return}if(!r)return;on(),s.focus();const c=document.createRange();c.selectNodeContents(r);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(c)),an.value=r.innerHTML||"",tn.value=Nn();const u=c.getBoundingClientRect(),m=s.parentElement;if(m){const M=m.getBoundingClientRect(),D=u.bottom-M.top,oe=Math.max(D+8,0);ht.value={top:`${oe}px`,bottom:"auto"}}const v=r.getAttribute("data-comment")||r.getAttribute("data-fake-comment");let y=[];if(v&&A.comments&&Array.isArray(A.comments)){const M=A.comments.find(D=>String(D.conversation_id)===String(v));if(M&&M.conversation&&Array.isArray(M.conversation)){const D=M.conversation.map(E=>({id:E.id||E.commentary_id,commentary_id:E.id||E.commentary_id,conversation_id:M.id||M.conversation_id,text:E.text,user:E.user,createdAt:E.created_at||E.createdAt,updated_at:E.updated_at||E.updatedAt}));y.push(...D)}}y.length===0&&Array.isArray(l)&&l.length>0&&(y=l.slice()),y.sort((M,D)=>{const E=Re=>{if(!Re)return 0;const Ve=new Date(Re).getTime();return isNaN(Ve)?0:Ve},oe=E(M.createdAt),j=E(D.createdAt);return oe===j?0:oe-j}),sn.value=y,yn(!0),q.value=v||null,r&&(ue.value=r,r.classList.add("editor-comment-highlighted")),e.nextTick(()=>{if(Mt.value="",Yt.value){const M=Yt.value;M.style.height="auto",M.style.height=`${M.scrollHeight}px`,M.focus()}if(m){const M=m.querySelector(".dss-comment-overlay");if(M){const D=m.querySelector(".dss-text-editor-footer");if(D){const E=m.getBoundingClientRect(),oe=M.getBoundingClientRect(),j=D.getBoundingClientRect(),Re=oe.bottom-E.top,Ve=j.top-E.top,at=8;if(Re>Ve-at){const gn=j.height;ht.value={bottom:`${gn+at}px`,top:"auto"}}}}}hn("openCommentOverlayForSelector")})},lo=e.ref(null),wo=e.ref(0),oo=o=>{if(!(A.disabled||!A.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(()=>{Mn()},50);return}}}if(o.key.length===1||o.key==="Enter"){const l=window.getSelection();if(l&&l.rangeCount>0){const s=l.getRangeAt(0),r=s.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=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,v=s.endContainer.nodeType===3?s.endContainer.parentElement:s.endContainer;if(d.contains(m)&&m!==u||d.contains(v)&&v!==u){o.preventDefault();const y=document.createRange();y.setStartAfter(d),y.collapse(!0),l.removeAllRanges(),l.addRange(y);return}}}}}}if(o.key==="Backspace"||o.key==="Delete"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);let r=null,c=null;if(s.collapsed)if(o.key==="Backspace"){const d=s.startContainer;let u=d;d.nodeType===3&&(s.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=s.startContainer;let u=d;d.nodeType===3&&(s.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=s.commonAncestorContainer,u=s.startContainer.nodeType===3?s.startContainer.parentElement:s.startContainer,m=s.endContainer.nodeType===3?s.endContainer.parentElement:s.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,y=c.contains(m)||m===c,D=s.cloneContents().textContent?.trim()||"",E=c.textContent?.trim()||"";(!v||!y||D.length>E.length)&&(c=null,r=null)}}if(c){o.preventDefault(),o.stopPropagation();const d=c.parentNode;if(d){const u=document.createTextNode("");d.insertBefore(u,c),c.remove();const m=document.createRange();m.setStartAfter(u),m.collapse(!0),l.removeAllRanges(),l.addRange(m),e.nextTick(()=>{re()});return}}}}if(o.key==="Tab"){o.preventDefault(),o.shiftKey?x():h();return}if(o.key==="Enter"){const l=window.getSelection();if(l.rangeCount>0){const s=l.getRangeAt(0);if(s.collapsed){const u=s.startContainer,m=v=>{if(!v)return!1;let y=v.previousSibling;for(;y;){if(y.classList&&y.classList.contains("dss-image-wrapper")||y.tagName==="IMG"||y.querySelector&&y.querySelector(".dss-image-wrapper")||y.querySelector&&y.querySelector("img"))return!0;y=y.previousSibling}const M=v.parentElement;return M&&M!==f.value?m(M):!1};if(u.nodeType===3){const v=u.parentElement;if(v&&(m(v)||m(u))){const y=v.closest("p, div");if(y&&y!==f.value){o.preventDefault(),o.stopPropagation();let M=null;const D=s.startOffset;D<u.length&&(M=u.splitText(D));const E=document.createElement("p");if(M?E.appendChild(M):E.innerHTML="<br>",u.length===0){const j=u.parentElement;j&&(j.removeChild(u),j.childNodes.length===0&&j.appendChild(document.createElement("br")))}y.nextSibling?y.parentNode.insertBefore(E,y.nextSibling):y.parentNode.appendChild(E);const oe=document.createRange();M?oe.setStart(M,0):oe.setStart(E,0),oe.collapse(!0),l.removeAllRanges(),l.addRange(oe),e.nextTick(()=>{re()});return}}}}const r=s.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=j=>{if(!j)return!1;const Re=j.textContent||"",at=(j.innerHTML||"").trim(),gn=at.replace(/<br\s*\/?>/gi,"").trim();return Re.trim()===""||at===""||gn===""||at==="<br>"||at==="<br/>"||at==="<p></p>"||at==="<p><br></p>"||at==="<p><br/></p>"||at==="<p> </p>"||at==="<p><br> </p>"||at==="<div></div>"||at==="<div><br></div>"||at==="<div><br/></div>"},v=c.lastChild,y=v&&v.nodeType===1&&v.tagName==="BR",M=s.startContainer,D=M.nodeType===3?M.parentElement:M,E=D===c||D&&D.parentElement===c;if(u&&m(u)||y&&E){o.preventDefault(),setTimeout(()=>{Mn()},50);return}}}}if(o.key===" "){const l=Date.now(),s=l-wo.value;if(lo.value===" "&&s<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(),h();return}}}}lo.value=" ",wo.value=l}else lo.value=o.key}},Wo=o=>{if(A.disabled||!A.richText)return;o.preventDefault();let l=o.clipboardData.getData("text/html"),s=o.clipboardData.getData("text/plain");l&&(l=l.replace(/<!--[\s\S]*?-->/g,"")),s&&(s=s.replace(/<!--[\s\S]*?-->/g,"")),ot();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 y=f.value.querySelector("h1")?1:0;if(v.querySelectorAll("h1").forEach(D=>{if(y>0){const E=v.createElement("p");E.innerHTML=D.innerHTML,D.parentNode.replaceChild(E,D)}else y++}),c){const D=["P","H1","H2","H3","H4","H5","H6","DIV","BLOCKQUOTE","UL","OL","LI"],E=Array.from(v.body.children).filter(oe=>D.includes(oe.tagName));if(E.length===1){const oe=E[0].tagName,j=c.tagName,Re=c.textContent.trim()===""&&!c.querySelector("img");let Ve=!1;if(["H1","H2","H3","H4","H5","H6"].includes(j)?Ve=!0:Re||(oe===j||oe==="P")&&(Ve=!0),Ve)return E[0].innerHTML.trim()}}return v.body.innerHTML.trim()};if(l){const u=d(l);document.execCommand("insertHTML",!1,u)}else if(s)if(/<[a-z][\s\S]*>/i.test(s)){const m=d(s);document.execCommand("insertHTML",!1,m)}else document.execCommand("insertText",!1,s);re()},Wl=o=>{if(xe.value){const s=o.target;!s.closest(".dss-toolbar-dropdown")&&!s.closest(".dss-toolbar-dropdown-toggle")&&on()}if(ut.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=f.value&&s.closest(".dss-text-editor-content");!r&&!c&&Hl()}if(st.value){const s=o.target,r=s.closest(".dss-floating-toolbar"),c=s.closest(".dss-toolbar-dropdown");!r&&!c&&Zl()}const l=o.target;if(!l.closest(".dss-toolbar-dropdown")&&!l.closest(".dss-toolbar-dropdown-submenu")&&(et.value=null),!f.value||!l.closest(".dss-text-editor-content")){const s=window.getSelection();if(s&&s.rangeCount>0){const r=s.getRangeAt(0);Y.value=!r.collapsed&&Ot(r)}else Y.value=!1}if(q.value!==null){const s=document.querySelector(".dss-comment-overlay");let r=!1;if(s){const u=s.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&&(q.value=null,Mt.value="",an.value="",tn.value=null,sn.value=[],yn(!0))}},En=(o,l)=>{o&&o.stopPropagation&&o.stopPropagation(),St.value&&(clearTimeout(St.value),St.value=null),et.value=l},F=o=>{const l=o.relatedTarget;if(l){const s=l.closest(".dss-toolbar-dropdown-submenu"),r=l.closest(".dss-toolbar-dropdown-item-has-submenu");if(s||r)return}St.value&&clearTimeout(St.value),St.value=setTimeout(()=>{et.value=null,St.value=null},150)},bn=o=>{et.value=null};let In=0;const Dl=o=>{if(!o)return;const l=Array.from(o.children);l.forEach(s=>{s.classList.contains("dss-toolbar-dropdown-submenu")||s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||(s.tagName==="BUTTON"||s.tagName==="DIV")&&!s.classList.contains("dss-toolbar-dropdown-item")&&s.classList.add("dss-toolbar-dropdown-item")}),l.forEach((s,r)=>{if(s.classList.contains("dss-toolbar-dropdown-item-has-submenu")||s.classList.contains("dss-toolbar-dropdown-submenu")||!s.classList.contains("dss-toolbar-dropdown-item"))return;const c=Array.from(s.children).find(m=>m.tagName==="DIV"?m.classList.contains("dss-toolbar-dropdown-item")?!1:Array.from(m.children).filter(y=>y.tagName==="BUTTON"||y.tagName==="DIV").length>0:!1),d=s.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-${++In}`;s.classList.add("dss-toolbar-dropdown-item-has-submenu"),s.setAttribute("data-submenu-id",m);let v=null;c?(s.tagName==="BUTTON"&&s.parentNode.insertBefore(c,s.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&&s.tagName!=="BUTTON"?v.dataset.originalParentRef="inside":v.dataset.originalParentRef="sibling",Array.from(v.children).forEach(M=>{(M.tagName==="BUTTON"||M.tagName==="DIV")&&!M.classList.contains("dss-toolbar-dropdown-item")&&M.classList.add("dss-toolbar-dropdown-item")}))}})},vn=()=>{document.querySelectorAll(".dss-toolbar-dropdown").forEach(l=>{Dl(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 y=c.getAttribute("data-submenu-id");y&&En(v,y)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m}}),l.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(c=>{const d=c._subMenuHandlers;d&&(c.removeEventListener("mouseenter",d.enter),c.removeEventListener("mouseleave",d.leave));const u=y=>{const M=c.getAttribute("data-submenu-id");M&&En(y,M)},m=F;c.addEventListener("mouseenter",u),c.addEventListener("mouseleave",m),c._subMenuHandlers={enter:u,leave:m},c.querySelectorAll(".dss-toolbar-dropdown-item").forEach(y=>{y.addEventListener("click",bn)})})})};let Sn=null;const jt=()=>{if(et.value){const o=document.querySelector(`.dss-toolbar-dropdown-submenu[data-submenu-id="${et.value}"]`),l=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${et.value}"]`);o&&l&&Mo(o,l)}if(ut.value&&en(),A.richText){if(Sn!==null)return;Sn=setTimeout(()=>{Sn=null,hn("handleWindowResize")},150)}},Gt=()=>{if(!A.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")})})},sl=()=>{const o=document.querySelectorAll(".dss-text-editor-footer, .dss-text-editor-footer-content, .dss-text-editor-footer-stat, .dss-text-editor-footer-separator"),l=s=>{if(s.preventDefault(),s.stopPropagation(),window.getSelection){const r=window.getSelection();r.removeAllRanges?r.removeAllRanges():r.empty&&r.empty()}return!1};o.forEach(s=>{s.addEventListener("selectstart",l),s.addEventListener("mousedown",l),s.addEventListener("dragstart",l),s.addEventListener("contextmenu",l),s.addEventListener("click",r=>{if(window.getSelection){const c=window.getSelection();c.removeAllRanges&&c.removeAllRanges()}})})};e.onMounted(()=>{if(e.nextTick(()=>{requestAnimationFrame(()=>{Qt.value?Vn():pn(),V.value?xn():ul()})}),e.nextTick(()=>{sl()}),A.richText&&f.value){try{document.execCommand("defaultParagraphSeparator",!1,"p")}catch{}document.addEventListener("click",Wl),window.addEventListener("resize",jt);let o=null;const l=()=>{o===null&&(o=setTimeout(()=>{o=null,jt()},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 s=f.value.closest(".dss-text-editor-content");let r=null;const c=()=>{r===null&&(r=setTimeout(()=>{r=null,jt()},150))};s&&(s.addEventListener("scroll",c),f.value._scrollHandlers={wrapper:null,content:s,handler:c}),e.nextTick(()=>{vn(),Gt()}),f.value.addEventListener("click",m=>{const v=m.target;v.closest("a")&&!A.disabled&&m.preventDefault();const M=v.closest(".dss-image-no-alt-icon"),D=v.closest(".dss-image-wrapper");if(M||D&&v===D){m.preventDefault(),m.stopPropagation();const E=window.getSelection(),oe=document.createRange();oe.setStartAfter(D),oe.collapse(!0),E.removeAllRanges(),E.addRange(oe)}else D&&v.tagName!=="IMG"&&(m.preventDefault(),e.nextTick(()=>{const E=window.getSelection();if(E.rangeCount>0){const j=E.getRangeAt(0).commonAncestorContainer,Re=j.nodeType===3?j.parentElement:j;if(D.contains(Re)&&Re!==D.querySelector("img")){const Ve=document.createRange();Ve.setStartAfter(D),Ve.collapse(!0),E.removeAllRanges(),E.addRange(Ve)}}else{const oe=document.createRange();oe.setStartAfter(D),oe.collapse(!0),E.addRange(oe)}}))},!0),f.value.addEventListener("mousedown",m=>{const v=m.target,y=v.closest(".dss-image-no-alt-icon"),M=v.closest(".dss-image-wrapper");if(y||M&&v.tagName!=="IMG"){m.preventDefault();const D=window.getSelection(),E=document.createRange();M&&(E.setStartAfter(M),E.collapse(!0),D.removeAllRanges(),D.addRange(E))}},!0),f.value.addEventListener("paste",m=>{e.nextTick(()=>{if(!f.value)return;f.value.querySelectorAll("img").forEach(y=>{if(!y.closest(".dss-image-wrapper"))y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="";else{const D=y.getAttribute("alt")||y.alt||"";if(D){const E=y.getAttribute("src")||y.src||"",oe=E.replace(/^https?:\/\//,"").replace(/^data:.*,/,""),j=D===E||D===oe;(D.startsWith("http://")||D.startsWith("https://")||D.startsWith("data:")||j||j)&&(y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="")}}}),fn()})}),f.value.addEventListener("dragstart",m=>{const v=m.target,y=v.tagName==="IMG"?v:v.closest("img"),M=y?.closest(".dss-image-wrapper");y&&f.value.contains(y)&&($t.value=M||y,m.dataTransfer.effectAllowed="move",m.dataTransfer.setData("text/html","image-drag"))}),f.value.addEventListener("dragover",m=>{$t.value&&(m.preventDefault(),m.stopPropagation(),m.dataTransfer.dropEffect="move")}),f.value.addEventListener("dragenter",m=>{$t.value&&(m.preventDefault(),m.stopPropagation())}),f.value.addEventListener("drop",m=>{if(!$t.value||!f.value)return;m.preventDefault(),m.stopPropagation();const v=$t.value,y=v.classList?.contains("dss-image-wrapper"),M=y?v.querySelector("img"):v,D=y?v:M?.closest(".dss-image-wrapper");if(!M||!f.value.contains(M)){$t.value=null;return}let E=null;const oe=m.clientX,j=m.clientY;if(document.caretRangeFromPoint)E=document.caretRangeFromPoint(oe,j);else{const nn=window.getSelection();nn.rangeCount>0?E=nn.getRangeAt(0).cloneRange():(E=document.createRange(),E.selectNodeContents(f.value),E.collapse(!1))}if(!E){$t.value=null;return}const Re=E.commonAncestorContainer,Ve=Re.nodeType===3?Re.parentElement:Re;if(Ve?.closest(".dss-image-wrapper")===D||D&&D.contains(Ve)){$t.value=null;return}if(D&&(Ve===D||D.contains(Ve))){$t.value=null;return}const gn=M.getAttribute("src");let un=null;D?un=D.cloneNode(!0):un=M.cloneNode(!0);try{let nn=E.startContainer;if(nn.nodeType===3&&(nn=nn.parentElement),D&&(nn===D||D.contains(nn))){const cn=document.createRange();cn.setStartAfter(D),cn.collapse(!0),E=cn}E.insertNode(un);const dn=document.createRange();dn.setStartAfter(un),dn.collapse(!0);const rn=window.getSelection();rn.removeAllRanges(),rn.addRange(dn)}catch{if(f.value.childNodes.length===0){const dn=document.createElement("p");dn.appendChild(un),f.value.appendChild(dn)}else{const dn=f.value.lastChild;if(dn&&dn.nodeType===1)dn.appendChild(un);else{const rn=document.createElement("p");rn.appendChild(un),f.value.appendChild(rn)}}}D?D.remove():M.remove(),$t.value=null,e.nextTick(()=>{const nn=f.value.querySelectorAll("img");let dn=!1;nn.forEach(rn=>{if(rn.getAttribute("src")===gn)if(!dn)dn=!0;else{const cn=rn.closest(".dss-image-wrapper");cn?cn.remove():rn.remove()}}),fn(),re()})}),f.value.addEventListener("dragend",m=>{$t.value=null});let d=null;const u=new MutationObserver(m=>{m.forEach(v=>{v.addedNodes.forEach(y=>{if(y.nodeType===1){y.tagName==="IMG"&&(y.removeAttribute("alt"),y.removeAttribute("data-alt"),y.setAttribute("alt",""),y.setAttribute("data-alt",""),y.alt="");const M=y.querySelectorAll&&y.querySelectorAll("img");M&&M.forEach(D=>{D.removeAttribute("alt"),D.removeAttribute("data-alt"),D.setAttribute("alt",""),D.setAttribute("data-alt",""),D.alt=""})}})}),d&&clearTimeout(d),d=setTimeout(()=>{fn(),Gt(),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(()=>{Gt()})});v.observe(m,{childList:!0,subtree:!0}),m._toolbarMutationObserver=v}}),A.modelValue){const m=yl(A.modelValue);f.value.innerHTML=m,vt()}e.nextTick(()=>{const m=f.value.innerHTML||"",v=A.title||"",y=A.description||"";Z.value=m,ve.value=v,We.value=y,Ke.value=v,Nt.value=y,k(),fn(),$e(),bt(),uo(),wn()}),Cn(),it(),f.value._mutationObserver=u}}),e.onUnmounted(()=>{if(document.removeEventListener("click",Wl),window.removeEventListener("resize",jt),f.value&&f.value._windowScrollHandler&&window.removeEventListener("scroll",f.value._windowScrollHandler,!0),Sn!==null&&(clearTimeout(Sn),Sn=null),f.value&&f.value._windowScrollTimeout!==null&&clearTimeout(f.value._windowScrollTimeout),Ye.value&&clearTimeout(Ye.value),St.value&&clearTimeout(St.value),f.value&&f.value._mutationObserver&&f.value._mutationObserver.disconnect(),Pe.value&&Pe.value.disconnect(),ft.value!==null&&(cancelAnimationFrame(ft.value),ft.value=null),tt.value!==null&&(clearTimeout(tt.value),tt.value=null),kt.value!==null&&(clearTimeout(kt.value),kt.value=null),yn(!0),f.value&&f.value._scrollHandlers){const{wrapper:l,content:s,handler:r}=f.value._scrollHandlers;l&&l.removeEventListener("scroll",r),s&&s.removeEventListener("scroll",r)}const o=document.querySelector(".dss-text-editor-toolbar");o&&o._toolbarMutationObserver&&o._toolbarMutationObserver.disconnect()});const ml=o=>{const l=o.target,s=l.closest("a");if(s&&!A.disabled){o.preventDefault();const c=document.createRange();c.selectNodeContents(s);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)}}fn(),Cn(),it(),en(),bt()}):e.nextTick(()=>{fn(),Cn(),it(),en(),bt()})},Dt=()=>{ol();const o=window.getSelection();if(o&&o.rangeCount>0){const s=o.getRangeAt(0);Y.value=!s.collapsed&&Ot(s),!s.collapsed&&w.value&&(w.value=null)}else Y.value=!1;if(fn(),Cn(),it(),en(),bt(),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(),Y.value=!1;return}}["bold","italic","underline"].forEach(s=>{try{const r=window.getSelection();if(r.rangeCount>0){const c=r.getRangeAt(0);if(!c.collapsed)if(s==="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{}de.value[s]=m}else{const d=document.queryCommandState(s);de.value[s]=d}}}catch{}})},bt=()=>{if(!A.richText||A.disabled||!f.value){S.value="p";return}try{const o=window.getSelection();if(!o||o.rangeCount===0){S.value="p";return}const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===3?s.parentElement:s;if(!r||!f.value.contains(r)){S.value="p";return}const c=r.closest("h1, h2, h3, h4, h5, h6, p");if(!c){S.value="p";return}const d=c.tagName.toLowerCase();["h1","h2","h3","h4","h5","h6","p"].includes(d)?S.value=d:S.value="p"}catch{S.value="p"}},it=()=>{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}},Ot=o=>{if(!o||!f.value)return!1;const l=o.commonAncestorContainer;if(!l)return!1;const s=l.nodeType===3?l.parentElement:l;return s?f.value.contains(s):!1},Hl=()=>{ut.value=!1},en=()=>{if(!A.floatingToolbar||!A.richText||A.disabled){ut.value=!1;return}const o=window.getSelection();if(!o||o.rangeCount===0){ut.value=!1;return}const l=o.getRangeAt(0);if(l.collapsed||!Ot(l)){ut.value=!1;return}const s=l.getBoundingClientRect();if(!s||s.width===0&&s.height===0){ut.value=!1;return}const r=f.value;if(!r){ut.value=!1;return}const c=r.getBoundingClientRect();if(!c||c.width===0){ut.value=!1;return}const d=40,u=8,m=s.top-d/2+15;let v=s.left+s.width/2;const y=window.innerWidth||document.documentElement.clientWidth||0;let M=0;Ut.value&&(M=Ut.value.getBoundingClientRect().width);const D=(M||320)/2;let E=c.left+D,oe=c.right-D;if(oe<E){const j=c.left+c.width/2;E=j,oe=j}if(y>0){const j=D+u,Re=y-D-u;if(E=Math.max(E,j),oe=Math.min(oe,Re),oe<E){const Ve=y/2;E=Ve,oe=Ve}}v<E?v=E:v>oe&&(v=oe),Oe.value={position:"fixed",top:`${Math.max(m,8)}px`,left:`${v}px`,transform:"translate(-50%, -100%)",zIndex:10003},ut.value=!0},wl=o=>{A.disabled||!A.richText||(st.value=st.value===o?null:o,o==="askAi"&&(xe.value=null))},Zl=()=>{st.value=null,et.value=null},Ln=o=>{Zn(o),Zl()};let Qn=null,Jn=null,pl=null,fl=null;const Zo=o=>{if(A.disabled||!A.richText){xl(),Rl();return}const l=o.target,s=l.closest("a"),r=l.closest("img");if(Qn&&(clearTimeout(Qn),Qn=null),pl&&(clearTimeout(pl),pl=null),s&&s!==Jn){Rl(),Jn=s;let c=s.getAttribute("href")||"";(!c||c==="#"||c==="")&&(c=s.textContent||""),Be.value=s,fe.value=c,le.value=!0,be.value=!0,Un(s)}else!s&&Jn?(Jn=null,Qn=setTimeout(()=>{be.value||xl()},150)):s&&s===Jn&&Un(s);if(r&&r!==fl){xl(),fl=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),yt.value=r,It.value=c.trim()||L("textEditor.image.noAlt"),wt.value=!0,ye.value=!0,xo(r)}else!r&&fl?(fl=null,pl=setTimeout(()=>{ye.value||Rl()},150)):r&&r===fl&&xo(r)},vl=o=>{const l=o.relatedTarget;(!l||!l.closest(".dss-text-editor-content")&&!l.closest(".dss-link-popup"))&&(Jn=null,fl=null,Qn&&(clearTimeout(Qn),Qn=null),pl&&(clearTimeout(pl),pl=null),xl(),Rl())},xl=()=>{be.value=!1,setTimeout(()=>{be.value||(le.value=!1,fe.value="",Te.value||(Be.value=null))},100)},Un=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;H.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Rl=()=>{ye.value=!1,setTimeout(()=>{ye.value||(wt.value=!1,It.value="",Et.value||(yt.value=null))},100)},xo=o=>{if(!o||!f.value)return;const l=o.getBoundingClientRect(),c=l.top-32-8,d=l.left+l.width/2;Q.value={position:"fixed",top:`${c}px`,left:`${d}px`,transform:"translateX(-50%)",zIndex:10002}},Fl=()=>{if(!fe.value||!Be.value)return;let l=Be.value.getAttribute("href")||fe.value;!l.startsWith("http://")&&!l.startsWith("https://")&&!l.startsWith("mailto:")&&(l="https://"+l),window.open(l,"_blank","noopener,noreferrer")},Uo=()=>{if(Be.value){const o=Be.value.textContent||"",l=Be.value.getAttribute("href")||"",s=Be.value;ze.value=l,rt.value=o,gt.value=o,be.value=!1,le.value=!1,fe.value="",Be.value=s,Te.value=!0}else if(he.value){const o=window.getSelection();if(o.rangeCount>0){const s=o.getRangeAt(0).commonAncestorContainer,r=s.nodeType===1?s.closest("a"):s.parentElement?.closest("a");if(r){const c=r.textContent||"",d=r.getAttribute("href")||"";ze.value=d,rt.value=c,gt.value=c,Be.value=r,Te.value=!0}}}else{Ce.value=Nn();const o=window.getSelection();let l="";o.rangeCount>0&&(l=o.getRangeAt(0).toString()),ze.value="",rt.value=l,gt.value="",Be.value=null,Te.value=!0}e.nextTick(()=>{R.value&&(R.value.focus(),R.value.select())})},Il=()=>{Te.value=!1,ze.value="",rt.value="",gt.value="",Be.value=null,Ce.value=null},ao=()=>{if(!ze.value.trim()){Il();return}if(W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot(),rt.value.trim()||(rt.value=ze.value.trim()),Be.value&&f.value&&f.value.contains(Be.value)){const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges();const l=Be.value;if(l.setAttribute("href",ze.value.trim()),rt.value.trim()!==gt.value.trim()){for(;l.firstChild;)l.removeChild(l.firstChild);l.textContent=rt.value.trim()}l.style.color="#60afdf",l.style.textDecoration="underline";const s=document.createRange();s.selectNodeContents(l),s.collapse(!1),o.removeAllRanges(),o.addRange(s),re()}else if(f.value){f.value.focus();const o=window.getSelection();o.removeAllRanges(),Ce.value&&Bn(Ce.value);let l=null;if(o.rangeCount>0&&(l=o.getRangeAt(0)),l&&!l.collapsed){l.toString();const s=document.createElement("a");s.href=ze.value.trim(),s.textContent=rt.value.trim(),s.style.color="#60afdf",s.style.textDecoration="underline",l.deleteContents(),l.insertNode(s);const r=document.createTextNode(" ");l.setStartAfter(s),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 s=l.startContainer,r=s.nodeType===3,c=r&&l.startOffset===s.textContent.length,d=document.createElement("a");if(d.href=ze.value.trim(),d.textContent=rt.value.trim(),d.style.color="#60afdf",d.style.textDecoration="underline",c){let u=s.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 y=document.createRange();y.setStartAfter(d),y.collapse(!0),o.removeAllRanges(),o.addRange(y)}else{if(l.startOffset>0){const y=s.textContent.substring(0,l.startOffset),M=y[y.length-1];if(M&&M!==" "&&M!==" "&&M!==`
|
|
102
102
|
`){const D=document.createTextNode(" ");l.insertNode(D),l.setStartAfter(D)}}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=s.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)}}re()}e.nextTick(()=>{Yt(),Fl()})},Ul=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=wn());const s=/(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;s.lastIndex=0;const M=[...h.matchAll(s)];if(M.length===0)continue;const D=M.filter(j=>{const He=j[0],Se=j.index;if(Se>0&&h[Se-1]==="@"||Se+He.length<h.length&&h[Se+He.length]==="@")return!1;const ot=v.parentElement;return!(ot&&ot.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===h.trim()){const j=D[0][0],He=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Se=document.createElement("a");Se.href=He,Se.textContent=j,Se.style.color="#60afdf",Se.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Se,v),u=!0);continue}let x=0;const ae=document.createDocumentFragment();if(D.forEach(j=>{const He=j.index,Se=j[0];if(He>x){const un=h.substring(x,He);un&&ae.appendChild(document.createTextNode(un))}const ot=Se.startsWith("http://")||Se.startsWith("https://")?Se:`https://${Se}`,vn=document.createElement("a");vn.href=ot,vn.textContent=Se,vn.style.color="#60afdf",vn.style.textDecoration="underline",ae.appendChild(vn),x=He+Se.length}),x<h.length){const j=h.substring(x);j&&ae.appendChild(document.createTextNode(j))}v.parentNode&&ae.childNodes.length>0&&(v.parentNode.replaceChild(ae,v),u=!0)}u&&l&&e.nextTick(()=>{Nn(l),Yt()})},Eo=()=>{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}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const h=document.createDocumentFragment();m.forEach(M=>{const D=M.index,x=M[0].startsWith("<u>")?"u":"ins",ae=M[1]||M[2]||"";D>v&&h.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(x);j.textContent=ae,h.appendChild(j),v=D+M[0].length}),v<u.length&&h.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&h.childNodes.length>0&&d.parentNode.replaceChild(h,d)}},So=o=>{if(!f.value||ne.value)return;if(!o){Eo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.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 un="",ln=0,dn=!1;const sn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:qn=>qn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let rn=0;for(;sn.nextNode();){const qn=sn.currentNode,ol=qn.textContent||"",il=rn;if(rn+=ol.length,qn===r.startContainer){un+=ol.substring(0,r.startOffset),ln=il+r.startOffset,dn=!0;break}un+=ol}return dn||(ln=un.length),{textBeforeCursor:un,cursorCharOffset:ln}},{textBeforeCursor:u}=d();if(!u.length)return;let m=null,v=null;if(u.endsWith("**")&&(m=u.match(/\*\*(.+?)\*\*$/s))||u.endsWith("__")&&(m=u.match(/__(.+?)__$/s))?v="strong":u.endsWith("*")&&!u.endsWith("**")&&(m=u.match(new RegExp("(?<!\\*)\\*([^*]+)\\*$")))||u.endsWith("_")&&!u.endsWith("__")&&(m=u.match(new RegExp("(?<!_)_([^_]+)_$")))?v="em":o===">"&&((m=u.match(/<u>(.+?)<\/u>$/s))||(m=u.match(/<ins>(.+?)<\/ins>$/s)))&&(v=m[0].startsWith("<u>")?"u":"ins",m[0].startsWith("<u>"),m[0].startsWith("<u>")),!m||!m[1])return;const h=m[0],M=m[1],D=u.length-h.length,ae=(un=>{let ln=0;const dn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:rn=>rn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let sn;for(;sn=dn.nextNode();){const rn=(sn.textContent||"").length;if(ln+rn>=un)return{node:sn,offset:un-ln};ln+=rn}return null})(D);if(!ae)return;const j=document.createRange();j.setStart(ae.node,ae.offset),j.setEnd(r.endContainer,r.endOffset);const He=document.createElement(v);He.textContent=M,j.deleteContents(),j.insertNode(He);const Se=window.getSelection(),ot=document.createRange();ot.setStartAfter(He),ot.collapse(!0),Se.removeAllRanges(),Se.addRange(ot);const vn=wn();e.nextTick(()=>{re(),vn&&Nn(vn)})},so=()=>{f.value&&(xt.value=wn(),Tt.value="",Ft.value="",Ze.value="",G.value="",ue.value="",Wt.value=null,kt.value=null,Me.value="upload",Et.value=!0,nn(),e.nextTick(()=>{De.value&&De.value.focus(),Xe.value&&(Xe.value.value="")}))},Gn=o=>{const l=o.target?.files?.[0];if(!l){Wt.value=null,Ft.value="";return}Wt.value=l;const s=new FileReader;s.onload=r=>{Ft.value=r.target?.result||""},s.readAsDataURL(l)},Qn=()=>{Xe.value&&Xe.value.click()},Xl=()=>{G.value&&(ue.value="")},ro=()=>{ue.value&&(G.value="")},Vo=()=>{let o=kt.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")||"";kt.value=o,Tt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(Ze.value=s,Ft.value="",Me.value="url"):(Ft.value=s,Ze.value="",Me.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";G.value=c.endsWith("px")?c.replace("px",""):c,ue.value=d.endsWith("px")?d.replace("px",""):d,xt.value=null}else{so();return}Et.value=!0,be.value=!1,Mt.value=!1,e.nextTick(()=>{Me.value==="url"&&Zt.value?(Zt.value.focus(),Zt.value.select()):De.value&&(De.value.focus(),De.value.select()),Xe.value&&(Xe.value.value="")})},Vl=()=>{Et.value=!1,Tt.value="",Ft.value="",Ze.value="",G.value="",ue.value="",Wt.value=null,kt.value=null,xt.value=null,Me.value="upload"},$n=()=>{const o=(Tt.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),P.value?(Re.value&&(clearTimeout(Re.value),Re.value=null),tt(),P.value=!1):tt();const s=Me.value==="url"?Ze.value.trim():Ft.value;if(kt.value&&f.value&&f.value.contains(kt.value)){s&&(kt.value.src=s),kt.value.setAttribute("alt",o),kt.value.setAttribute("data-alt",o),G.value?(kt.value.style.width=`${G.value}px`,kt.value.setAttribute("width",G.value)):(kt.value.style.removeProperty("width"),kt.value.removeAttribute("width")),ue.value?(kt.value.style.height=`${ue.value}px`,kt.value.setAttribute("height",ue.value)):(kt.value.style.removeProperty("height"),kt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(kt.value),c.collapse(!0),r.addRange(c)}re()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Vl();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(xt.value&&(Nn(xt.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){Vl();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=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),G.value&&(v.style.width=`${G.value}px`,v.setAttribute("width",G.value)),ue.value&&(v.style.height=`${ue.value}px`,v.setAttribute("height",ue.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 D=document.createElement("p");f.value.appendChild(D),D.appendChild(v)}else{const D=f.value.lastChild;if(D&&D.nodeType===1)D.appendChild(v);else{const x=document.createElement("p");f.value.appendChild(x),x.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}kt.value=v,re()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Yt(),en(),Vl()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!ne.value){const l=Cl(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=wn();f.value.innerHTML=l,e.nextTick(()=>{yt();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";X.value=u,me.value=m,ze.value=v,K.value=u,nt.value=m,St.value=v,je.value=[],_t.value=[],Re.value&&(clearTimeout(Re.value),Re.value=null),P.value=!1,d&&Nn(d),Z(),Vt(),_e(),Yt(),en(),wt(),hn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(en(),e.nextTick(()=>{uo()})):(Dl(),le.value=[],Ye.value&&(Ye.value.disconnect(),Ye.value=null)),wt()}),e.watch(()=>A.floatingToolbar,o=>{o?en():Dl()}),e.watch(()=>A.disabled,o=>{o&&Dl(),wt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{V.value?Xn():ul()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{an.value?In():Vn()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{Qt()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(tl.value){tl.value=!1;return}Tl.value||A.richText&&f.value&&e.nextTick(()=>{bn()})},{deep:!0,immediate:!1});const bn=()=>{if(!Tl.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Tl.value=!0;try{const o=new Set,l=A.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.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){Kt(h,u),d.add(v);return}try{const M=Xo(u.selection_range,u.selection_text);if(M&&!M.collapsed){const D=M.commonAncestorContainer,x=D.nodeType===3?D.parentElement:D;if(x){const He=x.closest("[data-comment], [data-fake-comment]");if(He){const Se=He.getAttribute("data-comment")||He.getAttribute("data-fake-comment");if(String(Se)===String(m)){He.setAttribute("data-comment",v),He.removeAttribute("data-fake-comment"),Kt(He,u),d.add(v);return}else return}}const ae=f.value.querySelector(`[data-comment="${v}"]`);if(ae){Kt(ae,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{M.surroundContents(j),c++,d.add(v)}catch{try{const Se=document.createRange();Se.setStart(M.startContainer,M.startOffset),Se.setEnd(M.endContainer,M.endOffset),io(Se),Se.surroundContents(j),c++,d.add(v)}catch{try{const ot=M.extractContents();j.appendChild(ot),M.insertNode(j),c++,d.add(v)}catch(ot){console.warn("Failed to create comment marker:",ot)}}}}}catch{}}),e.nextTick(()=>{hn("restoreCommentsFromModel"),re(),Tl.value=!1})}catch{Tl.value=!1}}},io=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!qt(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!No(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},qt=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},No=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},Xo=(o,l)=>{if(!o||!f.value)return null;try{const s=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&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?io(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.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=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},hn=(o="unknown")=>{if(!A.richText||!f.value){le.value=[];return}Date.now()-It.value<Ht&&at.value!==null||at.value===null&&(at.value=requestAnimationFrame(()=>{if(at.value=null,It.value=Date.now(),Fe.value)return;Fe.value=!0;const s={},r=f.value;if(!r){Fe.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){Fe.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(x=>{const ae=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");ae&&x.tagName==="SPAN"&&(m.has(ae)||(u.push(x),m.add(ae)))}),d.forEach(x=>{const ae=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");!ae||m.has(ae)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(x.tagName)?x.querySelector(`span[data-comment="${ae}"], span[data-fake-comment="${ae}"]`)||(u.push(x),m.add(ae)):x.tagName!=="SPAN"&&(u.push(x),m.add(ae)))});const v=c.getBoundingClientRect(),h=r.getBoundingClientRect();u.forEach((x,ae)=>{let j=x.getAttribute("data-comment")||x.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const al=x.textContent?.trim(),Jn=A.comments?.find(Wn=>(typeof Wn.conversation_id=="string"&&Wn.conversation_id.startsWith("comment-")?null:Wn.conversation_id)&&Wn.selection_text?.trim()===al);Jn?(j=String(Jn.conversation_id),x.setAttribute("data-comment",j),x.removeAttribute("data-fake-comment")):(j=String(Date.now()),x.setAttribute("data-comment",j),x.removeAttribute("data-fake-comment"))}const He=x.getBoundingClientRect(),Se=window.getComputedStyle(x),ot=parseFloat(Se.lineHeight)||parseFloat(Se.fontSize)*1.2,ln=He.top-h.top+ot/2-15,sn=h.top-v.top+ln;let rn=null,qn=null,ol=0;const il=[],mo=new Set;if(j&&A.comments){const al=A.comments.find(Jn=>String(Jn.conversation_id||Jn.id)===String(j));if(al){const Jn=al.conversation||[];Jn.length>0?(Jn.forEach(Wn=>{Wn.user&&Wn.user.id&&!mo.has(Wn.user.id)&&(mo.add(Wn.user.id),il.push(Wn.user))}),ol=Jn.length):(ol=0,rn=null,qn=null),il.length>0?rn=il[0]:rn=null,il.length>1?qn=il[1]:qn=null}}const _o=He.top+ot/2-15,Yo=_o+30,gl=5,po=Yo>h.top+gl&&_o<h.bottom-gl?1:0;le.value.find(al=>al.id===j);let Yl=x;if(!Yl&&j&&f.value){const al=String(j);Yl=f.value.querySelector(`[data-comment="${al}"], [data-fake-comment="${al}"]`)}const $o=il.length;s[j]?(s[j].top=sn,s[j].opacity=po,s[j].element=Yl,s[j].firstUser=rn,s[j].secondUser=qn,s[j].totalCount=ol,s[j].uniqueUserCount=$o):s[j]={id:j,top:sn,opacity:po,element:Yl,firstUser:rn,secondUser:qn,totalCount:ol,uniqueUserCount:$o}});const M=Object.values(s).map(x=>{const ae=Math.max(0,(x.uniqueUserCount??0)-2);if(!x.element&&x.id&&f.value){const He=String(x.id);x.element=f.value.querySelector(`[data-comment="${He}"], [data-fake-comment="${He}"]`)}return{...x,firstUser:x.firstUser||null,secondUser:x.secondUser||null,totalCount:x.totalCount,additionalCount:ae}});(le.value.length!==M.length||M.some((x,ae)=>{const j=le.value[ae];if(!j)return!0;const He=(j.firstUser?.id||null)!==(x.firstUser?.id||null),Se=(j.secondUser?.id||null)!==(x.secondUser?.id||null);return j.id!==x.id||Math.abs(j.top-x.top)>1||j.opacity!==x.opacity||j.totalCount!==x.totalCount||j.additionalCount!==x.additionalCount||He||Se||j.element!==x.element}))&&(le.value=M),Fe.value=!1}))},Bo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(yn(),Jt.value=l,l.classList.add("editor-comment-highlighted"))},yn=(o=!1)=>{!o&<.value!==null&&Jt.value&&(Jt.value.getAttribute("data-comment")||Jt.value.getAttribute("data-fake-comment"))===lt.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),Jt.value&&(Jt.value.classList.remove("editor-comment-highlighted"),Jt.value=null))},co=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 s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;U("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Nl=()=>{yn()},uo=()=>{!A.richText||!f.value||(Ye.value&&Ye.value.disconnect(),st.value!==null&&(clearTimeout(st.value),st.value=null),Ye.value=new MutationObserver(()=>{st.value===null&&(st.value=setTimeout(()=>{st.value=null,e.nextTick(()=>{hn("MutationObserver")})},200))}),Ye.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"]}),hn("setupCommentMarkersObserver-initial"))},Mo=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.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=s.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(()=>et.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.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(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[we.value,it.value],()=>{we.value==="askAi"||it.value==="askAi"?e.nextTick(()=>{fn()}):(et.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);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(()=>A.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),te({openCommentOverlayForSelector:bo,updateCommentMarkers:hn,restoreCommentsFromModel:bn}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",Ge.value]),style:e.normalizeStyle(Lt.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Lu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:bt,title:e.unref(L)("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,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!W.value}]),onClick:J,title:e.unref(L)("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,Au),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Du,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>zn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ou)):(e.openBlock(),e.createElementBlock("svg",qu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Hu),we.value==="paragraph"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-dropdown",onClick:l[8]||(l[8]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[1]||(l[1]=s=>Mn("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Wu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Mn("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Mn("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Mn("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Mn("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Mn("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Mn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("bold")}]),onClick:l[9]||(l[9]=s=>Bn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("italic")}]),onClick:l[10]||(l[10]=s=>Bn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("underline")}]),onClick:l[11]||(l[11]=s=>Bn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":vt.value}]),onClick:ql,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Ju),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Ll,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,td)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:$l,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,ed)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertUnorderedList")}]),onClick:k,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertOrderedList")}]),onClick:y,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ld),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:so,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,od),Y.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:ho},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>zn("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",ud,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,cd),we.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",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Xt(s)?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Xt(s)&&r<T.customToolbarSlots.length-1&&Tn(r)?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(we.value==="paragraph"||we.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:nn})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:Fl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fd,[e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:xe,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>ct.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,hd),[[e.vModelText,ct.value]])]),e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:R,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>qe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,Cd),[[e.vModelText,qe.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Fl},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:Et.value,width:"500px",height:"80vh",onCloseModal:Vl},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(kt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="upload"}]),onClick:l[17]||(l[17]=s=>Me.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="url"}]),onClick:l[18]||(l[18]=s=>Me.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),Me.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[ut.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),ut.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Qn},[e.createElementVNode("img",{src:Ft.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Vd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Xe,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Gn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Xe,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Gn},null,544))]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:De,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys($n,["enter"])},null,40,Md),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>G.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys($n,["enter"]),onInput:Xl},null,40,Ld),[[e.vModelText,G.value]])]),e.createElementVNode("div",Td,[e.createElementVNode("label",Ad,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>ue.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys($n,["enter"]),onInput:ro},null,40,Dd),[[e.vModelText,ue.value]])])])])):e.createCommentVNode("",!0),Me.value==="url"?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Zt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>Ze.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys($n,["enter"])},null,40,zd),[[e.vModelText,Ze.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>Tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys($n,["enter"])},null,40,qd),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",Wd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>G.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys($n,["enter"]),onInput:Xl},null,40,Ud),[[e.vModelText,G.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>ue.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys($n,["enter"]),onInput:ro},null,40,jd),[[e.vModelText,ue.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Vl},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:$n},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Hn.value&&an.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[an.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gd,[T.title?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(ft.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Pe,value:T.title,onInput:Rn,onFocus:el,onBlur:gn,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!an.value}]),placeholder:ft.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),Hn.value&&an.value?(e.openBlock(),e.createElementBlock("div",t1,[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":yl.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l1,[T.description?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(Qe.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:ht,value:T.description,onInput:_l,onFocus:zl,onBlur:Pl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:Qe.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),yl.value&&V.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(le.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":lt.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>Bo(s),onMouseleave:Nl},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,c1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,p1)):(e.openBlock(),e.createElementBlock("span",f1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,m1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>co(s),["stop"])},[e.createElementVNode("span",g1,"+"+e.toDisplayString(s.additionalCount),1)],12,v1)):e.createCommentVNode("",!0)],46,i1))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(O.value),onInput:re,onBlur:rt,onClick:ml,onMouseup:At,onKeyup:At,onKeydown:oo,onPaste:Wo,onMousemove:Zo,onMouseleave:vl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[lt.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(pn.value)},[jn.value||_n.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[jn.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:jn.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_n.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,_1)):(e.openBlock(),e.createElementBlock("span",$1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",L1,[e.createElementVNode("div",T1,[e.createElementVNode("div",A1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",D1,e.toDisplayString(Il(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":bl(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!bl(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Oo(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,H1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",R1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:kn,"onUpdate:modelValue":l[26]||(l[26]=s=>cn.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(kn.value){const s=kn.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,cn.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yo,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",I1,[e.createElementVNode("div",z1,[e.createElementVNode("span",P1,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",O1,e.toDisplayString(Ie.value)+" "+e.toDisplayString(Ie.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("textarea",{value:T.modelValue,onInput:wl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:Ct.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Fn.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Ie.value)+" "+e.toDisplayString(Ie.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[oe.value&&ve.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:l[28]||(l[28]=s=>Ce.value=!0),onMouseleave:Sl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Rl,["stop"]),title:ve.value},e.toDisplayString(ve.value),9,q1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Z1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,W1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[Mt.value&&Ut.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Q.value),onMouseenter:l[29]||(l[29]=s=>be.value=!0),onMouseleave:Hl},[e.createElementVNode("div",U1,[Ut.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",X1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:Ut.value},e.toDisplayString(Ut.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",K1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,j1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&>.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Pt,class:"dss-floating-toolbar",style:e.normalizeStyle(We.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",G1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(bt,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!W.value}]),onClick:e.withModifiers(J,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,J1),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",em,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>El("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[E.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):E.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):E.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):E.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):E.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):E.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,rm)):(e.openBlock(),e.createElementBlock("svg",im,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,tm),it.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]=s=>Ln("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>Ln("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>Ln("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>Ln("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>Ln("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>Ln("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>Ln("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>Bn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>Bn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>Bn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dm),l[91]||(l[91]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":vt.value}]),onClick:e.withModifiers(ql,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,mm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),ge.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Ll,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,fm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers($l,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,pm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertUnorderedList")}]),onClick:e.withModifiers(k,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":tn("insertOrderedList")}]),onClick:e.withModifiers(y,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,gm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,hm),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(ho,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,ym),T.askAi?(e.openBlock(),e.createElementBlock("div",km)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>El("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",wm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,bm),it.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)]),sl.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&sl.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[Xt(s)&&Dn(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),Xt(s)&&Dn(s)&&r<T.customToolbarSlots.length-1&&An(r)?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mm={class:"dss-color-picker__section-title"},_m={class:"dss-color-picker__presets-row"},$m=["title","onClick"],Lm={key:1,class:"dss-color-picker__section"},Tm={class:"dss-color-picker__presets-row"},Am=["title","onClick"],Dm={class:"dss-color-picker__section"},Hm={class:"dss-color-picker__section-header"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im=["onClick"],zm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Pm=["title","onClick"],Om={class:"dss-color-picker__input-row"},qm=["value"],Wm={__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(T,{emit:te}){function _(P){const X=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(P);if(!X)return{h:0,s:0,l:50};const K=parseInt(X[1],16)/255,me=parseInt(X[2],16)/255,ze=parseInt(X[3],16)/255,nt=Math.max(K,me,ze),St=Math.min(K,me,ze);let Pe=0,ht=0;const Ot=(nt+St)/2;if(nt!==St){const on=nt-St;switch(ht=Ot>.5?on/(2-nt-St):on/(nt+St),nt){case K:Pe=((me-ze)/on+(me<ze?6:0))/6;break;case me:Pe=((ze-K)/on+2)/6;break;case ze:Pe=((K-me)/on+4)/6;break}}return{h:Pe*360,s:ht*100,l:Ot*100}}function L(P,X,K){X/=100,K/=100;const me=X*Math.min(K,1-K),ze=nt=>{const St=(nt+P/30)%12,Pe=K-me*Math.max(Math.min(St-3,9-St,1),-1);return Math.round(255*Pe).toString(16).padStart(2,"0")};return`#${ze(0)}${ze(8)}${ze(4)}`}function ce(P){const X=P.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!X)return null;let K=X[1];return K.length===3&&(K=K.split("").map(me=>me+me).join("")),"#"+K}function z(P,X,K){X/=100,K/=100;const me=K+X*Math.min(K,1-K),ze=me===0?0:2-2*K/me;return{h:P,s:ze*100,v:me*100}}function A(P,X,K){X/=100,K/=100;const me=K*(1-X/2),ze=me===0||me===1?0:(K-me)/Math.min(me,1-me);return{h:P,s:ze*100,l:me*100}}const U=T,Ke=te,he=e.ref(!1),f=e.ref(!1),we=e.ref(!1),ge=e.ref(-1),ne=e.ref(-1),oe=e.ref(null),ve=e.ref(null),H=e.ref(null),Ce=e.ref(null),Te=e.ref({top:0,left:0}),qe=e.ref(_(U.modelValue||"#b8a5de")),ct=e.computed(()=>Array.isArray(U.presetGroups)&&U.presetGroups.length>0),R=e.computed(()=>ct.value?0:U.initialPresetCount!=null?U.initialPresetCount:ne.value<0?null:ne.value),xe=e.computed(()=>{const P=R.value;return P==null?!0:Math.max(0,U.presetColors.length-P)<U.max}),Be=e.computed(()=>!!(f.value||ge.value>=0||!ke.value&&U.presetColors.length===0));e.computed(()=>{const P=R.value;return P!=null&&U.presetColors.length>P});const ke=e.computed(()=>ct.value||R.value!=null),mt=e.computed(()=>{const P=R.value;return P==null?[]:U.presetColors.slice(0,P)}),vt=e.computed(()=>{const P=R.value;return P==null?[]:U.presetColors.slice(P)});function de(P){const X=R.value;return X!=null?X+P:-1}function gt(P){const X=R.value;return X!=null&&P>=X}function We(P){gt(P)&&(ge.value=P,qe.value=_(U.presetColors[P]),f.value=!0,e.nextTick(()=>Ce.value?.focus()))}function Pt(P){if(!gt(P))return;const X=U.presetColors.filter((ze,nt)=>nt!==P);Ke("update:presetColors",X);const K=ce(U.modelValue),me=ce(U.presetColors[P]);if(K&&me&&K.toLowerCase()===me.toLowerCase()){const ze=X[Math.max(0,P-1)]||X[0];ze&&Ke("update:modelValue",ze)}}function it(){we.value=!we.value,we.value||(ge.value=-1,f.value=!1)}function Et(){if(ge.value<0)return;const P=G.value,X=ce(P);if(X){const K=[...U.presetColors];K[ge.value]=X,Ke("update:presetColors",K),Ke("update:modelValue",X),ge.value=-1,f.value=!1}}function Tt(){U.disabled||(ge.value=-1,f.value=!f.value,f.value&&(Mt(),e.nextTick(()=>Ce.value?.focus())))}function Wt(P){const X=ce(P),K=ce(U.modelValue);return X&&K&&X.toLowerCase()===K.toLowerCase()}function Ft(){if(U.disabled||!xe.value)return;const P=G.value,X=ce(P);if(X){const K=[...U.presetColors,X];Ke("update:presetColors",K),Ke("update:modelValue",X);const me=R.value??ne.value;me>=0&&K.length-me>=U.max&&(f.value=!1)}}const G=e.computed(()=>{const{h:P,s:X,l:K}=qe.value;return L(P,X,K)}),ue=e.computed(()=>G.value.toLowerCase()),De=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${qe.value.h}, 100%, 50%))`})),Xe=e.computed(()=>{const P=z(qe.value.h,qe.value.s,qe.value.l);return{left:`${P.s}%`,bottom:`${P.v}%`,transform:"translate(-50%, 50%)"}}),Zt=e.computed(()=>({left:`${qe.value.h/360*100}%`,transform:"translateX(-50%)"})),kt=e.computed(()=>({position:"fixed",left:`${Te.value.left}px`,top:`${Te.value.top}px`,zIndex:1002}));function xt(){if(!oe.value||!he.value)return;const P=oe.value.getBoundingClientRect(),X=window.innerHeight||document.documentElement.clientHeight;let K=P.bottom+4;const me=ve.value;me&&K+me.offsetHeight>X-8&&(K=P.top-4-me.offsetHeight),Te.value={top:K,left:P.left}}function Mt(){const P=U.modelValue||"#b8a5de";ce(P)&&(qe.value=_(P))}function Ut(){Ke("update:modelValue",G.value)}function Q(){U.disabled||(he.value=!he.value,he.value&&(Mt(),e.nextTick(()=>{xt(),Ce.value?.focus()})))}function be(){const P=G.value,X=ce(P);if(X){if(ge.value>=0){const K=[...U.presetColors];K[ge.value]=X,Ke("update:presetColors",K),Ke("update:modelValue",X)}else if((U.presetColors.length>0||ct.value)&&f.value&&xe.value&&!U.presetColors.some(me=>ce(me)?.toLowerCase()===X.toLowerCase())){const me=[...U.presetColors,X];Ke("update:presetColors",me),Ke("update:modelValue",X)}}he.value=!1,f.value=!1,we.value=!1,ge.value=-1}function Me(P){if(!H.value)return;const X=H.value.getBoundingClientRect(),K=me=>{const ze=Math.max(0,Math.min(1,(me.clientX-X.left)/X.width)),nt=Math.max(0,Math.min(1,1-(me.clientY-X.top)/X.height)),St={h:qe.value.h,s:ze*100,v:nt*100};qe.value=A(St.h,St.s,St.v)};K(P),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),Ut()},{once:!0})}function Ze(P){if(!P.currentTarget)return;const K=P.currentTarget.getBoundingClientRect(),me=ze=>{const nt=Math.max(0,Math.min(1,(ze.clientX-K.left)/K.width));qe.value={...qe.value,h:nt*360}};me(P),document.addEventListener("mousemove",me),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",me),Ut()},{once:!0})}function et(P){const X=P.target.value,K=ce(X);K&&(qe.value=_(K),Ke("update:modelValue",K))}function pt(P){if(U.disabled)return;const X=ce(P);X&&(qe.value=_(X),Ke("update:modelValue",X))}let je=null,_t=null;function Re(){je&&(document.removeEventListener("keydown",je),je=null),_t&&(window.removeEventListener("resize",_t),_t=null)}return e.watch(he,P=>{if(Re(),P){if(!ct.value&&U.initialPresetCount==null){const X=U.presetColors.length;X>0&&(ne.value<0||X<ne.value)&&(ne.value=X)}je=X=>{X.key==="Escape"&&be()},_t=xt,document.addEventListener("keydown",je),window.addEventListener("resize",_t)}}),e.watch(()=>U.modelValue,()=>{he.value&&Mt()},{immediate:!1}),e.watch(vt,P=>{P.length===0&&(we.value=!1,ge.value=-1,f.value=!1)}),e.onBeforeUnmount(Re),(P,X)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":T.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:oe,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":he.value}]),onClick:Q},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:G.value})},[...X[0]||(X[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"},[he.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(be,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:ve,class:"dss-color-picker__dropdown",style:e.normalizeStyle(kt.value)},[ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[ct.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(K,me)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+me,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(K.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(ze,nt)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+me+"-"+nt,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Wt(ze)}]),style:e.normalizeStyle({backgroundColor:ze}),title:ze,onClick:e.withModifiers(St=>pt(ze),["stop"])},null,14,$m))),128))])]))),128)):mt.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[X[1]||(X[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value,(K,me)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+me,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Wt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(ze=>pt(K),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dm,[e.createElementVNode("div",Hm,[X[3]||(X[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),vt.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":we.value}]),title:"Manage custom colors",onClick:e.withModifiers(it,["stop"])},[...X[2]||(X[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",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,(K,me)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+me,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":we.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!we.value&&Wt(K),"dss-color-picker__preset-bubble--editing":we.value&&ge.value===de(me)}]),style:e.normalizeStyle({backgroundColor:ge.value===de(me)?G.value:K}),title:ge.value===de(me)?G.value:K,onClick:e.withModifiers(ze=>we.value?We(de(me)):pt(K),["stop"])},null,14,Fm),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(ze=>Pt(de(me)),["stop"])},[...X[4]||(X[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,Im)):e.createCommentVNode("",!0)],2))),128)),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):T.presetColors.length?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.presetColors,(K,me)=>(e.openBlock(),e.createElementBlock("button",{key:me,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":Wt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(ze=>pt(K),["stop"])},null,14,Pm))),128)),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Me},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(De.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Xe.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:Ze},[X[5]||(X[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Zt.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:Ce,type:"text",class:"dss-color-picker__hex-input",value:ue.value,onInput:et},null,40,qm)]),ke.value&&(T.presetColors.length||ct.value)&&xe.value&&ge.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),ke.value&&ge.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Et}," Save color ")):e.createCommentVNode("",!0),ke.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:be}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Zm={key:0,class:"dss-loader"},Um={key:0,class:"dss-loader-label"},Xm={key:1,class:"dss-loader"},Ym={key:0,class:"dss-loader-label"},jm={key:2,class:"dss-loader"},Km={key:0,class:"dss-loader-label"},Gm={key:3,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:4,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:5,class:"dss-loader dss-loader--inline"},n2={class:"dss-loader-inline-text"},l2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(T){const te=T,_=e.computed(()=>te.size==="small"?"dss-loaders--size-small":te.size==="large"?"dss-loaders--size-large":te.size==="medium"||te.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const ce={};if(!(te.size==="small"||te.size==="medium"||te.size==="large"||te.size==null)){const z=typeof te.size=="number"?`${te.size}px`:String(te.size);ce["--dss-loader-size"]=z}return te.color&&(ce["--dss-loader-accent"]=te.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${te.color} 30%, white)`),ce});return(ce,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(L.value)},[T.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Zm,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="dots"?(e.openBlock(),e.createElementBlock("div",Xm,[z[1]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",Ym,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="battery"?(e.openBlock(),e.createElementBlock("div",jm,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Km,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Gm,[z[3]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="bars"?(e.openBlock(),e.createElementBlock("div",Jm,[z[4]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="inline"?(e.openBlock(),e.createElementBlock("div",t2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])])])):e.createCommentVNode("",!0)],6))}},ia="dss-skeleton-item",o2={__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:T=>["single","multiple"].includes(T)},targetClass:{type:String,default:ia},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(T){const te=T,_=e.computed(()=>{const z={"dss-skeleton--loading":te.loading,"dss-skeleton--static":!te.shimmer,"dss-skeleton--multiple":te.mode==="multiple","dss-skeleton--dark":te.darkMode};return te.mode==="multiple"&&te.targetClass!==ia&&(z[`dss-skeleton--target-${te.targetClass}`]=!0),z}),L=e.computed(()=>{const z={};return te.borderRadius&&(z.borderRadius=te.borderRadius),z}),ce=e.computed(()=>{const z={};return te.borderRadius&&(z["--dss-skeleton-border-radius"]=te.borderRadius),te.darkMode?(z["--dss-skeleton-bg"]=te.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=te.shimmerDark||"#3e3f41",z):(te.bgColor&&(z["--dss-skeleton-bg"]=te.bgColor),te.shimmerColor&&(z["--dss-skeleton-shimmer"]=te.shimmerColor),z)});return(z,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(ce.value)},[T.loading&&T.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":T.loading&&T.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},a2={key:0,class:"dss-dnd-column-header"},s2={class:"dss-dnd-column-title"},r2={class:"dss-dnd-column-count"},i2=["data-column"],c2={key:0,class:"dss-dnd-indicator"},u2=["onPointerdown"],d2=["onPointerdown"],m2={class:"dss-dnd-item-content"},p2={class:"dss-dnd-item-default"},f2={key:0,class:"dss-dnd-empty"},v2={name:"DSSDnd"},g2=Object.assign(v2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(T,{emit:te}){const _=T,L=te,ce=e.useSlots(),z=e.computed(()=>!!ce["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},U=e.computed(()=>({...A,..._.options})),Ke=e.computed(()=>({"--dss-dnd-col-min-w":U.value.columnMinWidth,"--dss-dnd-col-max-w":U.value.columnMaxWidth,"--dss-dnd-col-gap":U.value.columnGap,"--dss-dnd-indicator-color":U.value.indicatorColor,"--dss-dnd-body-max-h":U.value.columnBodyMaxHeight}));function he(Q){if(!U.value.ColColor||!Q)return{};const be=Q.background||Q.color;return be?{background:be}:{}}const f=e.ref(null),we=e.ref(null),ge=e.ref(!1),ne=e.ref(-1),oe=e.ref(null);let ve=null,H=null,Ce=null,Te=null,qe=0,ct=0,R="",xe=null;const Be=5,ke=e.computed(()=>{const Q={};for(const be of _.columns)Q[be.value]=_.items.filter(Me=>Me[_.columnKey]===be.value).sort((Me,Ze)=>(Me[_.positionKey]??0)-(Ze[_.positionKey]??0));return Q}),mt=e.computed(()=>{const Q={},be=!!f.value,Me=f.value?.[_.itemKey],Ze=we.value,et=ne.value;for(const pt of _.columns){const je=ke.value[pt.value]||[],_t=[],Re=Ze==pt.value;let P=0;for(let X=0;X<je.length;X++){const K=je[X],me=be&&K[_.itemKey]===Me;!me&&Re&&et===P&&_t.push({type:"indicator",key:`ind-${P}`}),me||P++,_t.push({type:"item",item:K,isDragged:me,key:`item-${K[_.itemKey]}`})}Re&&et>=P&&_t.push({type:"indicator",key:"ind-end"}),Q[pt.value]=_t}return Q});function vt(Q,be){const Ze=(ke.value[Q]||[]).filter(je=>je[_.itemKey]!==f.value?.[_.itemKey]);if(Ze.length===0)return 1;if(be<=0){const je=Ze[0][_.positionKey];return je!=null&&je>0?je/2:.5}if(be>=Ze.length){const je=Ze[Ze.length-1][_.positionKey];return(je??0)+1}const et=Ze[be-1][_.positionKey]??0,pt=Ze[be][_.positionKey]??0;return(et+pt)/2}function de(Q,be,Me){Ce&&Ce.remove();const Ze=Q.getBoundingClientRect(),et=Q.cloneNode(!0);et.classList.add("dss-dnd-ghost"),et.style.cssText=`
|
|
103
|
+
`){const y=document.createTextNode(" ");l.insertNode(y),l.setStartAfter(y)}}l.insertNode(d);const u=document.createTextNode(" ");l.setStartAfter(d),l.insertNode(u),l.setStartAfter(u),l.collapse(!0),o.removeAllRanges(),o.addRange(l)}}re()}e.nextTick(()=>{Cn(),Il()})},Ul=()=>{if(!f.value||ne.value)return;const o=window.getSelection();let l=null;o&&o.rangeCount>0&&(l=Nn());const s=/(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],y=v.textContent;s.lastIndex=0;const M=[...y.matchAll(s)];if(M.length===0)continue;const D=M.filter(j=>{const Re=j[0],Ve=j.index;if(Ve>0&&y[Ve-1]==="@"||Ve+Re.length<y.length&&y[Ve+Re.length]==="@")return!1;const at=v.parentElement;return!(at&&at.closest("a"))});if(D.length===0)continue;if(D.length===1&&D[0][0]===y.trim()){const j=D[0][0],Re=j.startsWith("http://")||j.startsWith("https://")?j:`https://${j}`,Ve=document.createElement("a");Ve.href=Re,Ve.textContent=j,Ve.style.color="#60afdf",Ve.style.textDecoration="underline",v.parentNode&&(v.parentNode.replaceChild(Ve,v),u=!0);continue}let E=0;const oe=document.createDocumentFragment();if(D.forEach(j=>{const Re=j.index,Ve=j[0];if(Re>E){const un=y.substring(E,Re);un&&oe.appendChild(document.createTextNode(un))}const at=Ve.startsWith("http://")||Ve.startsWith("https://")?Ve:`https://${Ve}`,gn=document.createElement("a");gn.href=at,gn.textContent=Ve,gn.style.color="#60afdf",gn.style.textDecoration="underline",oe.appendChild(gn),E=Re+Ve.length}),E<y.length){const j=y.substring(E);j&&oe.appendChild(document.createTextNode(j))}v.parentNode&&oe.childNodes.length>0&&(v.parentNode.replaceChild(oe,v),u=!0)}u&&l&&e.nextTick(()=>{Bn(l),Cn()})},Eo=()=>{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}}),s=[];let r;for(;r=l.nextNode();)s.push(r);for(let c=s.length-1;c>=0;c--){const d=s[c],u=d.textContent,m=[...u.matchAll(o)];if(m.length===0)continue;let v=0;const y=document.createDocumentFragment();m.forEach(M=>{const D=M.index,E=M[0].startsWith("<u>")?"u":"ins",oe=M[1]||M[2]||"";D>v&&y.appendChild(document.createTextNode(u.substring(v,D)));const j=document.createElement(E);j.textContent=oe,y.appendChild(j),v=D+M[0].length}),v<u.length&&y.appendChild(document.createTextNode(u.substring(v))),d.parentNode&&y.childNodes.length>0&&d.parentNode.replaceChild(y,d)}},So=o=>{if(!f.value||ne.value)return;if(!o){Eo();return}if(!["*","_",">"].includes(o))return;const s=window.getSelection();if(!s||s.rangeCount===0)return;const r=s.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 un="",nn=0,dn=!1;const rn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:zn=>zn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});document.createTreeWalker(c,NodeFilter.SHOW_TEXT,null);let cn=0;for(;rn.nextNode();){const zn=rn.currentNode,el=zn.textContent||"",rl=cn;if(cn+=el.length,zn===r.startContainer){un+=el.substring(0,r.startOffset),nn=rl+r.startOffset,dn=!0;break}un+=el}return dn||(nn=un.length),{textBeforeCursor:un,cursorCharOffset:nn}},{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 y=m[0],M=m[1],D=u.length-y.length,oe=(un=>{let nn=0;const dn=document.createTreeWalker(c,NodeFilter.SHOW_TEXT,{acceptNode:cn=>cn.parentElement?.closest("a, code, pre")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let rn;for(;rn=dn.nextNode();){const cn=(rn.textContent||"").length;if(nn+cn>=un)return{node:rn,offset:un-nn};nn+=cn}return null})(D);if(!oe)return;const j=document.createRange();j.setStart(oe.node,oe.offset),j.setEnd(r.endContainer,r.endOffset);const Re=document.createElement(v);Re.textContent=M,j.deleteContents(),j.insertNode(Re);const Ve=window.getSelection(),at=document.createRange();at.setStartAfter(Re),at.collapse(!0),Ve.removeAllRanges(),Ve.addRange(at);const gn=Nn();e.nextTick(()=>{re(),gn&&Bn(gn)})},so=()=>{f.value&&(Pt.value=Nn(),Tt.value="",Ft.value="",qe.value="",G.value="",me.value="",qt.value=null,yt.value=null,Me.value="upload",Et.value=!0,on(),e.nextTick(()=>{He.value&&He.value.focus(),Ue.value&&(Ue.value.value="")}))},Xn=o=>{const l=o.target?.files?.[0];if(!l){qt.value=null,Ft.value="";return}qt.value=l;const s=new FileReader;s.onload=r=>{Ft.value=r.target?.result||""},s.readAsDataURL(l)},Yn=()=>{Ue.value&&Ue.value.click()},Xl=()=>{G.value&&(me.value="")},ro=()=>{me.value&&(G.value="")},Vo=()=>{let o=yt.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")||"";yt.value=o,Tt.value=l.trim()===""||l.trim()==="Image"?"":l;const s=o.getAttribute("src")||o.src||"";s.startsWith("http://")||s.startsWith("https://")?(qe.value=s,Ft.value="",Me.value="url"):(Ft.value=s,qe.value="",Me.value="upload");const c=o.style.width||o.getAttribute("width")||"",d=o.style.height||o.getAttribute("height")||"";G.value=c.endsWith("px")?c.replace("px",""):c,me.value=d.endsWith("px")?d.replace("px",""):d,Pt.value=null}else{so();return}Et.value=!0,ye.value=!1,wt.value=!1,e.nextTick(()=>{Me.value==="url"&&Wt.value?(Wt.value.focus(),Wt.value.select()):He.value&&(He.value.focus(),He.value.select()),Ue.value&&(Ue.value.value="")})},El=()=>{Et.value=!1,Tt.value="",Ft.value="",qe.value="",G.value="",me.value="",qt.value=null,yt.value=null,Pt.value=null,Me.value="upload"},_n=()=>{const o=(Tt.value||"").trim(),l=f.value?._mutationObserver;l&&l.disconnect(),W.value?(Ye.value&&(clearTimeout(Ye.value),Ye.value=null),ot(),W.value=!1):ot();const s=Me.value==="url"?qe.value.trim():Ft.value;if(yt.value&&f.value&&f.value.contains(yt.value)){s&&(yt.value.src=s),yt.value.setAttribute("alt",o),yt.value.setAttribute("data-alt",o),G.value?(yt.value.style.width=`${G.value}px`,yt.value.setAttribute("width",G.value)):(yt.value.style.removeProperty("width"),yt.value.removeAttribute("width")),me.value?(yt.value.style.height=`${me.value}px`,yt.value.setAttribute("height",me.value)):(yt.value.style.removeProperty("height"),yt.value.removeAttribute("height"));const r=window.getSelection();if(r){r.removeAllRanges();const c=document.createRange();c.setStartAfter(yt.value),c.collapse(!0),r.addRange(c)}re()}else{if(!s){l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),El();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(Pt.value&&(Bn(Pt.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 y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,0),d.collapse(!0)}else d.selectNodeContents(f.value),d.collapse(!1);c&&(c.removeAllRanges(),c.addRange(d))}if(!d){El();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 y=document.createElement("p");y.innerHTML="<br>",f.value.appendChild(y),d.setStart(y,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=s,v.setAttribute("alt",o),v.setAttribute("data-alt",o),G.value&&(v.style.width=`${G.value}px`,v.setAttribute("width",G.value)),me.value&&(v.style.height=`${me.value}px`,v.setAttribute("height",me.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 D=document.createElement("p");f.value.appendChild(D),D.appendChild(v)}else{const D=f.value.lastChild;if(D&&D.nodeType===1)D.appendChild(v);else{const E=document.createElement("p");f.value.appendChild(E),E.appendChild(v)}}const M=document.createRange();M.setStartAfter(v),M.collapse(!0),c&&(c.removeAllRanges(),c.addRange(M))}}yt.value=v,re()}}e.nextTick(()=>{l&&f.value&&l.observe(f.value,{childList:!0,subtree:!0}),Cn(),en(),El()})};e.watch(()=>A.modelValue,o=>{if(A.richText&&f.value&&!ne.value){const l=yl(o||""),r=f.value.innerHTML.replace(/ |\u00A0/g," "),c=l.replace(/ |\u00A0/g," ");if(r!==c){const d=Nn();f.value.innerHTML=l,e.nextTick(()=>{vt();const u=f.value.innerHTML||"",m=A.title||"",v=A.description||"";Z.value=u,ve.value=m,We.value=v,K.value=u,Ke.value=m,Nt.value=v,Xe.value=[],Vt.value=[],Ye.value&&(clearTimeout(Ye.value),Ye.value=null),W.value=!1,d&&Bn(d),k(),fn(),$e(),Cn(),en(),bt(),hn("watch-modelValue")})}}},{immediate:!0}),e.watch(()=>A.richText,o=>{o?(en(),e.nextTick(()=>{uo()})):(Hl(),J.value=[],Pe.value&&(Pe.value.disconnect(),Pe.value=null)),bt()}),e.watch(()=>A.floatingToolbar,o=>{o?en():Hl()}),e.watch(()=>A.disabled,o=>{o&&Hl(),bt()}),e.watch(()=>A.description,()=>{e.nextTick(()=>{V.value?xn():ul()})}),e.watch(()=>A.title,()=>{e.nextTick(()=>{Qt.value?Vn():pn()})}),e.watch(()=>A.customToolbarSlots,()=>{e.nextTick(()=>{Gt()})},{deep:!0}),e.watch(()=>A.comments,(o,l)=>{if(Fn.value){Fn.value=!1;return}Al.value||A.richText&&f.value&&e.nextTick(()=>{wn()})},{deep:!0,immediate:!1});const wn=()=>{if(!Al.value&&!(!A.comments||!Array.isArray(A.comments)||A.comments.length===0)&&!(!A.richText||!f.value)){Al.value=!0;try{const o=new Set,l=A.comments.filter(u=>{const m=String(u.conversation_id||u.id);return o.has(m)?!1:(o.add(m),!0)}),s=f.value.querySelectorAll("[data-comment], [data-fake-comment]"),r=s.length;s.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 y=f.value.querySelector(`[data-comment="${v}"]`);if(y){Kt(y,u),d.add(v);return}try{const M=Xo(u.selection_range,u.selection_text);if(M&&!M.collapsed){const D=M.commonAncestorContainer,E=D.nodeType===3?D.parentElement:D;if(E){const Re=E.closest("[data-comment], [data-fake-comment]");if(Re){const Ve=Re.getAttribute("data-comment")||Re.getAttribute("data-fake-comment");if(String(Ve)===String(m)){Re.setAttribute("data-comment",v),Re.removeAttribute("data-fake-comment"),Kt(Re,u),d.add(v);return}else return}}const oe=f.value.querySelector(`[data-comment="${v}"]`);if(oe){Kt(oe,u),d.add(v);return}const j=document.createElement("span");j.setAttribute("data-comment",v),Kt(j,u);try{M.surroundContents(j),c++,d.add(v)}catch{try{const Ve=document.createRange();Ve.setStart(M.startContainer,M.startOffset),Ve.setEnd(M.endContainer,M.endOffset),io(Ve),Ve.surroundContents(j),c++,d.add(v)}catch{try{const at=M.extractContents();j.appendChild(at),M.insertNode(j),c++,d.add(v)}catch(at){console.warn("Failed to create comment marker:",at)}}}}}catch{}}),e.nextTick(()=>{hn("restoreCommentsFromModel"),re(),Al.value=!1})}catch{Al.value=!1}}},io=o=>{if(!o||!f.value)return o;try{const l=["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"];let s=o.startContainer,r=o.startOffset;if(s.nodeType===3){const u=s.parentElement;u&&l.includes(u.tagName)&&(r===0&&!Zt(s)||o.setStartBefore(u))}else s.nodeType===1&&l.includes(s.tagName)&&r>0&&o.setStartBefore(s);let c=o.endContainer,d=o.endOffset;if(c.nodeType===3){const u=c.parentElement;u&&l.includes(u.tagName)&&(d===c.length&&!No(c)||o.setEndAfter(u))}else c.nodeType===1&&l.includes(c.tagName)&&d<c.childNodes.length&&o.setEndAfter(c);return o}catch{return o}},Zt=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},No=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},Xo=(o,l)=>{if(!o||!f.value)return null;try{const s=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&&(s.setStart(d,o.start-r),u=!0),u&&o.end>=r&&o.end<=v&&(s.setEnd(d,o.end-r),m=!0),r=v}else{let v=d.childNodes.length;for(;v--;)c.push(d.childNodes[v])}return u?io(s):null}}catch{return null}return null},Kt=(o,l)=>{if(!o||!l)return;const s=l.conversation||[],r=new Set,c=[],d=m=>{m&&m.id&&!r.has(m.id)&&(r.add(m.id),c.push(m))};s.length>0&&s.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=s.length;u>0?o.setAttribute("data-comment-count",String(u)):o.removeAttribute("data-comment-count")},hn=(o="unknown")=>{if(!A.richText||!f.value){J.value=[];return}Date.now()-Bt.value<At&&ft.value!==null||ft.value===null&&(ft.value=requestAnimationFrame(()=>{if(ft.value=null,Bt.value=Date.now(),we.value)return;we.value=!0;const s={},r=f.value;if(!r){we.value=!1;return}const c=r.closest(".editor-with-comments");if(!c){we.value=!1;return}const d=r.querySelectorAll("[data-comment], [data-fake-comment]"),u=[],m=new Set;d.forEach(E=>{const oe=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");oe&&E.tagName==="SPAN"&&(m.has(oe)||(u.push(E),m.add(oe)))}),d.forEach(E=>{const oe=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");!oe||m.has(oe)||(["P","DIV","H1","H2","H3","H4","H5","H6"].includes(E.tagName)?E.querySelector(`span[data-comment="${oe}"], span[data-fake-comment="${oe}"]`)||(u.push(E),m.add(oe)):E.tagName!=="SPAN"&&(u.push(E),m.add(oe)))});const v=c.getBoundingClientRect(),y=r.getBoundingClientRect();u.forEach((E,oe)=>{let j=E.getAttribute("data-comment")||E.getAttribute("data-fake-comment");if(!j)return;if(typeof j=="string"&&j.startsWith("comment-")){const tl=E.textContent?.trim(),jn=A.comments?.find(Pn=>(typeof Pn.conversation_id=="string"&&Pn.conversation_id.startsWith("comment-")?null:Pn.conversation_id)&&Pn.selection_text?.trim()===tl);jn?(j=String(jn.conversation_id),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment")):(j=String(Date.now()),E.setAttribute("data-comment",j),E.removeAttribute("data-fake-comment"))}const Re=E.getBoundingClientRect(),Ve=window.getComputedStyle(E),at=parseFloat(Ve.lineHeight)||parseFloat(Ve.fontSize)*1.2,nn=Re.top-y.top+at/2-15,rn=y.top-v.top+nn;let cn=null,zn=null,el=0;const rl=[],mo=new Set;if(j&&A.comments){const tl=A.comments.find(jn=>String(jn.conversation_id||jn.id)===String(j));if(tl){const jn=tl.conversation||[];jn.length>0?(jn.forEach(Pn=>{Pn.user&&Pn.user.id&&!mo.has(Pn.user.id)&&(mo.add(Pn.user.id),rl.push(Pn.user))}),el=jn.length):(el=0,cn=null,zn=null),rl.length>0?cn=rl[0]:cn=null,rl.length>1?zn=rl[1]:zn=null}}const _o=Re.top+at/2-15,Yo=_o+30,gl=5,po=Yo>y.top+gl&&_o<y.bottom-gl?1:0;J.value.find(tl=>tl.id===j);let Yl=E;if(!Yl&&j&&f.value){const tl=String(j);Yl=f.value.querySelector(`[data-comment="${tl}"], [data-fake-comment="${tl}"]`)}const $o=rl.length;s[j]?(s[j].top=rn,s[j].opacity=po,s[j].element=Yl,s[j].firstUser=cn,s[j].secondUser=zn,s[j].totalCount=el,s[j].uniqueUserCount=$o):s[j]={id:j,top:rn,opacity:po,element:Yl,firstUser:cn,secondUser:zn,totalCount:el,uniqueUserCount:$o}});const M=Object.values(s).map(E=>{const oe=Math.max(0,(E.uniqueUserCount??0)-2);if(!E.element&&E.id&&f.value){const Re=String(E.id);E.element=f.value.querySelector(`[data-comment="${Re}"], [data-fake-comment="${Re}"]`)}return{...E,firstUser:E.firstUser||null,secondUser:E.secondUser||null,totalCount:E.totalCount,additionalCount:oe}});(J.value.length!==M.length||M.some((E,oe)=>{const j=J.value[oe];if(!j)return!0;const Re=(j.firstUser?.id||null)!==(E.firstUser?.id||null),Ve=(j.secondUser?.id||null)!==(E.secondUser?.id||null);return j.id!==E.id||Math.abs(j.top-E.top)>1||j.opacity!==E.opacity||j.totalCount!==E.totalCount||j.additionalCount!==E.additionalCount||Re||Ve||j.element!==E.element}))&&(J.value=M),we.value=!1}))},Bo=o=>{if(!o)return;let l=o.element;if(!l&&o.id&&f.value){const s=String(o.id);l=f.value.querySelector(`[data-comment="${s}"], [data-fake-comment="${s}"]`)}l&&(yn(),ue.value=l,l.classList.add("editor-comment-highlighted"))},yn=(o=!1)=>{!o&&q.value!==null&&ue.value&&(ue.value.getAttribute("data-comment")||ue.value.getAttribute("data-fake-comment"))===q.value||(f.value&&f.value.querySelectorAll(".editor-comment-highlighted").forEach(s=>{s.classList.remove("editor-comment-highlighted")}),ue.value&&(ue.value.classList.remove("editor-comment-highlighted"),ue.value=null))},co=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 s=`[data-comment="${l}"], [data-fake-comment="${l}"]`;X("comment-marker-clicked",{commentId:l,selector:s,element:o.element})},Sl=()=>{yn()},uo=()=>{!A.richText||!f.value||(Pe.value&&Pe.value.disconnect(),kt.value!==null&&(clearTimeout(kt.value),kt.value=null),Pe.value=new MutationObserver(()=>{kt.value===null&&(kt.value=setTimeout(()=>{kt.value=null,e.nextTick(()=>{hn("MutationObserver")})},200))}),Pe.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"]}),hn("setupCommentMarkersObserver-initial"))},Mo=(o,l)=>{if(!o||!l)return;const s=l.getBoundingClientRect();let r=s.top,c=s.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=s.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(()=>et.value,o=>{e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(s=>{const r=s.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(s.parentNode!==document.body){const d=s.parentNode;s.dataset.originalParentRef=d===c?"inside":"sibling",document.body.appendChild(s)}s.style.display="block",s.style.visibility="hidden",s.style.opacity="0",requestAnimationFrame(()=>{requestAnimationFrame(()=>{Mo(s,c),s.offsetHeight,s.setAttribute("data-active","true"),s.style.visibility="visible",s.style.opacity="1"})})}else s.setAttribute("data-active","true")}else s.setAttribute("data-active","false"),s.style.display="none",s.style.top="",s.style.left="",s.style.visibility="",s.style.opacity=""})})}),e.watch(()=>[xe.value,st.value],()=>{xe.value==="askAi"||st.value==="askAi"?e.nextTick(()=>{vn()}):(et.value=null,e.nextTick(()=>{document.querySelectorAll(".dss-toolbar-dropdown-submenu").forEach(l=>{if(l.parentNode===document.body){const s=l.getAttribute("data-submenu-id");if(s){const r=document.querySelector(`.dss-toolbar-dropdown-item-has-submenu[data-submenu-id="${s}"]`);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(()=>A.locale,o=>{o&&o!==ce.value&&(ce.value=o)},{immediate:!0}),te({openCommentOverlayForSelector:bo,updateCommentMarkers:hn,restoreCommentsFromModel:wn}),(o,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-text-editor-container editor-with-comments",nt.value]),style:e.normalizeStyle(dt.value)},[T.richText?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-text-editor-toolbar",onMousedown:l[14]||(l[14]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",Lu,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:Ct,title:e.unref(L)("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,Tu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!U.value}]),onClick:ae,title:e.unref(L)("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,Au),l[61]||(l[61]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",Du,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[0]||(l[0]=s=>Kn("paragraph")),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Ru)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Fu)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Iu)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,zu)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Pu)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,Ou)):(e.openBlock(),e.createElementBlock("svg",qu,[...l[47]||(l[47]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[48]||(l[48]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,Hu),xe.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]=s=>Zn("<h1>"))},[e.createElementVNode("img",{src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,Wu),e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[2]||(l[2]=s=>Zn("<h2>"))},[e.createElementVNode("img",{src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,Zu),e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[3]||(l[3]=s=>Zn("<h3>"))},[e.createElementVNode("img",{src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,Uu),e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[4]||(l[4]=s=>Zn("<h4>"))},[e.createElementVNode("img",{src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,Xu),e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[5]||(l[5]=s=>Zn("<h5>"))},[e.createElementVNode("img",{src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,Yu),e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[6]||(l[6]=s=>Zn("<h6>"))},[e.createElementVNode("img",{src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,ju),e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[7]||(l[7]=s=>Zn("<p>"))},[l[49]||(l[49]=e.createElementVNode("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"paragraph-icon"},[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"})],-1)),e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:l[9]||(l[9]=s=>kn("bold")),title:e.unref(L)("textEditor.toolbar.bold")},[...l[50]||(l[50]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,Ku),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:l[10]||(l[10]=s=>kn("italic")),title:e.unref(L)("textEditor.toolbar.italic")},[...l[51]||(l[51]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,Gu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:l[11]||(l[11]=s=>kn("underline")),title:e.unref(L)("textEditor.toolbar.underline")},[...l[52]||(l[52]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,Qu),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":pt.value}]),onClick:$l,title:e.unref(L)("textEditor.toolbar.citation")},[...l[53]||(l[53]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,Ju),l[62]||(l[62]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:Gn,title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[55]||(l[55]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,td)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:ql,title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[54]||(l[54]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,ed)),l[63]||(l[63]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:Rn,title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[56]||(l[56]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,nd),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:Ll,title:e.unref(L)("textEditor.toolbar.numberList")},[...l[57]||(l[57]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,ld),l[64]||(l[64]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:so,title:e.unref(L)("textEditor.toolbar.image")},[...l[58]||(l[58]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,od),Y.value?(e.openBlock(),e.createElementBlock("div",ad)):e.createCommentVNode("",!0),Y.value?(e.openBlock(),e.createElementBlock("div",{key:3,class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:ho},[...l[59]||(l[59]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,sd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",rd)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",id,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-dropdown-toggle",onClick:l[12]||(l[12]=s=>Kn("askAi")),title:e.unref(L)("textEditor.toolbar.askAi")},[l[60]||(l[60]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",ud,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,cd),xe.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",dd,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[zt(s)?(e.openBlock(),e.createElementBlock("div",md,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),zt(s)&&r<T.customToolbarSlots.length-1&&Tn(r)?(e.openBlock(),e.createElementBlock("div",pd)):e.createCommentVNode("",!0)],64))),128))])],32)):e.createCommentVNode("",!0),(xe.value==="paragraph"||xe.value==="askAi")&&T.richText?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-dropdown-overlay",onClick:on})):e.createCommentVNode("",!0),e.createVNode(Jo,{showModal:Te.value,width:"500px",height:"55vh",onCloseModal:Il},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(L)("textEditor.link.editLink")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",fd,[e.createElementVNode("div",vd,[e.createElementVNode("label",gd,e.toDisplayString(e.unref(L)("textEditor.link.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkAltInput",ref:Ee,type:"text","onUpdate:modelValue":l[15]||(l[15]=s=>rt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterAltText"),onKeyup:e.withKeys(ao,["enter"])},null,40,hd),[[e.vModelText,rt.value]])]),e.createElementVNode("div",yd,[e.createElementVNode("label",kd,e.toDisplayString(e.unref(L)("textEditor.link.url")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"linkUrlInput",ref:R,type:"text","onUpdate:modelValue":l[16]||(l[16]=s=>ze.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.link.enterUrl"),onKeyup:e.withKeys(ao,["enter"])},null,40,Cd),[[e.vModelText,ze.value]])])])]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:Il},e.toDisplayString(e.unref(L)("textEditor.link.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:ao},e.toDisplayString(e.unref(L)("textEditor.link.save")),1)]),_:1},8,["showModal"]),e.createVNode(Jo,{showModal:Et.value,width:"500px",height:"80vh",onCloseModal:El},{title:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(yt.value?e.unref(L)("textEditor.image.editImage"):e.unref(L)("textEditor.image.addImage")),1)]),content:e.withCtx(()=>[e.createElementVNode("div",bd,[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="upload"}]),onClick:l[17]||(l[17]=s=>Me.value="upload")},e.toDisplayString(e.unref(L)("textEditor.image.upload")),3),l[65]||(l[65]=e.createElementVNode("div",{class:"dss-image-modal-tab-separator"},null,-1)),e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-image-modal-tab",{"dss-image-modal-tab-active":Me.value==="url"}]),onClick:l[18]||(l[18]=s=>Me.value="url")},e.toDisplayString(e.unref(L)("textEditor.image.imageLink")),3)]),Me.value==="upload"?(e.openBlock(),e.createElementBlock("div",wd,[e.createElementVNode("div",xd,[e.createElementVNode("div",Ed,[ct.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("label",Sd,e.toDisplayString(e.unref(L)("textEditor.image.uploadImage")),1)),ct.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-image-upload-preview",onClick:Yn},[e.createElementVNode("img",{src:Ft.value,alt:"Preview",class:"dss-image-preview-image"},null,8,Vd),l[66]||(l[66]=e.createElementVNode("div",{class:"dss-image-preview-overlay"},[e.createElementVNode("svg",{width:"35",height:"35",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.1 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z",fill:"white"})])],-1)),e.createElementVNode("input",{ref_key:"imageFileInput",ref:Ue,type:"file",accept:"image/*",class:"dss-image-file-input-hidden",onChange:Xn},null,544)])):(e.openBlock(),e.createElementBlock("input",{key:2,ref_key:"imageFileInput",ref:Ue,type:"file",accept:"image/*",class:"dss-link-modal-input dss-link-modal-input-image",onChange:Xn},null,544))]),e.createElementVNode("div",Nd,[e.createElementVNode("label",Bd,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageAltInput",ref:He,type:"text","onUpdate:modelValue":l[19]||(l[19]=s=>Tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_n,["enter"])},null,40,Md),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",_d,[e.createElementVNode("label",$d,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[20]||(l[20]=s=>G.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:Xl},null,40,Ld),[[e.vModelText,G.value]])]),e.createElementVNode("div",Td,[e.createElementVNode("label",Ad,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[21]||(l[21]=s=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:ro},null,40,Dd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0),Me.value==="url"?(e.openBlock(),e.createElementBlock("div",Hd,[e.createElementVNode("div",Rd,[e.createElementVNode("div",Fd,[e.createElementVNode("label",Id,e.toDisplayString(e.unref(L)("textEditor.image.imageUrl")),1),e.withDirectives(e.createElementVNode("input",{ref_key:"imageUrlInput",ref:Wt,type:"text","onUpdate:modelValue":l[22]||(l[22]=s=>qe.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterImageUrl"),onKeyup:e.withKeys(_n,["enter"])},null,40,zd),[[e.vModelText,qe.value]])]),e.createElementVNode("div",Pd,[e.createElementVNode("label",Od,e.toDisplayString(e.unref(L)("textEditor.image.altText")),1),e.withDirectives(e.createElementVNode("input",{type:"text","onUpdate:modelValue":l[23]||(l[23]=s=>Tt.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.enterAltText"),onKeyup:e.withKeys(_n,["enter"])},null,40,qd),[[e.vModelText,Tt.value]])]),e.createElementVNode("div",Wd,[e.createElementVNode("label",Zd,e.toDisplayString(e.unref(L)("textEditor.image.width")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[24]||(l[24]=s=>G.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:Xl},null,40,Ud),[[e.vModelText,G.value]])]),e.createElementVNode("div",Xd,[e.createElementVNode("label",Yd,e.toDisplayString(e.unref(L)("textEditor.image.height")),1),e.withDirectives(e.createElementVNode("input",{type:"number",min:"1","onUpdate:modelValue":l[25]||(l[25]=s=>me.value=s),class:"dss-link-modal-input",placeholder:e.unref(L)("textEditor.image.auto"),onKeyup:e.withKeys(_n,["enter"]),onInput:ro},null,40,jd),[[e.vModelText,me.value]])])])])):e.createCommentVNode("",!0)]),actions:e.withCtx(()=>[e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-cancel",onClick:El},e.toDisplayString(e.unref(L)("textEditor.image.cancel")),1),e.createElementVNode("button",{type:"button",class:"dss-link-modal-button dss-link-modal-button-save",onClick:_n},e.toDisplayString(e.unref(L)("textEditor.image.save")),1)]),_:1},8,["showModal"]),e.createElementVNode("div",{class:e.normalizeClass(["dss-text-editor-title-wrapper",{"dss-text-editor-no-border-bottom":Hn.value&&Qt.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.title")),1),e.createElementVNode("div",Kd,[Qt.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Gd,[T.title?(e.openBlock(),e.createElementBlock("span",Qd,e.toDisplayString(T.title),1)):(e.openBlock(),e.createElementBlock("span",Jd,e.toDisplayString(mt.value),1))])),e.createElementVNode("textarea",{ref_key:"titleInputRef",ref:Qe,value:T.title,onInput:$n,onFocus:to,onBlur:ll,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-title-input",{"dss-text-editor-title-input-blurred":!Qt.value}]),placeholder:mt.value,disabled:T.disabled,rows:"1"},null,42,e1)])],2),Hn.value&&Qt.value?(e.openBlock(),e.createElementBlock("div",t1,[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":Nl.value&&V.value}])},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.labels.description")),1),e.createElementVNode("div",n1,[V.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",l1,[T.description?(e.openBlock(),e.createElementBlock("span",o1,e.toDisplayString(T.description),1)):(e.openBlock(),e.createElementBlock("span",a1,e.toDisplayString(Je.value),1))])),e.createElementVNode("textarea",{ref_key:"descriptionInputRef",ref:lt,value:T.description,onInput:Cl,onFocus:kl,onBlur:Ol,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-description-input",{"dss-text-editor-description-input-blurred":!V.value}]),placeholder:Je.value,disabled:T.disabled,rows:"1"},null,42,s1)])],2),Nl.value&&V.value?(e.openBlock(),e.createElementBlock("div",r1,[e.renderSlot(o.$slots,"description-slot")])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(J.value,s=>(e.openBlock(),e.createElementBlock("div",{key:s.id,class:e.normalizeClass(["editor-comment-marker-group",{"editor-comment-marker-active":q.value===s.id,"editor-comment-marker-group-out-of-view":s.opacity===0}]),"data-comment-id":s.id,style:e.normalizeStyle({top:s.top+"px"}),onMouseenter:r=>Bo(s),onMouseleave:Sl},[s.firstUser?(e.openBlock(),e.createElementBlock("div",{key:0,class:"editor-comment-marker editor-comment-marker-first",onClick:e.withModifiers(r=>co(s),["stop"])},[s.firstUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.firstUser.avatar,alt:s.firstUser.name||"avatar"},null,8,u1)):(e.openBlock(),e.createElementBlock("span",d1,e.toDisplayString(s.firstUser.initials||(s.firstUser.name?s.firstUser.name.charAt(0):"")),1))],8,c1)):e.createCommentVNode("",!0),s.secondUser?(e.openBlock(),e.createElementBlock("div",{key:1,class:"editor-comment-marker editor-comment-marker-second",onClick:e.withModifiers(r=>co(s),["stop"])},[s.secondUser.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.secondUser.avatar,alt:s.secondUser.name||"avatar"},null,8,p1)):(e.openBlock(),e.createElementBlock("span",f1,e.toDisplayString(s.secondUser.initials||(s.secondUser.name?s.secondUser.name.charAt(0):"")),1))],8,m1)):e.createCommentVNode("",!0),s.additionalCount>0?(e.openBlock(),e.createElementBlock("div",{key:2,class:"editor-comment-marker editor-comment-marker-additional",style:e.normalizeStyle({top:s.secondUser?"30px":"15px"}),"data-has-second-user":s.secondUser?"true":"false",onClick:e.withModifiers(r=>co(s),["stop"])},[e.createElementVNode("span",g1,"+"+e.toDisplayString(s.additionalCount),1)],12,v1)):e.createCommentVNode("",!0)],46,i1))),128)),T.richText?(e.openBlock(),e.createElementBlock("div",x1,[e.createElementVNode("div",{ref_key:"editorRef",ref:f,contenteditable:"true",spellcheck:"false",class:e.normalizeClass(["dss-text-editor-content",{"dss-text-editor-content-disabled":T.disabled,"dss-text-editor-fixed-height":T.fixedHeight}]),style:e.normalizeStyle(O.value),onInput:re,onBlur:Ae,onClick:ml,onMouseup:Dt,onKeyup:Dt,onKeydown:oo,onPaste:Wo,onMousemove:Zo,onMouseleave:vl},null,38),e.createVNode(e.Transition,{name:"comment-overlay"},{default:e.withCtx(()=>[q.value!==null?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-overlay",style:e.normalizeStyle(ht.value)},[an.value||sn.value.length>0?(e.openBlock(),e.createElementBlock("div",E1,[e.createElementVNode("div",S1,[an.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-comment-selection",innerHTML:an.value},null,8,V1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",N1,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(sn.value,(s,r)=>(e.openBlock(),e.createElementBlock("div",{key:r,class:"dss-comment-message"},[s.user&&(s.user.avatar||s.user.initials||s.user.name)?(e.openBlock(),e.createElementBlock("div",B1,[e.createElementVNode("div",M1,[s.user.avatar?(e.openBlock(),e.createElementBlock("img",{key:0,src:s.user.avatar,alt:s.user.name||"avatar"},null,8,_1)):(e.openBlock(),e.createElementBlock("span",$1,e.toDisplayString(s.user.initials||(s.user.name?s.user.name.charAt(0):"")),1))])])):e.createCommentVNode("",!0),e.createElementVNode("div",L1,[e.createElementVNode("div",T1,[e.createElementVNode("div",A1,e.toDisplayString(s.user&&s.user.name||"Comment"),1),s.createdAt?(e.openBlock(),e.createElementBlock("div",D1,e.toDisplayString(zl(new Date(s.createdAt))),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",{class:e.normalizeClass(["dss-comment-body-text",{"comment-started":Ml(s.text)||s.class==="comment-started"}])},e.toDisplayString(s.text||""),3)]),A.commentUser&&s.user&&s.user.id===A.commentUser.id&&!Ml(s.text)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-comment-delete-button",onClick:e.withModifiers(c=>Oo(s,r),["stop"]),title:e.unref(L)("textEditor.comment.delete")||"Delete comment"},[...l[68]||(l[68]=[e.createElementVNode("svg",{width:"22",height:"25",viewBox:"0 0 22 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M19.5986 21.3535C19.5985 23.3679 18.1282 25 16.2891 25H5.30957C3.48166 24.9997 2.00011 23.3702 2 21.3535V8H19.5986V21.3535ZM8 11C7.44772 11 7 11.4477 7 12V20C7 20.5523 7.44772 21 8 21C8.55229 21 9 20.5523 9 20V12C9 11.4477 8.55229 11 8 11ZM14 11C13.4477 11 13 11.4477 13 12V20C13 20.5523 13.4477 21 14 21C14.5523 21 15 20.5523 15 20V12C15 11.4477 14.5523 11 14 11ZM13.2002 0C15.0227 0.000104554 16.4999 1.46937 16.5 3.27246V4.36328H20.9092C21.5117 4.36348 21.9998 4.84789 22 5.4541C22 6.05615 21.4986 6.54569 20.9092 6.5459H1.09082C0.488195 6.54569 0 6.06052 0 5.4541C0.000246661 4.85225 0.50153 4.36349 1.09082 4.36328H5.5L5.50098 3.27246C5.50112 1.46505 6.98382 0.000171185 8.80078 0H13.2002ZM8.79004 2.18164C8.19615 2.18167 7.70034 2.67042 7.7002 3.27246C7.7002 3.87899 8.18837 4.36325 8.79004 4.36328H13.21C13.8039 4.36325 14.2998 3.87462 14.2998 3.27246C14.2997 2.66606 13.8115 2.18167 13.21 2.18164H8.79004Z",fill:"#323232"})],-1)])],8,H1)):e.createCommentVNode("",!0)]))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",R1,[e.withDirectives(e.createElementVNode("textarea",{ref_key:"commentInputRef",ref:Yt,"onUpdate:modelValue":l[26]||(l[26]=s=>Mt.value=s),class:"dss-comment-input",rows:"1",placeholder:e.unref(L)("textEditor.comment.placeholder"),onKeydown:e.withKeys(e.withModifiers(yo,["prevent","stop"]),["enter"]),onInput:l[27]||(l[27]=()=>{if(Yt.value){const s=Yt.value;s.style.height="auto",s.style.height=`${s.scrollHeight}px`}})},null,40,F1),[[e.vModelText,Mt.value]]),e.createElementVNode("button",{type:"button",class:"dss-comment-send-button",onClick:e.withModifiers(yo,["stop"])},[...l[69]||(l[69]=[e.createElementVNode("svg",{width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0.00999999 18L21 9L0.00999999 0L0 7L15 9L0 11L0.00999999 18Z",fill:"#31312F"})],-1)])])])],4)):e.createCommentVNode("",!0)]),_:1}),e.createElementVNode("div",I1,[e.createElementVNode("div",z1,[e.createElementVNode("span",P1,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[70]||(l[70]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",O1,e.toDisplayString(Fe.value)+" "+e.toDisplayString(Fe.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])):(e.openBlock(),e.createElementBlock("div",h1,[e.createElementVNode("textarea",{value:T.modelValue,onInput:Pl,spellcheck:"false",class:e.normalizeClass(["dss-text-editor-textarea",{"dss-text-editor-fixed-height":T.fixedHeight}]),placeholder:xt.value,rows:T.rows,disabled:T.disabled,style:e.normalizeStyle(Wn.value)},null,46,y1),e.createElementVNode("div",k1,[e.createElementVNode("div",C1,[e.createElementVNode("span",b1,e.toDisplayString(se.value)+" "+e.toDisplayString(se.value===1?e.unref(L)("textEditor.footer.word"):e.unref(L)("textEditor.footer.words")),1),l[67]||(l[67]=e.createElementVNode("span",{class:"dss-text-editor-footer-separator"},"•",-1)),e.createElementVNode("span",w1,e.toDisplayString(Fe.value)+" "+e.toDisplayString(Fe.value===1?e.unref(L)("textEditor.footer.character"):e.unref(L)("textEditor.footer.characters")),1)])])])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[le.value&&fe.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(H.value),onMouseenter:l[28]||(l[28]=s=>be.value=!0),onMouseleave:xl},[e.createElementVNode("span",{class:"dss-link-popup-url",onClick:e.withModifiers(Fl,["stop"]),title:fe.value},e.toDisplayString(fe.value),9,q1),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Uo,["stop"]),title:e.unref(L)("textEditor.link.editLink")},[(e.openBlock(),e.createElementBlock("svg",Z1,[...l[71]||(l[71]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,W1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[wt.value&&It.value&&f.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-link-popup",style:e.normalizeStyle(Q.value),onMouseenter:l[29]||(l[29]=s=>ye.value=!0),onMouseleave:Rl},[e.createElementVNode("div",U1,[It.value===e.unref(L)("textEditor.image.noAlt")?(e.openBlock(),e.createElementBlock("div",X1,[...l[72]||(l[72]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M10 0C4.5 0 0 4.5 0 10C0 15.5 4.5 20 10 20C15.5 20 20 15.5 20 10C20 4.5 15.5 0 10 0ZM2 10C2 5.6 5.6 2 10 2C11.8 2 13.5 2.6 14.9 3.7L3.7 14.9C2.6 13.5 2 11.8 2 10ZM10 18C8.2 18 6.5 17.4 5.1 16.3L16.3 5.1C17.4 6.5 18 8.2 18 10C18 14.4 14.4 18 10 18Z",fill:"#fafafa"})],-1)])])):e.createCommentVNode("",!0),e.createElementVNode("p",{class:"dss-image-popup-alt",title:It.value},e.toDisplayString(It.value),9,Y1)]),e.createElementVNode("button",{type:"button",class:"dss-link-popup-edit",onClick:e.withModifiers(Vo,["stop"]),title:e.unref(L)("textEditor.image.editImage")},[(e.openBlock(),e.createElementBlock("svg",K1,[...l[73]||(l[73]=[e.createElementVNode("g",null,[e.createElementVNode("path",{d:"M25.264 1.008c-.524 0-1.049.197-1.443.592l-2.248 2.248 6.58 6.578 2.246-2.248a2.058 2.058 0 0 0 0-2.887L26.707 1.6a2.032 2.032 0 0 0-1.443-.592zm-5.106 4.254L3.889 21.532a1.022 1.022 0 0 0-.242.391c-.729 2.187-2.035 5.759-2.6 7.803a1 1 0 0 0 1.188 1.24c2.432-.562 5.687-1.896 7.84-2.613a1.03 1.03 0 0 0 .392-.236l16.269-16.275z",fill:"hsl(0, 0%, 98%)",opacity:"1","data-original":"#000000",class:""})],-1)])]))],8,j1)],36)):e.createCommentVNode("",!0)])),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[T.floatingToolbar&&T.richText&&ut.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"floatingToolbarRef",ref:Ut,class:"dss-floating-toolbar",style:e.normalizeStyle(Oe.value),onMousedown:l[44]||(l[44]=e.withModifiers(()=>{},["prevent"]))},[e.createElementVNode("div",G1,[e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(Ct,["stop"]),title:e.unref(L)("textEditor.toolbar.undo")},[...l[74]||(l[74]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M9.23302 0.888889C6.90278 0.888889 4.79238 1.76889 3.16561 3.2L0 0V8H7.91402L4.73083 4.78222C5.9531 3.75111 7.50953 3.11111 9.23302 3.11111C12.3459 3.11111 14.9927 5.16444 15.916 8L18 7.30667C16.7777 3.58222 13.3219 0.888889 9.23302 0.888889Z",fill:"#323232"})],-1)])],8,Q1),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-disabled":!U.value}]),onClick:e.withModifiers(ae,["stop"]),title:e.unref(L)("textEditor.toolbar.redo")},[...l[75]||(l[75]=[e.createElementVNode("svg",{viewBox:"0 0 18 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M14.8328 3.2C13.2053 1.76889 11.0938 0.888889 8.76246 0.888889C4.67155 0.888889 1.21408 3.58222 0 7.30667L2.07625 8C3 5.16444 5.6393 3.11111 8.76246 3.11111C10.478 3.11111 12.044 3.75111 13.2669 4.78222L10.0821 8H18V0L14.8328 3.2Z",fill:"#323232"})],-1)])],10,J1),l[89]||(l[89]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",em,[e.createElementVNode("div",{class:"dss-toolbar-button dss-toolbar-dropdown-toggle",onClick:l[30]||(l[30]=e.withModifiers(s=>wl("paragraph"),["stop"])),title:e.unref(L)("textEditor.toolbar.paragraphFormat")},[S.value==="h1"?(e.openBlock(),e.createElementBlock("img",{key:0,src:z.h1,alt:"H1",class:"dss-toolbar-heading-icon"},null,8,nm)):S.value==="h2"?(e.openBlock(),e.createElementBlock("img",{key:1,src:z.h2,alt:"H2",class:"dss-toolbar-heading-icon"},null,8,lm)):S.value==="h3"?(e.openBlock(),e.createElementBlock("img",{key:2,src:z.h3,alt:"H3",class:"dss-toolbar-heading-icon"},null,8,om)):S.value==="h4"?(e.openBlock(),e.createElementBlock("img",{key:3,src:z.h4,alt:"H4",class:"dss-toolbar-heading-icon"},null,8,am)):S.value==="h5"?(e.openBlock(),e.createElementBlock("img",{key:4,src:z.h5,alt:"H5",class:"dss-toolbar-heading-icon"},null,8,sm)):S.value==="h6"?(e.openBlock(),e.createElementBlock("img",{key:5,src:z.h6,alt:"H6",class:"dss-toolbar-heading-icon"},null,8,rm)):(e.openBlock(),e.createElementBlock("svg",im,[...l[76]||(l[76]=[e.createElementVNode("path",{d:"M4.33333 8.61539V14H6.5V2.15385H8.66667V14H10.8333V2.15385H13V0H4.33333C1.93917 0 0 1.92769 0 4.30769C0 6.68769 1.93917 8.61539 4.33333 8.61539Z",fill:"#323232"},null,-1)])])),l[77]||(l[77]=e.createElementVNode("span",{class:"dss-toolbar-dropdown-arrow"},"˅",-1))],8,tm),st.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]=s=>Ln("<h1>"))},[e.createElementVNode("h1",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading1")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[32]||(l[32]=s=>Ln("<h2>"))},[e.createElementVNode("h2",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading2")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[33]||(l[33]=s=>Ln("<h3>"))},[e.createElementVNode("h3",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading3")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[34]||(l[34]=s=>Ln("<h4>"))},[e.createElementVNode("h4",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading4")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[35]||(l[35]=s=>Ln("<h5>"))},[e.createElementVNode("h5",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading5")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[36]||(l[36]=s=>Ln("<h6>"))},[e.createElementVNode("h6",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.heading6")),1)]),e.createElementVNode("div",{class:"dss-toolbar-dropdown-item",onClick:l[37]||(l[37]=s=>Ln("<p>"))},[e.createElementVNode("p",null,e.toDisplayString(e.unref(L)("textEditor.paragraph.paragraph")),1)])])):e.createCommentVNode("",!0)]),l[90]||(l[90]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("bold")}]),onClick:l[39]||(l[39]=e.withModifiers(s=>kn("bold"),["stop"])),title:e.unref(L)("textEditor.toolbar.bold")},[...l[78]||(l[78]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M8.8 6.79C9.79256 6.12 10.4884 5.02 10.4884 4C10.4884 1.74 8.69767 0 6.39535 0H0V14H7.20372C9.34233 14 11 12.3 11 10.21C11 8.69 10.12 7.39 8.8 6.79ZM3.06977 2.5H6.13953C6.98884 2.5 7.67442 3.17 7.67442 4C7.67442 4.83 6.98884 5.5 6.13953 5.5H3.06977V2.5ZM6.65116 11.5H3.06977V8.5H6.65116C7.50047 8.5 8.18605 9.17 8.18605 10C8.18605 10.83 7.50047 11.5 6.65116 11.5Z",fill:"currentColor"})],-1)])],10,cm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("italic")}]),onClick:l[40]||(l[40]=e.withModifiers(s=>kn("italic"),["stop"])),title:e.unref(L)("textEditor.toolbar.italic")},[...l[79]||(l[79]=[e.createElementVNode("svg",{viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M4 0V3H6.21L2.79 11H0V14H8V11H5.79L9.21 3H12V0H4Z",fill:"#323232"})],-1)])],10,um),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("underline")}]),onClick:l[41]||(l[41]=e.withModifiers(s=>kn("underline"),["stop"])),title:e.unref(L)("textEditor.toolbar.underline")},[...l[80]||(l[80]=[e.createElementVNode("svg",{viewBox:"0 0 11 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M5.5 10.8889C8.10071 10.8889 10.2143 8.79667 10.2143 6.22222V0H8.25V6.22222C8.25 7.72333 7.01643 8.94444 5.5 8.94444C3.98357 8.94444 2.75 7.72333 2.75 6.22222V0H0.785714V6.22222C0.785714 8.79667 2.89929 10.8889 5.5 10.8889ZM0 12.4444V14H11V12.4444H0Z",fill:"#323232"})],-1)])],10,dm),l[91]||(l[91]=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($l,["stop"]),title:e.unref(L)("textEditor.toolbar.citation")},[...l[81]||(l[81]=[e.createElementVNode("svg",{viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.42857 14H5.71429L8.57143 8.4V0H0V8.4H4.28571L1.42857 14ZM12.8571 14H17.1429L20 8.4V0H11.4286V8.4H15.7143L12.8571 14Z",fill:"currentColor"})],-1)])],10,mm),l[92]||(l[92]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),he.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"dss-toolbar-button",onClick:e.withModifiers(Gn,["stop"]),title:e.unref(L)("textEditor.toolbar.removeLink")},[...l[83]||(l[83]=[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M18 4.88889H13.2V7.21111H18C20.052 7.21111 21.72 8.91 21.72 11C21.72 12.7478 20.544 14.2144 18.948 14.6422L20.7 16.4267C22.656 15.4122 24 13.3833 24 11C24 7.62667 21.312 4.88889 18 4.88889ZM16.8 9.77778H14.172L16.572 12.2222H16.8V9.77778ZM0 1.55222L3.732 5.35333C1.548 6.25778 0 8.44556 0 11C0 14.3733 2.688 17.1111 6 17.1111H10.8V14.7889H6C3.948 14.7889 2.28 13.09 2.28 11C2.28 9.05667 3.732 7.45556 5.592 7.24778L8.076 9.77778H7.2V12.2222H10.476L13.2 14.9967V17.1111H15.276L20.088 22L21.6 20.46L1.524 0L0 1.55222Z",fill:"#323232"})],-1)])],8,fm)):(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-toolbar-button",onClick:e.withModifiers(ql,["stop"]),title:e.unref(L)("textEditor.toolbar.insertLink")},[...l[82]||(l[82]=[e.createElementVNode("svg",{width:"20",height:"14",viewBox:"0 0 27 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.565 7C2.565 4.606 4.4415 2.66 6.75 2.66H12.15V0H6.75C3.024 0 0 3.136 0 7C0 10.864 3.024 14 6.75 14H12.15V11.34H6.75C4.4415 11.34 2.565 9.394 2.565 7ZM8.1 8.4H18.9V5.6H8.1V8.4ZM20.25 0H14.85V2.66H20.25C22.5585 2.66 24.435 4.606 24.435 7C24.435 9.394 22.5585 11.34 20.25 11.34H14.85V14H20.25C23.976 14 27 10.864 27 7C27 3.136 23.976 0 20.25 0Z",fill:"#323232"})],-1)])],8,pm)),l[93]||(l[93]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertUnorderedList")}]),onClick:e.withModifiers(Rn,["stop"]),title:e.unref(L)("textEditor.toolbar.bulletList")},[...l[84]||(l[84]=[e.createElementVNode("svg",{viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M1.37838 5.2C0.615676 5.2 0 5.78067 0 6.5C0 7.21933 0.615676 7.8 1.37838 7.8C2.14108 7.8 2.75676 7.21933 2.75676 6.5C2.75676 5.78067 2.14108 5.2 1.37838 5.2ZM1.37838 0C0.615676 0 0 0.580667 0 1.3C0 2.01933 0.615676 2.6 1.37838 2.6C2.14108 2.6 2.75676 2.01933 2.75676 1.3C2.75676 0.580667 2.14108 0 1.37838 0ZM1.37838 10.4C0.615676 10.4 0 10.9893 0 11.7C0 12.4107 0.624865 13 1.37838 13C2.13189 13 2.75676 12.4107 2.75676 11.7C2.75676 10.9893 2.14108 10.4 1.37838 10.4ZM4.13514 12.5667H17V10.8333H4.13514V12.5667ZM4.13514 7.36667H17V5.63333H4.13514V7.36667ZM4.13514 0.433333V2.16667H17V0.433333H4.13514Z",fill:"#323232"})],-1)])],10,vm),e.createElementVNode("div",{class:e.normalizeClass(["dss-toolbar-button",{"dss-toolbar-button-active":Jt("insertOrderedList")}]),onClick:e.withModifiers(Ll,["stop"]),title:e.unref(L)("textEditor.toolbar.numberList")},[...l[85]||(l[85]=[e.createElementVNode("svg",{viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 12.1875H1.89474V12.6562H0.947368V13.5938H1.89474V14.0625H0V15H2.84211V11.25H0V12.1875ZM0.947368 3.75H1.89474V0H0V0.9375H0.947368V3.75ZM0 6.5625H1.70526L0 8.53125V9.375H2.84211V8.4375H1.13684L2.84211 6.46875V5.625H0V6.5625ZM4.73684 0.9375V2.8125H18V0.9375H4.73684ZM4.73684 14.0625H18V12.1875H4.73684V14.0625ZM4.73684 8.4375H18V6.5625H4.73684V8.4375Z",fill:"#323232"})],-1)])],10,gm),l[94]||(l[94]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",onClick:e.withModifiers(so,["stop"]),title:e.unref(L)("textEditor.toolbar.image")},[...l[86]||(l[86]=[e.createElementVNode("svg",{viewBox:"1.5 1.5 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2.15065 15.8414L2.13398 15.8581C1.90898 15.3664 1.76732 14.8081 1.70898 14.1914C1.76732 14.7997 1.92565 15.3497 2.15065 15.8414Z",fill:"#323232"}),e.createElementVNode("path",{d:"M7.50091 8.65026C8.59628 8.65026 9.48425 7.76229 9.48425 6.66693C9.48425 5.57156 8.59628 4.68359 7.50091 4.68359C6.40555 4.68359 5.51758 5.57156 5.51758 6.66693C5.51758 7.76229 6.40555 8.65026 7.50091 8.65026Z",fill:"#323232"}),e.createElementVNode("path",{d:"M13.491 1.66699H6.50768C3.47435 1.66699 1.66602 3.47533 1.66602 6.50866V13.492C1.66602 14.4003 1.82435 15.192 2.13268 15.8587C2.84935 17.442 4.38268 18.3337 6.50768 18.3337H13.491C16.5243 18.3337 18.3327 16.5253 18.3327 13.492V11.5837V6.50866C18.3327 3.47533 16.5243 1.66699 13.491 1.66699ZM16.9743 10.417C16.3243 9.85866 15.2743 9.85866 14.6243 10.417L11.1577 13.392C10.5077 13.9503 9.45768 13.9503 8.80768 13.392L8.52435 13.1587C7.93268 12.642 6.99102 12.592 6.32435 13.042L3.20768 15.1337C3.02435 14.667 2.91602 14.1253 2.91602 13.492V6.50866C2.91602 4.15866 4.15768 2.91699 6.50768 2.91699H13.491C15.841 2.91699 17.0827 4.15866 17.0827 6.50866V10.5087L16.9743 10.417Z",fill:"#323232"})],-1)])],8,hm),l[95]||(l[95]=e.createElementVNode("div",{class:"dss-toolbar-separator"},null,-1)),e.createElementVNode("div",{class:"dss-toolbar-button",title:e.unref(L)("textEditor.toolbar.comment"),onClick:e.withModifiers(ho,["stop"])},[...l[87]||(l[87]=[e.createElementVNode("svg",{viewBox:"2 2 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M13.19 6H6.79C6.53 6 6.28 6.01 6.04 6.04C3.35 6.27 2 7.86 2 10.79V14.79C2 18.79 3.6 19.58 6.79 19.58H7.19C7.41 19.58 7.7 19.73 7.83 19.9L9.03 21.5C9.56 22.21 10.42 22.21 10.95 21.5L12.15 19.9C12.3 19.7 12.54 19.58 12.79 19.58H13.19C16.12 19.58 17.71 18.24 17.94 15.54C17.97 15.3 17.98 15.05 17.98 14.79V10.79C17.98 7.6 16.38 6 13.19 6ZM6.5 14C5.94 14 5.5 13.55 5.5 13C5.5 12.45 5.95 12 6.5 12C7.05 12 7.5 12.45 7.5 13C7.5 13.55 7.05 14 6.5 14ZM9.99 14C9.43 14 8.99 13.55 8.99 13C8.99 12.45 9.44 12 9.99 12C10.54 12 10.99 12.45 10.99 13C10.99 13.55 10.55 14 9.99 14ZM13.49 14C12.93 14 12.49 13.55 12.49 13C12.49 12.45 12.94 12 13.49 12C14.04 12 14.49 12.45 14.49 13C14.49 13.55 14.04 14 13.49 14Z",fill:"#323232"}),e.createElementVNode("path",{d:"M21.9802 6.79V10.79C21.9802 12.79 21.3602 14.15 20.1202 14.9C19.8202 15.08 19.4702 14.84 19.4702 14.49L19.4802 10.79C19.4802 6.79 17.1902 4.5 13.1902 4.5L7.10025 4.51C6.75025 4.51 6.51025 4.16 6.69025 3.86C7.44025 2.62 8.80025 2 10.7902 2H17.1902C20.3802 2 21.9802 3.6 21.9802 6.79Z",fill:"#323232"})],-1)])],8,ym),T.askAi?(e.openBlock(),e.createElementBlock("div",km)):e.createCommentVNode("",!0),T.askAi?(e.openBlock(),e.createElementBlock("div",Cm,[e.createElementVNode("div",{class:"dss-toolbar-ai-button dss-toolbar-ai-float dss-toolbar-dropdown-toggle",onClick:l[42]||(l[42]=e.withModifiers(s=>wl("askAi"),["stop"])),title:e.unref(L)("textEditor.toolbar.askAi")},[l[88]||(l[88]=e.createElementVNode("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M3.97363 4.34473C5.4926 6.769 7.88838 8.45732 10.7598 9.01855C9.21102 10.2499 7.99851 11.8959 7.30762 13.8027C7.21982 14.066 6.82404 14.066 6.69238 13.8027C5.59521 10.7746 3.18158 8.40476 0.197266 7.30762C-0.0658032 7.21978 -0.0656958 6.82515 0.197266 6.69336C1.62341 6.17665 2.90369 5.36753 3.97363 4.34473Z",fill:"#9784ba"}),e.createElementVNode("path",{d:"M6.66895 0.197266C6.75687 -0.0657415 7.1515 -0.0657945 7.2832 0.197266C8.38035 3.22532 10.7941 5.5952 13.7783 6.69238C14.0416 6.78015 14.0416 7.17497 13.7783 7.30664C12.6735 7.71282 11.6469 8.29371 10.7363 9.01758C7.86425 8.45633 5.46822 6.76786 3.94922 4.34277C5.15088 3.1939 6.08858 1.77583 6.66895 0.197266Z",fill:"#cfbeed"})],-1)),e.createElementVNode("span",wm,e.toDisplayString(e.unref(L)("textEditor.toolbar.askAi")),1)],8,bm),st.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)]),cl.value?(e.openBlock(),e.createElementBlock("div",xm,[T.askAi&&cl.value?(e.openBlock(),e.createElementBlock("div",Em)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.customToolbarSlots,(s,r)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:r},[zt(s)&&Dn(s)?(e.openBlock(),e.createElementBlock("div",Sm,[e.renderSlot(o.$slots,s)])):e.createCommentVNode("",!0),zt(s)&&Dn(s)&&r<T.customToolbarSlots.length-1&&An(r)?(e.openBlock(),e.createElementBlock("div",Vm)):e.createCommentVNode("",!0)],64))),128))])):e.createCommentVNode("",!0)],36)):e.createCommentVNode("",!0)]))],6))}}),Mm={class:"dss-color-picker__section-title"},_m={class:"dss-color-picker__presets-row"},$m=["title","onClick"],Lm={key:1,class:"dss-color-picker__section"},Tm={class:"dss-color-picker__presets-row"},Am=["title","onClick"],Dm={class:"dss-color-picker__section"},Hm={class:"dss-color-picker__section-header"},Rm={class:"dss-color-picker__presets-row"},Fm=["title","onClick"],Im=["onClick"],zm={key:1,class:"dss-color-picker__presets-row dss-color-picker__presets-row--standalone"},Pm=["title","onClick"],Om={class:"dss-color-picker__input-row"},qm=["value"],Wm={__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(T,{emit:te}){function _(W){const Z=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(W);if(!Z)return{h:0,s:0,l:50};const K=parseInt(Z[1],16)/255,ve=parseInt(Z[2],16)/255,We=parseInt(Z[3],16)/255,Ke=Math.max(K,ve,We),Nt=Math.min(K,ve,We);let Qe=0,lt=0;const Xt=(Ke+Nt)/2;if(Ke!==Nt){const ln=Ke-Nt;switch(lt=Xt>.5?ln/(2-Ke-Nt):ln/(Ke+Nt),Ke){case K:Qe=((ve-We)/ln+(ve<We?6:0))/6;break;case ve:Qe=((We-K)/ln+2)/6;break;case We:Qe=((K-ve)/ln+4)/6;break}}return{h:Qe*360,s:lt*100,l:Xt*100}}function L(W,Z,K){Z/=100,K/=100;const ve=Z*Math.min(K,1-K),We=Ke=>{const Nt=(Ke+W/30)%12,Qe=K-ve*Math.max(Math.min(Nt-3,9-Nt,1),-1);return Math.round(255*Qe).toString(16).padStart(2,"0")};return`#${We(0)}${We(8)}${We(4)}`}function ce(W){const Z=W.replace(/^#/,"").match(/^([a-f\d]{6}|[a-f\d]{3})$/i);if(!Z)return null;let K=Z[1];return K.length===3&&(K=K.split("").map(ve=>ve+ve).join("")),"#"+K}function z(W,Z,K){Z/=100,K/=100;const ve=K+Z*Math.min(K,1-K),We=ve===0?0:2-2*K/ve;return{h:W,s:We*100,v:ve*100}}function A(W,Z,K){Z/=100,K/=100;const ve=K*(1-Z/2),We=ve===0||ve===1?0:(K-ve)/Math.min(ve,1-ve);return{h:W,s:We*100,l:ve*100}}const X=T,je=te,ge=e.ref(!1),f=e.ref(!1),xe=e.ref(!1),he=e.ref(-1),ne=e.ref(-1),le=e.ref(null),fe=e.ref(null),H=e.ref(null),be=e.ref(null),Te=e.ref({top:0,left:0}),ze=e.ref(_(X.modelValue||"#b8a5de")),rt=e.computed(()=>Array.isArray(X.presetGroups)&&X.presetGroups.length>0),R=e.computed(()=>rt.value?0:X.initialPresetCount!=null?X.initialPresetCount:ne.value<0?null:ne.value),Ee=e.computed(()=>{const W=R.value;return W==null?!0:Math.max(0,X.presetColors.length-W)<X.max}),Be=e.computed(()=>!!(f.value||he.value>=0||!Ce.value&&X.presetColors.length===0));e.computed(()=>{const W=R.value;return W!=null&&X.presetColors.length>W});const Ce=e.computed(()=>rt.value||R.value!=null),gt=e.computed(()=>{const W=R.value;return W==null?[]:X.presetColors.slice(0,W)}),pt=e.computed(()=>{const W=R.value;return W==null?[]:X.presetColors.slice(W)});function de(W){const Z=R.value;return Z!=null?Z+W:-1}function ut(W){const Z=R.value;return Z!=null&&W>=Z}function Oe(W){ut(W)&&(he.value=W,ze.value=_(X.presetColors[W]),f.value=!0,e.nextTick(()=>be.value?.focus()))}function Ut(W){if(!ut(W))return;const Z=X.presetColors.filter((We,Ke)=>Ke!==W);je("update:presetColors",Z);const K=ce(X.modelValue),ve=ce(X.presetColors[W]);if(K&&ve&&K.toLowerCase()===ve.toLowerCase()){const We=Z[Math.max(0,W-1)]||Z[0];We&&je("update:modelValue",We)}}function st(){xe.value=!xe.value,xe.value||(he.value=-1,f.value=!1)}function Et(){if(he.value<0)return;const W=G.value,Z=ce(W);if(Z){const K=[...X.presetColors];K[he.value]=Z,je("update:presetColors",K),je("update:modelValue",Z),he.value=-1,f.value=!1}}function Tt(){X.disabled||(he.value=-1,f.value=!f.value,f.value&&(wt(),e.nextTick(()=>be.value?.focus())))}function qt(W){const Z=ce(W),K=ce(X.modelValue);return Z&&K&&Z.toLowerCase()===K.toLowerCase()}function Ft(){if(X.disabled||!Ee.value)return;const W=G.value,Z=ce(W);if(Z){const K=[...X.presetColors,Z];je("update:presetColors",K),je("update:modelValue",Z);const ve=R.value??ne.value;ve>=0&&K.length-ve>=X.max&&(f.value=!1)}}const G=e.computed(()=>{const{h:W,s:Z,l:K}=ze.value;return L(W,Z,K)}),me=e.computed(()=>G.value.toLowerCase()),He=e.computed(()=>({background:`linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(${ze.value.h}, 100%, 50%))`})),Ue=e.computed(()=>{const W=z(ze.value.h,ze.value.s,ze.value.l);return{left:`${W.s}%`,bottom:`${W.v}%`,transform:"translate(-50%, 50%)"}}),Wt=e.computed(()=>({left:`${ze.value.h/360*100}%`,transform:"translateX(-50%)"})),yt=e.computed(()=>({position:"fixed",left:`${Te.value.left}px`,top:`${Te.value.top}px`,zIndex:1002}));function Pt(){if(!le.value||!ge.value)return;const W=le.value.getBoundingClientRect(),Z=window.innerHeight||document.documentElement.clientHeight;let K=W.bottom+4;const ve=fe.value;ve&&K+ve.offsetHeight>Z-8&&(K=W.top-4-ve.offsetHeight),Te.value={top:K,left:W.left}}function wt(){const W=X.modelValue||"#b8a5de";ce(W)&&(ze.value=_(W))}function It(){je("update:modelValue",G.value)}function Q(){X.disabled||(ge.value=!ge.value,ge.value&&(wt(),e.nextTick(()=>{Pt(),be.value?.focus()})))}function ye(){const W=G.value,Z=ce(W);if(Z){if(he.value>=0){const K=[...X.presetColors];K[he.value]=Z,je("update:presetColors",K),je("update:modelValue",Z)}else if((X.presetColors.length>0||rt.value)&&f.value&&Ee.value&&!X.presetColors.some(ve=>ce(ve)?.toLowerCase()===Z.toLowerCase())){const ve=[...X.presetColors,Z];je("update:presetColors",ve),je("update:modelValue",Z)}}ge.value=!1,f.value=!1,xe.value=!1,he.value=-1}function Me(W){if(!H.value)return;const Z=H.value.getBoundingClientRect(),K=ve=>{const We=Math.max(0,Math.min(1,(ve.clientX-Z.left)/Z.width)),Ke=Math.max(0,Math.min(1,1-(ve.clientY-Z.top)/Z.height)),Nt={h:ze.value.h,s:We*100,v:Ke*100};ze.value=A(Nt.h,Nt.s,Nt.v)};K(W),document.addEventListener("mousemove",K),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",K),It()},{once:!0})}function qe(W){if(!W.currentTarget)return;const K=W.currentTarget.getBoundingClientRect(),ve=We=>{const Ke=Math.max(0,Math.min(1,(We.clientX-K.left)/K.width));ze.value={...ze.value,h:Ke*360}};ve(W),document.addEventListener("mousemove",ve),document.addEventListener("mouseup",()=>{document.removeEventListener("mousemove",ve),It()},{once:!0})}function et(W){const Z=W.target.value,K=ce(Z);K&&(ze.value=_(K),je("update:modelValue",K))}function St(W){if(X.disabled)return;const Z=ce(W);Z&&(ze.value=_(Z),je("update:modelValue",Z))}let Xe=null,Vt=null;function Ye(){Xe&&(document.removeEventListener("keydown",Xe),Xe=null),Vt&&(window.removeEventListener("resize",Vt),Vt=null)}return e.watch(ge,W=>{if(Ye(),W){if(!rt.value&&X.initialPresetCount==null){const Z=X.presetColors.length;Z>0&&(ne.value<0||Z<ne.value)&&(ne.value=Z)}Xe=Z=>{Z.key==="Escape"&&ye()},Vt=Pt,document.addEventListener("keydown",Xe),window.addEventListener("resize",Vt)}}),e.watch(()=>X.modelValue,()=>{ge.value&&wt()},{immediate:!1}),e.watch(pt,W=>{W.length===0&&(xe.value=!1,he.value=-1,f.value=!1)}),e.onBeforeUnmount(Ye),(W,Z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-color-picker",{"dss-color-picker--disabled":T.disabled}])},[e.createElementVNode("div",{ref_key:"triggerRef",ref:le,class:e.normalizeClass(["dss-color-picker__trigger",{"dss-color-picker__trigger--open":ge.value}]),onClick:Q},[e.createElementVNode("span",{class:"dss-color-picker__swatch",style:e.normalizeStyle({backgroundColor:G.value})},[...Z[0]||(Z[0]=[e.createElementVNode("span",{class:"dss-color-picker__hover-layer"},[e.createElementVNode("svg",{class:"dss-color-picker__pen-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})])],-1)])],4)],2),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[ge.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-color-picker__overlay",onClick:e.withModifiers(ye,["self"])},[e.createElementVNode("div",{ref_key:"dropdownRef",ref:fe,class:"dss-color-picker__dropdown",style:e.normalizeStyle(yt.value)},[Ce.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[rt.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(T.presetGroups,(K,ve)=>(e.openBlock(),e.createElementBlock("div",{key:"g-"+ve,class:"dss-color-picker__section"},[e.createElementVNode("span",Mm,e.toDisplayString(K.title),1),e.createElementVNode("div",_m,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.colors,(We,Ke)=>(e.openBlock(),e.createElementBlock("button",{key:"g-"+ve+"-"+Ke,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(We)}]),style:e.normalizeStyle({backgroundColor:We}),title:We,onClick:e.withModifiers(Nt=>St(We),["stop"])},null,14,$m))),128))])]))),128)):gt.value.length?(e.openBlock(),e.createElementBlock("div",Lm,[Z[1]||(Z[1]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Preset colors",-1)),e.createElementVNode("div",Tm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,(K,ve)=>(e.openBlock(),e.createElementBlock("button",{key:"p-"+ve,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(We=>St(K),["stop"])},null,14,Am))),128))])])):e.createCommentVNode("",!0),e.createElementVNode("div",Dm,[e.createElementVNode("div",Hm,[Z[3]||(Z[3]=e.createElementVNode("span",{class:"dss-color-picker__section-title"},"Custom Colors",-1)),pt.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__manage-icon",{"dss-color-picker__manage-icon--active":xe.value}]),title:"Manage custom colors",onClick:e.withModifiers(st,["stop"])},[...Z[2]||(Z[2]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64V11.67c0 .19.15.33.33.33h2.03c.09 0 .17-.03.23-.1l7.28-7.27-2.5-2.5L.1 9.4A.33.33 0 0 0 0 9.64ZM11.8 2.69c.26-.26.26-.68 0-.94L10.25.2a.66.66 0 0 0-.94 0L8.09 1.41l2.5 2.5 1.22-1.22Z",fill:"currentColor"})],-1)])],2)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Rm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,(K,ve)=>(e.openBlock(),e.createElementBlock("div",{key:"c-"+ve,class:e.normalizeClass(["dss-color-picker__preset-wrap",{"dss-color-picker__preset-wrap--manage":xe.value}])},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":!xe.value&&qt(K),"dss-color-picker__preset-bubble--editing":xe.value&&he.value===de(ve)}]),style:e.normalizeStyle({backgroundColor:he.value===de(ve)?G.value:K}),title:he.value===de(ve)?G.value:K,onClick:e.withModifiers(We=>xe.value?Oe(de(ve)):St(K),["stop"])},null,14,Fm),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__preset-action dss-color-picker__preset-action--delete",title:"Delete",onClick:e.withModifiers(We=>Ut(de(ve)),["stop"])},[...Z[4]||(Z[4]=[e.createElementVNode("svg",{viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M2 2l8 8M10 2L2 10",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)])],8,Im)):e.createCommentVNode("",!0)],2))),128)),Ee.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])])],64)):T.presetColors.length?(e.openBlock(),e.createElementBlock("div",zm,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.presetColors,(K,ve)=>(e.openBlock(),e.createElementBlock("button",{key:ve,type:"button",class:e.normalizeClass(["dss-color-picker__preset-bubble",{"dss-color-picker__preset-bubble--selected":qt(K)}]),style:e.normalizeStyle({backgroundColor:K}),title:K,onClick:e.withModifiers(We=>St(K),["stop"])},null,14,Pm))),128)),Ee.value?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:e.normalizeClass(["dss-color-picker__add-bubble",{"dss-color-picker__add-bubble--active":f.value}]),onClick:e.withModifiers(Tt,["stop"])}," + ",2)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Be.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.createElementVNode("div",{class:"dss-color-picker__sl-area",ref_key:"slAreaRef",ref:H,onMousedown:Me},[e.createElementVNode("div",{class:"dss-color-picker__sl-bg",style:e.normalizeStyle(He.value)},null,4),e.createElementVNode("div",{class:"dss-color-picker__sl-pointer",style:e.normalizeStyle(Ue.value)},null,4)],544),e.createElementVNode("div",{class:"dss-color-picker__hue-wrap",onMousedown:qe},[Z[5]||(Z[5]=e.createElementVNode("div",{class:"dss-color-picker__hue-track"},null,-1)),e.createElementVNode("div",{class:"dss-color-picker__hue-pointer",style:e.normalizeStyle(Wt.value)},null,4)],32),e.createElementVNode("div",Om,[e.createElementVNode("input",{ref_key:"hexInputRef",ref:be,type:"text",class:"dss-color-picker__hex-input",value:me.value,onInput:et},null,40,qm)]),Ce.value&&(T.presetColors.length||rt.value)&&Ee.value&&he.value<0?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"dss-color-picker__add-btn",onClick:Ft}," Save color ")):e.createCommentVNode("",!0),Ce.value&&he.value>=0?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"dss-color-picker__add-btn",onClick:Et}," Save color ")):e.createCommentVNode("",!0),Ce.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:2,type:"button",class:"dss-color-picker__add-btn",onClick:ye}," Save color "))],64)):e.createCommentVNode("",!0)],4)])):e.createCommentVNode("",!0)]))],2))}},Zm={key:0,class:"dss-loader"},Um={key:0,class:"dss-loader-label"},Xm={key:1,class:"dss-loader"},Ym={key:0,class:"dss-loader-label"},jm={key:2,class:"dss-loader"},Km={key:0,class:"dss-loader-label"},Gm={key:3,class:"dss-loader"},Qm={key:0,class:"dss-loader-label"},Jm={key:4,class:"dss-loader"},e2={key:0,class:"dss-loader-label"},t2={key:5,class:"dss-loader dss-loader--inline"},n2={class:"dss-loader-inline-text"},l2={__name:"DSSLoaders",props:{type:{type:String,default:"spinner"},label:{type:String,default:""},size:{type:[String,Number],default:"medium"},color:{type:String,default:""}},setup(T){const te=T,_=e.computed(()=>te.size==="small"?"dss-loaders--size-small":te.size==="large"?"dss-loaders--size-large":te.size==="medium"||te.size==null?"dss-loaders--size-medium":null),L=e.computed(()=>{const ce={};if(!(te.size==="small"||te.size==="medium"||te.size==="large"||te.size==null)){const z=typeof te.size=="number"?`${te.size}px`:String(te.size);ce["--dss-loader-size"]=z}return te.color&&(ce["--dss-loader-accent"]=te.color,ce["--dss-loader-accent-soft"]=`color-mix(in srgb, ${te.color} 30%, white)`),ce});return(ce,z)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-loaders",_.value]),style:e.normalizeStyle(L.value)},[T.type==="spinner"?(e.openBlock(),e.createElementBlock("div",Zm,[z[0]||(z[0]=e.createElementVNode("span",{class:"dss-loader-spinner","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Um,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="dots"?(e.openBlock(),e.createElementBlock("div",Xm,[z[1]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",Ym,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="battery"?(e.openBlock(),e.createElementBlock("div",jm,[z[2]||(z[2]=e.createElementVNode("div",{class:"battery","aria-hidden":"true"},null,-1)),T.label?(e.openBlock(),e.createElementBlock("span",Km,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="double-circle"?(e.openBlock(),e.createElementBlock("div",Gm,[z[3]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",Qm,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="bars"?(e.openBlock(),e.createElementBlock("div",Jm,[z[4]||(z[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)),T.label?(e.openBlock(),e.createElementBlock("span",e2,e.toDisplayString(T.label),1)):e.createCommentVNode("",!0)])):T.type==="inline"?(e.openBlock(),e.createElementBlock("div",t2,[z[5]||(z[5]=e.createElementVNode("span",{class:"dss-loader-inline-spinner","aria-hidden":"true"},null,-1)),e.createElementVNode("span",n2,[e.renderSlot(ce.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])])])):e.createCommentVNode("",!0)],6))}},ia="dss-skeleton-item",o2={__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:T=>["single","multiple"].includes(T)},targetClass:{type:String,default:ia},bgColor:{type:String,default:null},shimmerColor:{type:String,default:null},bgDark:{type:String,default:null},shimmerDark:{type:String,default:null}},setup(T){const te=T,_=e.computed(()=>{const z={"dss-skeleton--loading":te.loading,"dss-skeleton--static":!te.shimmer,"dss-skeleton--multiple":te.mode==="multiple","dss-skeleton--dark":te.darkMode};return te.mode==="multiple"&&te.targetClass!==ia&&(z[`dss-skeleton--target-${te.targetClass}`]=!0),z}),L=e.computed(()=>{const z={};return te.borderRadius&&(z.borderRadius=te.borderRadius),z}),ce=e.computed(()=>{const z={};return te.borderRadius&&(z["--dss-skeleton-border-radius"]=te.borderRadius),te.darkMode?(z["--dss-skeleton-bg"]=te.bgDark||"#322c3f",z["--dss-skeleton-shimmer"]=te.shimmerDark||"#3e3f41",z):(te.bgColor&&(z["--dss-skeleton-bg"]=te.bgColor),te.shimmerColor&&(z["--dss-skeleton-shimmer"]=te.shimmerColor),z)});return(z,A)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-skeleton",_.value]),style:e.normalizeStyle(ce.value)},[T.loading&&T.mode==="single"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-skeleton-overlay",style:e.normalizeStyle(L.value),"aria-hidden":"true"},null,4)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["dss-skeleton-content",{"dss-skeleton-content--hidden":T.loading&&T.mode==="single"}])},[e.renderSlot(z.$slots,"default")],2)],6))}},a2={key:0,class:"dss-dnd-column-header"},s2={class:"dss-dnd-column-title"},r2={class:"dss-dnd-column-count"},i2=["data-column"],c2={key:0,class:"dss-dnd-indicator"},u2=["onPointerdown"],d2=["onPointerdown"],m2={class:"dss-dnd-item-content"},p2={class:"dss-dnd-item-default"},f2={key:0,class:"dss-dnd-empty"},v2={name:"DSSDnd"},g2=Object.assign(v2,{props:{items:{type:Array,required:!0},columns:{type:Array,required:!0},columnKey:{type:String,default:"status"},positionKey:{type:String,default:"position"},itemKey:{type:String,default:"id"},options:{type:Object,default:()=>({})}},emits:["move","delete"],setup(T,{emit:te}){const _=T,L=te,ce=e.useSlots(),z=e.computed(()=>!!ce["delete-zone"]),A={columnMinWidth:"280px",columnMaxWidth:"none",columnGap:"12px",indicatorColor:"#7c6bc4",dragGhostOpacity:.75,dragSourceBackground:"#f5f5f5",dragSourceBorder:"#e0e0e0",useHandle:!1,columnBodyMaxHeight:"none",showHeader:!0,unstyled:!1,deleteZoneAlwaysVisible:!1,ColColor:!1},X=e.computed(()=>({...A,..._.options})),je=e.computed(()=>({"--dss-dnd-col-min-w":X.value.columnMinWidth,"--dss-dnd-col-max-w":X.value.columnMaxWidth,"--dss-dnd-col-gap":X.value.columnGap,"--dss-dnd-indicator-color":X.value.indicatorColor,"--dss-dnd-body-max-h":X.value.columnBodyMaxHeight}));function ge(Q){if(!X.value.ColColor||!Q)return{};const ye=Q.background||Q.color;return ye?{background:ye}:{}}const f=e.ref(null),xe=e.ref(null),he=e.ref(!1),ne=e.ref(-1),le=e.ref(null);let fe=null,H=null,be=null,Te=null,ze=0,rt=0,R="",Ee=null;const Be=5,Ce=e.computed(()=>{const Q={};for(const ye of _.columns)Q[ye.value]=_.items.filter(Me=>Me[_.columnKey]===ye.value).sort((Me,qe)=>(Me[_.positionKey]??0)-(qe[_.positionKey]??0));return Q}),gt=e.computed(()=>{const Q={},ye=!!f.value,Me=f.value?.[_.itemKey],qe=xe.value,et=ne.value;for(const St of _.columns){const Xe=Ce.value[St.value]||[],Vt=[],Ye=qe==St.value;let W=0;for(let Z=0;Z<Xe.length;Z++){const K=Xe[Z],ve=ye&&K[_.itemKey]===Me;!ve&&Ye&&et===W&&Vt.push({type:"indicator",key:`ind-${W}`}),ve||W++,Vt.push({type:"item",item:K,isDragged:ve,key:`item-${K[_.itemKey]}`})}Ye&&et>=W&&Vt.push({type:"indicator",key:"ind-end"}),Q[St.value]=Vt}return Q});function pt(Q,ye){const qe=(Ce.value[Q]||[]).filter(Xe=>Xe[_.itemKey]!==f.value?.[_.itemKey]);if(qe.length===0)return 1;if(ye<=0){const Xe=qe[0][_.positionKey];return Xe!=null&&Xe>0?Xe/2:.5}if(ye>=qe.length){const Xe=qe[qe.length-1][_.positionKey];return(Xe??0)+1}const et=qe[ye-1][_.positionKey]??0,St=qe[ye][_.positionKey]??0;return(et+St)/2}function de(Q,ye,Me){be&&be.remove();const qe=Q.getBoundingClientRect(),et=Q.cloneNode(!0);et.classList.add("dss-dnd-ghost"),et.style.cssText=`
|
|
104
104
|
position: fixed;
|
|
105
|
-
left: ${
|
|
106
|
-
top: ${Me-
|
|
107
|
-
width: ${
|
|
108
|
-
height: ${
|
|
105
|
+
left: ${ye-ze}px;
|
|
106
|
+
top: ${Me-rt}px;
|
|
107
|
+
width: ${qe.width}px;
|
|
108
|
+
height: ${qe.height}px;
|
|
109
109
|
z-index: 9999;
|
|
110
110
|
pointer-events: none;
|
|
111
|
-
opacity: ${
|
|
111
|
+
opacity: ${X.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: ${X.value.dragSourceBackground};
|
|
115
115
|
font-family: 'Work Sans', sans-serif;
|
|
116
116
|
cursor: grabbing;
|
|
117
|
-
`,document.body.appendChild(et),Ce=et}function gt(Q,be){Ce&&(Ce.style.left=`${Q-qe}px`,Ce.style.top=`${be-ct}px`)}function We(Q){Q.classList.add("dss-dnd-item--dragging"),Q.style.background=U.value.dragSourceBackground,Q.style.borderColor=U.value.dragSourceBorder,Q.style.transform="scale(0.97)"}function Pt(Q){Q.classList.remove("dss-dnd-item--dragging"),Q.style.background="",Q.style.borderColor="",Q.style.transform=""}function it(Q,be){return document.elementFromPoint(Q,be)?.closest(".dss-dnd-column-body")??null}function Et(Q,be){return!!document.elementFromPoint(Q,be)?.closest("[data-dss-dnd-delete-zone]")}function Tt(Q,be){if(z.value&&Et(Q,be)){ge.value=!0,we.value=null,ne.value=-1;return}ge.value=!1;const Me=it(Q,be),Ze=Me?.getAttribute("data-column")??null;if(!Ze){we.value=null,ne.value=-1;return}we.value=Ze;const et=Me.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let pt=et.length;for(let je=0;je<et.length;je++){const _t=et[je].getBoundingClientRect();if(be<_t.top+_t.height/2){pt=je;break}}ne.value=pt}function Wt(Q){Q.preventDefault(),gt(Q.clientX,Q.clientY),!ve&&(ve=requestAnimationFrame(()=>{ve=null,Tt(Q.clientX,Q.clientY)}))}function Ft(Q){window.removeEventListener("pointermove",Wt),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),Te?.releasePointerCapture?.(Q.pointerId),Pt(Te),Te=null;const be=z.value&&Et(Q.clientX,Q.clientY);if(f.value&&be)L("delete",{item:f.value});else{const Ze=it(Q.clientX,Q.clientY)?.getAttribute("data-column")??null;if(f.value&&Ze){const et=f.value[_.columnKey],pt=Ze,_t=(ke.value[pt]||[]).filter(K=>K[_.itemKey]!==f.value[_.itemKey]),Re=Math.max(0,Math.min(ne.value,_t.length)),P=vt(pt,Re),X=f.value[_.itemKey];L("move",{item:f.value,from:et,to:pt,position:P,index:Re}),H&&clearTimeout(H),oe.value={id:X,from:et,to:pt},H=setTimeout(()=>{oe.value=null},3500)}}Ce&&(Ce.remove(),Ce=null),R!==null&&(document.body.style.cursor=R,R=""),Ut()}function G(Q,be){Q.preventDefault();const Me=Q.target.closest(".dss-dnd-item");if(!Me)return;const Ze=Me.getBoundingClientRect();qe=Q.clientX-Ze.left,ct=Q.clientY-Ze.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=be,Te=Me,de(Me,Q.clientX,Q.clientY),requestAnimationFrame(()=>We(Me)),Me.setPointerCapture?.(Q.pointerId),window.addEventListener("pointermove",Wt),window.addEventListener("pointerup",Ft,{once:!0}),window.addEventListener("pointercancel",Ft,{once:!0})}function ue(){xe&&(window.removeEventListener("pointermove",De),window.removeEventListener("pointerup",Xe),window.removeEventListener("pointercancel",Xe),xe=null)}function De(Q){if(!xe||Q.pointerId!==xe.pointerId)return;const be=Q.clientX-xe.startX,Me=Q.clientY-xe.startY;if(Math.abs(be)>=Be||Math.abs(Me)>=Be){const Ze=xe.item;ue(),G(Q,Ze)}}function Xe(Q){!xe||Q.pointerId!==xe.pointerId||ue()}function Zt(Q,be){ue(),xe={item:be,startX:Q.clientX,startY:Q.clientY,pointerId:Q.pointerId},window.addEventListener("pointermove",De),window.addEventListener("pointerup",Xe),window.addEventListener("pointercancel",Xe)}function kt(Q,be){U.value.useHandle||Zt(Q,be)}function xt(Q,be){Zt(Q,be)}function Mt(){ve&&(cancelAnimationFrame(ve),ve=null)}function Ut(){Mt(),f.value=null,we.value=null,ge.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{Mt(),ue(),H&&clearTimeout(H),Ce&&(Ce.remove(),Ce=null)}),(Q,be)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":U.value.unstyled}]),style:e.normalizeStyle(Ke.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":ge.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(Q.$slots,"delete-zone",{isDragging:!!f.value,isOver:ge.value})],2),[[e.vShow,!!f.value||U.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,Me=>(e.openBlock(),e.createElementBlock("div",{key:Me.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":we.value==Me.value},Me.class||""]]),style:e.normalizeStyle(he(Me))},[U.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(Q.$slots,"column-header",{column:Me,items:ke.value[Me.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(Me.title||Me.value),1),e.createElementVNode("span",r2,e.toDisplayString((ke.value[Me.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(mt.value[Me.value],Ze=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:Ze.key},[Ze.type==="indicator"?(e.openBlock(),e.createElementBlock("div",c2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":Ze.isDragged,"dss-dnd-item--no-handle":!U.value.useHandle}]),onPointerdown:et=>kt(et,Ze.item)},[U.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(et=>xt(et,Ze.item),["stop"])},[e.renderSlot(Q.$slots,"handle",{},()=>[be[0]||(be[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,d2)):e.createCommentVNode("",!0),e.createElementVNode("div",m2,[e.renderSlot(Q.$slots,"item",{item:Ze.item,column:Me,justDropped:oe.value?.id===Ze.item[T.itemKey],droppedFrom:oe.value?.id===Ze.item[T.itemKey]?oe.value.from:null,droppedTo:oe.value?.id===Ze.item[T.itemKey]?oe.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(Ze.item[T.itemKey]),1)])])],42,u2))],64))),128)),(ke.value[Me.value]||[]).length===0&&we.value!=Me.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(Q.$slots,"empty",{column:Me},()=>[be[1]||(be[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,i2)],6))),128))],6))}}),h2={name:"DSSConfetti"},y2=Object.assign(h2,{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(T){const te=T,_=e.ref(null),L=e.ref(!1);let ce=[],z=null,A=null;function U(ne,oe){const ve=[];for(let H=0;H<te.count;H++)ve.push(Ke(ne));return ve}function Ke(ne,oe){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:te.colors[Math.floor(Math.random()*te.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 he(ne,oe,ve,H){ne.clearRect(0,0,oe,ve);for(const Ce of ce)ne.save(),ne.globalAlpha=Ce.opacity*H,ne.beginPath(),ne.lineWidth=Ce.r,ne.strokeStyle=Ce.color,ne.moveTo(Ce.x+Ce.tilt+Ce.r/2,Ce.y),ne.lineTo(Ce.x+Ce.tilt,Ce.y+Ce.tilt+Ce.r/2),ne.stroke(),ne.restore()}function f(ne,oe,ve){const H=.3+ve*.7;for(let Ce=0;Ce<ce.length;Ce++){const Te=ce[Ce];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*H,Te.x+=Math.sin(Te.d)*.5*H,Te.tilt=Math.sin(Te.tiltAngle)*15,ve>=.99&&Te.y>oe+20&&(ce[Ce]=Ke(ne))}}function we(){L.value=!0,e.nextTick(()=>{const ne=_.value;if(!ne)return;const oe=ne.getContext("2d"),ve=ne.parentElement;if(!ve)return;const H=ve.getBoundingClientRect();ne.width=H.width,ne.height=H.height,ce=U(ne.width,ne.height);const Ce=Date.now(),Te=Ce+te.duration,qe=()=>{const ct=Date.now(),R=ct-Ce;if(ct<Te){let xe=1;R>te.fadeStart&&(xe=1-(R-te.fadeStart)/(te.duration-te.fadeStart)),he(oe,ne.width,ne.height,xe),f(ne.width,ne.height,xe),z=requestAnimationFrame(qe)}else ge()};qe()})}function ge(){z&&(cancelAnimationFrame(z),z=null),ce=[],L.value=!1}return e.watch(()=>te.trigger,ne=>{ne&&(A&&clearTimeout(A),A=setTimeout(we,te.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{ge(),A&&clearTimeout(A)}),(ne,oe)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),k2={class:"dss-filter-global-inner"},C2=["placeholder","value"],b2=["title"],w2={key:0,class:"dss-filter-funnel-badge"},x2={key:1,class:"dss-filter-sortby"},E2=["value"],S2=["value"],V2=["disabled","title"],N2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_2={class:"dss-filter-panel"},$2={key:0,class:"dss-filter-empty"},L2={class:"dss-filter-row-prefix"},T2={class:"dss-filter-cell"},A2=["onClick"],D2={class:"dss-filter-trigger-text"},H2=["placeholder"],R2={class:"dss-filter-popup-list"},F2=["onClick"],I2={key:0,class:"dss-filter-popup-empty"},z2={key:0,class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},q2={class:"dss-filter-popup-list"},W2=["onClick"],Z2={key:1,class:"dss-filter-cell dss-filter-cell--value"},U2=["placeholder","onUpdate:modelValue"],X2={key:1,class:"dss-filter-date-wrap"},Y2=["placeholder","onUpdate:modelValue"],j2=["placeholder","value","onInput","step"],K2={key:4,class:"dss-filter-between"},G2=["placeholder","value","onInput","step"],Q2={class:"dss-filter-between-sep"},J2=["placeholder","value","onInput","step"],e0={key:5,class:"dss-filter-multiselect"},t0=["onClick"],n0={class:"dss-filter-trigger-text"},l0=["placeholder"],o0={class:"dss-filter-popup-list dss-filter-popup-list--check"},a0=["onClick"],s0=["checked"],r0={key:0,class:"dss-filter-popup-empty"},i0=["onClick"],c0={class:"dss-filter-foot"},u0={class:"dss-filter-cell"},d0=["placeholder"],m0={class:"dss-filter-popup-list"},p0=["onClick"],f0={key:0,class:"dss-filter-popup-divider"},v0=["onClick"],g0=["placeholder"],h0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:0,class:"dss-filter-popup-empty"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={name:"DSSFilter"},S0=Object.assign(E0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{expose:te,emit:_}){const{t:L}=Gl.useI18n(),ce=T,z=_,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},U=e.computed(()=>({...A,...ce.options})),Ke={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},he=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],we=e.ref(""),ge=e.ref([]),ne=e.ref(null),oe=e.ref(!1),ve=e.ref(null),H=e.ref(""),Ce=e.ref(null),Te=e.ref(""),qe=e.ref("asc");let ct=1;function R(V){const w=V.find(E=>E&&typeof E=="object");if(!w)return null;for(const E of f)if(E in w&&typeof w[E]=="string")return E;return Object.keys(w).find(E=>typeof w[E]=="string")||null}function xe(V,w){const E=w.filter(Y=>Y!=null&&Y!=="NULL");if(E.length===0)return null;if(E.every(Y=>Array.isArray(Y))){const Y=E.flatMap(Ye=>Ye).filter(Ye=>Ye!=null);return Y.length===0?null:typeof Y.find(Ye=>Ye!=null)=="object"?"arraySelect":"arrayText"}return E.every(Y=>typeof Y=="boolean")?"boolean":E.every(Y=>typeof Y=="number")?new Set(E).size<=U.value.maxUniqueForEnum?"select":"range":E.every(Y=>typeof Y=="string")?new Set(E).size<=U.value.maxUniqueForSelect?"select":"text":E.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const Be=e.computed(()=>{if(!ce.data?.length)return[];const V=new Set;for(const le of ce.data)if(le&&typeof le=="object")for(const Ye of Object.keys(le))V.add(Ye);const w=new Set(ce.exclude),E=[];for(const le of V){if(w.has(le))continue;const Ye=ce.config[le]||{},at=ce.data.map(st=>st?.[le]),Ve=Ye.type||xe(le,at);if(!Ve)continue;const Fe=Ye.filterMode||"contain",It=Fe==="date"?"date":Fe==="string"?"text":Ve,Ht={key:le,label:Ye.label||$t(le),type:It,filterMode:Fe};if(Ve==="select"){const st=at.filter(Ge=>Ge!=null&&Ge!=="NULL");Ht.uniqueValues=[...new Set(st)].sort((Ge,Lt)=>typeof Ge=="number"&&typeof Lt=="number"?Ge-Lt:String(Ge).localeCompare(String(Lt)))}else if(Ve==="range"||Ve==="int"){const st=at.filter(Ge=>typeof Ge=="number");Ht.min=Math.min(...st),Ht.max=Math.max(...st)}else if(Ve==="arraySelect"){const st=Ye.displayKey||R(at.flatMap(Ge=>Array.isArray(Ge)?Ge:[]));if(Ht.displayKey=st,Array.isArray(Ye.uniqueValues)&&Ye.uniqueValues.length>0)Ht.uniqueValues=Ye.uniqueValues.map(Ge=>String(Ge));else{const Ge=at.flatMap(Lt=>Array.isArray(Lt)?Lt:[]).filter(Lt=>Lt!=null).map(Lt=>st&&typeof Lt=="object"?Lt[st]:String(Lt)).filter(Lt=>Lt!=null&&Lt!=="");Ht.uniqueValues=[...new Set(Ge)].sort((Lt,Fn)=>String(Lt).localeCompare(String(Fn)))}}E.push(Ht)}const Y=ce.config._order;return Y&&E.sort((le,Ye)=>{const at=Y.indexOf(le.key),Ve=Y.indexOf(Ye.key);return at===-1&&Ve===-1?0:at===-1?1:Ve===-1?-1:at-Ve}),E}),ke=e.computed(()=>{const V={};for(const w of Be.value)V[w.key]=w;return V}),mt=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),vt=e.computed(()=>{if(!mt.value)return[];const V=new Set(Be.value.map(w=>w.key));return ce.config.groups.map(w=>({...w,keys:w.keys.filter(E=>V.has(E))})).filter(w=>w.keys.length>0)}),de=e.computed(()=>{if(!mt.value)return[];const V=new Set(ce.config.groups.flatMap(w=>w.keys));return Be.value.filter(w=>!V.has(w.key))}),gt=e.computed(()=>{if(!Ce.value)return[];const V=new Set(Ce.value.keys),w=Be.value.filter(Y=>V.has(Y.key));if(!H.value)return w;const E=H.value.toLowerCase();return w.filter(Y=>Y.label.toLowerCase().includes(E))}),We=e.computed(()=>{if(!H.value)return Be.value;const V=H.value.toLowerCase();return Be.value.filter(w=>w.label.toLowerCase().includes(V))}),Pt=e.computed(()=>Be.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),it=e.computed(()=>Te.value?qe.value==="asc"?"Ascending":"Descending":"No sort selected");function Et(V){ne.value===V?Tt():(ne.value=V,H.value="",Ce.value=null)}function Tt(){ne.value=null,H.value="",Ce.value=null}function Wt(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Tt(),oe.value&&ve.value&&!ve.value.contains(V.target)&&(w||(oe.value=!1))}e.onMounted(()=>document.addEventListener("click",Wt)),e.onBeforeUnmount(()=>document.removeEventListener("click",Wt));function Ft(V){return ke.value[V]?.label||$t(V)}function G(V){return ke.value[V.key]?.filterMode||"contain"}function ue(V){return L(`filter.operators.${V}`)}function De(V){const w=ke.value[V.key];return(Ke[w?.type]||Ke.text).map(E=>({...E,label:L(`filter.operators.${E.value}`)}))}function Xe(V){return he.has(V)}function Zt(V){const w=ke.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function kt(V){return Ke[V]?.[0]?.value||"contains"}function xt(V,w){return he.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function Mt(V){return ke.value[V.key]?.uniqueValues||[]}function Ut(V){const w=Mt(V);if(!H.value)return w;const E=H.value.toLowerCase();return w.filter(Y=>String(Y).toLowerCase().includes(E))}function Q(V){const w=V.value;return!w||w.length===0?L("filter.select"):w.length<=2?w.join(", "):L("filter.selectedCount",{count:w.length})}function be(V){const w=ke.value[V],E=w?.filterMode||"contain",Y=w?.type||"text",le=E==="string"?"contains":kt(Y);ge.value.push(e.reactive({id:ct++,key:V,operator:le,value:xt(Y,le)})),Tt()}function Me(V){ge.value=ge.value.filter(w=>w.id!==V)}function Ze(V,w){const Y=ke.value[w]?.type||"text";V.key=w,V.operator=kt(Y),V.value=xt(Y,V.operator),Tt()}function et(V,w){const E=Zt(V);V.operator=w;const Y=Zt(V);if(E!==Y||he.has(w)){const le=ke.value[V.key];V.value=xt(le?.type||"text",w)}Tt()}function pt(V,w){const E=w.target.value;V.value=E===""?null:Number(E)}function je(V,w,E){const Y=E.target.value,le=Y===""?null:Number(Y);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(le)?null:le}}function _t(V,w){const E=V.value||[],Y=E.indexOf(w);V.value=Y>=0?E.filter(le=>le!==w):[...E,w]}function Re(){ge.value=[],we.value="",Tt()}function P(V){we.value=V.target.value}function X(V){Te.value=V.target.value}function K(){qe.value=qe.value==="asc"?"desc":"asc"}const me=e.computed(()=>{if(!ce.data)return[];let V=ce.data;if(we.value){const w=we.value.toLowerCase();V=V.filter(E=>{for(const Y of Object.keys(E)){const le=E[Y];if(typeof le=="string"&&le.toLowerCase().includes(w)||typeof le=="number"&&String(le).includes(w)||Array.isArray(le)&&le.some(Ye=>Ye!=null&&(typeof Ye=="string"?Ye.toLowerCase().includes(w):typeof Ye=="object"?Object.values(Ye).some(at=>typeof at=="string"&&at.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of ge.value){if(!St(w))continue;const E=ke.value[w.key];E&&(V=V.filter(Y=>Pe(Y,w,E)))}if(ce.showSortBy&&Te.value){const w=Te.value,E=qe.value==="asc"?1:-1;V=[...V].sort((Y,le)=>ze(Y?.[w],le?.[w])*E)}return V});function ze(V,w){const E=nt(V),Y=nt(w);return E==null&&Y==null?0:E==null?1:Y==null?-1:typeof E=="number"&&typeof Y=="number"?E-Y:String(E).localeCompare(String(Y),void 0,{numeric:!0,sensitivity:"base"})}function nt(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function St(V){return he.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Pe(V,w,E){const Y=V?.[w.key],le=w.value,Ye=w.operator;if(Ye==="is_empty")return on(Y);if(Ye==="is_not_empty")return!on(Y);const at=E.type;if(at==="text"||at==="arrayText"){const Ve=at==="arrayText"&&Array.isArray(Y)?Y.filter(Ht=>Ht!=null).map(String).join(" "):Y!=null?String(Y):"",Fe=String(le).toLowerCase(),It=Ve.toLowerCase();switch(Ye){case"contains":return It.includes(Fe);case"not_contains":return!It.includes(Fe);case"equals":return It===Fe;case"not_equals":return It!==Fe;case"starts_with":return It.startsWith(Fe);case"ends_with":return It.endsWith(Fe);default:return!0}}if(at==="select")switch(Ye){case"is_any_of":return le.includes(Y);case"is_none_of":return!le.includes(Y);default:return!0}if(at==="range"||at==="int"){const Ve=typeof Y=="number"?Y:Number(Y);if(typeof Ve!="number"||isNaN(Ve))return!1;if(Ye==="between"){const It=le?.min!=null?Number(le.min):null,Ht=le?.max!=null?Number(le.max):null,st=It!=null&&!isNaN(It)?It:null,Ge=Ht!=null&&!isNaN(Ht)?Ht:null;return(st==null||Ve>=st)&&(Ge==null||Ve<=Ge)}const Fe=typeof le=="number"&&!isNaN(le)?le:Number(le);if(Ye==="contains"||Ye==="not_contains"){const It=String(Ve),Ht=String(le??"").toLowerCase(),st=It.toLowerCase().includes(Ht);return Ye==="contains"?st:!st}if(typeof Fe!="number"||isNaN(Fe))return!1;switch(Ye){case"eq":return Ve===Fe;case"neq":return Ve!==Fe;case"gt":return Ve>Fe;case"gte":return Ve>=Fe;case"lt":return Ve<Fe;case"lte":return Ve<=Fe;default:return!0}}if(at==="arraySelect"){if(!Array.isArray(Y))return!1;const Ve=Y.filter(Fe=>Fe!=null).map(Fe=>E.displayKey&&typeof Fe=="object"?Fe[E.displayKey]:String(Fe));switch(Ye){case"contains_any":return Ve.some(Fe=>le.includes(Fe));case"contains_all":return le.every(Fe=>Ve.includes(Fe));case"not_contains_any":return!Ve.some(Fe=>le.includes(Fe));default:return!0}}if(at==="date"){const Ve=ht(le);if(!Ve||isNaN(Ve.getTime()))return!1;const Fe=ht(Y);if(!Fe||isNaN(Fe.getTime()))return!1;const It=Ot(Fe),Ht=Ot(Ve);switch(Ye){case"eq":return It===Ht;case"before":return It<Ht;case"after":return It>Ht;default:return!0}}if(at==="boolean"){const Ve=Y===!0||Y==="true"||Y===1,Fe=Y===!1||Y==="false"||Y===0;switch(Ye){case"is_true":return Ve;case"is_false":return Fe;default:return!0}}return!0}function ht(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function Ot(V){const w=V.getFullYear(),E=String(V.getMonth()+1).padStart(2,"0"),Y=String(V.getDate()).padStart(2,"0");return`${w}-${E}-${Y}`}function on(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(me,V=>z("update:modelValue",V),{immediate:!0}),e.watch(()=>ce.data,()=>{ge.value=[],we.value="",oe.value=!1,Te.value="",qe.value="asc",Tt()});function $t(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function an(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const E={};for(const Y of Object.keys(w))E[Y]=V(w[Y]);return E}return w};return{globalSearch:we.value,rows:ge.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:ke.value[w.key]?.type,defFilterMode:ke.value[w.key]?.filterMode})),filteredCount:me.value?.length??0}}return te({getDebugState:an}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":U.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:ve},[e.createElementVNode("div",k2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:we.value,onInput:P},null,40,C2),we.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=E=>we.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:oe.value||ge.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:w[1]||(w[1]=E=>oe.value=!oe.value),type:"button",title:oe.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),ge.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(ge.value.length),1)):e.createCommentVNode("",!0)],10,b2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Te.value,onChange:X},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Pt.value,E=>(e.openBlock(),e.createElementBlock("option",{key:E.key,value:E.key},e.toDisplayString(E.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:K,disabled:!Te.value,title:it.value},[Te.value?qe.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),oe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_2,[ge.value.length===0?(e.openBlock(),e.createElementBlock("div",$2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ge.value,(E,Y)=>(e.openBlock(),e.createElementBlock("div",{key:E.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Y===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",T2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Et(`${E.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(Ft(E.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),ne.value===`${E.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=le=>H.value=le),placeholder:e.unref(L)("filter.searchAttributes")},null,8,H2),[[e.vModelText,H.value]]),e.createElementVNode("ul",R2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,le=>(e.openBlock(),e.createElementBlock("li",{key:le.key,class:"dss-filter-popup-item",onClick:Ye=>Ze(E,le.key)},e.toDisplayString(le.label),9,F2))),128)),We.value.length===0?(e.openBlock(),e.createElementBlock("li",I2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),G(E)==="contain"||G(E)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Et(`${E.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(ue(E.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),ne.value===`${E.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(De(E),le=>(e.openBlock(),e.createElementBlock("li",{key:le.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:E.operator===le.value}]),onClick:Ye=>et(E,le.value)},e.toDisplayString(le.label),11,W2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Xe(E.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[G(E)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":le=>E.value=le},null,8,U2)),[[e.vModelText,E.value]]):G(E)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:E.value,"onUpdate:modelValue":le=>E.value=le},null,8,["modelValue","onUpdate:modelValue"])])):Zt(E)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":le=>E.value=le},null,8,Y2)),[[e.vModelText,E.value]]):Zt(E)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:E.value,onInput:le=>pt(E,le),step:ke.value[E.key]?.type==="int"?1:void 0},null,40,j2)):Zt(E)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:E.value?.min,onInput:le=>je(E,"min",le),step:ke.value[E.key]?.type==="int"?1:void 0},null,40,G2),e.createElementVNode("span",Q2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:E.value?.max,onInput:le=>je(E,"max",le),step:ke.value[E.key]?.type==="int"?1:void 0},null,40,J2)])):Zt(E)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(le=>Et(`${E.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(Q(E)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),ne.value===`${E.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[Mt(E).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=le=>H.value=le),placeholder:e.unref(L)("filter.search")},null,8,l0)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",o0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut(E),le=>(e.openBlock(),e.createElementBlock("li",{key:le,class:"dss-filter-popup-item",onClick:Ye=>_t(E,le)},[e.createElementVNode("input",{type:"checkbox",checked:(E.value||[]).includes(le),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(le),1)],8,a0))),128)),Ut(E).length===0?(e.openBlock(),e.createElementBlock("li",r0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:le=>Me(E.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(E=>Et("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[mt.value&&!Ce.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=E=>H.value=E),placeholder:e.unref(L)("filter.searchAttributes")},null,8,d0),[[e.vModelText,H.value]]),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(vt.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>Ce.value=E},[e.createElementVNode("span",null,e.toDisplayString(E.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p0))),128)),de.value.length>0?(e.openBlock(),e.createElementBlock("li",f0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:Y=>be(E.key)},e.toDisplayString(E.label),9,v0))),128))])],64)):Ce.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=E=>Ce.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(Ce.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=E=>H.value=E),placeholder:e.unref(L)("filter.searchAttributes")},null,8,g0),[[e.vModelText,H.value]]),e.createElementVNode("ul",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:Y=>be(E.key)},e.toDisplayString(E.label),9,y0))),128)),gt.value.length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=E=>H.value=E),placeholder:e.unref(L)("filter.searchAttributes")},null,8,C0),[[e.vModelText,H.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(We.value,E=>(e.openBlock(),e.createElementBlock("li",{key:E.key,class:"dss-filter-popup-item",onClick:Y=>be(E.key)},e.toDisplayString(E.label),9,w0))),128)),We.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),ge.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Re},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V0={class:"dss-pill-field__pills"},N0=["disabled"],B0={class:"dss-pill-field__pill-text"},M0={key:0,class:"dss-pill-field__pill-actions"},_0=["onClick"],$0=["onClick"],L0=["placeholder","disabled"],T0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{emit:te}){const _=T,L=te,ce=e.ref(""),z=e.ref([..._.modelValue]),A=e.ref(null);let U=null;const Ke=e.ref(null),he=e.ref(""),f=e.ref(null),we=e.computed(()=>new Set(z.value.map(R=>R.trim()).filter(Boolean)));function ge(R){A.value=R,U&&clearTimeout(U),U=setTimeout(()=>{A.value=null,U=null},900)}function ne(R){const xe=R.trim();return xe?we.value.has(xe)?(ge(xe),!1):(z.value=[...z.value,xe],L("update:modelValue",[...z.value]),!0):!1}function oe(R){const xe=R.split(/\r?\n/g).map(vt=>vt.trim()).filter(Boolean);if(!xe.length)return;const Be=new Set(z.value.map(vt=>vt.trim()).filter(Boolean)),ke=[...z.value];let mt=null;for(const vt of xe){if(Be.has(vt)){mt??=vt;continue}Be.add(vt),ke.push(vt)}ke.length!==z.value.length&&(z.value=ke,L("update:modelValue",[...z.value])),mt&&ge(mt)}function ve(R){_.disabled||(Ke.value===R&&(Ke.value=null,he.value=""),z.value=z.value.filter((xe,Be)=>Be!==R),L("update:modelValue",[...z.value]))}async function H(R){_.disabled||(Ke.value=R,he.value=z.value[R]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function Ce(){Ke.value=null,he.value=""}function Te(){if(_.disabled||Ke.value===null)return;const R=Ke.value,xe=z.value[R]??"",Be=he.value.trim();if(Ke.value=null,he.value="",Be!==xe&&we.value.has(Be)){ge(Be);return}if(!Be){z.value=z.value.filter((mt,vt)=>vt!==R),L("update:modelValue",[...z.value]);return}const ke=z.value.map((mt,vt)=>vt===R?Be:mt);z.value=ke,L("update:modelValue",[...z.value])}function qe(R){R.preventDefault(),!_.disabled&&(ne(ce.value),ce.value="")}function ct(R){if(_.disabled)return;const xe=R.clipboardData?.getData("text")??"";!xe.includes(`
|
|
118
|
-
`)&&!xe.includes("\r")||(R.preventDefault(),oe(xe),ce.value="")}return e.watch(()=>_.modelValue,R=>{z.value=Array.isArray(R)?[...R]:[]},{deep:!0}),e.onBeforeUnmount(()=>{U&&clearTimeout(U)}),(R,xe)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":R.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(Be,ke)=>(e.openBlock(),e.createElementBlock("span",{key:Be,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===Be}])},[Ke.value===ke?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":xe[0]||(xe[0]=mt=>he.value=mt),class:"dss-pill-field__pill-edit",type:"text",disabled:R.disabled,onKeydown:[e.withKeys(Te,["enter"]),e.withKeys(Ce,["esc"])],onBlur:Te},null,40,N0)),[[e.vModelText,he.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",B0,e.toDisplayString(Be),1),R.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",M0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:mt=>H(ke)},[...xe[2]||(xe[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,_0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:mt=>ve(ke)}," × ",8,$0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":xe[1]||(xe[1]=Be=>ce.value=Be),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":R.placeholder,disabled:R.disabled,onPaste:ct,onKeydown:e.withKeys(qe,["enter"])},null,40,L0),[[e.vModelText,ce.value]])])],2))}}),A0={class:"dss-step-bar__header"},D0={class:"dss-step-bar__label"},H0={key:0,class:"dss-step-bar__counter"},R0={class:"dss-step-bar__track-wrapper"},F0=["aria-valuemax","aria-valuenow","aria-label"],I0=["onMouseenter"],z0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:T=>["input","desc","asc"].includes(T)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(T){const te=T,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=G=>G&&typeof G=="object"&&!Array.isArray(G),ce=(G,ue)=>{const De=Object.assign({},G);return!L(G)||!L(ue)||Object.keys(ue).forEach(Xe=>{if(L(ue[Xe])){Xe in G?De[Xe]=ce(G[Xe],ue[Xe]):Object.assign(De,{[Xe]:ue[Xe]});return}Object.assign(De,{[Xe]:ue[Xe]})}),De},z=e.computed(()=>ce(_,te.options)),A=e.computed(()=>Math.max(1,Number(te.steps)||1)),U=e.computed(()=>Math.min(A.value,Math.max(0,Number(te.currentStep)||0))),Ke=e.computed(()=>Array.isArray(te.segments)&&te.segments.length>0),he=e.computed(()=>{if(!Ke.value)return[];const G=te.segments.map((ue,De)=>{const Xe=Number(ue?.value);return{label:ue?.label||`Step ${De+1}`,value:Number.isFinite(Xe)&&Xe>0?Xe:0,color:ue?.color||te.activeColor,marker:ue?.marker}});return te.segmentOrder==="desc"?[...G].sort((ue,De)=>De.value-ue.value):te.segmentOrder==="asc"?[...G].sort((ue,De)=>ue.value-De.value):G}),f=e.computed(()=>Ke.value?he.value.reduce((G,ue)=>G+ue.value,0):U.value),we=e.computed(()=>Ke.value?Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0?Number(te.totalValue):Math.max(1,f.value):A.value),ge=e.computed(()=>Ke.value&&Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0),ne=e.computed(()=>ge.value?Math.max(0,Number(te.totalValue)-f.value):0),oe=e.computed(()=>typeof te.remainderLabel=="string"&&te.remainderLabel.trim().length>0),ve=e.computed(()=>ne.value>0),H=e.computed(()=>he.value.reduce((G,ue)=>Math.max(G,Number(ue.value)||0),0)),Ce=e.computed(()=>he.value.filter(G=>G.value>0).map(G=>`${G.label}: ${Pt(G.value)}`).join(" | ")),Te=e.computed(()=>Ke.value?ge.value?he.value.filter(G=>G.value>0):he.value:[]),qe=e.computed(()=>{if(!te.counterAsPercentage)return`${f.value} / ${we.value}`;const G=Number(we.value);if(!Number.isFinite(G)||G<=0)return"0%";const ue=Math.round(Number(f.value)/G*100);return`${Math.min(Math.max(ue,0),100)}%`}),ct=e.computed(()=>f.value),R=e.computed(()=>we.value),xe=e.reactive({visible:!1,x:0,content:""}),Be=e.computed(()=>({left:`${xe.x}px`})),ke=G=>{const ue=G?.parentElement;return ue?ue.offsetLeft+ue.offsetWidth/2:0},mt=G=>{if(ge.value){const Xe=Math.max(0,Number(G.value)||0);return{flex:`${Xe} 0 0`,minWidth:Xe>0?"6px":"0",backgroundColor:G.color}}const ue=f.value;return{flex:`${G.value>0?G.value:ue>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:G.color}},vt=G=>Number(G?.value||0)>0&&Number(G?.value||0)===H.value,de=G=>{const ue=L(G?.marker)?G.marker:{},De=G?.marker===!0||ue.enabled===!0,Xe=vt(G)&&z.value.maxSegment?.marker?.enabled===!0;if(!(De||Xe))return{enabled:!1};const kt=ue.backgroundColor??(Xe?z.value.maxSegment?.marker?.backgroundColor:z.value.segmentMarker?.backgroundColor),xt=ue.borderColor??(Xe?z.value.maxSegment?.marker?.borderColor:z.value.segmentMarker?.borderColor),Mt=ue.color??(Xe?z.value.maxSegment?.marker?.color:z.value.segmentMarker?.color),Ut=ue.width??(Xe?z.value.maxSegment?.marker?.width:z.value.segmentMarker?.width),Q=ue.height??(Xe?z.value.maxSegment?.marker?.height:z.value.segmentMarker?.height);return{enabled:!0,backgroundColor:kt,borderColor:xt,color:Mt,width:Ut,height:Q,icon:ue.icon??null,...ue}},gt=G=>{const ue=de(G);return{backgroundColor:ue.backgroundColor??void 0,borderColor:ue.borderColor??void 0,color:ue.color??void 0}},We=G=>{const ue=de(G);return{width:ue.width??void 0,height:ue.height??void 0}},Pt=G=>`${G}${te.valueLabel}`,it=e.computed(()=>({flex:`${ne.value} 0 0`,minWidth:ne.value>0?"6px":"0",backgroundColor:te.inactiveColor})),Et=(G,ue)=>{if(!G||!ue?.currentTarget)return;const De=ue.currentTarget;if(te.remainderTooltipSummary){xe.x=ke(De),xe.content=Ce.value,xe.visible=!!xe.content;return}xe.x=De.offsetLeft+De.offsetWidth/2,xe.content=`${G.label}: ${Pt(G.value)}`,xe.visible=!0},Tt=G=>{if(!ne.value||!G?.currentTarget)return;const ue=G.currentTarget;if(te.remainderTooltipSummary){xe.x=ke(ue),xe.content=Ce.value,xe.visible=!!xe.content;return}xe.x=ue.offsetLeft+ue.offsetWidth/2,oe.value&&(xe.content=`${te.remainderLabel}: ${Pt(ne.value)}`,xe.visible=!0)},Wt=()=>{xe.visible=!1},Ft=e.computed(()=>({"--dss-step-bar-label-color":te.labelColor??void 0,"--dss-step-bar-counter-color":te.counterColor??void 0,"--dss-step-bar-active-color":te.activeColor,"--dss-step-bar-inactive-color":te.inactiveColor}));return(G,ue)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Ft.value)},[e.createElementVNode("div",A0,[e.createElementVNode("span",D0,[e.renderSlot(G.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",H0,[e.renderSlot(G.$slots,"counter",{counterDisplay:qe.value},()=>[e.createTextVNode(e.toDisplayString(qe.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",R0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":R.value,"aria-valuenow":ct.value,"aria-label":T.label},[Ke.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(De,Xe)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Xe}-${De.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":vt(De),"dss-step-bar__segment--marker-enabled":de(De).enabled}]),style:e.normalizeStyle(mt(De)),onMouseenter:Zt=>Et(De,Zt),onMouseleave:Wt},[de(De).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(gt(De)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(We(De))},[e.renderSlot(G.$slots,"segment-marker-icon",{segment:De,index:Xe,marker:de(De)},()=>[e.renderSlot(G.$slots,"max-segment-icon",{segment:De,index:Xe,marker:de(De)},()=>[e.createTextVNode(e.toDisplayString(de(De).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,I0))),128)),ve.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(it.value),onMouseenter:ue[0]||(ue[0]=De=>Tt(De)),onMouseleave:Wt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,De=>(e.openBlock(),e.createElementBlock("div",{key:De,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":De<=U.value}])},null,2))),128))],8,F0),xe.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Be.value)},e.toDisplayString(xe.content),5)):e.createCommentVNode("",!0)])],4))}},P0={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"}},O0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},q0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},W0={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"}},Z0={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"}},Ql={chart:P0,table:O0,filter:q0,datepicker:W0,textEditor:Z0},U0={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"}},X0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},Y0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},j0={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"}},K0={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"}},Jl={chart:U0,table:X0,filter:Y0,datepicker:j0,textEditor:K0},G0={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"}},Q0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},J0={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},e9={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"}},t9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:G0,table:Q0,filter:J0,datepicker:e9,textEditor:t9},Ho={en:Ql,fr:Jl,nl:eo};function ca(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Ho).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Ho[_])})}const Ro={en:{textEditor:Ql.textEditor},fr:{textEditor:Jl.textEditor},nl:{textEditor:eo.textEditor}};function ua(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Ro).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Ro[_])})}const Fo={en:{table:Ql.table},fr:{table:Jl.table},nl:{table:eo.table}};function da(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Fo).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Fo[_])})}const Io={en:{datepicker:Ql.datepicker},fr:{datepicker:Jl.datepicker},nl:{datepicker:eo.datepicker}};function ma(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Io).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Io[_])})}const zo={en:{filter:Ql.filter},fr:{filter:Jl.filter},nl:{filter:eo.filter}};function pa(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(zo).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,zo[_])})}const n9={chart:Ho,textEditor:Ro,table:Fo,datepicker:Io,filter:zo};function l9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const o9={en:{...Ql},fr:{...Jl},nl:{...eo}};Gl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:o9});exports.DSSChart=lc;exports.DSSChartMessages=Ho;exports.DSSColorPicker=Wm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Io;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=zo;exports.DSSLoader=l2;exports.DSSMessages=n9;exports.DSSModal=Jo;exports.DSSPillField=T0;exports.DSSSkeleton=o2;exports.DSSStepBar=z0;exports.DSSTable=Su;exports.DSSTableMessages=Fo;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=ca;exports.addDSSDatepickerTranslations=ma;exports.addDSSFilterTranslations=pa;exports.addDSSTableTranslations=da;exports.addDSSTextEditorTranslations=ua;exports.addDSSTranslations=l9;
|
|
117
|
+
`,document.body.appendChild(et),be=et}function ut(Q,ye){be&&(be.style.left=`${Q-ze}px`,be.style.top=`${ye-rt}px`)}function Oe(Q){Q.classList.add("dss-dnd-item--dragging"),Q.style.background=X.value.dragSourceBackground,Q.style.borderColor=X.value.dragSourceBorder,Q.style.transform="scale(0.97)"}function Ut(Q){Q.classList.remove("dss-dnd-item--dragging"),Q.style.background="",Q.style.borderColor="",Q.style.transform=""}function st(Q,ye){return document.elementFromPoint(Q,ye)?.closest(".dss-dnd-column-body")??null}function Et(Q,ye){return!!document.elementFromPoint(Q,ye)?.closest("[data-dss-dnd-delete-zone]")}function Tt(Q,ye){if(z.value&&Et(Q,ye)){he.value=!0,xe.value=null,ne.value=-1;return}he.value=!1;const Me=st(Q,ye),qe=Me?.getAttribute("data-column")??null;if(!qe){xe.value=null,ne.value=-1;return}xe.value=qe;const et=Me.querySelectorAll(".dss-dnd-item:not(.dss-dnd-item--dragging)");let St=et.length;for(let Xe=0;Xe<et.length;Xe++){const Vt=et[Xe].getBoundingClientRect();if(ye<Vt.top+Vt.height/2){St=Xe;break}}ne.value=St}function qt(Q){Q.preventDefault(),ut(Q.clientX,Q.clientY),!fe&&(fe=requestAnimationFrame(()=>{fe=null,Tt(Q.clientX,Q.clientY)}))}function Ft(Q){window.removeEventListener("pointermove",qt),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),Te?.releasePointerCapture?.(Q.pointerId),Ut(Te),Te=null;const ye=z.value&&Et(Q.clientX,Q.clientY);if(f.value&&ye)L("delete",{item:f.value});else{const qe=st(Q.clientX,Q.clientY)?.getAttribute("data-column")??null;if(f.value&&qe){const et=f.value[_.columnKey],St=qe,Vt=(Ce.value[St]||[]).filter(K=>K[_.itemKey]!==f.value[_.itemKey]),Ye=Math.max(0,Math.min(ne.value,Vt.length)),W=pt(St,Ye),Z=f.value[_.itemKey];L("move",{item:f.value,from:et,to:St,position:W,index:Ye}),H&&clearTimeout(H),le.value={id:Z,from:et,to:St},H=setTimeout(()=>{le.value=null},3500)}}be&&(be.remove(),be=null),R!==null&&(document.body.style.cursor=R,R=""),It()}function G(Q,ye){Q.preventDefault();const Me=Q.target.closest(".dss-dnd-item");if(!Me)return;const qe=Me.getBoundingClientRect();ze=Q.clientX-qe.left,rt=Q.clientY-qe.top,R=document.body.style.cursor,document.body.style.cursor="grabbing",f.value=ye,Te=Me,de(Me,Q.clientX,Q.clientY),requestAnimationFrame(()=>Oe(Me)),Me.setPointerCapture?.(Q.pointerId),window.addEventListener("pointermove",qt),window.addEventListener("pointerup",Ft,{once:!0}),window.addEventListener("pointercancel",Ft,{once:!0})}function me(){Ee&&(window.removeEventListener("pointermove",He),window.removeEventListener("pointerup",Ue),window.removeEventListener("pointercancel",Ue),Ee=null)}function He(Q){if(!Ee||Q.pointerId!==Ee.pointerId)return;const ye=Q.clientX-Ee.startX,Me=Q.clientY-Ee.startY;if(Math.abs(ye)>=Be||Math.abs(Me)>=Be){const qe=Ee.item;me(),G(Q,qe)}}function Ue(Q){!Ee||Q.pointerId!==Ee.pointerId||me()}function Wt(Q,ye){me(),Ee={item:ye,startX:Q.clientX,startY:Q.clientY,pointerId:Q.pointerId},window.addEventListener("pointermove",He),window.addEventListener("pointerup",Ue),window.addEventListener("pointercancel",Ue)}function yt(Q,ye){X.value.useHandle||Wt(Q,ye)}function Pt(Q,ye){Wt(Q,ye)}function wt(){fe&&(cancelAnimationFrame(fe),fe=null)}function It(){wt(),f.value=null,xe.value=null,he.value=!1,ne.value=-1}return e.onBeforeUnmount(()=>{wt(),me(),H&&clearTimeout(H),be&&(be.remove(),be=null)}),(Q,ye)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-dnd",{"dss-dnd--unstyled":X.value.unstyled}]),style:e.normalizeStyle(je.value)},[z.value?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["dss-dnd-delete-zone",{"dss-dnd-delete-zone--drag-over":he.value}]),"data-dss-dnd-delete-zone":""},[e.renderSlot(Q.$slots,"delete-zone",{isDragging:!!f.value,isOver:he.value})],2),[[e.vShow,!!f.value||X.value.deleteZoneAlwaysVisible]])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.columns,Me=>(e.openBlock(),e.createElementBlock("div",{key:Me.value,class:e.normalizeClass(["dss-dnd-column",[{"dss-dnd-column--drag-over":xe.value==Me.value},Me.class||""]]),style:e.normalizeStyle(ge(Me))},[X.value.showHeader?(e.openBlock(),e.createElementBlock("div",a2,[e.renderSlot(Q.$slots,"column-header",{column:Me,items:Ce.value[Me.value]||[]},()=>[e.createElementVNode("span",s2,e.toDisplayString(Me.title||Me.value),1),e.createElementVNode("span",r2,e.toDisplayString((Ce.value[Me.value]||[]).length),1)])])):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"dss-dnd-column-body","data-column":Me.value},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(gt.value[Me.value],qe=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:qe.key},[qe.type==="indicator"?(e.openBlock(),e.createElementBlock("div",c2)):(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(["dss-dnd-item",{"dss-dnd-item--dragging":qe.isDragged,"dss-dnd-item--no-handle":!X.value.useHandle}]),onPointerdown:et=>yt(et,qe.item)},[X.value.useHandle?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-dnd-handle",onPointerdown:e.withModifiers(et=>Pt(et,qe.item),["stop"])},[e.renderSlot(Q.$slots,"handle",{},()=>[ye[0]||(ye[0]=e.createElementVNode("span",{class:"dss-dnd-handle-icon"},"⠿",-1))])],40,d2)):e.createCommentVNode("",!0),e.createElementVNode("div",m2,[e.renderSlot(Q.$slots,"item",{item:qe.item,column:Me,justDropped:le.value?.id===qe.item[T.itemKey],droppedFrom:le.value?.id===qe.item[T.itemKey]?le.value.from:null,droppedTo:le.value?.id===qe.item[T.itemKey]?le.value.to:null},()=>[e.createElementVNode("div",p2,e.toDisplayString(qe.item[T.itemKey]),1)])])],42,u2))],64))),128)),(Ce.value[Me.value]||[]).length===0&&xe.value!=Me.value?(e.openBlock(),e.createElementBlock("div",f2,[e.renderSlot(Q.$slots,"empty",{column:Me},()=>[ye[1]||(ye[1]=e.createElementVNode("span",{class:"dss-dnd-empty-text"},"No items",-1))])])):e.createCommentVNode("",!0)],8,i2)],6))),128))],6))}}),h2={name:"DSSConfetti"},y2=Object.assign(h2,{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(T){const te=T,_=e.ref(null),L=e.ref(!1);let ce=[],z=null,A=null;function X(ne,le){const fe=[];for(let H=0;H<te.count;H++)fe.push(je(ne));return fe}function je(ne,le){return{x:Math.random()*ne,y:-Math.random()*150-20,r:Math.random()*8+3,d:Math.random()*50,color:te.colors[Math.floor(Math.random()*te.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 ge(ne,le,fe,H){ne.clearRect(0,0,le,fe);for(const be of ce)ne.save(),ne.globalAlpha=be.opacity*H,ne.beginPath(),ne.lineWidth=be.r,ne.strokeStyle=be.color,ne.moveTo(be.x+be.tilt+be.r/2,be.y),ne.lineTo(be.x+be.tilt,be.y+be.tilt+be.r/2),ne.stroke(),ne.restore()}function f(ne,le,fe){const H=.3+fe*.7;for(let be=0;be<ce.length;be++){const Te=ce[be];Te.tiltAngle+=Te.tiltInc,Te.y+=Te.speed*H,Te.x+=Math.sin(Te.d)*.5*H,Te.tilt=Math.sin(Te.tiltAngle)*15,fe>=.99&&Te.y>le+20&&(ce[be]=je(ne))}}function xe(){L.value=!0,e.nextTick(()=>{const ne=_.value;if(!ne)return;const le=ne.getContext("2d"),fe=ne.parentElement;if(!fe)return;const H=fe.getBoundingClientRect();ne.width=H.width,ne.height=H.height,ce=X(ne.width,ne.height);const be=Date.now(),Te=be+te.duration,ze=()=>{const rt=Date.now(),R=rt-be;if(rt<Te){let Ee=1;R>te.fadeStart&&(Ee=1-(R-te.fadeStart)/(te.duration-te.fadeStart)),ge(le,ne.width,ne.height,Ee),f(ne.width,ne.height,Ee),z=requestAnimationFrame(ze)}else he()};ze()})}function he(){z&&(cancelAnimationFrame(z),z=null),ce=[],L.value=!1}return e.watch(()=>te.trigger,ne=>{ne&&(A&&clearTimeout(A),A=setTimeout(xe,te.delay))},{immediate:!0}),e.onBeforeUnmount(()=>{he(),A&&clearTimeout(A)}),(ne,le)=>L.value?(e.openBlock(),e.createElementBlock("canvas",{key:0,ref_key:"canvasRef",ref:_,class:"dss-confetti-canvas"},null,512)):e.createCommentVNode("",!0)}}),k2={class:"dss-filter-global-inner"},C2=["placeholder","value"],b2=["title"],w2={key:0,class:"dss-filter-funnel-badge"},x2={key:1,class:"dss-filter-sortby"},E2=["value"],S2=["value"],V2=["disabled","title"],N2={key:0,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B2={key:1,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},M2={key:2,class:"dss-filter-sortby-order-icon",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_2={class:"dss-filter-panel"},$2={key:0,class:"dss-filter-empty"},L2={class:"dss-filter-row-prefix"},T2={class:"dss-filter-cell"},A2=["onClick"],D2={class:"dss-filter-trigger-text"},H2=["placeholder"],R2={class:"dss-filter-popup-list"},F2=["onClick"],I2={key:0,class:"dss-filter-popup-empty"},z2={key:0,class:"dss-filter-cell"},P2=["onClick"],O2={class:"dss-filter-trigger-text"},q2={class:"dss-filter-popup-list"},W2=["onClick"],Z2={key:1,class:"dss-filter-cell dss-filter-cell--value"},U2=["placeholder","onUpdate:modelValue"],X2={key:1,class:"dss-filter-date-wrap"},Y2=["placeholder","onUpdate:modelValue"],j2=["placeholder","value","onInput","step"],K2={key:4,class:"dss-filter-between"},G2=["placeholder","value","onInput","step"],Q2={class:"dss-filter-between-sep"},J2=["placeholder","value","onInput","step"],e0={key:5,class:"dss-filter-multiselect"},t0=["onClick"],n0={class:"dss-filter-trigger-text"},l0=["placeholder"],o0={class:"dss-filter-popup-list dss-filter-popup-list--check"},a0=["onClick"],s0=["checked"],r0={key:0,class:"dss-filter-popup-empty"},i0=["onClick"],c0={class:"dss-filter-foot"},u0={class:"dss-filter-cell"},d0=["placeholder"],m0={class:"dss-filter-popup-list"},p0=["onClick"],f0={key:0,class:"dss-filter-popup-divider"},v0=["onClick"],g0=["placeholder"],h0={class:"dss-filter-popup-list"},y0=["onClick"],k0={key:0,class:"dss-filter-popup-empty"},C0=["placeholder"],b0={class:"dss-filter-popup-list"},w0=["onClick"],x0={key:0,class:"dss-filter-popup-empty"},E0={name:"DSSFilter"},S0=Object.assign(E0,{props:{data:{type:Array,required:!0},modelValue:{type:Array,default:void 0},exclude:{type:Array,default:()=>[]},config:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},showSortBy:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{expose:te,emit:_}){const{t:L}=Gl.useI18n(),ce=T,z=_,A={unstyled:!1,maxUniqueForSelect:30,maxUniqueForEnum:15},X=e.computed(()=>({...A,...ce.options})),je={text:[{value:"contains"},{value:"not_contains"},{value:"equals"},{value:"not_equals"},{value:"starts_with"},{value:"ends_with"},{value:"is_empty"},{value:"is_not_empty"}],select:[{value:"is_any_of"},{value:"is_none_of"},{value:"is_empty"},{value:"is_not_empty"}],range:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],int:[{value:"eq"},{value:"neq"},{value:"gt"},{value:"gte"},{value:"lt"},{value:"lte"},{value:"between"},{value:"is_empty"},{value:"is_not_empty"}],arraySelect:[{value:"contains_any"},{value:"contains_all"},{value:"not_contains_any"},{value:"is_empty"},{value:"is_not_empty"}],arrayText:[{value:"contains"},{value:"not_contains"},{value:"is_empty"},{value:"is_not_empty"}],date:[{value:"eq"},{value:"before"},{value:"after"},{value:"is_empty"},{value:"is_not_empty"}],boolean:[{value:"is_true"},{value:"is_false"},{value:"is_empty"},{value:"is_not_empty"}]},ge=new Set(["is_empty","is_not_empty","is_true","is_false"]),f=["label","name","title","keyword","full_name","value","text"],xe=e.ref(""),he=e.ref([]),ne=e.ref(null),le=e.ref(!1),fe=e.ref(null),H=e.ref(""),be=e.ref(null),Te=e.ref(""),ze=e.ref("asc");let rt=1;function R(V){const w=V.find(S=>S&&typeof S=="object");if(!w)return null;for(const S of f)if(S in w&&typeof w[S]=="string")return S;return Object.keys(w).find(S=>typeof w[S]=="string")||null}function Ee(V,w){const S=w.filter(Y=>Y!=null&&Y!=="NULL");if(S.length===0)return null;if(S.every(Y=>Array.isArray(Y))){const Y=S.flatMap(Pe=>Pe).filter(Pe=>Pe!=null);return Y.length===0?null:typeof Y.find(Pe=>Pe!=null)=="object"?"arraySelect":"arrayText"}return S.every(Y=>typeof Y=="boolean")?"boolean":S.every(Y=>typeof Y=="number")?new Set(S).size<=X.value.maxUniqueForEnum?"select":"range":S.every(Y=>typeof Y=="string")?new Set(S).size<=X.value.maxUniqueForSelect?"select":"text":S.some(Y=>typeof Y=="object"&&!Array.isArray(Y))?null:"text"}const Be=e.computed(()=>{if(!ce.data?.length)return[];const V=new Set;for(const J of ce.data)if(J&&typeof J=="object")for(const Pe of Object.keys(J))V.add(Pe);const w=new Set(ce.exclude),S=[];for(const J of V){if(w.has(J))continue;const Pe=ce.config[J]||{},ft=ce.data.map(kt=>kt?.[J]),tt=Pe.type||Ee(J,ft);if(!tt)continue;const we=Pe.filterMode||"contain",Bt=we==="date"?"date":we==="string"?"text":tt,At={key:J,label:Pe.label||$t(J),type:Bt,filterMode:we};if(tt==="select"){const kt=ft.filter(nt=>nt!=null&&nt!=="NULL");At.uniqueValues=[...new Set(kt)].sort((nt,dt)=>typeof nt=="number"&&typeof dt=="number"?nt-dt:String(nt).localeCompare(String(dt)))}else if(tt==="range"||tt==="int"){const kt=ft.filter(nt=>typeof nt=="number");At.min=Math.min(...kt),At.max=Math.max(...kt)}else if(tt==="arraySelect"){const kt=Pe.displayKey||R(ft.flatMap(nt=>Array.isArray(nt)?nt:[]));if(At.displayKey=kt,Array.isArray(Pe.uniqueValues)&&Pe.uniqueValues.length>0)At.uniqueValues=Pe.uniqueValues.map(nt=>String(nt));else{const nt=ft.flatMap(dt=>Array.isArray(dt)?dt:[]).filter(dt=>dt!=null).map(dt=>kt&&typeof dt=="object"?dt[kt]:String(dt)).filter(dt=>dt!=null&&dt!=="");At.uniqueValues=[...new Set(nt)].sort((dt,Wn)=>String(dt).localeCompare(String(Wn)))}}S.push(At)}const Y=ce.config._order;return Y&&S.sort((J,Pe)=>{const ft=Y.indexOf(J.key),tt=Y.indexOf(Pe.key);return ft===-1&&tt===-1?0:ft===-1?1:tt===-1?-1:ft-tt}),S}),Ce=e.computed(()=>{const V={};for(const w of Be.value)V[w.key]=w;return V}),gt=e.computed(()=>Array.isArray(ce.config.groups)&&ce.config.groups.length>0),pt=e.computed(()=>{if(!gt.value)return[];const V=new Set(Be.value.map(w=>w.key));return ce.config.groups.map(w=>({...w,keys:w.keys.filter(S=>V.has(S))})).filter(w=>w.keys.length>0)}),de=e.computed(()=>{if(!gt.value)return[];const V=new Set(ce.config.groups.flatMap(w=>w.keys));return Be.value.filter(w=>!V.has(w.key))}),ut=e.computed(()=>{if(!be.value)return[];const V=new Set(be.value.keys),w=Be.value.filter(Y=>V.has(Y.key));if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Y=>Y.label.toLowerCase().includes(S))}),Oe=e.computed(()=>{if(!H.value)return Be.value;const V=H.value.toLowerCase();return Be.value.filter(w=>w.label.toLowerCase().includes(V))}),Ut=e.computed(()=>Be.value.filter(V=>!["arraySelect","arrayText"].includes(V.type))),st=e.computed(()=>Te.value?ze.value==="asc"?"Ascending":"Descending":"No sort selected");function Et(V){ne.value===V?Tt():(ne.value=V,H.value="",be.value=null)}function Tt(){ne.value=null,H.value="",be.value=null}function qt(V){const w=V.target.closest(".dss-datepicker__overlay, .dss-datepicker__dropdown");ne.value&&!w&&!V.target.closest(".dss-filter-popup")&&!V.target.closest(".dss-filter-trigger")&&!V.target.closest(".dss-filter-add-btn")&&Tt(),le.value&&fe.value&&!fe.value.contains(V.target)&&(w||(le.value=!1))}e.onMounted(()=>document.addEventListener("click",qt)),e.onBeforeUnmount(()=>document.removeEventListener("click",qt));function Ft(V){return Ce.value[V]?.label||$t(V)}function G(V){return Ce.value[V.key]?.filterMode||"contain"}function me(V){return L(`filter.operators.${V}`)}function He(V){const w=Ce.value[V.key];return(je[w?.type]||je.text).map(S=>({...S,label:L(`filter.operators.${S.value}`)}))}function Ue(V){return ge.has(V)}function Wt(V){const w=Ce.value[V.key];return w?w.type==="date"?"date":w.type==="boolean"?"boolean":w.type==="text"||w.type==="arrayText"?"text":w.type==="select"||w.type==="arraySelect"?"multiselect":w.type==="range"||w.type==="int"?V.operator==="between"?"between":"number":"text":"text"}function yt(V){return je[V]?.[0]?.value||"contains"}function Pt(V,w){return ge.has(w)||V==="date"?null:V==="select"||V==="arraySelect"?[]:(V==="range"||V==="int")&&w==="between"?{min:null,max:null}:V==="range"||V==="int"?null:""}function wt(V){return Ce.value[V.key]?.uniqueValues||[]}function It(V){const w=wt(V);if(!H.value)return w;const S=H.value.toLowerCase();return w.filter(Y=>String(Y).toLowerCase().includes(S))}function Q(V){const w=V.value;return!w||w.length===0?L("filter.select"):w.length<=2?w.join(", "):L("filter.selectedCount",{count:w.length})}function ye(V){const w=Ce.value[V],S=w?.filterMode||"contain",Y=w?.type||"text",J=S==="string"?"contains":yt(Y);he.value.push(e.reactive({id:rt++,key:V,operator:J,value:Pt(Y,J)})),Tt()}function Me(V){he.value=he.value.filter(w=>w.id!==V)}function qe(V,w){const Y=Ce.value[w]?.type||"text";V.key=w,V.operator=yt(Y),V.value=Pt(Y,V.operator),Tt()}function et(V,w){const S=Wt(V);V.operator=w;const Y=Wt(V);if(S!==Y||ge.has(w)){const J=Ce.value[V.key];V.value=Pt(J?.type||"text",w)}Tt()}function St(V,w){const S=w.target.value;V.value=S===""?null:Number(S)}function Xe(V,w,S){const Y=S.target.value,J=Y===""?null:Number(Y);(!V.value||typeof V.value!="object")&&(V.value={min:null,max:null}),V.value={...V.value,[w]:isNaN(J)?null:J}}function Vt(V,w){const S=V.value||[],Y=S.indexOf(w);V.value=Y>=0?S.filter(J=>J!==w):[...S,w]}function Ye(){he.value=[],xe.value="",Tt()}function W(V){xe.value=V.target.value}function Z(V){Te.value=V.target.value}function K(){ze.value=ze.value==="asc"?"desc":"asc"}const ve=e.computed(()=>{if(!ce.data)return[];let V=ce.data;if(xe.value){const w=xe.value.toLowerCase();V=V.filter(S=>{for(const Y of Object.keys(S)){const J=S[Y];if(typeof J=="string"&&J.toLowerCase().includes(w)||typeof J=="number"&&String(J).includes(w)||Array.isArray(J)&&J.some(Pe=>Pe!=null&&(typeof Pe=="string"?Pe.toLowerCase().includes(w):typeof Pe=="object"?Object.values(Pe).some(ft=>typeof ft=="string"&&ft.toLowerCase().includes(w)):!1)))return!0}return!1})}for(const w of he.value){if(!Nt(w))continue;const S=Ce.value[w.key];S&&(V=V.filter(Y=>Qe(Y,w,S)))}if(ce.showSortBy&&Te.value){const w=Te.value,S=ze.value==="asc"?1:-1;V=[...V].sort((Y,J)=>We(Y?.[w],J?.[w])*S)}return V});function We(V,w){const S=Ke(V),Y=Ke(w);return S==null&&Y==null?0:S==null?1:Y==null?-1:typeof S=="number"&&typeof Y=="number"?S-Y:String(S).localeCompare(String(Y),void 0,{numeric:!0,sensitivity:"base"})}function Ke(V){return V==null||V==="NULL"?null:typeof V=="string"||typeof V=="number"||typeof V=="boolean"?V:V instanceof Date?V.getTime():null}function Nt(V){return ge.has(V.operator)?!0:V.value==null||typeof V.value=="string"&&V.value===""||Array.isArray(V.value)&&V.value.length===0?!1:V.value instanceof Date?!isNaN(V.value.getTime()):!(typeof V.value=="object"&&!Array.isArray(V.value)&&V.value.min==null&&V.value.max==null)}function Qe(V,w,S){const Y=V?.[w.key],J=w.value,Pe=w.operator;if(Pe==="is_empty")return ln(Y);if(Pe==="is_not_empty")return!ln(Y);const ft=S.type;if(ft==="text"||ft==="arrayText"){const tt=ft==="arrayText"&&Array.isArray(Y)?Y.filter(At=>At!=null).map(String).join(" "):Y!=null?String(Y):"",we=String(J).toLowerCase(),Bt=tt.toLowerCase();switch(Pe){case"contains":return Bt.includes(we);case"not_contains":return!Bt.includes(we);case"equals":return Bt===we;case"not_equals":return Bt!==we;case"starts_with":return Bt.startsWith(we);case"ends_with":return Bt.endsWith(we);default:return!0}}if(ft==="select")switch(Pe){case"is_any_of":return J.includes(Y);case"is_none_of":return!J.includes(Y);default:return!0}if(ft==="range"||ft==="int"){const tt=typeof Y=="number"?Y:Number(Y);if(typeof tt!="number"||isNaN(tt))return!1;if(Pe==="between"){const Bt=J?.min!=null?Number(J.min):null,At=J?.max!=null?Number(J.max):null,kt=Bt!=null&&!isNaN(Bt)?Bt:null,nt=At!=null&&!isNaN(At)?At:null;return(kt==null||tt>=kt)&&(nt==null||tt<=nt)}const we=typeof J=="number"&&!isNaN(J)?J:Number(J);if(Pe==="contains"||Pe==="not_contains"){const Bt=String(tt),At=String(J??"").toLowerCase(),kt=Bt.toLowerCase().includes(At);return Pe==="contains"?kt:!kt}if(typeof we!="number"||isNaN(we))return!1;switch(Pe){case"eq":return tt===we;case"neq":return tt!==we;case"gt":return tt>we;case"gte":return tt>=we;case"lt":return tt<we;case"lte":return tt<=we;default:return!0}}if(ft==="arraySelect"){if(!Array.isArray(Y))return!1;const tt=Y.filter(we=>we!=null).map(we=>S.displayKey&&typeof we=="object"?we[S.displayKey]:String(we));switch(Pe){case"contains_any":return tt.some(we=>J.includes(we));case"contains_all":return J.every(we=>tt.includes(we));case"not_contains_any":return!tt.some(we=>J.includes(we));default:return!0}}if(ft==="date"){const tt=lt(J);if(!tt||isNaN(tt.getTime()))return!1;const we=lt(Y);if(!we||isNaN(we.getTime()))return!1;const Bt=Xt(we),At=Xt(tt);switch(Pe){case"eq":return Bt===At;case"before":return Bt<At;case"after":return Bt>At;default:return!0}}if(ft==="boolean"){const tt=Y===!0||Y==="true"||Y===1,we=Y===!1||Y==="false"||Y===0;switch(Pe){case"is_true":return tt;case"is_false":return we;default:return!0}}return!0}function lt(V){if(V==null)return null;if(V instanceof Date)return isNaN(V.getTime())?null:V;if(typeof V=="number")return new Date(V>1e10?V:V*1e3);if(typeof V=="string"){const w=new Date(V);return isNaN(w.getTime())?null:w}return null}function Xt(V){const w=V.getFullYear(),S=String(V.getMonth()+1).padStart(2,"0"),Y=String(V.getDate()).padStart(2,"0");return`${w}-${S}-${Y}`}function ln(V){return!!(V==null||V===""||V==="NULL"||Array.isArray(V)&&V.length===0||Array.isArray(V)&&V.every(w=>w==null))}e.watch(ve,V=>z("update:modelValue",V),{immediate:!0}),e.watch(()=>ce.data,()=>{he.value=[],xe.value="",le.value=!1,Te.value="",ze.value="asc",Tt()});function $t(V){return V.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,w=>w.toUpperCase())}function Qt(){const V=w=>{if(w==null)return w;if(w instanceof Date)return{_type:"Date",value:w.toISOString(),local:w.toLocaleDateString()};if(Array.isArray(w))return w.map(V);if(typeof w=="object"&&!Array.isArray(w)){const S={};for(const Y of Object.keys(w))S[Y]=V(w[Y]);return S}return w};return{globalSearch:xe.value,rows:he.value.map(w=>({key:w.key,operator:w.operator,value:V(w.value),defType:Ce.value[w.key]?.type,defFilterMode:Ce.value[w.key]?.filterMode})),filteredCount:ve.value?.length??0}}return te({getDebugState:Qt}),(V,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-filter",{"dss-filter--unstyled":X.value.unstyled}])},[e.createElementVNode("div",{class:"dss-filter-global",ref_key:"globalRef",ref:fe},[e.createElementVNode("div",k2,[w[20]||(w[20]=e.createElementVNode("svg",{class:"dss-filter-global-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),e.createElementVNode("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),e.createElementVNode("input",{type:"text",class:"dss-filter-global-input",placeholder:e.unref(L)("filter.searchAcrossFields"),value:xe.value,onInput:W},null,40,C2),xe.value?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-global-clear",onClick:w[0]||(w[0]=S=>xe.value="")},"×")):e.createCommentVNode("",!0),e.createElementVNode("button",{class:e.normalizeClass(["dss-filter-funnel-btn",{active:le.value||he.value.length>0,"dss-filter-funnel-btn--with-sort":ce.showSortBy}]),onClick:w[1]||(w[1]=S=>le.value=!le.value),type:"button",title:le.value?e.unref(L)("filter.closeAdvancedFilter"):e.unref(L)("filter.openAdvancedFilter")},[w[14]||(w[14]=e.createElementVNode("svg",{class:"dss-filter-funnel-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M11.7583 2.00407L11.7537 2.00926L7.84558 6.18223V9.38409C7.84581 9.53637 7.80836 9.68634 7.73658 9.82064C7.6648 9.95494 7.56091 10.0694 7.43417 10.1538L5.58772 11.3852C5.44858 11.4779 5.28688 11.531 5.11988 11.539C4.95288 11.5469 4.78685 11.5094 4.63952 11.4304C4.49219 11.3514 4.36908 11.2338 4.28334 11.0903C4.1976 10.9467 4.15244 10.7826 4.15269 10.6154V6.18223L0.244567 2.00926L0.239951 2.00407C0.119785 1.87182 0.0405781 1.70755 0.0119374 1.53118C-0.0167033 1.35481 0.00645342 1.17391 0.0785984 1.01044C0.150743 0.846967 0.268776 0.707944 0.418378 0.610235C0.56798 0.512525 0.742722 0.460328 0.921405 0.459976H11.0769C11.2557 0.459994 11.4307 0.511948 11.5805 0.609528C11.7304 0.707107 11.8487 0.846111 11.9211 1.00965C11.9934 1.17319 12.0167 1.35422 11.9881 1.53075C11.9596 1.70728 11.8803 1.87172 11.7601 2.00407H11.7583Z",fill:"currentColor"})],-1)),he.value.length>0?(e.openBlock(),e.createElementBlock("span",w2,e.toDisplayString(he.value.length),1)):e.createCommentVNode("",!0)],10,b2),ce.showSortBy?(e.openBlock(),e.createElementBlock("div",x2,[w[19]||(w[19]=e.createElementVNode("label",{class:"dss-filter-sortby-label",for:"dss-filter-sort-select"},"Sort by",-1)),e.createElementVNode("select",{id:"dss-filter-sort-select",class:"dss-filter-sortby-select",value:Te.value,onChange:Z},[w[15]||(w[15]=e.createElementVNode("option",{value:""},"None",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ut.value,S=>(e.openBlock(),e.createElementBlock("option",{key:S.key,value:S.key},e.toDisplayString(S.label),9,S2))),128))],40,E2),e.createElementVNode("button",{class:"dss-filter-sortby-order",type:"button",onClick:K,disabled:!Te.value,title:st.value},[Te.value?ze.value==="asc"?(e.openBlock(),e.createElementBlock("svg",B2,[...w[17]||(w[17]=[e.createElementVNode("path",{d:"M6 12C6.36819 12 6.66667 11.7015 6.66667 11.3333L6.66667 2.55333L8.58967 4.47098C8.84953 4.73012 9.27017 4.72983 9.52967 4.47033C9.78943 4.21057 9.78943 3.78943 9.52967 3.52967L6.70711 0.707106C6.31658 0.316582 5.68342 0.316582 5.29289 0.707107L2.47033 3.52967C2.21057 3.78943 2.21057 4.21057 2.47033 4.47033C2.72983 4.72983 3.15047 4.73012 3.41033 4.47098L5.33333 2.55333L5.33333 11.3333C5.33333 11.7015 5.63181 12 6 12Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",M2,[...w[18]||(w[18]=[e.createElementVNode("path",{d:"M6 -1.74846e-07C5.63181 -1.58751e-07 5.33333 0.298476 5.33333 0.666666L5.33333 9.44667L3.41033 7.52902C3.15047 7.26988 2.72983 7.27017 2.47033 7.52967C2.21057 7.78943 2.21057 8.21057 2.47033 8.47033L5.29289 11.2929C5.68342 11.6834 6.31658 11.6834 6.70711 11.2929L9.52967 8.47033C9.78943 8.21057 9.78943 7.78943 9.52967 7.52967C9.27017 7.27017 8.84953 7.26988 8.58967 7.52902L6.66667 9.44667L6.66667 0.666667C6.66667 0.298477 6.36819 -1.9094e-07 6 -1.74846e-07Z",fill:"currentColor"},null,-1)])])):(e.openBlock(),e.createElementBlock("svg",N2,[...w[16]||(w[16]=[e.createElementVNode("path",{d:"M5.413 9.06387C5.45434 9.16352 5.4652 9.27319 5.4442 9.37901C5.42321 9.48484 5.3713 9.58206 5.29505 9.65837L3.11339 11.84C3.06273 11.8907 3.00258 11.931 2.93637 11.9584C2.87016 11.9859 2.79918 12 2.72751 12C2.65583 12 2.58486 11.9859 2.51865 11.9584C2.45243 11.931 2.39228 11.8907 2.34163 11.84L0.159964 9.65837C0.0835992 9.58209 0.0315843 9.48487 0.0105038 9.37902C-0.0105768 9.27316 0.000224981 9.16343 0.0415416 9.06371C0.0828581 8.964 0.152832 8.87879 0.242604 8.81886C0.332376 8.75894 0.43791 8.72699 0.545845 8.72708H2.18209V0.545845C2.18209 0.401191 2.23955 0.262463 2.34184 0.160178C2.44413 0.0578925 2.58285 0.000429123 2.72751 0.000429123C2.87216 0.000429123 3.01089 0.0578925 3.11317 0.160178C3.21546 0.262463 3.27292 0.401191 3.27292 0.545845V8.72708H4.90917C5.01704 8.7271 5.12248 8.75911 5.21216 8.81906C5.30185 8.87901 5.37174 8.9642 5.413 9.06387ZM11.84 2.34162L9.65837 0.159963C9.60772 0.109252 9.54757 0.0690231 9.48135 0.0415755C9.41514 0.0141278 9.34417 0 9.27249 0C9.20082 0 9.12984 0.0141278 9.06363 0.0415755C8.99742 0.0690231 8.93727 0.109252 8.88661 0.159963L6.70495 2.34162C6.62858 2.4179 6.57657 2.51513 6.55549 2.62098C6.53441 2.72684 6.54521 2.83657 6.58653 2.93629C6.62784 3.036 6.69782 3.12121 6.78759 3.18114C6.87736 3.24107 6.9829 3.27301 7.09083 3.27292H8.72708V11.4542C8.72708 11.5988 8.78454 11.7375 8.88683 11.8398C8.98911 11.9421 9.12784 11.9996 9.27249 11.9996C9.41715 11.9996 9.55587 11.9421 9.65816 11.8398C9.76045 11.7375 9.81791 11.5988 9.81791 11.4542V3.27292H11.4542C11.5621 3.27301 11.6676 3.24107 11.7574 3.18114C11.8472 3.12121 11.9171 3.036 11.9585 2.93629C11.9998 2.83657 12.0106 2.72684 11.9895 2.62098C11.9684 2.51513 11.9164 2.4179 11.84 2.34162Z",fill:"currentColor"},null,-1)])]))],8,V2)])):e.createCommentVNode("",!0)]),le.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-advanced-popup",onClick:w[13]||(w[13]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",_2,[he.value.length===0?(e.openBlock(),e.createElementBlock("div",$2,e.toDisplayString(e.unref(L)("filter.noConditionsApplied")),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(he.value,(S,Y)=>(e.openBlock(),e.createElementBlock("div",{key:S.id,class:"dss-filter-row"},[e.createElementVNode("span",L2,e.toDisplayString(Y===0?e.unref(L)("filter.where"):e.unref(L)("filter.and")),1),e.createElementVNode("div",T2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:field`),["stop"])},[e.createElementVNode("span",D2,e.toDisplayString(Ft(S.key)),1),w[21]||(w[21]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,A2),ne.value===`${S.id}:field`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[3]||(w[3]=e.withModifiers(()=>{},["stop"]))},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[2]||(w[2]=J=>H.value=J),placeholder:e.unref(L)("filter.searchAttributes")},null,8,H2),[[e.vModelText,H.value]]),e.createElementVNode("ul",R2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,J=>(e.openBlock(),e.createElementBlock("li",{key:J.key,class:"dss-filter-popup-item",onClick:Pe=>qe(S,J.key)},e.toDisplayString(J.label),9,F2))),128)),Oe.value.length===0?(e.openBlock(),e.createElementBlock("li",I2,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)]),G(S)==="contain"||G(S)==="date"?(e.openBlock(),e.createElementBlock("div",z2,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:op`),["stop"])},[e.createElementVNode("span",O2,e.toDisplayString(me(S.operator)),1),w[22]||(w[22]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,P2),ne.value===`${S.id}:op`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[4]||(w[4]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("ul",q2,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(He(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J.value,class:e.normalizeClass(["dss-filter-popup-item",{selected:S.operator===J.value}]),onClick:Pe=>et(S,J.value)},e.toDisplayString(J.label),11,W2))),128))])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),Ue(S.operator)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Z2,[G(S)==="string"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":J=>S.value=J},null,8,U2)),[[e.vModelText,S.value]]):G(S)==="date"?(e.openBlock(),e.createElementBlock("div",X2,[e.createVNode(ea,{mode:"single",modelValue:S.value,"onUpdate:modelValue":J=>S.value=J},null,8,["modelValue","onUpdate:modelValue"])])):Wt(S)==="text"?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:2,type:"text",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),"onUpdate:modelValue":J=>S.value=J},null,8,Y2)),[[e.vModelText,S.value]]):Wt(S)==="number"?(e.openBlock(),e.createElementBlock("input",{key:3,type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.enterValue"),value:S.value,onInput:J=>St(S,J),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,j2)):Wt(S)==="between"?(e.openBlock(),e.createElementBlock("div",K2,[e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.min"),value:S.value?.min,onInput:J=>Xe(S,"min",J),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,G2),e.createElementVNode("span",Q2,e.toDisplayString(e.unref(L)("filter.and")),1),e.createElementVNode("input",{type:"number",class:"dss-filter-value-input",placeholder:e.unref(L)("filter.max"),value:S.value?.max,onInput:J=>Xe(S,"max",J),step:Ce.value[S.key]?.type==="int"?1:void 0},null,40,J2)])):Wt(S)==="multiselect"?(e.openBlock(),e.createElementBlock("div",e0,[e.createElementVNode("button",{class:"dss-filter-trigger",onClick:e.withModifiers(J=>Et(`${S.id}:val`),["stop"])},[e.createElementVNode("span",n0,e.toDisplayString(Q(S)),1),w[23]||(w[23]=e.createElementVNode("svg",{class:"dss-filter-chevron",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"})],-1))],8,t0),ne.value===`${S.id}:val`?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup",onClick:w[6]||(w[6]=e.withModifiers(()=>{},["stop"]))},[wt(S).length>6?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[5]||(w[5]=J=>H.value=J),placeholder:e.unref(L)("filter.search")},null,8,l0)),[[e.vModelText,H.value]]):e.createCommentVNode("",!0),e.createElementVNode("ul",o0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(It(S),J=>(e.openBlock(),e.createElementBlock("li",{key:J,class:"dss-filter-popup-item",onClick:Pe=>Vt(S,J)},[e.createElementVNode("input",{type:"checkbox",checked:(S.value||[]).includes(J),tabindex:"-1"},null,8,s0),e.createElementVNode("span",null,e.toDisplayString(J),1)],8,a0))),128)),It(S).length===0?(e.openBlock(),e.createElementBlock("li",r0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)])),e.createElementVNode("button",{class:"dss-filter-row-remove",onClick:J=>Me(S.id)},[...w[24]||(w[24]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.createElementVNode("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])],8,i0)]))),128)),e.createElementVNode("div",c0,[e.createElementVNode("div",u0,[e.createElementVNode("button",{class:"dss-filter-add-btn",onClick:w[7]||(w[7]=e.withModifiers(S=>Et("add"),["stop"]))},e.toDisplayString(e.unref(L)("filter.addFilter")),1),ne.value==="add"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-filter-popup dss-filter-add-popup",onClick:w[12]||(w[12]=e.withModifiers(()=>{},["stop"]))},[gt.value&&!be.value&&!H.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[8]||(w[8]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,d0),[[e.vModelText,H.value]]),e.createElementVNode("ul",m0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(pt.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.label,class:"dss-filter-popup-item dss-filter-popup-group",onClick:Y=>be.value=S},[e.createElementVNode("span",null,e.toDisplayString(S.label),1),w[25]||(w[25]=e.createElementVNode("svg",{class:"dss-filter-chevron-right",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"9 18 15 12 9 6"})],-1))],8,p0))),128)),de.value.length>0?(e.openBlock(),e.createElementBlock("li",f0)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(de.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,v0))),128))])],64)):be.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"dss-filter-popup-back",onClick:w[9]||(w[9]=S=>be.value=null)},[w[26]||(w[26]=e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("polyline",{points:"15 18 9 12 15 6"})],-1)),e.createElementVNode("span",null,e.toDisplayString(be.value.label),1)]),e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[10]||(w[10]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,g0),[[e.vModelText,H.value]]),e.createElementVNode("ul",h0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(ut.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,y0))),128)),ut.value.length===0?(e.openBlock(),e.createElementBlock("li",k0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[e.withDirectives(e.createElementVNode("input",{type:"text",class:"dss-filter-popup-search","onUpdate:modelValue":w[11]||(w[11]=S=>H.value=S),placeholder:e.unref(L)("filter.searchAttributes")},null,8,C0),[[e.vModelText,H.value]]),e.createElementVNode("ul",b0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Oe.value,S=>(e.openBlock(),e.createElementBlock("li",{key:S.key,class:"dss-filter-popup-item",onClick:Y=>ye(S.key)},e.toDisplayString(S.label),9,w0))),128)),Oe.value.length===0?(e.openBlock(),e.createElementBlock("li",x0,e.toDisplayString(e.unref(L)("filter.noMatch")),1)):e.createCommentVNode("",!0)])],64))])):e.createCommentVNode("",!0)]),he.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,class:"dss-filter-clear-all",onClick:Ye},e.toDisplayString(e.unref(L)("filter.clearAllFilters")),1)):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)],512)],2))}}),V0={class:"dss-pill-field__pills"},N0=["disabled"],B0={class:"dss-pill-field__pill-text"},M0={key:0,class:"dss-pill-field__pill-actions"},_0=["onClick"],$0=["onClick"],L0=["placeholder","disabled"],T0=e.defineComponent({__name:"DSSPillField",props:{modelValue:{default:()=>[]},placeholder:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(T,{emit:te}){const _=T,L=te,ce=e.ref(""),z=e.ref([..._.modelValue]),A=e.ref(null);let X=null;const je=e.ref(null),ge=e.ref(""),f=e.ref(null),xe=e.computed(()=>new Set(z.value.map(R=>R.trim()).filter(Boolean)));function he(R){A.value=R,X&&clearTimeout(X),X=setTimeout(()=>{A.value=null,X=null},900)}function ne(R){const Ee=R.trim();return Ee?xe.value.has(Ee)?(he(Ee),!1):(z.value=[...z.value,Ee],L("update:modelValue",[...z.value]),!0):!1}function le(R){const Ee=R.split(/\r?\n/g).map(pt=>pt.trim()).filter(Boolean);if(!Ee.length)return;const Be=new Set(z.value.map(pt=>pt.trim()).filter(Boolean)),Ce=[...z.value];let gt=null;for(const pt of Ee){if(Be.has(pt)){gt??=pt;continue}Be.add(pt),Ce.push(pt)}Ce.length!==z.value.length&&(z.value=Ce,L("update:modelValue",[...z.value])),gt&&he(gt)}function fe(R){_.disabled||(je.value===R&&(je.value=null,ge.value=""),z.value=z.value.filter((Ee,Be)=>Be!==R),L("update:modelValue",[...z.value]))}async function H(R){_.disabled||(je.value=R,ge.value=z.value[R]??"",await e.nextTick(),f.value?.focus(),f.value?.select())}function be(){je.value=null,ge.value=""}function Te(){if(_.disabled||je.value===null)return;const R=je.value,Ee=z.value[R]??"",Be=ge.value.trim();if(je.value=null,ge.value="",Be!==Ee&&xe.value.has(Be)){he(Be);return}if(!Be){z.value=z.value.filter((gt,pt)=>pt!==R),L("update:modelValue",[...z.value]);return}const Ce=z.value.map((gt,pt)=>pt===R?Be:gt);z.value=Ce,L("update:modelValue",[...z.value])}function ze(R){R.preventDefault(),!_.disabled&&(ne(ce.value),ce.value="")}function rt(R){if(_.disabled)return;const Ee=R.clipboardData?.getData("text")??"";!Ee.includes(`
|
|
118
|
+
`)&&!Ee.includes("\r")||(R.preventDefault(),le(Ee),ce.value="")}return e.watch(()=>_.modelValue,R=>{z.value=Array.isArray(R)?[...R]:[]},{deep:!0}),e.onBeforeUnmount(()=>{X&&clearTimeout(X)}),(R,Ee)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["dss-pill-field",{"dss-pill-field--disabled":R.disabled}])},[e.createElementVNode("div",V0,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(z.value,(Be,Ce)=>(e.openBlock(),e.createElementBlock("span",{key:Be,class:e.normalizeClass(["dss-pill-field__pill",{"dss-pill-field__pill--highlight":A.value===Be}])},[je.value===Ce?e.withDirectives((e.openBlock(),e.createElementBlock("input",{key:0,ref_for:!0,ref_key:"editInputEl",ref:f,"onUpdate:modelValue":Ee[0]||(Ee[0]=gt=>ge.value=gt),class:"dss-pill-field__pill-edit",type:"text",disabled:R.disabled,onKeydown:[e.withKeys(Te,["enter"]),e.withKeys(be,["esc"])],onBlur:Te},null,40,N0)),[[e.vModelText,ge.value]]):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("span",B0,e.toDisplayString(Be),1),R.disabled?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",M0,[e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action",onClick:gt=>H(Ce)},[...Ee[2]||(Ee[2]=[e.createElementVNode("svg",{class:"dss-pill-field__pill-action-icon",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:"M0 9.64033V11.6667C0 11.8534 0.146646 12 0.333287 12H2.35967C2.44633 12 2.53298 11.9667 2.59297 11.9L9.87196 4.62769L7.37231 2.12804L0.0999862 9.40036C0.0333288 9.46702 0 9.54701 0 9.64033ZM11.805 2.69463C12.065 2.43466 12.065 2.01472 11.805 1.75476L10.2452 0.194973C9.98528 -0.064991 9.56534 -0.064991 9.30537 0.194973L8.08554 1.4148L10.5852 3.91446L11.805 2.69463Z",fill:"currentColor"})],-1)])],8,_0),e.createElementVNode("button",{type:"button",class:"dss-pill-field__pill-action dss-pill-field__pill-action--remove",onClick:gt=>fe(Ce)}," × ",8,$0)]))],64))],2))),128)),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":Ee[1]||(Ee[1]=Be=>ce.value=Be),class:"dss-pill-field__input",type:"text",placeholder:z.value.length?"":R.placeholder,disabled:R.disabled,onPaste:rt,onKeydown:e.withKeys(ze,["enter"])},null,40,L0),[[e.vModelText,ce.value]])])],2))}}),A0={class:"dss-step-bar__header"},D0={class:"dss-step-bar__label"},H0={key:0,class:"dss-step-bar__counter"},R0={class:"dss-step-bar__track-wrapper"},F0=["aria-valuemax","aria-valuenow","aria-label"],I0=["onMouseenter"],z0={__name:"DSSStepBar",props:{label:{type:String,default:"Progress"},steps:{type:Number,default:5},currentStep:{type:Number,default:0},segments:{type:Array,default:()=>[]},segmentOrder:{type:String,default:"input",validator:T=>["input","desc","asc"].includes(T)},totalValue:{type:Number,default:null},activeColor:{type:String,default:"#34c759"},labelColor:{type:String,default:null},counterColor:{type:String,default:null},valueLabel:{type:String,default:""},counterAsPercentage:{type:Boolean,default:!1},showCounter:{type:Boolean,default:!0},inactiveColor:{type:String,default:"#e5e7eb"},remainderLabel:{type:String,default:"Unused"},remainderTooltipSummary:{type:Boolean,default:!1},options:{type:Object,default:()=>({})}},setup(T){const te=T,_={segmentMarker:{color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"},maxSegment:{marker:{enabled:!1,color:null,width:null,height:null,backgroundColor:"transparent",borderColor:"transparent"}}},L=G=>G&&typeof G=="object"&&!Array.isArray(G),ce=(G,me)=>{const He=Object.assign({},G);return!L(G)||!L(me)||Object.keys(me).forEach(Ue=>{if(L(me[Ue])){Ue in G?He[Ue]=ce(G[Ue],me[Ue]):Object.assign(He,{[Ue]:me[Ue]});return}Object.assign(He,{[Ue]:me[Ue]})}),He},z=e.computed(()=>ce(_,te.options)),A=e.computed(()=>Math.max(1,Number(te.steps)||1)),X=e.computed(()=>Math.min(A.value,Math.max(0,Number(te.currentStep)||0))),je=e.computed(()=>Array.isArray(te.segments)&&te.segments.length>0),ge=e.computed(()=>{if(!je.value)return[];const G=te.segments.map((me,He)=>{const Ue=Number(me?.value);return{label:me?.label||`Step ${He+1}`,value:Number.isFinite(Ue)&&Ue>0?Ue:0,color:me?.color||te.activeColor,marker:me?.marker}});return te.segmentOrder==="desc"?[...G].sort((me,He)=>He.value-me.value):te.segmentOrder==="asc"?[...G].sort((me,He)=>me.value-He.value):G}),f=e.computed(()=>je.value?ge.value.reduce((G,me)=>G+me.value,0):X.value),xe=e.computed(()=>je.value?Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0?Number(te.totalValue):Math.max(1,f.value):A.value),he=e.computed(()=>je.value&&Number.isFinite(Number(te.totalValue))&&Number(te.totalValue)>0),ne=e.computed(()=>he.value?Math.max(0,Number(te.totalValue)-f.value):0),le=e.computed(()=>typeof te.remainderLabel=="string"&&te.remainderLabel.trim().length>0),fe=e.computed(()=>ne.value>0),H=e.computed(()=>ge.value.reduce((G,me)=>Math.max(G,Number(me.value)||0),0)),be=e.computed(()=>ge.value.filter(G=>G.value>0).map(G=>`${G.label}: ${Ut(G.value)}`).join(" | ")),Te=e.computed(()=>je.value?he.value?ge.value.filter(G=>G.value>0):ge.value:[]),ze=e.computed(()=>{if(!te.counterAsPercentage)return`${f.value} / ${xe.value}`;const G=Number(xe.value);if(!Number.isFinite(G)||G<=0)return"0%";const me=Math.round(Number(f.value)/G*100);return`${Math.min(Math.max(me,0),100)}%`}),rt=e.computed(()=>f.value),R=e.computed(()=>xe.value),Ee=e.reactive({visible:!1,x:0,content:""}),Be=e.computed(()=>({left:`${Ee.x}px`})),Ce=G=>{const me=G?.parentElement;return me?me.offsetLeft+me.offsetWidth/2:0},gt=G=>{if(he.value){const Ue=Math.max(0,Number(G.value)||0);return{flex:`${Ue} 0 0`,minWidth:Ue>0?"6px":"0",backgroundColor:G.color}}const me=f.value;return{flex:`${G.value>0?G.value:me>0?1e-4:1} 0 0`,minWidth:"6px",backgroundColor:G.color}},pt=G=>Number(G?.value||0)>0&&Number(G?.value||0)===H.value,de=G=>{const me=L(G?.marker)?G.marker:{},He=G?.marker===!0||me.enabled===!0,Ue=pt(G)&&z.value.maxSegment?.marker?.enabled===!0;if(!(He||Ue))return{enabled:!1};const yt=me.backgroundColor??(Ue?z.value.maxSegment?.marker?.backgroundColor:z.value.segmentMarker?.backgroundColor),Pt=me.borderColor??(Ue?z.value.maxSegment?.marker?.borderColor:z.value.segmentMarker?.borderColor),wt=me.color??(Ue?z.value.maxSegment?.marker?.color:z.value.segmentMarker?.color),It=me.width??(Ue?z.value.maxSegment?.marker?.width:z.value.segmentMarker?.width),Q=me.height??(Ue?z.value.maxSegment?.marker?.height:z.value.segmentMarker?.height);return{enabled:!0,backgroundColor:yt,borderColor:Pt,color:wt,width:It,height:Q,icon:me.icon??null,...me}},ut=G=>{const me=de(G);return{backgroundColor:me.backgroundColor??void 0,borderColor:me.borderColor??void 0,color:me.color??void 0}},Oe=G=>{const me=de(G);return{width:me.width??void 0,height:me.height??void 0}},Ut=G=>`${G}${te.valueLabel}`,st=e.computed(()=>({flex:`${ne.value} 0 0`,minWidth:ne.value>0?"6px":"0",backgroundColor:te.inactiveColor})),Et=(G,me)=>{if(!G||!me?.currentTarget)return;const He=me.currentTarget;if(te.remainderTooltipSummary){Ee.x=Ce(He),Ee.content=be.value,Ee.visible=!!Ee.content;return}Ee.x=He.offsetLeft+He.offsetWidth/2,Ee.content=`${G.label}: ${Ut(G.value)}`,Ee.visible=!0},Tt=G=>{if(!ne.value||!G?.currentTarget)return;const me=G.currentTarget;if(te.remainderTooltipSummary){Ee.x=Ce(me),Ee.content=be.value,Ee.visible=!!Ee.content;return}Ee.x=me.offsetLeft+me.offsetWidth/2,le.value&&(Ee.content=`${te.remainderLabel}: ${Ut(ne.value)}`,Ee.visible=!0)},qt=()=>{Ee.visible=!1},Ft=e.computed(()=>({"--dss-step-bar-label-color":te.labelColor??void 0,"--dss-step-bar-counter-color":te.counterColor??void 0,"--dss-step-bar-active-color":te.activeColor,"--dss-step-bar-inactive-color":te.inactiveColor}));return(G,me)=>(e.openBlock(),e.createElementBlock("div",{class:"dss-step-bar",style:e.normalizeStyle(Ft.value)},[e.createElementVNode("div",A0,[e.createElementVNode("span",D0,[e.renderSlot(G.$slots,"label",{label:T.label},()=>[e.createTextVNode(e.toDisplayString(T.label),1)])]),T.showCounter?(e.openBlock(),e.createElementBlock("span",H0,[e.renderSlot(G.$slots,"counter",{counterDisplay:ze.value},()=>[e.createTextVNode(e.toDisplayString(ze.value),1)])])):e.createCommentVNode("",!0)]),e.createElementVNode("div",R0,[e.createElementVNode("div",{class:"dss-step-bar__track",role:"progressbar","aria-valuemin":0,"aria-valuemax":R.value,"aria-valuenow":rt.value,"aria-label":T.label},[je.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Te.value,(He,Ue)=>(e.openBlock(),e.createElementBlock("div",{key:`segment-${Ue}-${He.label}`,class:e.normalizeClass(["dss-step-bar__segment dss-step-bar__segment--interactive",{"dss-step-bar__segment--max":pt(He),"dss-step-bar__segment--marker-enabled":de(He).enabled}]),style:e.normalizeStyle(gt(He)),onMouseenter:Wt=>Et(He,Wt),onMouseleave:qt},[de(He).enabled?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment-marker",style:e.normalizeStyle(ut(He)),"aria-hidden":"true"},[e.createElementVNode("span",{class:"dss-step-bar__segment-marker-icon",style:e.normalizeStyle(Oe(He))},[e.renderSlot(G.$slots,"segment-marker-icon",{segment:He,index:Ue,marker:de(He)},()=>[e.renderSlot(G.$slots,"max-segment-icon",{segment:He,index:Ue,marker:de(He)},()=>[e.createTextVNode(e.toDisplayString(de(He).icon||""),1)])])],4)],4)):e.createCommentVNode("",!0)],46,I0))),128)),fe.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__segment dss-step-bar__segment--remainder",style:e.normalizeStyle(st.value),onMouseenter:me[0]||(me[0]=He=>Tt(He)),onMouseleave:qt},null,36)):e.createCommentVNode("",!0)],64)):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(A.value,He=>(e.openBlock(),e.createElementBlock("div",{key:He,class:e.normalizeClass(["dss-step-bar__segment",{"dss-step-bar__segment--active":He<=X.value}])},null,2))),128))],8,F0),Ee.visible?(e.openBlock(),e.createElementBlock("div",{key:0,class:"dss-step-bar__tooltip",style:e.normalizeStyle(Be.value)},e.toDisplayString(Ee.content),5)):e.createCommentVNode("",!0)])],4))}},P0={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"}},O0={firstPage:"First page",previousPage:"Previous page",nextPage:"Next page",lastPage:"Last page",currentPageAriaLabel:"Current page",rowsPerPage:"Rows per page",searchPlaceholder:"Search...",searchAriaLabel:"Search",searchTableAriaLabel:"Search table",clearSearchAriaLabel:"Clear search",downloadPdf:"Download PDF",downloadExcel:"Download Excel",columnVisibility:"Columns Visibility",expandRowAriaLabel:"Expand row",collapseRowAriaLabel:"Collapse row",filterColumnAriaLabel:"Filter column",clearFilter:"Clear",search:"Search...",filterFrom:"From:",filterTo:"To:",dateFormat:"dd/mm/yyyy",showingRange:"Showing {start}-{end} from {total}",ofPages:"of {total}",emptyMessage:"No data available"},q0={searchAcrossFields:"Search across all fields...",openAdvancedFilter:"Open advanced filter",closeAdvancedFilter:"Close advanced filter",noConditionsApplied:"No filter conditions are applied to this view",where:"Where",and:"And",searchAttributes:"Search attributes...",noMatch:"No match",enterValue:"Enter value...",min:"Min",max:"Max",search:"Search...",addFilter:"Add filter",clearAllFilters:"Clear all filters",select:"Select...",selectedCount:"{count} selected",operators:{contains:"contains",not_contains:"does not contain",equals:"equals",not_equals:"does not equal",starts_with:"starts with",ends_with:"ends with",is_empty:"is empty",is_not_empty:"is not empty",is_any_of:"is any of",is_none_of:"is none of",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"between",contains_any:"contains any of",contains_all:"contains all of",not_contains_any:"does not contain",before:"before",after:"after",is_true:"is true",is_false:"is false"}},W0={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"}},Z0={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"}},Ql={chart:P0,table:O0,filter:q0,datepicker:W0,textEditor:Z0},U0={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"}},X0={firstPage:"Première page",previousPage:"Page précédente",nextPage:"Page suivante",lastPage:"Dernière page",currentPageAriaLabel:"Page actuelle",rowsPerPage:"Lignes par page",searchPlaceholder:"Rechercher...",searchAriaLabel:"Rechercher",searchTableAriaLabel:"Rechercher dans le tableau",clearSearchAriaLabel:"Effacer la recherche",downloadPdf:"Télécharger PDF",downloadExcel:"Télécharger Excel",columnVisibility:"Visibilité des colonnes",expandRowAriaLabel:"Développer la ligne",collapseRowAriaLabel:"Réduire la ligne",filterColumnAriaLabel:"Filtrer la colonne",clearFilter:"Effacer",search:"Rechercher...",filterFrom:"Du :",filterTo:"Au :",dateFormat:"jj/mm/aaaa",showingRange:"Affichage de {start}-{end} sur {total}",ofPages:"sur {total}",emptyMessage:"Aucune donnée disponible"},Y0={searchAcrossFields:"Rechercher dans tous les champs...",openAdvancedFilter:"Ouvrir le filtre avancé",closeAdvancedFilter:"Fermer le filtre avancé",noConditionsApplied:"Aucune condition de filtre n'est appliquée à cette vue",where:"Où",and:"Et",searchAttributes:"Rechercher des attributs...",noMatch:"Aucun résultat",enterValue:"Saisir une valeur...",min:"Min",max:"Max",search:"Rechercher...",addFilter:"Ajouter un filtre",clearAllFilters:"Effacer tous les filtres",select:"Sélectionner...",selectedCount:"{count} sélectionnés",operators:{contains:"contient",not_contains:"ne contient pas",equals:"est égal à",not_equals:"est différent de",starts_with:"commence par",ends_with:"se termine par",is_empty:"est vide",is_not_empty:"n'est pas vide",is_any_of:"est l'un de",is_none_of:"n'est aucun de",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"entre",contains_any:"contient l'un de",contains_all:"contient tous",not_contains_any:"ne contient pas",before:"avant",after:"après",is_true:"est vrai",is_false:"est faux"}},j0={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"}},K0={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"}},Jl={chart:U0,table:X0,filter:Y0,datepicker:j0,textEditor:K0},G0={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"}},Q0={firstPage:"Eerste pagina",previousPage:"Vorige pagina",nextPage:"Volgende pagina",lastPage:"Laatste pagina",currentPageAriaLabel:"Huidige pagina",rowsPerPage:"Rijen per pagina",searchPlaceholder:"Zoeken...",searchAriaLabel:"Zoeken",searchTableAriaLabel:"Zoeken in tabel",clearSearchAriaLabel:"Zoekopdracht wissen",downloadPdf:"PDF downloaden",downloadExcel:"Excel downloaden",columnVisibility:"Kolommen weer te geven",expandRowAriaLabel:"Rij uitklappen",collapseRowAriaLabel:"Rij inklappen",filterColumnAriaLabel:"Kolom filteren",clearFilter:"Wissen",search:"Zoeken...",filterFrom:"Van:",filterTo:"Tot:",dateFormat:"dd-mm-jjjj",showingRange:"{start}-{end} van {total} weergegeven",ofPages:"van {total}",emptyMessage:"Geen gegevens beschikbaar"},J0={searchAcrossFields:"Zoeken in alle velden...",openAdvancedFilter:"Geavanceerde filter openen",closeAdvancedFilter:"Geavanceerde filter sluiten",noConditionsApplied:"Er zijn geen filtervoorwaarden toegepast op deze weergave",where:"Waar",and:"En",searchAttributes:"Zoek attributen...",noMatch:"Geen overeenkomst",enterValue:"Voer waarde in...",min:"Min",max:"Max",search:"Zoeken...",addFilter:"Filter toevoegen",clearAllFilters:"Alle filters wissen",select:"Selecteren...",selectedCount:"{count} geselecteerd",operators:{contains:"bevat",not_contains:"bevat niet",equals:"is gelijk aan",not_equals:"is niet gelijk aan",starts_with:"begint met",ends_with:"eindigt op",is_empty:"is leeg",is_not_empty:"is niet leeg",is_any_of:"is een van",is_none_of:"is geen van",eq:"=",neq:"≠",gt:">",gte:"≥",lt:"<",lte:"≤",between:"tussen",contains_any:"bevat een van",contains_all:"bevat alle",not_contains_any:"bevat niet",before:"voor",after:"na",is_true:"is waar",is_false:"is onwaar"}},e9={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"}},t9={toolbar:{undo:"Ongedaan maken",redo:"Opnieuw",paragraphFormat:"Alineaopmaak",bold:"Vet",italic:"Cursief",underline:"Onderstreept",citation:"Citaat",insertLink:"Link invoegen",removeLink:"Link verwijderen",bulletList:"Lijst met opsommingstekens",numberList:"Genummerde lijst",image:"Afbeelding",comment:"Commentaar",askAi:"Vraag AI"},paragraph:{heading1:"Kop 1",heading2:"Kop 2",heading3:"Kop 3",heading4:"Kop 4",heading5:"Kop 5",heading6:"Kop 6",paragraph:"Alinea"},link:{editLink:"Link bewerken",altText:"Alt-tekst:",url:"URL:",enterAltText:"Voer alt-tekst in...",enterUrl:"Voer URL in...",cancel:"Annuleren",save:"Opslaan"},image:{addImage:"Afbeelding toevoegen",editImage:"Afbeelding bewerken",upload:"Uploaden",imageLink:"Afbeeldingslink",uploadImage:"Afbeelding uploaden:",imageUrl:"Afbeeldings-URL:",altText:"Alt-tekst:",width:"Breedte (px):",height:"Hoogte (px):",enterAltText:"Voer alt-tekst in...",enterImageUrl:"https://voorbeeld.com/afbeelding.jpg",auto:"Auto",noAlt:"Geen alt-tekst",cancel:"Annuleren",save:"Opslaan"},comment:{placeholder:"Voeg een opmerking toe",send:"Verzenden",delete:"Opmerking verwijderen"},started_conversation:"Gesprek gestart",labels:{title:"Titel",description:"Beschrijving"},placeholders:{title:"Voer titel in...",description:"Voer beschrijving in...",startTyping:"Begin met typen..."},footer:{word:"woord",words:"woorden",character:"teken",characters:"tekens"}},eo={chart:G0,table:Q0,filter:J0,datepicker:e9,textEditor:t9},Ho={en:Ql,fr:Jl,nl:eo};function ca(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Ho).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Ho[_])})}const Ro={en:{textEditor:Ql.textEditor},fr:{textEditor:Jl.textEditor},nl:{textEditor:eo.textEditor}};function ua(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Ro).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Ro[_])})}const Fo={en:{table:Ql.table},fr:{table:Jl.table},nl:{table:eo.table}};function da(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Fo).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Fo[_])})}const Io={en:{datepicker:Ql.datepicker},fr:{datepicker:Jl.datepicker},nl:{datepicker:eo.datepicker}};function ma(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(Io).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,Io[_])})}const zo={en:{filter:Ql.filter},fr:{filter:Jl.filter},nl:{filter:eo.filter}};function pa(T){if(!T||!T.global)return;const te=T.global.availableLocales||[];Object.keys(zo).forEach(_=>{te.includes(_)&&T.global.mergeLocaleMessage(_,zo[_])})}const n9={chart:Ho,textEditor:Ro,table:Fo,datepicker:Io,filter:zo};function l9(T){!T||!T.global||(ca(T),ua(T),da(T),ma(T),pa(T))}const o9={en:{...Ql},fr:{...Jl},nl:{...eo}};Gl.createI18n({legacy:!1,locale:"en",fallbackLocale:"en",messages:o9});exports.DSSChart=lc;exports.DSSChartMessages=Ho;exports.DSSColorPicker=Wm;exports.DSSConfetti=y2;exports.DSSDatepicker=ea;exports.DSSDatepickerMessages=Io;exports.DSSDnd=g2;exports.DSSFilter=S0;exports.DSSFilterMessages=zo;exports.DSSLoader=l2;exports.DSSMessages=n9;exports.DSSModal=Jo;exports.DSSPillField=T0;exports.DSSSkeleton=o2;exports.DSSStepBar=z0;exports.DSSTable=Su;exports.DSSTableMessages=Fo;exports.DSSTextEditor=Bm;exports.DSSTextEditorMessages=Ro;exports.addDSSChartTranslations=ca;exports.addDSSDatepickerTranslations=ma;exports.addDSSFilterTranslations=pa;exports.addDSSTableTranslations=da;exports.addDSSTextEditorTranslations=ua;exports.addDSSTranslations=l9;
|